메트릭 인 더 루프: 복잡도 피드백이 에이전트가 작성하는 코드를 바꾼다
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
한국어 초록
코딩 에이전트는 이제 긴 자율 실행을 통해 전체 코드베이스를 작성하며, 주로 테스트 통과 여부에 따라 안내된다. 그러나 테스트 통과만으로는 누적되는 복잡도나 테스트 커버리지의 공백이 드러나지 않으며, 이러한 문제는 에이전트가 자신의 코드를 확장하는 과정에서 지속된다. 우리는 추론 시점 개입인 메트릭 인 더 루프(metrics-in-the-loop)를 소개한다. 이는 자동으로 저비용 계산한 코드 메트릭을 궤적 진행 중 에이전트의 컨텍스트에 주입하여 실시간 피드백을 제공한다. 코드를 변경하는 에이전트 턴마다, 순환 복잡도가 한도를 초과한 변경 함수(복잡도 피드백) 또는 테스트에서 건너뛴 변경 라인(커버리지 피드백)을 명시하는 짧은 피드백 메시지를 삽입하여, 에이전트가 계속하기 전에 코드를 리팩터링하거나 테스트를 강화할 기회를 준다. 우리는 세 가지 장기 코딩 벤치마크와 네 가지 강력한 모델에 걸쳐 여러 개입을 비교하는 광범위한 실험과 소거 연구를 수행한다. 그 결과 복잡도 피드백이 코드의 복잡도 집중도를 나타내는 척도인 침식(erosion)을 유의미하게 줄이면서도, 보류된 데이터에 대한 코드의 정확성에는 영향을 주지 않음을 확인했다. 전반적으로 우리의 실험은 시의적절하고 실행 가능한 측정값이 약점이 에이전트가 계속 쌓아 올리는 토대가 되기 전에 에이전트의 방향을 바로잡는 실용적인 형태의 에이전트 "리레일링"을 탐구한다. 에이전트가 수백만 줄 규모의 코드베이스로 확장됨에 따라, 이러한 개입은 효과적인 개발과 장기적인 코드 유지보수성을 지속하는 데 필수적이 된다.
원문 초록
Coding agents now write whole codebases in long autonomous runs, guided mainly by whether their tests pass. Yet passing tests alone does not reveal accumulating complexity or gaps in test coverage, which then persist as agents extend their own code. We introduce metrics-in-the-loop, an inference-time intervention that gives agents in-flight feedback: cheap, automatically computed code metrics injected into the agent's context during the trajectory. After each code-changing agent turn, we insert short feedback messages naming changed functions whose cyclomatic complexity exceeds a limit (complexity feedback) or changed lines that are skipped by tests (coverage feedback), giving the agent the opportunity to refactor code or strengthen tests before continuing. We run extensive experiments and ablations comparing several interventions across three long-horizon coding benchmarks and four strong models. We find that complexity feedback significantly reduces erosion, a measure of complexity concentration of code, without affecting held-out correctness of the code. Broadly, our experiments investigate a practical form of agent "re-railing", where timely, actionable measurements redirect agents before weaknesses become the foundation they keep building on. As agents scale to codebases with millions of lines, such interventions become critical to sustaining effective development and long-term code maintainability.
제출 이력
확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.
- arXiv:2611.23817v1제출 시각 미확인
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
공통 태그로 연결된 공개 논문이 아직 없습니다.
토론
이 논문과 연결된 포럼 글이 아직 없습니다.