用视觉表示压缩检索文本,提升问答准确率并减少计算量
RAGOCR: Optical Compression of Retrieval-Augmented Text via Visual Representation

- 将检索文本转为查询相关的视觉图像,实现动态压缩
- 在5个基准上准确率提升超15%,输入token减少87.5%
- 适合需要高效处理长文本的问答系统研发者
检索增强生成(RAG)已成为知识密集型问答的核心技术,但因处理长篇检索内容带来高昂计算成本而难以扩展。现有压缩方法存在根本权衡:硬压缩虽能在线响应查询,但压缩率低且常需微调生成模型;软压缩虽压缩率高,却依赖耗时的离线编码,且完全忽略输入查询。为此,我们提出RAGOCR,一种将检索文档压缩为查询相关视觉表示的新框架。为进一步平衡压缩率与信息保真度,引入查询感知的动态分辨率机制,根据文档的估计相关性和复杂度自适应分配视觉粒度:高度相关段落以高分辨率渲染以保留细节,边缘文档则大幅压缩至低分辨率。在使用MedOmniKB检索语料库的五个问答基准上的实验表明,RAGOCR比原始RAG准确率提升超过15%,同时仅需八分之一的输入标记数,并在不同检索深度下持续优于硬/软压缩基线。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) has become essential for knowledge-intensive question answering, yet scaling RAG pipelines remains challenging due to the prohibitive computational cost of processing lengthy retrieved contexts. Existing compression approaches face a fundamental trade-off: hard compression methods operate online in a query-aware fashion but achieve only modest compression rates and typically require fine-tuning the generative model, while soft compression methods attain higher ratios but rely on costly offline encoding that is entirely agnostic to the input query. To bridge this gap, we introduce RAGOCR, a novel framework that compresses retrieved documents into compact visual representations conditioned on the input query. To further balance compression rate and information fidelity, we introduce a query-aware dynamic resolution mechanism that adaptively allocates visual granularity based on each document's estimated relevance and complexity: highly relevant passages are rendered at higher resolution to preserve fine-grained details, while peripheral documents are aggressively compressed at lower resolution. Experiments on five QA benchmarks using the MedOmniKB retrieval corpus demonstrate that RAGOCR surpasses naive RAG by over 15\% in accuracy while requiring only one-eighth the number of input tokens, and consistently outperforms both hard and soft compression baselines across varying retrieval depths.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。