HyperAIHyperAI

Command Palette

Search for a command to run...

ECHO: 터미널 에이전트는 무료로 월드 모델을 학습한다

Vaishnavi Shrivastava Piero Kauffmann Ahmed Awadallah Dimitris Papailiopoulos

초록

CLI 에이전트는 언어 모델(LLM)이 가진 신체화된 설정(embodied setting)과 가장 유사한 형태이다. 모델이 명령을 생성하면 터미널에서 이를 실행하고, 반환된 스트림(표준 입력, 오류, 파일, 로그, 트레이스 등)이 그 결과를 기록한다. 우리는 이 스트림이 강력한 감독 신호(supervision signal)로 작용할 수 있다고 주장하지만, 기존 표준 에이전트 강화학습(RL) 방식은 이를 무시한다. GRPO(Reinforcement Learning with Generalized Reward Optimization) 스타일의 훈련은 환경 응답이 이미 롤아웃(rollout)에 포함된 상태에서도 환경의 피드백을 배제하고, 드문 outcome-level 보상만 사용하여 행동 토큰(action tokens)을 업데이트한다. 이로 인해 실패한 롤아웃에서는 환경이 어떻게 반응했는지에 대한 풍부한 증거가 포함되어 있음에도 불구하고 정책 경량(policy-gradient) 신호는 거의 제공되지 않는다.이에 본 연구에서는 ECHO(Environment Cross-entropy Hybrid Objective)라는 하이브리드 목적 함수를 제안한다. ECHO는 행동 토큰에 대한 기존 정책 경량 손실(policy-gradient loss)과, 모델 자신의 행동으로 인해 발생한 환경 관찰 토큰(environment observation tokens)을 예측하도록 정책을 훈련시키는 보조 손실(auxiliary loss)을 결합한다. ECHO는 GRPO와 동일한 순전파(forward pass)를 재사용하며 추가적인 롤아웃이 필요 없고, 터미널 피드백을 모든 롤아웃에 대한稠密(dense)한 감독 신호로 전환한다.TerminalBench-2.0에서 ECHO는 GRPO의 pass@1 성능을 두 배 이상 향상시켰다. 구체적으로, Qwen3-8B 모델은 2.70%에서 5.17%로, Qwen3-14B 모델은 5.17%에서 10.79%로 개선되었다. 또한 ECHO는 모델이 생성하지 않은 에제(trajectories)에서도 터미널 동역학을 더 정확하게 예측하는 정책을 산출한다. 홀드아웃(held-out) 롤아웃에 걸쳐 검증된 결과, ECHO는 환경 토큰 환경 교차 엔트로피(environment-token cross-entropy)를 급격히 감소시키는 반면, GRPO만 적용한 경우 이러한 변화는 미미했다.

One-sentence Summary

ECHO (Environment Cross-entropy Hybrid Objective) enables terminal agents to learn world models by combining standard policy-gradient loss with an auxiliary loss predicting environment observation tokens, turning terminal feedback into dense supervision without additional rollouts, doubling GRPO pass@1 on TerminalBench-2.0 as Qwen3-8B improves from 2.70% to 5.17% and Qwen3-14B from 5.17% to 10.79% while reducing environment-token cross-entropy on held-out rollouts.

Key Contributions

  • This work introduces ECHO, a hybrid objective for CLI agents that combines standard policy-gradient loss with an auxiliary loss to predict resulting environment observation tokens. The method reuses the same forward pass as GRPO without requiring additional rollouts, effectively turning terminal feedback into dense supervision for all trajectories.
  • Unlike approaches relying on judges or separate world-modeling stages, the proposed method injects observation prediction directly into on-policy GRPO using raw environment-observation tokens. This design eliminates the need for a separate corpus or dynamics model while leveraging existing transcript data as context.
  • Evaluation on TerminalBench-2.0 shows ECHO doubles GRPO pass@1 scores, improving Qwen3-14B from 5.17% to 10.79%. Trained policies also better predict terminal dynamics, sharply reducing environment-token cross-entropy on held-out rollouts compared to GRPO alone.

Introduction

In the context of terminal agents powered by large language models, learning effective policies is often hindered by sparse reward signals during environment interaction. Previous methods attempt to densify learning through auxiliary predictions or world models, yet they typically depend on separate training stages, external judges, or complex dynamics models to generate necessary supervision. The authors leverage terminal observations already present in agent transcripts to inject an auxiliary cross-entropy loss directly into on-policy GRPO. This strategy eliminates the need for separate corpora or feedback generators while providing dense supervision derived directly from the environment's literal response.

Dataset

  • Dataset Composition and Sources

    • The authors construct the training corpus from 2700 curated terminal tasks sourced from Endless Terminals and OpenThoughts-Agent-v1-RL.
    • They expand this pool by generating 6170 additional tasks via a modified Endless Terminals pipeline.
    • The final collection comprises 8870 tasks focused on data processing, system operations, and development tooling.
  • Filtering and Selection Criteria

    • Initial filtering excludes domains involving analysis, computation, specialized applications, infrastructure, networking, and complex bash.
    • Tasks are retained only if GPT-5 solves them within at least one of 16 attempts.
  • Data Splits and Usage

    • The training split includes 8770 tasks used for model optimization.
    • A separate set of 100 tasks is held out for in-distribution validation under the name val100.
    • Evaluation benchmarks include TerminalBench-2.0 and OpenThoughts-TBLite alongside the internal sets.
  • Environment and Processing Details

    • Episodes run in Docker containers orchestrated by the Harbor framework.
    • Limits are set to 16 turns per episode with a 16k context window.
    • Verification uses unit tests with 10-minute agent and 2-minute verifier timeouts.
    • The pipeline handles task specification, Dockerfile generation, and Harbor-format export.

Method

The ECHO method introduces a hybrid objective designed to utilize environment feedback as a dense supervision signal during reinforcement learning for terminal agents. Standard training pipelines typically apply loss functions only to assistant action tokens, ignoring the rich information contained in the terminal responses. ECHO augments this process by adding an auxiliary cross-entropy loss on the environment observation tokens.

The training framework operates on a multi-turn rollout sequence that interleaves system prompts, user tasks, assistant actions, and environment observations. The policy generates actions conditioned on the prior transcript, and the environment responds with outputs such as stdout, stderr, or file contents. As illustrated in the framework diagram below:

The total loss function combines the standard policy gradient term with the environment prediction term. The GRPO component targets action positions A\mathcal{A}A and relies on group-normalized advantages derived from sparse outcome rewards. This term is silenced when the advantage is zero. Concurrently, the environment loss targets observation positions O\mathcal{O}O and trains the policy to predict the terminal output resulting from its actions. This component remains active on every rollout. The combined objective is defined as:

LECHO=LGRPO(A)+λLenv(O)\mathcal{L}_{\mathrm{ECHO}} = \mathcal{L}_{\mathrm{GRPO}}(\mathcal{A}) + \lambda \mathcal{L}_{\mathrm{env}}(\mathcal{O})LECHO=LGRPO(A)+λLenv(O)

where λ\lambdaλ is a mixing coefficient. This formulation ensures that failed rollouts still contribute to learning by teaching the model how the terminal responds to specific commands.

From an implementation perspective, the method maintains computational efficiency by reusing the same forward pass. The model computes logits for the entire sequence once. The training loop then applies distinct masks to these logits to calculate the respective loss terms. This approach avoids the need for additional rollouts or a separate teacher model. Regarding target selection, the method specifically excludes low-entropy warning tokens from the harness, focusing the environment loss on actual command outputs that provide task-specific feedback.

Experiment

The experiments evaluate ECHO against GRPO baselines and expert SFT initialization across multiple benchmarks to validate improvements in terminal interaction and learning efficiency. Results demonstrate that ECHO consistently enhances task success and terminal prediction accuracy by learning transferable dynamics, which reduces reliance on expert demonstrations while achieving faster training convergence. Additionally, verifier-free adaptation tests confirm that environment prediction alone can drive policy improvement on tasks with informative feedback, supporting the conclusion that agents can learn effectively from terminal consequences without explicit reward signals.

The the the table evaluates training efficiency by comparing the number of steps required for ECHO and GRPO to reach their best internal scores across different model configurations. ECHO demonstrates significant speed advantages for the Qwen3-8B model, converging much faster than the GRPO baseline on both aggregate and difficult out-of-distribution tasks. In contrast, the larger Qwen3-14B model shows no step-based speedup, with both methods reaching peak performance at the same training step. ECHO substantially accelerates training for the Qwen3-8B model, reaching peak performance in significantly fewer steps than GRPO. While the OT-SFT initialization benefits from ECHO on aggregate metrics, it converges slower than GRPO on the specific TBLite benchmark. For the Qwen3-14B model, ECHO and GRPO reach their best internal scores at the same step count, indicating a plateau in convergence speed for larger models.

The authors evaluate verifier free adaptation where the model learns solely from predicting terminal output tokens without reward signals. Results indicate that this approach successfully improves performance on in distribution tasks and specific out of distribution benchmarks like PyTerm and ITD when filtering for clean tool calls. However, the method fails to improve performance on the TBLite benchmark, suggesting that the effectiveness depends on the density and action linkage of the environment feedback. Verifier free adaptation improves in distribution performance using only environment prediction. Filtering for clean tool calls enables substantial gains on out of distribution tasks like PyTerm and ITD without degrading base performance. The approach degrades performance on TBLite, likely due to less direct action feedback linkage compared to other benchmarks.

The the the table compares the performance of Qwen3-8B models trained with standard GRPO, the proposed ECHO method, and an expert SFT initialization. Results demonstrate that ECHO consistently outperforms the standard GRPO baseline across all internal and external benchmarks. Additionally, ECHO significantly reduces the performance gap relative to the expert SFT model, recovering the majority of the advantage on internal evaluations and roughly half on external benchmarks. ECHO consistently outperforms the standard GRPO baseline across all internal and external benchmarks. The approach recovers nearly all of the performance advantage provided by expert SFT initialization on internal evaluations. ECHO closes roughly half of the expert SFT performance gap on TerminalBench-2.0 metrics.

The authors present results showing that the ECHO method consistently improves task success over base policies and GRPO baselines across multiple model sizes. ECHO achieves substantial gains on TerminalBench-2.0 and internal evaluations, matching the performance of expert SFT initialization on internal metrics without requiring expert demonstrations. ECHO consistently outperforms GRPO and base models across all internal evaluations and TerminalBench-2.0 benchmarks. The method nearly doubles the TerminalBench-2.0 pass@1 rate compared to the standard GRPO baseline. ECHO recovers almost all of the performance gain provided by expert SFT initialization on internal evaluations.

The authors compare inference efficiency metrics, including timeout rates, turns, and tokens, between the GRPO baseline and the ECHO method across different model configurations. The results demonstrate that ECHO generally improves efficiency by reducing timeouts and token usage, particularly for the smaller and SFT-initialized models. ECHO significantly lowers timeout rates and average turns for the Qwen3-8B and OT-SFT models compared to the GRPO baseline. Token consumption is reduced across all model variants, with the most notable decrease seen in the Qwen3-8B configuration. While the Qwen3-14B model experiences a slight increase in timeouts and turns, it still achieves a reduction in total token usage.

The experiments evaluate the ECHO method against GRPO baselines and expert SFT initialization to assess training efficiency, task performance, and inference metrics. ECHO consistently outperforms standard GRPO across internal and external benchmarks while recovering most of the performance advantage provided by expert SFT on internal evaluations without requiring expert demonstrations. While training convergence accelerates for smaller models and inference efficiency improves through reduced token usage, verifier-free adaptation demonstrates effectiveness on specific out-of-distribution tasks but struggles where action feedback linkage is weak.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp
ECHO: 터미널 에이전트는 무료로 월드 모델을 학습한다 | 문서 | HyperAI초신경