feat: ECHO env-token world modeling (RFC 010 + runnable demo)#16
feat: ECHO env-token world modeling (RFC 010 + runnable demo)#16thegovind wants to merge 1 commit into
Conversation
|
📖 Added a diagram-rich explainer for the blog: Harbor → ACA Sandboxes: Harbor is just SkyRL’s terminal sandbox backend (spin up a container, run the command, return the observation, run the verifier). So we map it to the Scenario: reframed as forward-deployed incident triage (an FDE-relatable, ECHO-native terminal setting). |
|
🧵 End-to-end showcase added: 🔧 Loom/ECHO is feasible with the current SDK. The |
Add RFC 010 and two runnable reference examples so an OpenEnv trajectory can carry per-token role masks (action / env_output / warning) and the optimizer seam can take a world_model_coeff. Purely additive: world_model_coeff = 0 drops the env term, leaving the existing action-token objective unchanged. During agent RL we usually mask out the environment's reply tokens and train only on the agent's actions. ECHO keeps that half with a small cross-entropy loss that makes the policy predict the environment's observation tokens. Those logits are already computed when the policy conditions on them, so the signal needs no extra rollouts and no teacher. L = L_GRPO(action tokens) + lambda * CE(observation tokens) - rfcs/010-echo-env-token-world-model.md: the proposal. Part A adds the role masks (extends RFC 009); Part B adds the world_model_coeff knob on the optimizer seam (extends RFC 007). - examples/echo_world_model/: a self-contained CPU reference that trains a small model on the environment's own observation tokens (verifier-free), with adapter notes for SkyRL, Tinker, and Foundry Fine-Tuning. Held-out env-token CE drops from 6.18 to 0.27 nats/token (echo_run.png). 6 tests. - examples/echo_on_agent_world_model/: the same role masks on the Agent World Model env (huggingface#428), with 10 CPU tests over a captured episode. 89% of the learnable tokens are environment observations that standard agent-RL discards. The Agent World Model env is AgentWorldModel-1K from Snowflake AI Research and UNC-Chapel Hill (CC-BY-4.0, arXiv:2602.10090). The ECHO objective is from microsoft/echo-rl (arXiv:2605.24517). Signed-off-by: Govind Kamtamneni <gok@microsoft.com>
b304756 to
851b353
Compare
|
Superseded by the upstream submission: huggingface#819. Squashed the history into one clean DCO-signed commit, swapped the video placeholder for the reproducible env-token CE chart, and fixed the cross-repo references. Closing this fork staging PR; huggingface#819 is canonical. |
Walkthrough
Video placeholder. Drag the recording here before upstream submission.
What this PR adds to OpenEnv
rfcs/010-echo-env-token-world-model.md): a small, additive amendment so a trajectory can carry per-token role masks (action/env_output/warning) and the optimizer seam can take aworld_model_coeff. This is the one thing OpenEnv is missing to train on environment tokens.examples/echo_world_model/: a CPU reference that trains a small model on the environment's own tokens (verifier-free), with adapter notes for SkyRL, Tinker, and Foundry Fine-Tuning.examples/echo_on_agent_world_model/: the same masks on the real upstreamagent_world_model_env(10 CPU tests), showing its observations already carry the roles.Purely additive.
world_model_coeff = 0drops the env term entirely, so the trainer's existing action-token objective is unchanged.ECHO, crisply
During agent RL we mask out the environment's reply tokens and train only on the agent's actions. ECHO keeps that half: a small cross-entropy loss that makes the policy predict the environment's observation tokens. Those logits are already computed when the policy conditions on them, so the signal needs no extra rollouts and no teacher (about free).
The gap it closes. OpenEnv trajectories are message-level today, so a trainer cannot tell, per token, which tokens are actions and which are observations. RFC 010 Part A adds the masks (extends RFC 009); Part B adds the
world_model_coeffknob on the optimizer seam (extends RFC 007).Evidence
6.18 -> 0.27nats/token on a small model.forward_backward+optim_stepon Foundry Fine-Tuning, not reproducible from this PR): plain GRPO degraded held-out env-CE (10.08 -> 21.16, +110%) while ECHO learned it (10.08 -> 7.69, -24%). Config, seed, and logs available on request.Production rollouts can be isolated in ACA Sandboxes (PR #4, not part of this PR); the CPU demos here run in-process. Training adapters: SkyRL (open reference), Tinker, Foundry Fine-Tuning. Trained task-reward numbers (about 2.3x faster RL, TerminalBench-2.0 pass@1 about doubles) are in
microsoft/echo-rland arXiv:2605.24517.Verify
Credits
The real-env demo builds on the upstream Agent World Model env (
agent_world_model_env) from Snowflake AI Research and UNC-Chapel Hill: AgentWorldModel-1K, CC-BY-4.0, arXiv:2602.10090. The ECHO objective is frommicrosoft/echo-rl(arXiv:2605.24517). Full citations in the example READMEs.DCO signed. Refs #14, #9, #11. On the fork, this supersedes #17 (folded in here).