Improving the Efficiency of LLM Agent Systems through Trajectory Reduction

πŸ“… 2025-09-27
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
To address the high input-token overhead caused by ever-growing reasoning trajectories in large language model (LLM)-based multi-turn agents for software engineering tasks, this paper proposes AgentDietβ€”a training-free, inference-time trajectory compression method. We first systematically identify pervasive redundancy, irrelevance, and obsolescence in agent trajectories; leveraging this insight, we design a lightweight, dynamic filtering strategy that automatically prunes context while preserving task-critical information, ensuring compatibility across diverse LLMs and software engineering tasks. Experiments on two mainstream LLMs and standard benchmarks demonstrate that AgentDiet reduces input tokens by 39.9%–59.7% and computational cost by 21.1%–35.9%, with no degradation in agent performance. Our core contributions are threefold: (i) the first quantitative characterization of trajectory redundancy in LLM-based agents; (ii) a novel, efficient, general-purpose, and training-free trajectory compression paradigm; and (iii) empirical validation of its effectiveness and robustness across models and tasks.

Technology Category

Application Category

πŸ“ Abstract
Multi-turn agent systems based on Large Language Models (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.
Problem

Research questions and friction points this paper is trying to address.

Reducing computational costs in LLM agent systems
Identifying and removing redundant trajectory information
Maintaining agent performance while improving efficiency
Innovation

Methods, ideas, or system contributions that make the work stand out.

Introduces inference-time trajectory reduction approach
Automatically removes useless redundant expired information
Reduces input tokens by up to 59.7% without performance loss
πŸ”Ž Similar Papers
No similar papers found.
Y
Yuan-An Xiao
Peking University, China
P
Pengfei Gao
ByteDance, China
C
Chao Peng
ByteDance, China
Yingfei Xiong
Yingfei Xiong
Associate Professor, Peking University
Software EngineeringProgramming LanguagesProgram RepairProgram SynthesisProgram Analysis