← Research

Technical Report · Self Model Research · Rung 5

An Arc of Elimination: Why Surprise Attribution Fails on a Compliant Body

In simulation only. The compliant body is a simulated series-elastic joint, not hardware.

Abstract

This document tells the story of five experiment runs as one argument. Each run tested one explanation for a failure, ruled it out or narrowed it, and handed a sharper question to the next. Nothing here is a working detector for a compliant body. What the arc does produce is a narrower and better-supported statement of why the detector fails.

Where the numbers come from

Every number below is copied from a results file in surprise_attribution/. A few numbers were computed directly from the per-trial CSVs rather than taken from a summary; those are marked (from the per-trial CSV). Anything not logged is marked as such.

stepexperimentresults folder
1Factorial, rigid body, simultaneous disturbancesresults_factorial/
2The same factorial on a compliant, noisy gridresults_compliant/
3Per-body calibration (z-scoring)results_calibrated/
4aHistory-input forward modelresults_history/
4bShape feature, no settle gateresults_shape/
Table 1.

1The question

A robot with a learned self-model (a forward model that predicts its own next state) gets surprised whenever a prediction fails. Two very different causes produce that surprise:

Adapting to a push corrupts a correct model. Failing to adapt to a body change leaves a stale one. So the question is:

Question

Can the self-model's own one-step prediction error tell a body change from a world event, and does that still work on a compliant, noisy body?

Setup shared by every step:

Two failure rates matter most:

2Experiment 1: rigid body, simultaneous disturbances

Tested: whether the rule still works when a body change and a push land at the same moment, unannounced, on the rigid pendulum.

Found (results_factorial/summary.txt):

ground truth→ body→ world→ alarm
neither01200
body only11703
push only01200
body + push701931
Table 2.

Mechanism. All 19 masked trials took the same route:

  1. The pendulum never settled within 10 s.
  2. The error stayed raised, but in fewer than the required 80% of late 1 s blocks.
  3. The rule therefore fell through to its default verdict, “world”.

18 of the 19 were length changes. Masking was concentrated in the 0.5 s pushes at 1 and 2 N·m (8/20 and 10/20).

Not logged

The factorial files don't log the pendulum's angle, so why those trials never settled isn't measured here. An earlier ad-hoc look at results_overlap/ traces suggested the pendulum had fallen, but that wasn't saved as a number.

Question handed on: the rigid result holds, with a thin margin and a known failure route through “never settles”. Does it hold on a body that isn't rigid?

3Experiment 2: the compliant grid

Tested: the same trials, rule and seed on a simulated compliant joint, at 4 stiffnesses × 3 sensor-noise levels.

Found (results_compliant/summary.txt). Rates are out of 120 per cell. The AUC is computed on settled trials only, comparing those with and without a body change.

configfalse positivemaskingmissed, no pushgapAUCsettled, body / no body
rigid, none0.0%15.8%0.0%+0.00141.000187 / 239
rigid, low0.0%55.8%38.3%−0.01670.930193 / 238
rigid, medium12.5%60.0%100.0%−0.10840.291192 / 225
stiff, none2.5%70.0%24.2%−0.01260.980134 / 196
stiff, low0.8%78.3%64.2%−0.05410.83051 / 185
stiff, medium96.7%2.5%2.5%−0.02410.7676 / 5
medium, none4.2%97.5%100.0%−0.02710.9557 / 185
medium, low15.0%100.0%100.0%−0.02810.37313 / 192
medium, medium100.0%0.8%0.0%n/an/a1 / 0
soft, none21.7%100.0%100.0%−0.04010.202172 / 177
soft, low43.3%99.2%100.0%−0.04100.286166 / 180
soft, medium100.0%0.0%0.0%n/an/a0 / 0
Table 3.

Lesson: this is not a threshold problem. The body/world threshold was already recalibrated per body by the rule's own procedure, and it still failed. Where the AUC is below 0.5, no threshold placement could fix it.

Question handed on: the compliant body's normal error is higher (normal balancing error 0.0107 rigid vs 0.0907 soft, from findings.md). Is the failure just a matter of scale?

4Experiment 3: per-body calibration

Tested: scoring surprise relative to each body's own healthy baseline instead of in absolute terms. Each step's error was z-scored, (error − baseline mean) / baseline std, using that body's undisturbed calibration episodes. The same rule then ran on the standardised signal, on the same trials.

Found (results_calibrated/summary.txt). Counts are out of 120.

configfalse positive old → newmasking old → newmissed, no push old → newAUC old = new
rigid, low0 → 067 → 10046 → 510.930
rigid, medium15 → 072 → 120120 → 1200.291
stiff, none3 → 1284 → 8429 → 280.980
medium, low18 → 2120 → 120120 → 1200.373
soft, none26 → 0120 → 120120 → 1200.202
soft, low52 → 0119 → 120120 → 1200.286
Table 4.

Lesson: this is not a scale problem. The scores are in the wrong order, not just on the wrong scale.

Question handed on: if the order is wrong, maybe the model lacks information. The compliant joint has hidden spring and motor state that one observation can't reveal. Does giving the model that information put the scores in order?

5Experiment 4a: a forward model with history

Tested: a forward model fed the last k observations and actions (k = 2, 4, 8) instead of one, so it can infer hidden actuator state. Everything else was the same.

Found (results_history/summary.txt). “Held-out” is one-step error on 1,000 fresh random-action transitions.

configheld-out single → k=4AUC singlek=2k=4k=8missed, no push single → k=4
rigid, none0.0162 → 0.02131.0001.0000.6610.9930 → 60
rigid, medium0.1267 → 0.11020.2910.6530.7770.854120 → 108
stiff, none0.0066 → 0.00720.9801.0000.8960.90429 → 30
medium, none0.0775 → 0.01050.9550.9980.9830.615120 → 118
medium, low0.0817 → 0.02640.3731.0000.9940.998120 → 116
soft, none0.0519 → 0.01180.2020.3020.0470.479120 → 120
soft, low0.0578 → 0.02810.2860.5060.1100.215120 → 120
Table 5.

What history did

What it didn't do

Why detection didn't improve: two separate walls

The settled regime is where the model is worst. Balancing calm and upright is the regime the gate trusts, but on compliant bodies it's where error is highest. For example, on soft/none without a body change, the median settled error is 0.0901 against a median late-window error of 0.0444 in trials that never settled (from the per-trial CSV). The history model raises settled-regime error further on every body, even while it lowers held-out error.

Lesson: this is not mainly a model-information problem. Better information fixed the model and two inversions, but not the soft body, and not detection. On medium stiffness the settle mechanism blocks detection. On soft, something in the settled error itself orders the trials the wrong way.

Question handed on: what if attribution doesn't wait to settle at all?

6Experiment 4b: the shape feature, with no settle gate

Tested: replacing the settle and persistence rule with the shape of the error after onset. A push should spike and recover; a body change should rise and stay up.

Found (results_shape/summary.txt, summary.json). Counts: detection is out of 240, false positives out of 120.

configAUC body-only vs push-only, W=20 / W=40median r at W=20: push only / body only / undisturbeddetected, old → shape+elev (W=20)false positives, shape+elev (W=20)
rigid, none1.000 / 1.000−2.70 / 0.11 / 0.02221 → 1270
stiff, none0.999 / 0.998−1.01 / 0.07 / −0.01127 → 1401
medium, none0.996 / 1.000−0.77 / 0.37 / 0.013 → 16716
medium, low0.985 / 0.996−0.64 / 0.15 / 0.030 → 12440
soft, none0.796 / 0.935−0.60 / 0.03 / −0.010 → 1522
soft, low0.847 / 0.990−0.56 / 0.05 / 0.041 → 4350
Table 6.

What removing the gate fixed

What it didn't fix

The shape can't tell “stays up” from “nothing happened”. Undisturbed runs have r ≈ 0, like a body change, so shape alone flags 113–120 of 120 undisturbed runs as body changes. The “+elev” rule is needed, and it cuts those to 1–10.

On the soft body, a body change is almost invisible in the one-step error. Its median r (0.03, 0.05) is the same as an undisturbed run's (−0.01, 0.04). Its error doesn't rise above normal balancing error either. Once elevation is required, soft detection falls to 15/240 (soft/none) and 43/240 (soft/low) at W = 20, and to 21 and 39 at W = 40.

It's worse than the old rule on the rigid body. Detection drops from 221 to 127, because a simultaneous push's decay dominates the window (masking 19 → 103).

Window length matters. At W = 10, a 0.5 s push is still on during the window's second half, and nearly all of those pushes are called body (54–60 of 60 on most bodies). On soft at W ≥ 20, longer pushes give more false positives than short ones:

No slow, gradually fading pushes exist in these trials, so that weak spot is untested.

Lesson: the settle gate was a real wall on medium stiffness, and removing it helps there. On the soft body, removing it reveals a lower wall: the body change hardly shows up in the error at all.

7The core finding, by elimination

On a simulated soft series-elastic joint, under this controller, the four experiments rule out four explanations for why surprise attribution fails:

explanationruled out byevidence
wrong thresholdExp 2already recalibrated per body; AUC < 0.5, so no threshold works
wrong scaleExp 3z-scoring leaves every AUC unchanged; soft stays at 0.202 and 0.286
model lacks memory of hidden stateExp 4amodel 4× more accurate on soft (0.0519 → 0.0118); soft AUC still 0.047–0.479
settle mechanismExp 4bno gate at all; soft body changes still look like undisturbed runs (median r 0.03 vs −0.01)
Table 7.
What remains

On the soft body, a mass or length change of the sizes tested barely changes the one-step prediction error during balancing. It doesn't change its level relative to normal balancing error, or its shape over time. In this simulation, one-step prediction error is the wrong observable for detecting a body change on a compliant body. It's a good observable for detecting pushes on every body tested, and for detecting body changes on rigid, stiff and (without the settle gate) medium joints.

How far this claim goes:

8Open question: what observable would reveal it?

These are the next hypotheses. None has been tested.

  1. Multi-step (rollout) error. A changed mass or length may change slow dynamics (period, sag, how the spring settles) more than the next 0.05 s step. Prediction error over a horizon of 0.5–2 s could make a small per-step difference add up.
  2. Model-parameter drift. Instead of reading error, let a copy of the model adapt online and watch how far its parameters have to move to keep fitting. A push needs a brief, reversible move; a body change needs a lasting one.
  3. A different residual. Compare commanded torque or acceleration against what the model expects for the observed motion, rather than the predicted state. On a compliant joint the spring may absorb a body change in the state while the torque needed to hold position still shifts.
  4. A baseline matched to the regime. Train the model, or at least its normal-error baseline, on healthy closed-loop balancing data instead of random actions. Exp 4a showed that balancing is where the random-action model is worst, so a body change may only stand out against a baseline from that regime.
A test that would end the arc

On the soft body, find an observable whose body-only vs undisturbed AUC is clearly above 0.5 while keeping push-only separable. Exp 4b showed that one-step error fails the first half of that test on soft. The second half already passes.

9Caveats

1

Simulated compliance, not hardware. The joint parameters (J_MOTOR 0.05, B_MOTOR 0.5, B_JOINT 0.3, HYST 0.3, SPRING_ZETA 0.3, N_SUBSTEPS 10) were chosen, not measured from a device. The spring damper was added after a balance-only pilot whose numbers aren't logged.

2

One training seed per model. In Exp 4a the AUC swings between k values (for example rigid/none 1.000 → 0.661 → 0.993). These may be model-to-model noise; with one seed per k it can't be told apart from a real effect of k.

3

Controller held fixed. Every experiment after Exp 2 used the single-state model's controller, so that trajectories stay paired. A different controller would produce different trajectories and settling behaviour. That hasn't been tested.

4

Medium-noise compliant configurations are degenerate. Calibration episodes never settle (stiff 0/50, medium 1/50, soft 0/50), so the settle-based rule has no threshold. The rigid medium-noise body did calibrate (50/50).

5

Rigid-tuned settings. The calm limits, settle windows and alarm threshold were tuned on the rigid body and never re-tuned. Exp 3 changed the threshold units; Exp 4b removed the gate.

6

One run per configuration, fixed seed. The confidence intervals cover trial-to-trial variation, not reruns.

7

Test conditions are narrow. Body changes were mass ×1.3–1.7 and length ×1.2–1.5. Pushes were square pulses of 0.2 s or 0.5 s; no slow, fading pushes were tested.

8

Some mechanism statements are interpretations. These include: hidden actuator state explains the held-out gain; the rigid/medium gain comes from averaging noise; the history model partly adapts to the body change from its input. Each is labelled as an interpretation where it appears.

10Reproducibility

Shared by all experiments:

experimentcode (in surprise_attribution/)results
1 Factorial, rigidrun_factorial.py, factorial_config.pyresults_factorial/ (summary.txt, trials.csv)
2 Compliant gridrun_compliant.py, compliant_config.py, compliant_env.py, compliant_trials.pyresults_compliant/ (summary.txt/json, trials_<config>.csv, sweep.png); models in compliant_models/
3 Calibrationrun_calibrated.py, calibrated_config.pyresults_calibrated/ (summary.txt/json, trials_<config>.csv, sweep_calibrated.png)
4a Historyrun_history.py, history_config.py, history_model.pyresults_history/ (summary.txt/json, trials_<config>.csv, sweep_history.png); models in history_models/
4b Shaperun_shape.py, shape_config.pyresults_shape/ (summary.txt/json, trials_<config>.csv, sweep_shape.png)
Table 8.

The rule under test: alarm_classifier.py and classifier.py, unchanged throughout. The frozen alarm threshold is in results_alarm/chosen_alarm.json.

Not committed (regenerable):

Self Model Research
  1. Rung 1The Planner Hides the Model
  2. Rung 2A Wrong Model Is Worse Than None
  3. Rung 3Surprise Has a Signature
  4. Rung 4The Margin Was Rigid
  5. Rung 5An Arc of Elimination (this report)
  6. Rung 6The Quiet Body
  7. Rung 7Why Prediction Error Falls When the Body Changes