CoA - Google's multi-agent collaboration framework
CoA (Chain-of-Agents) is a multi-agent collaborative framework launched by Google to address the contextual constraints faced by Large Language Models (LLMs) when processing long text tasks. The CoA framework segments long texts into multiple shorter...
What is CoA?
CoA (Chain-of-Agents) is a multi-agent collaborative framework introduced by Google to address the contextual constraints faced by Large Language Models (LLMs) when processing long text tasks. The CoA framework segments long texts into multiple shorter segments, which are then processed sequentially by multiple worker agents. Useful information is passed to the next agent through chained communication. A manager agent integrates all the information to generate the final output. It requires no additional training, is task-agnostic, and highly interpretable.
Main functions of CoA
- Segmentation and Chained CommunicationCoA segments long texts into multiple shorter segments, which are then processed sequentially by multiple worker agents. Useful information is passed to the next agent through chained communication.
- Information aggregation and contextual reasoningWhen processing their respective segments, the working agents pass key information to the next agent. Finally, the managing agent integrates all the information to generate a consistent output.
- Task-independent and training-freeThe CoA framework requires no additional training and is suitable for various task types, such as question answering, summarizing, and code completion.
- Improve performance and efficiencyCoA significantly improves the performance of long text tasks by up to 10% through multi-agent collaboration, reducing the time complexity from quadratic to linear.
- ScalabilityCoA can adapt to inputs of different lengths by adjusting the number of working agents, and has good scalability.
CoA Design Principles
- Multi-agent collaboration and information aggregationIn the first phase, the working agents sequentially read and process text fragments, passing key information to the next agent. Each agent receives information from the previous agent and updates its own processing results. Finally, the manager agent receives the outputs of all the working agents, integrates the information, and generates the final answer.
- Contextual reasoning and task irrelevanceCoA enables collaboration among multiple agents through natural language communication, with each agent focusing on a shorter context, thus alleviating the attention problem in long contexts.
- Time complexity optimizationThe time complexity of CoA has been reduced from the traditional quadratic complexity (O(n²)) to linear complexity (O(nk)), where n is the number of input tokens and k is the context constraint of LLM. This significantly reduces computational costs and makes it more efficient for handling long text tasks.
CoA's project address
- arXiv technical paper:https://arxiv.org/pdf/2406.02818
Application scenarios of CoA
- Long text Q&ACoA can handle complex multi-hop reasoning problems. For example, when dealing with family relationship reasoning, long texts are segmented into multiple fragments, the working agent processes these fragments sequentially and passes on key information, and finally the managing agent generates the answer.
- Long text summaryIn long text summarization tasks, CoA can effectively extract key information and generate accurate summaries through chunking and multi-agent collaboration.
- Code completionCoA can be applied to code completion tasks. Through multi-agent collaboration, CoA can handle long code snippets, extract key information, and generate code completion suggestions.
- Multi-domain tasksThe CoA framework is highly flexible and task-independent, and can work with a variety of large language models (LLMs).