TraceLite cuts software agent token use with smart trace compression

TraceLite: Efficient Trace Reduction for SWE Agents via Optical Compression and Redundancy Removal

Software Engineering

Summary

Software engineering agents solve coding tasks by using tools step-by-step, which creates long records that cost a lot for AI to process. The authors found that turning old records into images and removing repeated information shrinks these records without losing key details. Their system, TraceLite, keeps recent text as normal but compresses older info visually and discards outdated parts after edits. This approach lowers the amount of data AI models must read, saving time and money, while still fixing problems effectively.

What this means in practice

  • For software development teams: Reduce AI tool usage costs by compressing interaction histories in automated code fixing workflows without losing performance.
  • For cloud service providers: Lower the resource demand of AI-driven software engineering offerings by integrating TraceLite’s efficient compression methods.$Commercial implications: Enables subscription services to offer more cost-effective AI code assistance by reducing token and API usage overhead.

Authors

Jingyu Xiao, Qianxi Liu, Yintong Huo, Yuan Jiang, Michael R. Lyu

Abstract

Software engineering agents solve repository-level tasks through iterative tool use, but their continuously growing interaction traces incur substantial token consumption and inference overhead. Existing compression approaches often require model training, auxiliary LLM calls, or assumptions about specific content such as source code. We present TraceLite, a simple yet effective, training-free framework for compressing heterogeneous SWE-agent observations. Our preliminary study shows that optical rendering preserves substantial textual and semantic information under moderate compression, while agent trajectories exhibit both cross-step and phase-level redundancy. Motivated by these findings, TraceLite preserves recent observations as high-fidelity text, renders historical observations as compact images, removes overlapping content, and discards phase-expired observation payloads after code editing. It requires neither offline training nor auxiliary LLM inference. We evaluate TraceLite on SWE-bench Verified and DeepSWE using GPT-5.6-Luna and Gemini-3.8Flash as backbone models. On SWE-bench Verified, TraceLite achieves 78.25% resolve rate, outperforming the evaluated compression baselines while reducing average input-token consumption and API cost by 33.05% and 21.30%, respectively. Moreover, it introduces only 0.438 seconds of compression latency per observation. These results demonstrate that TraceLite improves SWE-agent efficiency with low processing overhead and without compromising issue-resolution capability. Our code is available at https://github.com/xjywhu/TraceLite.