让大模型问答更省token,同时保持高准确率。
TeaRAG: A Token-Efficient Agentic Retrieval-Augmented Generation Framework
- 用知识图谱压缩检索内容,减少冗余信息。
- 通过奖励机制鼓励简洁推理,少走弯路。
- 适合需要高效推理的落地应用,如客服、搜索。
检索增强生成(RAG)通过引入外部知识提升大语言模型的可靠性。为实现灵活性,智能体式RAG采用自主、多轮检索与推理来解答问题。尽管近期研究借助强化学习提升了性能,但搜索与推理过程仍带来大量token开销,导致效率低下。为此,本文提出TeaRAG框架,可在不牺牲精度的前提下显著压缩检索内容与推理步骤。首先,将基于段落的语义检索与简洁三元组构建的知识图谱结合,利用语义相似性和共现关系构建知识关联图,并通过个性化PageRank算法突出关键知识,降低每轮检索的token数量。其次,提出迭代式过程感知直接偏好优化(IP-DPO),其奖励函数通过知识匹配机制评估知识充分性,同时惩罚过多推理步骤,从而生成高质量偏好数据集,支持迭代DPO优化推理过程的简洁性。在六个数据集上的实验表明,TeaRAG在Llama3-8B-Instruct和Qwen2.5-14B-Instruct上分别将平均精确匹配率提升4%和2%,同时输出token数减少61%和59%。代码已开源:https://github.com/Applied-Machine-Learning-Lab/TeaRAG。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) utilizes external knowledge to augment Large Language Models' (LLMs) reliability. For flexibility, agentic RAG employs autonomous, multi-round retrieval and reasoning to resolve queries. Although recent agentic RAG has improved via reinforcement learning, they often incur substantial token overhead from search and reasoning processes. This trade-off prioritizes accuracy over efficiency. To address this issue, this work proposes TeaRAG, a token-efficient agentic RAG framework capable of compressing both retrieval content and reasoning steps. 1) First, the retrieved content is compressed by augmenting chunk-based semantic retrieval with a graph retrieval using concise triplets. A knowledge association graph is then built from semantic similarity and co-occurrence. Finally, Personalized PageRank is leveraged to highlight key knowledge within this graph, reducing the number of tokens per retrieval. 2) Besides, to reduce reasoning steps, Iterative Process-aware Direct Preference Optimization (IP-DPO) is proposed. Specifically, our reward function evaluates the knowledge sufficiency by a knowledge matching mechanism, while penalizing excessive reasoning steps. This design can produce high-quality preference-pair datasets, supporting iterative DPO to improve reasoning conciseness. Across six datasets, TeaRAG improves the average Exact Match by 4% and 2% while reducing output tokens by 61% and 59% on Llama3-8B-Instruct and Qwen2.5-14B-Instruct, respectively. Code is available at https://github.com/Applied-Machine-Learning-Lab/TeaRAG.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。