Spaces:
Running
Download WRITEUP.md from munish0838/beam-duck-engineer: direct link, hf CLI and curl.
- Browser
- Download file 11.2 kB
-
https://huggingface.co/spaces/munish0838/beam-duck-engineer/resolve/main/WRITEUP.md
- Command line
-
hf download hf://spaces/munish0838/beam-duck-engineer/WRITEUP.md
-
curl -L -o WRITEUP.md https://huggingface.co/spaces/munish0838/beam-duck-engineer/resolve/main/WRITEUP.md
Beam as an RL engineer: a 44% faster Microduck sprint, and three mirages it had to be shown
The question. Can Beam, following Pollen Robotics' own agent guide, engineer a training recipe that beats the reference sprinter at the same training budget — and does it predict its own results correctly?
The setup. Pollen's 2 m Sprint (sprint-2m). Each round Beam reads the challenge's
AGENTS.md verbatim, the pristine env.py and challenge.toml, the reward API, the
budget, the bar and the session's history, and returns one JSON object: analysis,
hypothesis, a recipe change as exact-once search/replace edits, and a prediction of its
own score. A human operator runs a fixed pipeline — apply unedited, validate, train,
score — and hands back a report. Beam never runs anything; the operator never decides
anything; nothing Beam writes is edited by hand.
Every run: from scratch, 4,096 envs, 1,000 iterations, one L4. Every checkpoint (250/500/750/999) scored with Pollen's own Arena evaluator. A run's result is its best checkpoint: 5/5 finishes first, then lowest time.
Every recipe was trained on two training seeds. That turned out to be the single most important design decision, and it is why three of the headline-looking results in this experiment are not in the headline.
The result
| Recipe | Seed 1 | Seed 2 | Spread | Worst | |
|---|---|---|---|---|---|
| Control — unchanged recipe | 5.438 s | 5.219 s | 0.219 s | 5.438 s | baseline |
r1 — forward_reward 3.0 |
3.403 s | 3.271 s | 0.132 s | 3.403 s | ✅ reproduced |
r2 — forward_reward 4.0 |
2.795 s | 4.469 s | 1.674 s | 4.469 s | ❌ |
r5 — r2 + step_reward 5.0 |
2.751 s | 3.159 s | 0.408 s | 3.159 s | ❌ |
r6 — r5 + upright_reward 3.0 |
2.945 s | 3.085 s | 0.140 s | 3.085 s | ✅ reproduced |
| r7 — r6 + action-rate −0.4 | 2.917 s | 2.797 s | 0.120 s | 2.917 s | ✅ best |
r8 — r7 + heading_hold std 0.2 |
2.745 s | 3.252 s | 0.507 s | 3.252 s | ❌ |
Headline: Beam's best reproducible recipe runs the sprint in 2.797–2.917 s against the unchanged recipe's 5.219–5.438 s at an identical budget. Measured the hard way — Beam's slower seed against the control's faster one — that is 2.302 s, 44% faster, with a seed spread of 0.120 s against the baseline's own 0.219 s. It also beats Pollen's published reference (4.883 s), which used 3× the training budget.
The fastest single run was r8 at 2.745 s. It is not the headline, because the same commit retrained on another seed gives 3.252 s.
What the two-seed protocol caught
Three recipes looked like wins on one seed and were not reproducible: r2 (1.674 s spread), r5 (0.408 s), r8 (0.507 s). Any of them, measured once, would have been reported as the result. r8 would have become the Arena entry at an advertised 2.745 s that is really 3.252 s half the time.
Beam could not see this for rounds 1–6, because each report showed one seed. It pushed
forward_reward to 4.0 because r1 worked, and 4.0 was unstable — it optimised a mean it
had one sample of. That is the clearest limitation we measured, and it is a property of the
feedback, not of the model.
From round 7 we showed it both seeds and the measured noise floor. Its behaviour changed:
- It built on r6 — slower but reproduced (0.140 s) — rather than r5, which was faster on one seed and swung 0.408 s, citing the spread as its reason.
- After r8 destroyed reproducibility it diagnosed the cause itself: "The culprit was tightening heading_hold std from 0.4 to 0.2, which makes the reward landscape too sharp and seed-sensitive." It reverted to r7 as the baseline instead of chasing 2.745 s, and distinguished reward magnitude (weight) from sharpness (std) — proposing weight 2.0 at std 0.4 to get gradient without sharpness.
- It spent 10,221 output tokens on round 7 against ~4,400 for the single-seed knob rounds.
Calibration
Beam's prediction error separates by the kind of change it proposed:
| Change type | Rounds | Mean signed error | |
|---|---|---|---|
knob — a lever it had measured |
4 | −0.202 s | pessimistic |
env / combined — an untested mechanism |
4 | +0.311 s | optimistic |
Per round: −0.997, −0.305, +0.316, +0.767, +0.151, +0.345, +0.117, +0.045 s. It under-promises when extrapolating what it has evidence for and over-promises when reasoning about mechanisms it has not tested. The aggregate across all eight rounds is +0.055 s, which would read as near-perfect calibration and hide the effect entirely.
Accuracy also improved over the session: mean absolute error 0.596 s over rounds 1–4 versus 0.165 s over rounds 5–8. The two-seed rounds are the best calibrated (0.117, 0.045 s) — but experience accumulates at the same time, and with n=2 we cannot separate "saw the variance" from "had more rounds behind it".
What was mechanically true
A coherent story across 16 runs:
forward_rewardwas the real bottleneck. The shipped recipe underweights speed tracking; 2.0 → 3.0 alone bought 2.0 s. The control needs ~500 iterations just to walk (its checkpoint 250 scores 50 s, 0/5).- Aggressive speed destabilises, and a specific knob fixes it.
forward_reward4.0 alone swung 1.674 s across seeds. Addingstep_reward5.0 kept it unstable (0.408 s). Addingupright_reward3.0 made it reproducible (0.140 s) — more complex was more stable, not less. heading_holdstd is a reliable destabiliser — 2 for 2. Tightening it to 0.2 hurt outright on the r2 base (3.367 s) and produced the fastest-but-unreproducible run on the r7 base (2.745/3.252 s). Its weight is a different matter: r9 tests exactly that.- The same change can help or hurt depending on the base recipe. std 0.2 gave 3.367 s on one base and 2.745 s on another. A refuted change is not permanently refuted.
What we had to retract
- A cheap stability proxy that does not work. After two recipes it looked like a run whose checkpoints regress within a single run is the one that will not reproduce across seeds — a free stability test. Measured over four recipes it scored 2 of 4, i.e. chance (r5 clean and did not reproduce; r6 flagged and did). Reported because it is exactly the kind of proxy that looks right after two data points.
- The author made the same single-seed error as the model. We called r8's retry "vindicated" on the strength of seed 1 (2.745 s), fifteen minutes after documenting that Beam does precisely that. Seed 2 gave 3.252 s. The error is cheap to make; the protocol is what caught it.
Two grounding failures
Both were checkable against context Beam had been given, and neither was corrected — the change was applied as written:
- Round 7 asserted "checkpoint 750 beat checkpoint 999 in both rounds 5 and 6". False: 999 won in 3 of the 4 runs, and the history table it was handed listed round 5's best checkpoint as 999. Its action-rate change improved the result anyway.
- Round 8 re-proposed
heading_holdstd 0.4 → 0.2 — the identical intervention it had measured as harmful in round 4 — with no mention of the prior attempt, though round 4's hypothesis and score were both in its history table. Retrying on a different base is legitimate engineering; not citing the earlier failure is the finding.
One round (r3) needed a second attempt: its first reply quoted
value = 2.0 / min = 0.5 / max = 5.0, which matches both forward_reward and
upright_reward. A naive apply would have silently changed the wrong knob and trained a
recipe nobody intended. The exact-once rule rejected it and Beam self-corrected from the
raw error.
The honest cost of the speed
forward_reward |
0.20 m/s | 0.25 m/s | 0.30 m/s |
|---|---|---|---|
| 2.0 (control) | 16.49 s ✅ | 10.85 s ✅ | 8.04 s ✅ |
| 3.0 | fall ❌ | timeout ❌ | 6.94 s ✅ |
| 4.0 | timeout ❌ | timeout ❌ | fall ❌ |
Speed was bought by losing low-speed walking entirely. The Arena sweeps 21 speeds and keeps the best, so this is invisible to the score — but on hardware a duck that cannot walk at 0.2 m/s is worse, not better. Point an optimiser at a best-over-sweep metric and it will specialise; the metric gives Beam no reason to care.
On the public board the entry ranks #191 of 252. That rank is not the result: the median there is 1.196 s and the top entries reach 0.817 s — 2.45 m/s average while commanded 0.20 m/s, i.e. by ignoring the speed command. Pollen's own reference sits near #225 on that same board. This entry obeys its command.
Method
Each change was applied unedited to a fresh branch off a pinned pristine tag (a branch would have moved when upstream shipped Arena 0.7.0 mid-experiment), then gated by: schema → path check → knob ranges → exact-once search/replace → a banned-pattern guard → Pollen's own pytest suite (137 tests) → a CPU smoke test. A failure went back to Beam verbatim as a same-round retry. Scoring every checkpoint mattered: r2's final checkpoint scored 6.114 s and its best scored 2.795 s, so scoring only the last would have recorded r2 as worse than the control.
Script bugs were fixed and the step rerun; Beam was never re-asked because of one. Four
occurred and all are in OPERATOR_LOG.md. Rounds 1–6 were approved job by job; rounds 7–10
under one standing instruction — recorded, because it changes what "a human approved every
job" means.
For the record, Arena 0.7.0 does not change sprint scoring: sprint-2m.toml is
byte-identical, its runner changes are gated on manifest.lights/steering (the sprint
declares neither), and the reference re-scores at 4.883 s seed-for-seed under both.
Cost
16 scored runs, 578 GPU minutes ≈ $7.71 on l4x1; 11 Beam API calls (9 rounds, one
same-round retry, one independent-session proposal), 437,304 in / 68,387 out tokens
(≈ $0.64). Total ≈ $8.35.
Limitations
Simulation only. One event, one model, one provider. Two seeds per recipe — enough to show which recipes do not reproduce, not enough to characterise the distribution. The two-seed protocol began at round 7, so the before/after comparison is confounded with accumulated experience (n=2 after the change). Local Arena scores are indicative: only the Space times an official entry, and simulations on different CPU architectures drift after a few seconds — though our local export and the job's own x86 export agreed exactly at 2.795 s. Human-operated, not autonomous.
Credits
Pollen Robotics for the Microduck, the challenges repo, AGENTS.md, the Arena, its
evaluator and the reference policy. Reflection AI for Beam. Helper scripts built with
Claude Code. Every recipe change was proposed by Beam; a human operator ran every command
and approved every job; no hand-tuning.
Full record — prompts, raw replies, reasoning traces, diffs, validation failures, per-checkpoint scores, operator log — in the dataset.