用交叉注意力精检冗余段落,提升RAG系统去重效率与准确率。
Cross-Attention Calibrated Deduplication for Retrieval-Augmented Generation System

- 通过交叉编码器保留词级细节,对比新段落与内存池中保留段落
- 平均去除9.75%冗余段落,比精确匹配法多删近10倍
- 处理速度比主流方法快27%-7倍,适合大规模RAG应用
RAG系统中常见的分块策略常产生冗余段落,导致向量数据库膨胀且检索变慢。传统方法如余弦相似度阈值化将每个段落压缩为单一向量,但会丢失细粒度的词级信息,难以区分真正重复与仅主题相同的段落。本文提出交叉注意力校准去重(CACD),利用交叉编码器对新段落与内存中已保留段落进行细粒度对比,保留词级差异。CACD包含三部分:交叉编码器比较、衡量新信息量的新人信息得分(NIS,基于交叉编码器注意力熵计算)、以及对多个候选段落的多数投票机制。在完整SQuAD 1.1验证集上,共测试5种过滤方法、9种分块策略和18种配置。实验显示,CACD平均去除9.75%的段落,接近其他语义级方法,远高于精确匹配法(几乎不删)。处理时间平均为51.0秒/配置,比最强基线NERExact(69.6秒)快27%,比余弦相似度法(356.7秒)快约7倍。结果基于单一数据集,仅为初步对比。代码见https://github.com/lehuyphuong/rag_bench 和 https://github.com/lehuyphuong/cacd_dedup。
原文摘要 · Abstract (English)
Common chunking strategies in Retrieval-Augmented Generation (RAG) systems often create redundant chunks. These redundant chunks make the vector database bigger and slow down retrieval. A common fix is cosine-similarity thresholding. This method reduces each chunk to a single vector, then compares vectors using a similarity score. But a single vector can lose the fine-grained, token-level detail needed to tell a true duplicate apart from a chunk that just shares the same topic. We propose Cross-Attention Calibrated Deduplication (CACD). CACD checks each new chunk against an in-memory pool of chunks already kept, using a cross-encoder instead of a single pooled vector. This keeps token-level detail all the way to the final comparison. CACD combines three parts: the cross-encoder comparison itself, a New Information Score (NIS) that measures how much of a chunk is not explained by a candidate already kept, and a majority vote across several candidates rather than a single best match. NIS is calculated from the attention entropy of the cross-encoder. We tested CACD against five existing filtering methods, nine chunking strategies, and 18 configurations, all on the full SQuAD 1.1 validation set. In our experiments, CACD removes 9.75% of chunks on average. This drop rate is close to other semantic-level methods, and much higher than exact-match filters, which barely remove anything. In these experiments, CACD also processes each configuration in 51.0 seconds on average, about 27% faster than the strongest baseline, NERExact (69.6s), and about 7x faster than cosine-similarity filtering (356.7s). These results come from a single dataset, so we present them as an early comparison, not a general claim. Code for the baseline evaluation and for CACD is available at https://github.com/lehuyphuong/rag_bench and https://github.com/lehuyphuong/cacd_dedup.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。