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

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

4 Jun 2024 | Yusen Zhang, Ruoxi Sun, Yanfei Chen, Tomas Pfister, Rui Zhang, Sercan Ö. Arik
Chain-of-Agents (CoA) is a novel framework for large language models (LLMs) to collaboratively process long-context tasks. The framework consists of multiple worker agents that sequentially process different segments of the input text and communicate to aggregate information. A manager agent then synthesizes the contributions of the workers to generate a coherent final output. CoA addresses the challenges of processing long contexts by interleaving reading and reasoning, allowing each agent to focus on a short context. This approach outperforms existing methods such as Retrieval-Augmented Generation (RAG) and Full-Context by up to 10% on various long-context tasks including question answering, summarization, and code completion. CoA is training-free, task-agnostic, and highly interpretable, and it reduces time complexity from n² to nk, where n is the input length and k is the context window limit. The framework is evaluated on nine datasets and demonstrates significant improvements over strong baselines. CoA also mitigates the "lost-in-the-middle" phenomenon by providing each agent a shorter context to focus on, enabling effective reasoning across long contexts. The framework's multi-agent collaboration allows for complex reasoning and enhances performance on long-context tasks. CoA is shown to be more effective than other multi-agent frameworks, including hierarchical and merging approaches, and it can be applied to a wide range of tasks. The results demonstrate that CoA is a promising approach for handling long-context tasks with LLMs.Chain-of-Agents (CoA) is a novel framework for large language models (LLMs) to collaboratively process long-context tasks. The framework consists of multiple worker agents that sequentially process different segments of the input text and communicate to aggregate information. A manager agent then synthesizes the contributions of the workers to generate a coherent final output. CoA addresses the challenges of processing long contexts by interleaving reading and reasoning, allowing each agent to focus on a short context. This approach outperforms existing methods such as Retrieval-Augmented Generation (RAG) and Full-Context by up to 10% on various long-context tasks including question answering, summarization, and code completion. CoA is training-free, task-agnostic, and highly interpretable, and it reduces time complexity from n² to nk, where n is the input length and k is the context window limit. The framework is evaluated on nine datasets and demonstrates significant improvements over strong baselines. CoA also mitigates the "lost-in-the-middle" phenomenon by providing each agent a shorter context to focus on, enabling effective reasoning across long contexts. The framework's multi-agent collaboration allows for complex reasoning and enhances performance on long-context tasks. CoA is shown to be more effective than other multi-agent frameworks, including hierarchical and merging approaches, and it can be applied to a wide range of tasks. The results demonstrate that CoA is a promising approach for handling long-context tasks with LLMs.
Reach us at info@study.space
[slides and audio] Chain of Agents%3A Large Language Models Collaborating on Long-Context Tasks