An Omitted Mode Is a Rare Rule: The Sampling-Verification Danger Law in Continuous Code World Models
Organizations: AGILabs
Abstract
In the Code World Model paradigm an LLM synthesizes an executable world model that a classical planner searches, and the model is accepted when it reproduces sampled transitions. We ask what that acceptance certifies in continuous control. We define the pipeline's danger as an expected risk and isolate its exact factor: the probability that N i.i.d. gate rollouts all miss a critical event of probability r is exactly (1-r)^N; an independent acceptance sample adds its budget to the exponent. On three hybrid instruments the accepted mode-blind model is exploited: the planner is pinned at the mode boundary at a regret of nearly the whole attainable return. We prove a localization budget, valid at boundary points: models with Lipschitz constant at most L differing by eta at a point disagree above tolerance eps on a region of volume at least kappa((eta-eps)/L)^(d+m); the discontinuous reset modes studied pay no such budget. With real LLM synthesis, GPT-5.x repairs an omitted 1D clamp in 105 of 111 mode-containing draws -- every attempt exact on 50 of 56 instrument-stream blocks (95% CI [0.781, 0.960]). On 2D regions no artifact recovers the rule (0/156); eight targeted interventions leave the failure in place, and positive controls locate it: a located rule is not induced, while given form and location the constants follow exactly. A version-space certificate proves identification is class-relative: at the widest dose the declared fit succeeds in 20/20 blocks and every sample-consistent circle is within tolerance in 18/20. We prove a class of entry rules exactly consistent with every sample yet harmless at play, so identifiability is a measurable property of the instrument. Re-scoring all 1034 artifacts on independent samples confirms acceptance certifies sample consistency and no more: where the gate is provably informative it covers about two percent of the exploited planner's queries.
Figures & tables
| rarity | play_cost | blind hit | d@20 | d@40 | d@80 | ||||
|---|---|---|---|---|---|---|---|---|---|
| 2 | 0.3168 | 17.77 | 0.53 | 1.031 | 1.00 | 0.001 | |||
| 3 | 0.2135 | 17.77 | 0.53 | 1.031 | 1.00 | 0.008 | |||
| 4 | 0.1352 | 17.77 | 0.53 | 1.031 | 1.00 | 0.056 | 0.003 | ||
| 5 | 0.0797 | 17.77 | 0.53 | 1.031 | 1.00 | 0.196 | 0.037 | 0.001 | |
| 6 | 0.0439 | 17.77 | 0.53 | 1.031 | 1.00 | 0.420 | 0.171 | 0.028 | |
| 8 | 0.0114 | 17.77 | 0.02 | 0.53 | 1.030 | 1.00 | 0.818 | 0.650 | 0.410 |
| rarity | play_cost | blind hit | d@40 | |||
|---|---|---|---|---|---|---|
| 0.8 | 0.2876 | 20.08 | 0.01 | 1.002 | 1.00 | |
| 1.0 | 0.1270 | 20.08 | 0.03 | 1.002 | 1.00 | 0.004 |
| 1.2 | 0.0509 | 20.08 | 0.05 | 1.000 | 1.00 | 0.124 |
| 1.4 | 0.0196 | 20.08 | 0.12 | 0.997 | 1.00 | 0.452 |
| 1.6 | 0.0070 | 20.08 | 0.26 | 0.990 | 1.00 | 0.748 |
| 2.0 | 0.0007 | 20.08 | 1.23 | 0.942 | 1.00 | 0.917 |
| play_cost | d@40 | d@40 | d@40 joint | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 2 | 6 | 0.245 | 0.010 | 0.252 | 17.98 | 1.006 | 0.673 | ||
| 2 | 7 | 0.245 | 0.008 | 0.253 | 18.02 | 1.006 | 0.720 | ||
| 2 | 8 | 0.245 | 0.007 | 0.252 | 18.08 | 1.006 | 0.770 | ||
| 3 | 6 | 0.142 | 0.008 | 0.150 | 18.57 | 1.006 | 0.002 | 0.720 | 0.002 |
| 3 | 7 | 0.142 | 0.008 | 0.150 | 18.47 | 1.006 | 0.002 | 0.720 | 0.002 |
| 3 | 8 | 0.142 | 0.007 | 0.148 | 17.72 | 1.006 | 0.002 | 0.770 | 0.002 |
| arm | reveal-rarity | pass@40 measured | play_cost | d@40 | |
|---|---|---|---|---|---|
| wall@4 omitted | 0.1351 | 0.0030 | 0.003 | 1.031 | 0.0031 |
| wall@8 omitted | 0.0103 | 0.6622 | 0.667 | 1.030 | 0.6821 |
| drag bias 1.03 (sub- ) | 0.0001 | 0.9940 | 0.997 | (exact) | (exact) |
| drag bias 2.0 (supra- ) | 1.0000 | (exact) | (exact) | ||
| bump@4, amp 0.5 | 0.1829 | 0.0003 | (exact) | (exact) | |
| bump@4, amp 1.0 | 0.2018 | 0.0001 |
| cell (20 seeds each) | full | absent blind & exploited | present repaired (stalled) |
|---|---|---|---|
| mini | 20/20 | (pc 0.995) | (0) |
| large | 20/20 | (pc 0.995) | (0) |
| mini | 20/20 | — | (0) |
| large | 20/20 | — | (0) |
| Qwen (3 seeds) | 3/3 | (pc 0.995) | (2 stalled @0.9997) |
| # | what it targets | repaired | what did not suffice, as tested |
|---|---|---|---|
| 1 | region-first guidance, budget | 0/40 | prompting and budget |
| 2 | axis-aligned square, flat edges | 0/40 | boundary curvature |
| 3 | a second model family (Claude) | 0/3 | one family’s idiosyncrasy |
| 4 | trigger arity: a band in one coordinate | 0/40 | nothing — target unidentifiable |
| 5 | the trigger’s argument named | 0/40 | variable identification |
| 6 | the mover stops inside the region | 0/40 | the interior’s censoring |
| model | trained on | off-mode err mean / max | probe err | gate | gate |
|---|---|---|---|---|---|
| linear-LSQ | wall-free | / | 4.18 | PASS | PASS |
| linear-LSQ | wall-data | / | 4.17 | fail | fail |
| MLP h=8 | wall-free | / | 4.20 | fail | fail |
| MLP h=8 | wall-data | / | 4.19 | fail | fail |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| mode arm | firing | first grid | measured in the same sample | |
|---|---|---|---|---|
| cart wall@8 | 0.3959 | 25 | none in grid | flat through |
| cart wall@4 | 0.1137 | 277 | 0.3 | to , at 0.3 |
| pendulum [email protected] | 0.0791 | 282 | 0.1 | to , at 0.1, at 0.3 |
| pendulum [email protected] | 0.0805 | 35 | 0.1 | to , at 0.1, at 0.3 |
| instrument | knob | pc MPC | pc CEM | contact CEM | crossing CEM | crossing MPC |
|---|---|---|---|---|---|---|
| cart | 2.0 | 1.031 | (exact) | 0.0309 | 0.3865 | |
| cart | 4.0 | 1.031 | (exact) | 0.0055 | 0.2453 | |
| cart | 6.0 | 1.031 | (exact) | 0.0003 | 0.1483 | |
| cart | 8.0 | 1.030 | (exact) | 1.4e-05 † | 0.0773 | |
| cart | 10.0 | 0.977 | (exact) | 0.0369 | ||
| pendulum | 0.8 | 1.002 | 0.009 | 0.70 | 0.1150 | 0.6392 |
| knob | pc_blind | pc_mit | first-contact step |
|---|---|---|---|
| cart ( ) | |||
| 2 | 1.031 | 0.290 | 11.6 |
| 4 | 1.031 | 0.446 | 16.9 |
| 6 | 1.031 | 0.578 | 21.3 |
| 8 | 1.030 | 0.699 | 25.1 |
| 10 | 0.977 | 0.806 | 28.7 |
| pc_blind | pc_mit | mean viol. | first contact | |
|---|---|---|---|---|
| 1.006 | 0.257 | 1.05 | 8.50 | |
| 1.006 | 0.541 | 2.65 | 12.35 | |
| 1.006 | 0.862 | 4.25 | 15.25 |
| wall@8 rarity | bias 1.03 rarity | bias 2.0 rarity | |
|---|---|---|---|
| 0.0125 | 1.0000 | 1.0000 | |
| 0.0125 | 1.0000 | ||
| 0.1 | 0.0125 | 0.0040 | |
| 0.3 | 0.0125 | 0.0040 |
| truth passes | blind passes | exact CP | analytic conditional | |
|---|---|---|---|---|
| 0–0.1 | 200/200 | 11/200 | 0.0550 | |
| 0.3 | 200/200 | 11/200 | 0.0556 | |
| 1 | 200/200 | 32/200 | 0.1582 | |
| 3 | 200/200 | 106/200 | 0.5029 |
| campaign | model | cells | calls | min / med / max | cap |
|---|---|---|---|---|---|
| qwen_xwall8 | Qwen3-Coder-30B | 6 | 16 | 1 / 1 / 6 | 2 |
| large_xwall8 | gpt-5.4 | 40 | 48 | 1 / 1 / 2 | 0 |
| large_xwall8_off20 | gpt-5.4 | 40 | 50 | 1 / 1 / 2 | 0 |
| mini_xwall4 | gpt-5.4-mini | 10 | 27 | 1 / 1 / 6 | 3 |
| mini_xwall8 | gpt-5.4-mini | 40 | 62 | 1 / 1 / 6 | 1 |
| patch2d_qwen_k3_7 | Qwen3-Coder-30B | 3 | 3 | 1 / 1 / 1 | 0 |
| class | operational rule | line |
|---|---|---|
| invalid | exec raises, step missing, or step returns a state of the wrong arity | :183--189 |
| crash | mask construction raises | :190--194 |
| blind | and , and step ’s body has no if | :234--237 |
| blind-textual-patch (the paper’s superstitious patch ) | and , and step ’s body does contain an if ( _step_has_conditional , :170--175 ) — a written rule whose trigger set is behaviourally empty, e.g. an exact-coordinate trap, which is measure-zero and so never fires | :234--236 |
| vdep | but : deviates only at nonzero velocity | :238--240 |
| point | largest connected component below world-units 2 | :244--247 |
| variant | max_examples | max_failures | guidance |
|---|---|---|---|
| default | 30 | 20 | empty string; byte-identical to every pre-knob run |
| guided | 120 | 40 | describe-the-region-first process guidance ( :198--204 ) |
| region | 120 | 40 | guided plus “the trigger region need not be a 1-D threshold” de-bias ( :205--210 ) |
| landing | 120 | 40 | region plus one sentence naming the trigger’s argument ( :221--225 ) |
| object | backing results/ JSON | checking |
| tab:epsstar | eps_invariance_threshold | claims |
| tab:danger | continuous_reach | cells |
| fig:threshold | continuous_reach | claims |
| fig:reach | continuous_reach | claims |
| tab:pendulum | continuous_pendulum | cells |
| tab:patch2d | continuous_patch2d | cells |