大型语言模型(LLMs)在理解语言和执行复杂推理任务方面展现了令人印象深刻的表现。然而,具有长上下文窗口的LLMs因其昂贵的训练成本和高推理延迟而闻名。即使是诸如GPT-4和Claude2等最先进的模型,在处理超过100k个令牌的输入时也常常出错,这一现象也被称为“lost in the middle”(中间丢失)。在本文中,我们提出了LongAgent,一种基于多智能体协作的方法,它将LLMs(例如LLaMA)扩展到128K的上下文,并在长文本处理方面展现出相比GPT-4的潜在优越性。在LongAgent中,一个领导者负责理解用户意图并指导团队成员从文档中获取信息。由于成员存在幻觉,领导者从数十到数百名成员的响应中获取准确信息并非易事。为了解决这个问题,我们开发了一种成员间通信机制,通过信息共享来解决由幻觉引起的响应冲突。我们的实验结果表明,LongAgent为长文本处理提供了一种有前景的替代方案。使用LLaMA-7B实例化的智能体团队在128k长文本检索、多跳问答等任务上相比GPT-4取得了显著改进。
英文摘要:
Large language models (LLMs) have demonstrated impressive performance in understanding language and executing complex reasoning tasks. However, LLMs with long context windows have been notorious for their expensive training costs and high inference latency. Even the most advanced models such as GPT-4 and Claude2 often make mistakes when processing inputs of over $100k$ tokens, a phenomenon also known as \textit{lost in the middle}. In this paper, we propose \textsc{LongAgent}, a method based on multi-agent collaboration, which scales LLMs (e.g., LLaMA) to a context of 128K and demonstrates potential superiority in long-text processing compared to GPT-4. In \textsc{LongAgent}, a leader is responsible for understanding user intent and directing team members to acquire information from documents. Due to members' hallucinations, it is non-trivial for a leader to obtain accurate information from the responses of dozens to hundreds of members. To address this, we develop an \textit{inter-member communication} mechanism to resolve response conflicts caused by hallucinations through information sharing. Our experimental results indicate that \textsc{LongAgent} offers a promising alternative for long-text processing. The agent team instantiated with LLaMA-7B achieves significant improvements in tasks such as 128k-long text retrieval, multi-hop question answering, compared to GPT-4.
Visual Document Understanding and Reasoning: A Multi-Agent Collaboration Framework with Agent-Wise Adaptive Test-Time Scaling
National University of Singapore(新加坡国立大学);Tencent Youtu Lab(腾讯优图实验室);Tsinghua University(清华大学);University of Science and Technology of China(中国科学技术大学);Nanyang Technological University(南洋理工大学);Zhejiang University(浙江大学);DeepWisdom(深智科技)
Scaling External Knowledge Input Beyond Context Windows of LLMs via Multi-Agent Collaboration
Dept. of Comp. Sci. & Tech., Institute for AI, Tsinghua University, Beijing, China(计算机科学与技术系,人工智能研究院,清华大学,北京,中国);Institute for AI Industry Research (AIR), Tsinghua University, Beijing, China(人工智能产业研究院(AIR),清华大学,北京,中国);Institute of Intelligent Computing, Alibaba Group(智能计算研究院,阿里巴巴集团)
Local-First Intelligence via Proactive SLM Collaborating with Feedback-Providing LLM
Shanghai Jiao Tong University, Shanghai, China(上海交通大学);WeChat Tencent, Beijing, China(微信腾讯);State University of New York at Buffalo, New York, United States(纽约州立大学布法罗分校)
MARS$^2$: Scaling Multi-Agent Tree Search via Reinforcement Learning for Code Generation
Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Shanghai Innovation Institute(上海创新研究院);Harbin Institute of Technology(哈尔滨工业大学);Tsinghua University(清华大学)