arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.02818cs.CL
收藏

智能体链:大语言模型在长上下文任务上的协作

Chain of Agents: Large Language Models Collaborating on Long-Context Tasks

Penn State University(宾夕法尼亚州立大学);Google Cloud AI Research(谷歌云人工智能研究部门)

Yusen Zhang, Ruoxi Sun, Yanfei Chen, Tomas Pfister, Rui Zhang, Sercan Ö. Arik

AI总结:

本文提出Chain-of-Agents(CoA)框架,通过多个工作智能体分段处理长文本并由管理智能体综合输出,以多智能体协作缓解长上下文信息聚合与聚焦问题,在问答、摘要和代码补全任务上最高提升10%。

摘要:

有效处理长上下文已成为大语言模型(LLMs)面临的关键挑战。目前出现了两种常见策略:1)缩短输入长度,例如通过检索增强生成(RAG)检索相关片段;2)扩大LLMs的上下文窗口限制。然而,这两种策略都存在缺陷:输入缩减无法保证覆盖包含所需信息的部分,而窗口扩展则难以聚焦于解决任务所需的相关信息。为缓解这些局限性,我们提出了智能体链(Chain-of-Agents,CoA),这是一个新颖的框架,通过自然语言利用多智能体协作,在长上下文任务中实现跨不同LLMs的信息聚合和上下文推理。CoA由多个工作智能体组成,它们依次通信以处理文本的不同分段部分,随后由一个管理智能体将这些贡献综合成连贯的最终输出。CoA通过交替进行阅读和推理来处理整个输入,并通过为每个智能体分配短上下文来缓解长上下文聚焦问题。我们在问答、摘要和代码补全等广泛的长上下文任务上对CoA进行了全面评估,结果表明相较于RAG、全上下文和多智能体LLMs等强基线,性能显著提升,最高可达10%。

英文摘要:

Addressing the challenge of effectively processing long contexts has become a critical issue for Large Language Models (LLMs). Two common strategies have emerged: 1) reducing the input length, such as retrieving relevant chunks by Retrieval-Augmented Generation (RAG), and 2) expanding the context window limit of LLMs. However, both strategies have drawbacks: input reduction has no guarantee of covering the part with needed information, while window extension struggles with focusing on the pertinent information for solving the task. To mitigate these limitations, we propose Chain-of-Agents (CoA), a novel framework that harnesses multi-agent collaboration through natural language to enable information aggregation and context reasoning across various LLMs over long-context tasks. CoA consists of multiple worker agents who sequentially communicate to handle different segmented portions of the text, followed by a manager agent who synthesizes these contributions into a coherent final output. CoA processes the entire input by interleaving reading and reasoning, and it mitigates long context focus issues by assigning each agent a short context. We perform comprehensive evaluation of CoA on a wide range of long-context tasks in question answering, summarization, and code completion, demonstrating significant improvements by up to 10% over strong baselines of RAG, Full-Context, and multi-agent LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑