Rafhael Oliveira · IA

Learned costs and inference modes: the three searches and the two sources of energy, measured

Energy, gradient and MPC, with an independent judge. First reading: none governs. Second: one governs and gets more plausible too.

1 min read· chapter: 18 min· Experiment in progress · chapter updated on 12 Sept 2026

Landed here from LinkedIn? This is chapter 12 of the experiment Antivision · Latent Rehearsal. It reads on its own; if you want the beginning, it is chapter 00.

On the first reading, no inference mode governed. Free generation had more heading than any planner. Energy is the sum of two things: what the system wants and what it cannot do. Inference is the search that minimises it. Three searches: energy, gradient, predictive control. With weight 1, all came in below free generation. The map predicted the next state with cosine 0.93, but the energies of the eight candidates were almost equal. The cause was none of the ones we suspected. With weight 0.1, a learned head and cost on the real state, the rudder governed: more heading and more plausible at the same time. The only mode that improves both axes. All three pieces were needed together.

The three points

  1. The energy: task (distance to the heading) plus guardrail (minus log p). The task can be a heading in text or a head learned from three positive sentences.
  2. The independent judge: a head trained elsewhere says whether the generated text has the requested heading. Without it, the planner judges itself.
  3. The best configuration: learned head, cost on the real state, weight 0.1. Affinity 0.355 against 0.256 for free, with perplexity 36.7 against 48.5.

From the chapter, the beginning

The energy is the sum of two things — what the system wants and what it must not do — and inference is the search that minimizes it. This chapter measures the three searches and the two sources of energy on a trained world model.

E(z) = task(z) + γc Σ guardraili(z) + γ · (−log p) accumulated along the trajectory

Keep reading chapter 12 →Ler em portuguêsThe PDFs by e-mail →
What the chapter covers · 3 sections · 18 min
  1. The energy
  2. The search modes
  3. The independent judge
All chapters of the experiment · Antivision · Latent Rehearsal
  1. 00 · Antivision: an ELLM, a language model that rehearses in latent space before speaking
  2. 01 · The custom tokenizer: why 16 thousand tokens suit this corpus better than 50 thousand, and what the whole table shows
  3. 02 · Two architectures, one file: the fair duel between 2019 and what came after
  4. 03 · The geometry of the embedding: training starts with a perfect space and ruins it
  5. 04 · The lineage of collapse: five answers from computer vision, each measured on text
  6. 05 · The rudder and the world model: three versions of the same question, each measured against the last
  7. 06 · Method and mistakes: the rules of a legitimate comparison and the catalogue of our own errors
  8. 07 · Scale and budget: what it costs to reach GPT-3, and why VRAM is almost never the limit
  9. 08 · The workbench: serve, x-ray and train from the browser
  10. 09 · The hierarchical architecture: the whole project aligned to the four patterns of the world model
  11. 10 · What JEPA is, according to LeCun: two talks read concept by concept, and where each one applies
  12. 11 · Memory and horizon: two claims from LeCun that became experiments, and both hold for text
  13. 12 · Learned costs and inference modes: the three searches and the two sources of energy, measured
  14. 13 · The corrections from LeCun's talks: failure, passage, flag, measurement
  15. 14 · Consulted memory: a bank of abstract states read by attention
  16. 15 · What it costs and what it delivers: us, GPT-1 and GPT-2 on the only ruler valid across tokenizers
  17. 16 · The minimum was off the list: the day I measured my own search by energy
  18. 17 · ELLM: the right name for a language model that predicts in latent space and decides by energy
  19. 18 · Searching better does not fix the energy: three searches, the same text
  20. 19 · The inversion that did not repeat: the world model's cost appears once the ruler stops swinging
  21. 20 · What changed on 17/09: two new chapters and two corrections

Before this: the GPT-2 course

Rafhael Oliveira
Rafhael Oliveira

Writes the GPT-2 course and runs the Antivision experiment, measuring every run before publishing the number. The LinkedIn posts start here and end in the chapters.

Follow on LinkedIn →