- The paper demonstrates that reducing redundant tokens in LLM multi-turn trajectories cuts computational costs by up to 35.9% while preserving performance.
- Key methodology involves a reflection module that processes steps past a certain threshold to condense trajectory information while retaining necessary context.
- AgentDietās integration with the Trae Agent system underscores its potential for broader adoption to enhance efficiency in LLM applications.
Improving the Efficiency of LLM Agent Systems through Trajectory Reduction
This paper discusses the inefficiencies in multi-turn agent systems that utilize LLMs due to growing trajectories composed of input tokens. It introduces AgentDiet, a method to reduce unnecessary information in the trajectory, thereby maintaining system performance while decreasing computational costs.
Problem Analysis
LLM agents are used extensively for software engineering tasks but face efficiency issues due to the expansive and redundant nature of their trajectories. These trajectories often contain useless, redundant, and expired information. The inefficiency stems from the nature of multi-turn systems where each step adds more tokens, unnecessary in subsequent steps, to the trajectory. This paper highlights a large potential for improving efficiency by reducing these tokens without degrading performance.
Prototype Approach and Algorithm
AgentDiet employs a reflection module, which leverages an LLM to identify and reduce waste in the trajectory. It processes steps beyond a certain threshold in length and replaces them with condensed information while maintaining necessary context for future steps.
The reflection module can be integrated into existing agent systems with minimal overhead and without disrupting the agent's workflow. Key hyperparameters include the number of steps before processing, sensitivity to step length, and context window size.
Implementation Details
AgentDiet is implemented in Trae Agent, an agent system excelling in existing benchmarks. Findings show significant reductions in computational overhead across different benchmarks. The implementation features:
- A separate reflection module leveraging cost-efficient LLMs.
- Tuned hyperparameters to balance between computational costs and maintained performance.
- Strategies to minimize token input through selective context processing.
Evaluation
The effectiveness of AgentDiet was tested through rigorous benchmarking on tasks from SWE-bench Verified and Multi-SWE-bench Flash. The results demonstrated:
- A significant reduction in trajectory tokens, leading to a computational cost decrease between 21.1% and 35.9%.
- Maintained or slightly improved task completion rates, showing no detrimental impact on agent performance.
Conclusion
AgentDiet successfully reduces efficiency concerns in LLM agent systems by focusing on trajectory reduction. This approach, applicable to various agent systems, highlights a potential direction for future research in improving agent efficiency without impacting task performance.
The findings advocate for broader adoption of trajectory reduction techniques in LLM agent systems to curtail computational expenses, making AI solutions more viable and widespread.