File size: 3,171 Bytes
1439be2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
license: apache-2.0
library_name: ferric
pipeline_tag: robotics
tags:
- energy-based-model
- control
- physical-ai
- deterministic
- pendulum-v1
- external-benchmark
---

# EFA-2 Β· Pendulum-v1 (v0 of the external-body program)

**The EFA recipe on the first body the world defines, measured on the metric the world publishes.**
Gym **Pendulum-v1**, exact published spec β€” dynamics, Β±2 torque limit (swing-up regime), reward function, start
distribution, 200-step episodes. Nothing about the task is ours; every number below is externally reproducible
against the same spec.

Charlot Lab Β· Institute for Physical AI @ Bailey Military Institute.
Runtime: [Ferric](https://ferric.physicalai-bmi.org) (pure-Rust, cross-fabric). Sibling flagship:
[physicalai-bmi/efa-1](https://huggingface.co/physicalai-bmi/efa-1) (multi-body, certified, agency-gated).

## The external card

| policy | mean return (100 spec episodes) | upright at end | cost per decision |
|---|---|---|---|
| random | β‰ˆ βˆ’1200 | β€” | β€” |
| **published anchor: SB3 SAC** | **β‰ˆ βˆ’150** | β€” | 1 fwd pass (256-wide Γ—2) |
| **efa-2-pendulum, flow K=1** | **βˆ’142.6** | **100%** | **1 forward pass** (~21k FLOPs) |
| flow K=2 | βˆ’127.9 | 100% | 2 passes |
| flow K=4 | βˆ’125.8 | 100% | 4 passes |
| DP teacher (near-optimal) | βˆ’124.5 | 100% | 106 evals/decision |

The **thinking dial is real on the external metric**: K=1 β†’ K=4 climbs βˆ’142.6 β†’ βˆ’125.8, converging toward the
near-optimal teacher. The same potential **verifies** at 98.1% (ranks the demonstrator's action below random), and
decisions are **bit-exact deterministic**. Swing-up β€” a discontinuous, energy-pumping optimal policy β€” is solved at
K=1 closed-loop (100% upright from every spec start).

## Honesty (read before citing)

- **This distills a model-based DP demonstrator** (known dynamics, grid value iteration). The claim is *SOTA-level
  control on the published metric at one forward pass, with verification and determinism* β€” **not** "beats SAC at
  model-free RL." SAC learns from reward alone; this artifact does not.
- One seed, 2-D body. The external-body program continues toward MuJoCo / SO-101-LeRobot.
- The energy gate (Ο„ in `config.json`) escalated on ~0.1% of decisions β€” K=1 already succeeds closed-loop here, so
  the gate prices compute; it has nothing to rescue. Stated plainly, as on every EFA card.
- Gated release: thresholds fixed before the run (return@K1 β‰₯ βˆ’160 ∧ upright 100% ∧ verify β‰₯ 90% ∧ bit-exact ∧
  reload-exact); train β†’ gate β†’ save β†’ reload from disk β†’ re-verify. Provenance: `experiments/ebm_efa2pend.rs` in the
  [EFA repo](https://github.com/dcharlot-physicalai-bmi/efa) (69+-experiment ledger, negatives included).

## Architecture

The coordinated pair on the env's **own observation vector** `[cosΞΈ, sinΞΈ, ΞΈΜ‡]`:
- **Flow head** (5β†’96β†’96β†’1): conditional-flow-matched velocity field; `u = clamp(flow(obs, a=0, t=0), Β±2)` at K=1;
  K-step integration for the accuracy-vs-compute dial.
- **Potential head** (4β†’96β†’96β†’1): contrastive energy β€” low = valid action; the model checking its own actions.

License: Apache-2.0.