
What ECHO is
ECHO is a hybrid training objective for agents that work on the command line. It trains on both sides of the interaction: what the agent writes (its commands) and what the terminal writes back. If you're in a hurry, these are the article's five findings:
- Standard agent reinforcement learning throws away the environment's response, even though it's already in the context.
- ECHO puts it to use with an extra loss that costs almost nothing: a few lines on top of any GRPO trainer.
- Agents get better; on Terminal Bench 2, the hardest benchmark, the first-try success rate nearly doubles compared to GRPO.
- ECHO recovers a good part of what fine-tuning on an expert's demonstrations gives you.
- With no reward at all, the agent can keep improving just by acting and predicting what happens (on some task sets).
How a terminal agent is trained
A terminal agent works in a loop: it writes a command, the terminal responds, and with that response it picks the next one. The example in the article's animation: the agent tries to connect to port 8080 and the connection is refused; it checks open ports with ss -tln and sees 3000; it tries there and gets back not_found. In the end the task fails: reward zero.
These agents are trained with reinforcement learning, for example with GRPO. The agent makes several attempts at each task, and a verifier (the task's tests) says whether each attempt solved it: a 1 or a 0. GRPO reinforces the commands from attempts that did better than the group average and penalizes the rest. If all attempts get the same score (for example, they all fail), there's nothing to compare and the signal is zero.
What GRPO throws away
Each attempt mixes two kinds of tokens: actions (what the agent writes) and observations (what the terminal says back). GRPO only learns from the actions. The observations are in the context, the model reads them and even computes their probabilities in the forward pass, but training covers them with a mask and learns nothing from them.
That's wasteful, especially because the reward is sparse, delayed and binary. In their Qwen3-8B setting, on many tasks fewer than 15% of attempts succeed. But a failed attempt isn't garbage: it's full of file listings, errors, logs, stack traces and grep outputs. Those are the consequences of each command.
The world as a loss function
The idea came from a question about continual learning: how does an agent get better just by acting in the world, even without a verifier? The usual problem with verifier-free learning is where supervision comes from when there's no reward. Dimitris's hunch: maybe continual learning is training on whatever the environment gives you back when you act.
His analogy is a light switch. You flip it and the light comes on, or it doesn't. If it doesn't, that's information too: something's up with the bulb, the wiring or the breaker. You don't see how electricity works, only the outcome, and that's enough to start building a mental model of how switches turn lights on.
The terminal works the same way. After a command you see stdout, stderr, the exit code or a file listing; you don't see the kernel state or the process tree. It's a small projection of how the machine changed, and it's exactly what the agent uses to choose its next step. The best part: that output is a supervision signal that comes already computed, on every turn, for free. To predict it, the agent has to keep track of which files it just created and what lives where.
Predicting the next token well means that you understand the underlying reality that led to the creation of that token. — Ilya Sutskever, quoted in the article
The ECHO loss
ECHO keeps the GRPO loss on the actions and adds a length-normalized cross-entropy loss on the observations: the classic language model loss, predicting every token of the terminal's response. A weight, λ, decides how much the second one counts. The authors call it the most embarrassingly simple way to learn from consequences.
In code it's a few lines: same attempts, same forward pass and a different mask over the logits. And there's an important difference between the two terms: the GRPO loss goes silent when all of a task's attempts get the same score, while the terminal loss is active on every one. Three technical details:
- It learns on-policy. It doesn't train on frozen transcripts from a teacher, but on the responses the model itself triggers while it learns. If it improves, it explores new corners and gets fresh supervision; if it predicts better, it picks better actions. A loop.
- λ matters. Too small and the terminal barely teaches anything. Too large and the agent can end up chasing outputs that are easy to predict instead of making progress on the task.
- What gets predicted matters. The real terminal output, not harness warnings: warnings are memorized right away; the useful part is file names, stack traces and error messages.
What it costs
The obvious question: isn't the backward pass more expensive if you push gradients through more positions? According to the authors, barely. The expensive part is the matrix multiplications in attention and the MLP layers, which run over the same sequence whether or not a position contributes to the loss. The logits at every position were already computed for GRPO; the two masks just pick different subsets. No extra attempts, no teacher model and no extra forward pass: a cost that is, in their words, basically zero.
The results
The comparison is as clean as it gets: same models, same GRPO recipe, same tasks, the same attempt and turn budget and the same number of steps. The reward is 1 if the agent passes the tests at the end and 0 if not. The only difference is whether the terminal output also goes into the loss. They tried it with Qwen3-8B, Qwen3-14B and a model already fine-tuned on an expert's demonstrations (OpenThoughts-Agent-v1-SFT).
In the training curves, the ECHO curve pulls away from GRPO early and usually stays above it on all three validation sets (with the 14B model on ITD, the two cross). And it learns faster: with Qwen3-8B, ECHO reaches on Terminal Bench Lite what GRPO gets in 500 steps 280 steps sooner, about 2.3 times faster, and it keeps climbing.
In the table, the story is the same. On Terminal Bench 2, the hardest benchmark, the first-try success rate nearly doubles compared to GRPO: from 2.70% to 5.17% with Qwen3-8B and from 5.17% to 10.79% with Qwen3-14B. It doesn't come from more data, more attempts or a teacher: the terminal's response was already in the attempt. One caveat: ECHO wins almost every cell of the table, but not all of them; with the OT-SFT model, on TB2 pass@3 it lands slightly below GRPO (13.82 vs 14.38), and on pass@5 they tie.
Why does it work? GRPO only learns from a sparse, binary reward, and on hard terminal tasks a small model almost never succeeds, so many tasks give no signal at all. ECHO turns failures into supervision: even when a command doesn't solve the task, the terminal teaches it what that command caused.
Does it learn how the terminal behaves?
The title talks about "world models", and the authors hedge: they don't claim ECHO learns a world model in the strong sense. They claim something testable, by flipping Sutskever's quote around: if the model has learned how the terminal behaves, it has to be good at predicting its output. And a better predictor is, in information-theoretic terms, a better compressor of what it predicts.
To measure it cleanly, they generated attempts with a stronger model, Qwen3-32B, which wasn't used in any training run, and measured how surprised each model was by the terminal output (cross-entropy per token: the lower, the less surprise). On val100, with Qwen3-8B, the starting policy scores 0.29; after GRPO, 0.27; after ECHO, 0.07. The pattern repeats with the other models.
So they won't say world model with a capital W. What they do claim is that ECHO produces policies that compress terminal dynamics much better, on attempts they didn't even generate. And the same checkpoints that best predict the terminal are the ones that solve more tasks.
Surprise 1: less reliance on the expert
The usual recipe for terminal agents is to first copy a stronger model's demonstrations (supervised fine-tuning, SFT) and then run reinforcement learning. Here the reference is OpenThoughts-Agent-v1-SFT: Qwen3-8B fine-tuned on demonstrations generated by GLM-4.6. The question: how much of the advantage of starting from the expert can ECHO recover without copying anyone?
They compared three runs: GRPO on the base model, ECHO on the base model, and GRPO on the fine-tuned model (SFT + GRPO). Of the advantage the expert gives, ECHO recovers 104% on ITD, 89% on Terminal Bench Lite and 50% on Terminal Bench 2 (pass@1).
The authors' reading: much of the value of demonstrations may not lie in the expert's strategy, but in teaching what it's like to interact with a terminal (inspect files, run tests, follow a traceback). ECHO doesn't imitate the expert: it learns to predict the consequences of its own commands, and with that, which commands expose useful state, which errors are diagnostic and which outputs signal progress. On TB2 half the gap remains, consistent with it being harder and further from the training tasks; they don't see it as a fixed ceiling. The takeaway isn't that expert SFT is obsolete, but that part of what it buys can be learned directly from the environment: the terminal teaches too.
Surprise 2: improving without rewards
If ECHO really teaches how the terminal behaves, do we even need the verifier? They turned it off: no GRPO, only the terminal loss. The agent acts, observes and learns only to predict what comes back; no label says which action was good. If it still improves, it's because predicting the terminal changes how it picks its actions.
They took their best Qwen3-8B trained with ECHO and trained for 100 more steps on tasks it had never seen, with that loss alone. The result, in their words, "kinda" worked: +3.8 points on val100 (tasks similar to the training ones), +5.2 on ITD and +10.0 on PyTerm, a set of Python-heavy terminal tasks; on the last two, keeping only the clean attempts.
But it doesn't always work. On val100 the gain is small because the agent had already learned almost everything. On ITD, noisy attempts (invalid commands, parse errors, dead-end loops) had to be filtered out. And on Terminal Bench Lite the same filtering didn't improve consistently. The key, according to the authors, is how informative the output is: in Python, code, traceback and fix sit right next to the action; in other tasks the state shows up more indirectly, through files, configs and multi-step setup.
The surprising part isn't that the agent improves itself perfectly, but that it improves at all, from nothing but acting and predicting what comes back. But only when reinforcement learning has already produced a model that explores reasonably well, its attempts are clean and the terminal gives useful clues.
Where this leaves us
The core lesson: an agent's attempts contain much more supervision than the final reward. The authors don't say rewards or demonstrations are obsolete: the expert teaches strategy and the verifier gives the cleanest signal. But between "imitate the expert" and "wait for a sparse reward" there's a dense, underused source of supervision: the consequences of the agent's own actions.
It's not an idea out of nowhere, either. Predicting the environment as an auxiliary task has a long history in reinforcement learning, and recent work like Agent Learning via Early Experience, VAGEN, RWML or CWM has already brought it to language model agents in different ways. ECHO is the online version, inside the training loop and for the terminal.
Open questions remain: is there a better way to represent what gets predicted (a summary of the state instead of the raw output)? Which observations to use, when to filter and how much to weigh prediction against the policy? Does it work beyond the terminal, in browser agents, multi-tool systems or assistants, where user corrections are another kind of response? Back in May 2026 they bet that, before the year was out, some form of environment-token prediction would be standard in agent trainers.
The laptop maze
Before all of this, Dimitris tried the idea on his laptop: a maze in a tiny terminal and a 10-million-parameter transformer trained from scratch. The agent says up, down, left or right, and the terminal tells it what's around it and how far the goal is. Training on those responses too, it solved more small mazes (up to 0.42 higher solve rate on 6×6 mazes with λ = 1); on 9×9 or bigger, the advantage almost disappeared.
He himself says it's not a Nature paper. His lesson is a different one: almost every clean idea has a microcosm, a scaled-down version you can run on a laptop in an evening to find out whether it's worth scaling up. The maze didn't prove ECHO would work, but it gave him enough conviction to message Vaish, and the big results are hers. Most of his ideas are wrong, he says, and the cheap experiment tells him which ones to drop before they cost anyone else time.
In short
A terminal agent already reads what the terminal says back, but standard reinforcement learning doesn't learn from it. ECHO makes it predict that, at almost no cost, and according to the authors the agent solves more tasks, learns faster, relies less on an expert and, in some cases, improves even without rewards.
Stop throwing away the tokens the terminal already gave you: they teach too.
Sources
- "ECHO: Terminal Agents Learn World Models for Free", by Dimitris Papailiopoulos and Vaish Shrivastava, AI Frontiers, Microsoft Research (May 18, 2026).
- The paper and the code (built on SkyRL).
- The video, on my channels: English and Spanish.