[论文解读] Late Chunking: Contextual Chunk Embeddings Using Long-Context Embedding Models
本文提出晚期分块(late chunking)方法,即在长上下文嵌入之后再进行分块,以保留完整文档的上下文信息,显著提升检索性能。通过在分割文本前先利用长上下文模型,该方法在无需额外训练的情况下增强了语义表征,相较于基线分块方法在多个基准测试中表现更优。
Many use cases require retrieving smaller portions of text, and dense vector-based retrieval systems often perform better with shorter text segments, as the semantics are less likely to be over-compressed in the embeddings. Consequently, practitioners often split text documents into smaller chunks and encode them separately. However, chunk embeddings created in this way can lose contextual information from surrounding chunks, resulting in sub-optimal representations. In this paper, we introduce a novel method called late chunking, which leverages long context embedding models to first embed all tokens of the long text, with chunking applied after the transformer model and just before mean pooling - hence the term late in its naming. The resulting chunk embeddings capture the full contextual information, leading to superior results across various retrieval tasks. The method is generic enough to be applied to a wide range of long-context embedding models and works without additional training. To further increase the effectiveness of late chunking, we propose a dedicated fine-tuning approach for embedding models.
研究动机与目标
- 解决传统文本分块在密集检索中因丢失长距离上下文依赖而导致的问题。
- 通过在嵌入生成过程中保留块间上下文,提升文本块的语义表征。
- 开发一种通用的、无需训练的方法,适用于多种长上下文嵌入模型。
- 探索进一步提升晚期分块检索性能的微调策略。
- 在多样化检索基准上实证验证晚期分块,并与现有方法进行比较。
提出的方法
- 首先对整个文档应用长上下文嵌入模型,生成完整上下文的标记嵌入,再进行分块。
- 在完整的标记嵌入序列上执行分块,然后应用平均池化生成上下文感知的块嵌入。
- 使用生成的嵌入执行检索任务,确保每个块继承周围文本的语义上下文。
- 提出一种长晚期分块方法,通过重叠或分段处理序列,适用于超过模型上下文长度的文档。
- 引入一种专门的对比微调方法,使用跨度标注数据集,以进一步提升晚期分块的检索准确率。
- 利用现有的长上下文模型(如 jina-embeddings-v2-small),无需架构修改或重新训练。
实验结果
研究问题
- RQ1晚期分块是否能通过保留块间语义依赖关系来提升检索性能?
- RQ2在语境相关块的余弦相似度方面,晚期分块与基线分块相比表现如何?
- RQ3当输入文档超过模型最大上下文长度时,晚期分块方法是否仍有效?
- RQ4在使用晚期分块时,微调是否能进一步提升检索准确率?
- RQ5在性能和推理成本方面,晚期分块与大语言模型增强的上下文嵌入方法相比如何?
主要发现
- 与基线分块相比,晚期分块将语境相关块的余弦相似度得分最高提升了 0.1165,例如,对于提及 'Berlin' 的句子,得分从 0.7084 提升至 0.8249。
- 在 FEVER 和 TriviaQA 数据集中,微调期间使用跨度池化相较于平均池化表现出微小但稳定的提升。
- 晚期分块达到的相似度得分与大语言模型增强的上下文嵌入方法相当(例如,0.8516 vs. 0.8590),但无需额外的大语言模型推理步骤。
- 该方法在所有评估的检索基准中均优于基线分块,包括金融、维基百科和问答风格文档。
- 使用跨度标注数据进行微调,相比标准对比训练带来了可测量的性能提升,尤其在零样本和少样本设置下更为显著。
- 长晚期分块方法能有效处理超过模型上下文窗口的文档,通过重叠或分段处理保持高质量的嵌入。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。