Buckets:
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| assets | 6 items | ||
| .gitattributes | 1.79 kB xet | 60750116 | |
| HiChunk.py | 16.2 kB xet | 24ab3a60 | |
| LICENSE.txt | 12.1 kB xet | b841fdff | |
| README.md | 3.52 kB xet | b8a9146d | |
| config.json | 1.41 kB xet | 7dd0855a | |
| configuration_utu_v1.py | 12.6 kB xet | 892a9e71 | |
| generation_config.json | 143 Bytes xet | df06355e | |
| model-00001-of-00002.safetensors | 4.99 GB xet | 6a96e093 | |
| model-00002-of-00002.safetensors | 3.18 GB xet | 955a9ef9 | |
| model.safetensors.index.json | 37 kB xet | 233fae58 | |
| modeling_utu_v1.py | 52.2 kB xet | 2db5050c | |
| registry.py | 26.8 kB xet | 120a42ab | |
| special_tokens_map.json | 449 Bytes xet | 83677006 | |
| tokenizer.json | 9.35 MB xet | bfc7b80b | |
| tokenizer_config.json | 53.5 kB xet | dd650e68 | |
| utu_v1.py | 35.6 kB xet | ed6c708f | |
| zero_to_fp32.py | 33.3 kB xet | 5eb783c9 |
🎯 Introduction
Youtu-HiChunk is a hierarchical document chunking framework developed by Tencent Youtu Lab. Combined with the Auto-Merge retrieval algorithm, it can dynamically adjust the semantic granularity of retrieval fragments, mitigating issues of incomplete information caused by chunking.
Hierarchical Document Structuring HiChunk is a hierarchical document structuring framework designed to address the limitations of traditional linear chunking methods in RAG systems. It focuses on modeling multi-level semantic granularity (e.g., sections, subsections, paragraphs) rather than flat text sequences, enabling RAG systems to retrieve information at contextually appropriate abstraction levels.
Auto-Merge Retrieval Algorithm Auto-Merge Retrieval Algorithm dynamically adjusts chunk granularity via three complementary conditions, balancing semantic completeness and retrieval quality for both evidence-dense and sparse tasks.
📊 Performance
1. RAG piepline performance
2. Performance in various retrieval size
🚀 Quick Start
Install packages
uv venv hichunk --python 3.12
source hichunk/bin/activate
uv pip install torch==2.7.0 vllm==0.9.1 transformers==4.53.0 liger_kernel
uv pip install nltk
python -c "import nltk; nltk.download('punkt_tab')"
Then, you can deploy HiChunk model according link.
Usage
import os
os.environ['OPENAI_BASE_URL'] = "http://{serve_ip}:{serve_port}"
from HiChunk import HiChunkInferenceEngine, PROMPT
engine = HiChunkInferenceEngine(window_size=16*1024, line_max_len=100, max_level=10, prompt=PROMPT)
document_text = open('doc.txt', 'r').read()
chunked_document, chunks = engine.inference(document_text, recurrent_type=2)
print(chunked_document)
🎨 Visualization
Case 1
Case 2
🤝 Acknowledgements
The project is based on the excellent work of several open source projects:
📚 Citation
If you find our work useful in your research, please consider citing the following paper:
@misc{hi-chunk-2025,
title={HiChunk: Evaluating and Enhancing Retrieval-Augmented Generation with Hierarchical Chunking},
author={Tencent Youtu Lab},
year={2025},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/TencentYoutuResearch/HiChunk.git}},
}
- Total size
- 8.17 GB
- Files
- 23
- Last updated
- Aug 29
- Pre-warmed CDN
- US EU US EU