Manuscript Offprint

arXiv:2610.28612

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

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

JINGYU XIAO, The Chinese University of Hong Kong, China

QIANXI LIU, Dalian University of Technology, China

YINTONG HUO*, Singapore Management University, Singapore

YUAN JIANG, Harbin Institute of Technology, China

MICHAEL R. LYU, The Chinese University of Hong Kong, China

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.8-Flash 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.

CCS Concepts: • Software and its engineering → Automatic programming; • Computing methodologies → Artificial intelligence.

Additional Key Words and Phrases: Large Language Models, Coding Agent, Token Compression

ACM Reference Format:

Jingyu Xiao, Qianxi Liu, Yintong Huo, Yuan Jiang, and Michael R. Lyu. 2018. TraceLite: Efficient Trace Reduction for SWE Agents via Optical Compression and Redundancy Removal. In Proceedings of Make sure to enter the correct conference title from your rights confirmation email (Conference acronym 'XX). ACM, New York, NY, USA, 20 pages. https://doi.org/XXXXXXX.XXXXXXX

*Yintong Huo is the corresponding author.

Authors' Contact Information: Jingyu Xiao, The Chinese University of Hong Kong, Hong Kong, China, jyxiao@link.cuhk.edu.hk; Qianxi Liu, Dalian University of Technology, Dalian, China, lqx19152881917@gmail.com; Yintong Huo, Singapore Management University, Singapore, Singapore, ythuo@smu.edu.sg; Yuan Jiang, Harbin Institute of Technology, Harbin, China, jiangyuan@hit.edu.cn; Michael R. Lyu, The Chinese University of Hong Kong, Hong Kong, China, lyu@cse.cuhk.edu.hk.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

Conference acronym 'XX, Woodstock, NY

© 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM ISBN 978-1-4503-XXXX-X/2018/06

https://doi.org/XXXXXXX.XXXXXXX

Jingyu Xiao et al.

1 Introduction

Large language models have evolved from passive code-generation tools into coding agents that autonomously interact with software development environments [21, 26]. Equipped with interfaces for repository search, file editing, command execution, and testing, these agents have been applied to tasks such as fault localization, program repair, test generation, and issue resolution. Rather than producing a solution in a single invocation, a coding agent iteratively inspects the repository, invokes tools, interprets their outputs, and adjusts its subsequent actions. SWE-agent exemplifies this paradigm by introducing an agent–computer interface through which an LLM can navigate repositories, modify files, and execute tests [26]. Its evaluation on SWE-bench, a benchmark constructed from real-world GitHub issues, demonstrates the potential of agents to perform repository-level debugging and patch generation [8].

However, this iterative workflow causes the interaction trajectory to grow continuously [2, 25]. Tool observations such as source code, search results, command outputs, and test logs are repeatedly included in subsequent prompts. Retaining redundant, outdated, or irrelevant observations increases inference cost and context window pressure and may distract the model from evidence needed for its current decision. Effective context management is therefore essential for compressing historical interaction traces while preserving information useful for future actions.

Existing context compression methods differ in their targets, redundancy criteria, and context-handling strategies, as summarized in Table 1. LLMLingua2 [17] learns token-level importance using a dedicated compressor, whereas LongCodeZip [18] uses conditional perplexity to prune code at the function and block levels. SWE-Pruner [22] instead employs a trained neural pruner to perform line-level code filtering. SeeRepo [11] constructs and renders repository graphs to guide code exploration, augmenting the agent's context rather than compressing its accumulated trajectory. AgentDiet [25] directly reduces agent trajectories, but relies on an auxiliary reflection LLM to identify and remove redundant or expired information. Consequently, existing approaches require either learned components, auxiliary model inference, or repository-specific preprocessing, and do not provide a training-free and auxiliary-free solution for context compressing.

Table 1. Taxonomy of context compression methods, OR denotes optical rendering.

MethodTargetRedundancy JudgeContext HandleExtra Cost
LLMLingua2 [17]Single promptToken-level importanceToken-level pruningTrained compressor
LongCodeZip [18]Code functionPerplexity-based relevanceBlock-level pruningAuxiliary LLM
AgentDiet [25]TrajectoryLLM-as-judgeLLM-guided reductionAdditional LLM calls LLM-based graph
SeeRepo [11]Code Repo-Graph augmentationinformation extraction
SWE-Pruner [22]Code linesLine-level relevanceLine-level pruningTrained pruner
TraceLite (Ours)TrajectoryOverlap and Edit-trigger OR and removeNone

These limitations raise a natural question: can interaction traces be compressed effectively without training a dedicated compressor or invoking an auxiliary model? Answering this question requires examining two complementary aspects of an agent trajectory: representation and content. First, can verbose observations be represented more compactly while preserving the information required by the agent? Second, does every observation remain necessary throughout the entire issue-resolution process?

To answer these questions, we conduct a preliminary study of SWE-agent trajectories. Regarding representation, we find that rendering observations as images preserves substantial character-level and semantic information under moderate compression. However, rendering the entire trajectory degrades issue-resolution performance because recent observations often contain precise evidence needed for the next action. Regarding content, we identify two forms of redundancy. First, observations from different interaction steps exhibit substantial textual overlap. Second, localization and diagnostic observations become largely unnecessary after the agent applies a concrete code modification, as their information has been incorporated into the updated repository state. These findings motivate a hybrid strategy that preserves recent evidence, compresses historical observations, and removes redundant content.

Motivated by these findings, we propose TraceLite, a simple yet effective training-free framework for compressing SWE-agent interaction traces. TraceLite divides the trajectory into recent and historical windows: recent observations are retained as high-fidelity text, while observations leaving the recent window are rendered as compact images. Within the recent window, TraceLite detects textual overlap and removes duplicated content from earlier observations while preserving their tool calls and non-overlapping information. Moreover, when the agent performs a code-editing action, TraceLite treats the edit as a phase transition and clears the preceding observation payloads while keeping the historical tool-call sequence. The complete procedure requires neither model training nor auxiliary LLM calls and supports heterogeneous tool observations.

Our contributions are summarized as follows:

● We conduct a preliminary study of SWE-agent trajectories and identify three opportunities for compression: optical rendering preserves substantial information under moderate compression, observations across different steps contain considerable textual overlap, and pre-edit observations become largely unnecessary after the repository is modified.

● We propose TraceLite, a simple yet effective trace-compression framework that combines historical optical compression and redundancy removal. It requires neither model training nor auxiliary LLM calls and supports heterogeneous tool observations.

● We extensively evaluate TraceLite on SWE-bench Verified and DeepSWE using GPT-5.6-Luna and Gemini-3.8-Flash. On SWE-bench Verified, TraceLite achieves the highest resolved rate of 78.25%, while reducing input tokens and API cost by 33.05% and 21.30%, respectively. It requires no training or auxiliary LLM calls and adds only 0.438 seconds of latency per observation.

References (13)