用多智能体树结构提升大模型长文本推理能力,解决信息遗忘问题。
Tree of Agents: Improving Long-Context Capabilities of Large Language Models through Multi-Perspective Reasoning
- 将长文本分块由独立智能体处理,通过树状路径动态协作推理
- 在多个长文本任务上超越基线,接近更大商用模型性能
- 适合需要精准长程理解的复杂问答与分析场景
大语言模型在处理长文本任务时普遍存在‘中间信息丢失’问题,即输入中间部分的信息难以被有效利用。现有减少输入的方法可能丢弃关键内容,而扩展上下文窗口又会导致注意力分散。为此,我们提出树状智能体框架(Tree of Agents, TOA),将输入分块交由独立智能体处理,各智能体生成局部认知后,沿树状结构路径动态交换信息,实现多视角协同推理。该机制可探索不同推理顺序,有效缓解位置偏差并减少幻觉。为提升效率,引入前缀哈希缓存与自适应剪枝策略,在保持较低API开销的前提下显著提升性能。实验表明,基于小型LLaMA3.1-8B模型的TOA在多项长文本任务中显著优于多个基线,并达到与更大型商业模型Gemini1.5-pro相当的效果。代码已开源。
原文摘要 · Abstract (English)
Large language models (LLMs) face persistent challenges when handling long-context tasks, most notably the lost in the middle issue, where information located in the middle of a long input tends to be underutilized. Some existing methods that reduce input have the risk of discarding key information, while others that extend context windows often lead to attention dispersion. To address these limitations, we propose Tree of Agents (TOA), a multi-agent reasoning framework that segments the input into chunks processed by independent agents. Each agent generates its local cognition, then agents dynamically exchange information for collaborative reasoning along tree-structured paths. TOA enables agents to probe different reasoning orders for multi-perspective understanding, effectively mitigating position bias and reducing hallucinations. To improve processing efficiency, we incorporate prefix-hash caching and adaptive pruning strategies, achieving significant performance improvements with comparable API overhead. Experiments show that TOA, powered by compact LLaMA3.1-8B, significantly outperforms multiple baselines and demonstrates comparable performance to the latest and much larger commercial models, such as Gemini1.5-pro, on various long-context tasks. Code is available at https://github.com/Aireduce952/Tree-of-Agents.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。