AgentPrune - A multi-agent communication optimization framework jointly developed by Tongji University, the Chinese University of Hong Kong, and other institutions.
AgentPrune is a communication optimization framework for multi-agent systems driven by large language models (LLMs), jointly proposed by Tongji University, the Chinese University of Hong Kong, and other institutions. It uses a "pruning" technique to remove redundant or harmful communication content...
What is AgentPrune?
AgentPrune, a communication optimization framework for multi-agent systems driven by large language models (LLMs), was jointly proposed by Tongji University, the Chinese University of Hong Kong, and other institutions. It utilizes a "pruning" technique to remove redundant or harmful communication content, reducing communication costs and improving system performance. AgentPrune models the multi-agent system as a spatiotemporal graph, optimizes communication connections based on low-rank sparse graph masks, and generates efficient communication topologies through one-time pruning. AgentPrune performs exceptionally well in multiple benchmark tests, achieving comparable performance at only 5.6% the cost of traditional methods. It can be seamlessly integrated into existing multi-agent frameworks such as AutoGen and GPTSwarm, achieving token reductions of 28.1% to 72.8%.
Main functions of AgentPrune
- Communication redundancy identification and pruningAgentPrune was the first to identify and define the problem of communication redundancy in LLM multi-agent systems, and eliminated redundant and harmful communication content through one-time pruning techniques.
- Spatiotemporal graph modeling and optimizationThe multi-agent system is modeled as a spatiotemporal graph, which includes spatial edges (communication within the same round of dialogue) and temporal edges (communication across rounds of dialogue), and optimized using parametric graph masks.
- Applications of low-rank sparse graph masksBased on low-rank sparse graph masks, communication structures are made more sparse, reducing redundancy, noise, and malicious messages, while enhancing robustness against network attacks.
- Cost and performance optimizationIn multiple benchmark tests, AgentPrune achieves comparable performance to state-of-the-art topologies at a lower cost (only $5.6 compared to $43.7 for other systems), and can be seamlessly integrated into existing multi-agent frameworks, achieving a token reduction of 28.1% to 72.8%.
- Counterattack and DefenseAgentPrune can successfully defend against two types of agent adversarial attacks, resulting in a performance improvement of 3.5% to 10.8%.
AgentPrune's technical principles
- Spatiotemporal graph modelingAgentPrune models the communication structure of a multi-agent system as a spatiotemporal graph, where nodes represent agents and edges represent communication connections, divided into spatial edges (communication within the same round of dialogue) and temporal edges (communication across rounds of dialogue).
- Parametric graph maskAgentPrune optimizes communication connections through parameterized graph masks. The goal of graph masks is to reflect the importance of communication connections through distribution approximation and low-rank sparsity. Distribution approximation maximizes the system's utility while minimizing communication redundancy through policy gradient methods; low-rank sparsity makes the communication structure more sparse through low-rank constraints, eliminating redundancy, noise, and even malicious messages.
- One-time pruningIn the early stages of training, AgentPrune performs a finite number of optimizations on the graph mask, and then removes unimportant communication connections through a one-time pruning. Specifically, AgentPrune selects to retain a certain proportion of the most important connections based on the size of the graph mask, generating a sparse communication graph.
- Optimized communication graphIn subsequent communication processes, the multi-agent system will strictly follow this optimized communication graph for message passing, reducing communication costs while maintaining high performance.
AgentPrune's project address
- Github repository:https://github.com/yanweiyue/AgentPrune
- arXiv technical paper:https://arxiv.org/pdf/2410.02506
Application scenarios of AgentPrune
- Multi-agent system optimizationAgentPrune can be seamlessly integrated into existing multi-agent frameworks such as AutoGen and GPTSwarm, significantly reducing communication costs while maintaining or improving system performance.
- Cost-effective communication topologyIn multi-agent systems, AgentPrune generates sparse communication topologies through one-time pruning, significantly reducing token consumption.
- Complex task collaborationAgentPrune is suitable for complex tasks requiring collaboration among multiple agents, such as mathematical reasoning, code generation, and commonsense question answering. By optimizing the communication structure, AgentPrune can improve task completion efficiency and reduce economic costs.
- Industrial and enterprise applicationsIn industrial automation and enterprise applications, AgentPrune can optimize communication between agents, reduce resource waste, and improve the overall efficiency of the system.