2607.18161v1 Jul 20, 2026 cs.SE

TRIM: 에이전트 경로 최소화를 통한 AI 생성 코드 품질 저하 감소

TRIM: Reducing AI-Generated CodeSlop via Agent Trajectory Minimization

Franjo Ivancic
Franjo Ivancic
Citations: 3
h-index: 1
Junfeng Yang
Junfeng Yang
Citations: 155
h-index: 6
Baishakhi Ray
Baishakhi Ray
Citations: 513
h-index: 7
Alex Mathai
Alex Mathai
Citations: 33
h-index: 4
Shobini Iyer
Shobini Iyer
Citations: 0
h-index: 0
A. Nogikh
A. Nogikh
Citations: 26
h-index: 3
Petros Maniatis
Petros Maniatis
Citations: 88
h-index: 6

코딩 에이전트는 버그 수정, 애플리케이션 구축 및 프로토타입 제작과 같은 다양한 작업에서 코드 생성을 가속화하는 데 점점 더 많이 사용되고 있습니다. 그러나 코딩 지원 도구로서의 가치에도 불구하고, 에이전트가 생성한 코드는 종종 인간이 작성한 구현보다 크고 장황한 경향이 있습니다. 본 연구에서는 이러한 원인이 에이전트 자체의 탐색 과정에 있다는 것을 보여줍니다. 솔루션을 찾기 위해 반복하는 동안, 에이전트는 추측적인 수정 사항, 포기된 가설 및 임시 변경 사항을 축적하며, 이는 최종 패치에 그대로 남게 됩니다. 이는 단일 패치에서는 큰 문제가 되지 않을 수 있지만, 에이전트가 코드베이스의 점점 더 많은 부분을 담당하게 되면서, 한때 최소화되고 잘 관리되었던 코드베이스는 불필요한 중복이 빠르게 증가하여 유지 관리가 더욱 어려워지는 상태로 변질됩니다. 이러한 문제의 심각성을 고려하여, 우리는 이 문제를 완화하기 위한 첫걸음을 내딛습니다. 먼저, 우리는 AI가 생성한 코드에서 흔히 볼 수 있는 잔류적인 기능적으로 불필요한 수정 사항을 '코드 슬롭(CodeSlop)'이라는 용어로 공식적으로 정의합니다. 그런 다음, 우리는 '경로 기반 중복 식별 및 최소화(Trajectory-guided Redundancy Identification and Minimization)' 알고리즘인 TRIM을 소개합니다. TRIM은 코드 슬롭 자체를 직접 최소화하는 대신, 에이전트 경로를 최소화합니다. 경험적으로 입증된 바와 같이, 이러한 간접적인 코드 슬롭 최소화 기술은 매우 효과적입니다. TRIM은 다양한 에이전트 기반 시스템에서 코드 슬롭을 17.9%~32.9% 감소시키며, 성능 저하가 거의 없습니다. 또한 TRIM은 알고리즘 기준인 Delta Debugging과 같은 방법보다 약 절반의 검증 비용만 필요하여 매우 효율적입니다.

Original Abstract

Coding agents are increasingly used to accelerate code generation in many downstream tasks, such as fixing bugs, building applications, and prototyping. However, despite their value as coding assistants, agent-generated code tends to be larger and more verbose than the corresponding human-written implementation. In this work, we show that the cause lies in the agent's own search process: while iterating toward a passing solution, an agent accumulates speculative edits, abandoned hypotheses, and temporary changes that persist into the final patch. This may seem harmless for a single patch, but the problem compounds as agents take responsibility for ever-larger portions of a codebase-a codebase that was once minimal and well-maintained slowly accumulates redundancy faster than it can be cleaned up, drifting to a state that is harder to maintain. Given the magnitude of this problem, we take a step towards alleviating this issue. First, we formally define this phenomenon as CodeSlop-the residual and functionally unnecessary edits commonly seen in AI-generated code. We then introduce our algorithm TRIM (Trajectory-guided Redundancy Identification and Minimization). Rather than minimizing CodeSlop directly, TRIM instead minimizes agent trajectories. As we show empirically, this indirect technique of minimizing CodeSlop is highly effective: TRIM cuts CodeSlop by 17.9%-32.9% across agentic scaffolds, with negligible performance regression. TRIM is also highly efficient, requiring roughly half the validation cost of algorithmic baselines such as Delta Debugging.

0 Citations
0 Influential
3.5 Altmetric
17.5 Score
Original PDF

No Analysis Report Yet

This paper hasn't been analyzed by Gemini yet.

Log in to request an AI analysis.

댓글

댓글을 작성하려면 로그인하세요.

아직 댓글이 없습니다. 첫 번째 댓글을 남겨보세요!