Papers
Topics
Authors
Recent
2000 character limit reached

Improving the Efficiency of LLM Agent Systems through Trajectory Reduction

Published 28 Sep 2025 in cs.SE and cs.AI | (2509.23586v1)

Abstract: Multi-turn agent systems based on LLMs have been increasingly popular for software engineering tasks. While LLM agents show decent effectiveness, the high computational cost of input tokens due to the ever-growing trajectory remains an efficiency concern for their applications. Efficiency is largely neglected in existing studies and agent products, and this paper fills the gap by introducing an inference-time trajectory reduction approach to reduce the cost of agents. Through analyzing existing agent trajectories, we demonstrate that useless, redundant, and expired information is widespread in all trajectories, which can be identified and reduced without harming the agent's performance. We then design a simple yet effective trajectory reduction approach, AgentDiet, which automatically removes such waste information. We implement AgentDiet on a top-performing coding agent, and the evaluation on two LLMs and two benchmarks shows that AgentDiet can reduce input tokens by 39.9% ~ 59.7%, or the final computational cost by 21.1% ~ 35.9%, while maintaining the same agent performance. This indicates that trajectory reduction is a promising direction for agent systems.

Summary

  • 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.

Whiteboard

Paper to Video (Beta)

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.