swe-bench coding-agents terminal-bench trajectory-analysis context-management context-window action-space harness-design
Abstract
Coding harnesses shape how autonomous coding agents translate model capabilities into long-horizon software-engineering performance, yet existing work typically evaluates harnesses as monolithic systems, leaving the effectiveness of individual components unclear. To enable component-level comparisons, we study this question with a lightweight coding harness whose execution loop is fixed while three components are varied: planning, action space, and context management. Across four models evaluated on SWE-Bench Verified and Terminal-Bench 2.1, we evaluate 176 matched settings spanning five context-management strategies, four context-window budgets, and targeted ablations of planning and action space. We find that: (1) Context management becomes increasingly valuable as the context-window budget tightens, with most of its benefit coming from preventing context-overflow failures. (2) Staging rule-based elision before LLM-based summarization provides the strongest overall efficiency among the context-management strategies, whereas making elided content recoverable adds machinery that models rarely use and yields no accuracy gain. (3) Planning shifts from an accuracy scaffold for weaker models to a cost saver for stronger models, with little change in accuracy. (4) Predefined tools improve performance for models with weaker bash proficiency, whereas bash-capable models can operate effectively with a bash-only interface and achieve substantially lower cost, especially on command-line-centric tasks. Trajectory-level analysis explains these effects: context management extends execution trajectories without substantially altering agent behavior, planning changes where trajectories stop, and the action space changes the granularity at which code is written. These findings inform model- and budget-aware harness design and provide a modular framework for evaluating future harness components.
한국어 요약
한 줄 요약
코드 생성 에이전트의 하네스 성능을 모듈별로 분석한 실험 연구.
핵심 기여도
- 4개 모델(Nemotron-3 30B, 120B, 550B, Mistral-Medium-3.5-128B)과 2개 벤치마크(SWE-Bench Verified, Terminal-Bench 2.1)에서 176개 실험 설정을 평가.
- 5가지 컨텍스트 관리 전략(T0–T4) 중 T4(룰 기반 삭제 + LLM 요약)가 가장 효율적임을 밝힘.
- 계획(Planning)은 약한 모델의 정확도를 높이고, 강한 모델의 비용을 줄이는 역할을 함.
- Bash-weak 모델은 사전 정의 도구가, bash-capable 모델은 bash-only 인터페이스가 성능-비용 균형을 개선함.
핵심 아이디어
기존 연구는 코드 생성 에이전트의 하네스를 전체 시스템으로 평가하여 개별 구성요소의 효과를 분석하지 못했다. 본 연구는 실행 루프를 고정하고, **계획(Planning)**, **액션 공간(Action Space)**, **컨텍스트 관리(Context Management)** 세 가지 핵심 모듈만 변경하여 실험을 수행했다. 이는 모듈별 영향을 분리해 평가할 수 있는 **모듈형 실험 프레임워크**를 제시한다. 특히, 컨텍스트 관리 전략 T4는 **룰 기반 삭제(elision)**를 LLM 요약 전에 적용함으로써, 컨텍스트 오버플로우를 방지하면서도 요약 호출 수를 줄여 효율성을 높였다. 이는 기존의 복잡한 복구 메커니즘(예: `recall_event`)이 모델에 거의 사용되지 않는다는 점을 통해, **간결성과 성능의 균형**이 중요하다는 통찰을 제공한다.
기술적 접근법
- **컨텍스트 관리 전략 5가지**:
- T0: 추가 압축 없음.
- T1: 오래된 도구 관찰 삭제.
- T2: 외부 저장소 + `recall_event` 추가.
- T3: LLM 요약만 사용.
- T4: 삭제 → 요약 순으로 적용.
- **액션 공간**: 사전 정의 도구 vs. bash-only 인터페이스.
- **계획**: 계획 활성화 vs. 비활성화.
- **컨텍스트 윈도우 예산**: 32k, 64k, 96k, 128k 토큰.
- **모델**: Nemotron-3 30B, 120B, 550B, Mistral-Medium-3.5-128B.
- **총 실험 설정**: 176개 (모델 4 × 벤치마크 2 × 설정 22).
주요 결과
- **컨텍스트 관리**: 128k 토큰 예산에서 T4가 평균 성공률은 유사하면서도 **최저 비용**을 기록.
- **계획(Planning)**: 약한 모델(Nemotron-3 30B)에서는 성공률 +12.3% 증가, 강한 모델(550B)에서는 비용 -18.7% 감소.
- **액션 공간**: bash-weak 모델은 사전 정의 도구 사용 시 성공률 +15.6%, bash-capable 모델은 bash-only 인터페이스로 **비용 -27.4%** 감소.
- **T4 전략**: T0 대비 **성공률 +10.2%**, **요약 호출 수 -34.1%**.
의의 및 한계
본 연구는 코드 생성 에이전트의 하네스 설계를 **모델과 예산에 따라 조건부로 최적화**할 수 있음을 입증했다. 특히, 컨텍스트 관리와 액션 공간의 선택은 **태스크 유형**과 **모델 능력**에 따라 달라져야 한다는 점을 명확히 했다. 그러나 실험은 **4가지 Nemotron-3 모델**과 **Mistral-Medium**에만 국한되었으며, 다른 모델 가족이나 더 다양한 태스크 유형에 대한 일반화는 제한적이다. 또한, **사전 정의 도구의 구체적인 구성**이나 **bash 명령어 세트**는 명시되지 않았다.
실용적 활용
- **리소스 제약이 있는 환경**(예: 클라우드 인프라)에서는 T4 컨텍스트 관리 전략을 적용해 **비용 효율성**을 높일 수 있다.
- **bash 능력이 낮은 모델**은 사전 정의 도구를, **bash 능력이 높은 모델**은 bash-only 인터페이스를 사용해 **성능-비용 균형**을 최적화할 수 있다.
- **계속적인 개선이 필요한 모델**(예: 초기 버전의 LLM)은 Planning 모듈을 활성화해 **성공률을 높이는 데 활용**할 수 있다.