Verace Descent: prototype code
A PyTorch reference agent and equal-compute scaling experiments testing prediction in representation space and energy descent as a single mechanism.
- Amortised initial guess: Encoder output as a first guess, then gradient steps
- Shared prediction energy: One energy for perceiving, planning and learning
- Lowest-energy candidates: CEM refits its sampling to these and repeats
- Restarts: Reasoning by descent with annealing and restarts
Overview
The prototype code is the runnable PyTorch implementation of Verace Descent, the lab's energy-based agent design, published under the research name Energy Descent Is All You Need. It has two parts. The minimal reference agent turns the code snippets of the design specification into an importable package. The scaling experiments test the design's central architectural bet at small real scale. Together they ask two things: whether perception, planning, reasoning and learning can all be written as descents on one shared prediction energy, and whether predicting in representation space beats predicting in input space at equal compute.
The reference agent is built from five exported parts. RateModule applies a free-bits Gaussian rate constraint against collapse. Encoder and WorldModel form a free-energy predictor trained without stop-gradient. cem_plan plans by descending an energy over actions. Learner learns online on two timescales with an anti-collapse regulariser. core_loop.py runs perceive, plan, act and learn online on a point-mass environment. Numbered experiments E1 to E11, kill gates and drift diagnostics surround this core. The scaling part trains one ViT encoder and predictor two ways, predicting masked embeddings (JEPA, a joint-embedding predictive architecture) or masked pixels, and scores each frozen encoder with a linear probe.
The reference agent records 10 components passing, a 10/10 smoke test, and 8 of the experiments E1 to E11 passing at toy scale. With the free-bits floor, all 16 latent dimensions stay active at , against 0 of 16 under plain KL. Common-fate binding scores 0.994 against 0.639. Ensemble disagreement is 1390 times larger on unseen states. On CIFAR-10 at about 8M parameters, JEPA with an EMA target reaches 0.531 probe accuracy against 0.423 for MAE. Without the EMA target, JEPA loses to MAE. The online core loop climbs to 0.26 success and then falls to 0.06.
The reference agent, its experiments and the scaling harnesses are implemented and were run, and the evaluation records report results at toy scale and at 2M to 32M parameters. Two results are negative and recorded as such. The E1 toy did not show that representation-space prediction is better, and the online core loop drifts after bootstrapping. The lab records that drift as diagnosed, and the code contains anti-drift experiments whose outcomes these records do not give. A JEPA advantage holds at or below 16M parameters on CIFAR-10. At about 29M parameters the two methods tie, which the lab attributes to the dataset running out of signal. The claim that JEPA needs no stabilising tricks is refuted, because an EMA or detached target is required.
Status
Experiments. Both parts are implemented and were run: the evaluation records give measured toy-scale passes, two negative results, a diagnosed drift in the online loop and CIFAR-10 scaling comparisons from 2M to 32M parameters.
Simulator
A point rolls downhill on a made-up energy surface with one deep valley and two shallower ones. Set the step size and the momentum, and drag the start.
- rings: lines of equal energy · dots: the floors of the three valleys
- Comes to rest in
- The deepest valley
- Energy at the start
- -0.01
- Energy at the end
- -0.98
- Overshot on the way
- No
Drag the ring, or tap the surface, to move the start. Raise the step size until the point overshoots, or the momentum until it rolls through a shallow valley.
This simulator is an illustration of the principle, with made-up numbers. It does not run the lab's code or show the lab's data, and nothing in it is a measurement.
Architecture
Free-bits rate module
RateModuleinrate_module.pyimplements C-RATE, a Gaussian latent rate term with a per-dimension floor that prevents representation collapse. The specification calls it the most reused guarantee.Encoder and world model
EncoderandWorldModelinworld_model.pyform the perception encoder and the next-representation predictor. They are trained on a free-energy objective without stop-gradient.CEM planner
cem_planinplanner.pyplans by sampling action sequences and minimising a rollout energy under the world model.Two-timescale learner
Learnerinlearner.pyminimises world-model free energy plus an anti-collapse regulariser, eithersigregorvariance_floor, with fast and slow update rates.Perpetual core loop
core_loop.pyruns perceive, plan with CEM, act and learn online on a point-mass environment. It reports goal success and collapse indicators such as effective rank.Intrinsic cost ensemble
Ensembleincost.pyis a set of next-representation predictors. Their disagreement supplies epistemic uncertainty, and the module also computes goal cost and a cross-source gap.Hierarchical planner
hier_planner.pyholds a coarse k-stepJumpModelthat proposes a subgoal by CEM. The fine world model then plans toward that subgoal.Configurator
configurator.pydecides per step whether to run expensive Mode-2 planning or a cheap Mode-1 reflex plan.Drift diagnostic harness
diag_drift.pyis the core loop extended with optional anti-drift and anchor interventions. It adds probes for plasticity, metric fidelity, visitation shift and gradient alignment.Equal-compute scaling harness
train.pyandcifar_exp.pytrain identical ViT encoders and predictors that differ only in the output head. They compare embedding prediction with pixel prediction by frozen linear probe.
Implementation
Mechanisms as they are implemented in the source code, with the constants the code uses.
- Free-bits per-dimension KL floor
- Each latent dimension's KL term is clamped at a floor , giving a rate of . Below the floor the gradient is zero, so no value of can push a dimension into collapse.
exp_e2.pychecks this throughactive_dimsand effective rank as rises. - SIGReg anti-collapse regulariser
sigreg()inworld_model.pyimplements SIGReg, the regulariser of LeJEPA, published work by others that the lab adopted. It matches the marginal distribution of representations to an isotropic Gaussian, working on sketched random projections of the representations. It replaces stop-gradient or EMA targets as the collapse guard, andvariance_floor()is the simpler alternative.- Ensemble disagreement as uncertainty
- The variance of predictions across independently initialised heads of
Ensembleserves as epistemic uncertainty. That variance drives curiosity, and as it acts as a planning penalty.cross_source_gap()adds disagreement against an independently trained model. - CEM energy descent over actions
cem_plan()samples candidate action sequences, rolls them out through the world model and scores each by a rollout energy. It then refits the sampling distribution to the lowest-energy candidates and repeats.exp_full_agent.pyuses it with the uncertainty penalty added.- Value-of-computation gating
- The configurator runs Mode-2 deliberative planning only when a value-of-computation proxy exceeds a cost . Otherwise it uses a cheap reflex plan. Its sanity check compares the gate with always-Mode-1 and always-Mode-2 policies.
- Two-level subgoal planning
hier_plan()runs CEM over a coarse k-step jump model to choose a waypoint, then plans the fine level toward it.exp_hjepa.pycompares this with flat CEM on far goals at matched inference compute.- Binding by common fate
binding.pyassigns features to slots by expectation maximisation. Each slot has one shared velocity, and features whose motion that velocity predicts join the slot. This minimises a binding energy and separates overlapping camouflaged objects that position clustering cannot.- Reasoning by energy descent
exp_reason.pysolves planted-colourable graph 3-colouring. It runs gradient descent on soft colour assignments with annealing and restarts, and compares this with a single-step baseline.exp_reason_mugood.pyfits the decay of the single-restart solve probability and tests .- Amortised warm-start inference
exp_amortize.pytrains a policy on solved instances so that it starts descent inside the global basin of a rugged energy. This cuts the restarts needed on familiar problem types, but not out of distribution.- Iterative perceptual refinement
exp_perception.pytreats the encoder output as an amortised first guess at the latent state. It then takes a few gradient steps on an energy combining prediction compatibility and observation compatibility, and tests whether this beats the single pass on noisy percepts.- Shift-gated learning rate
exp_shift_gate.pyscales the learning rate by the measured visitation shift , as . This counters non-stationary data caused by the agent's own changing policy. A constant gate with the same mean rate is the control.- Planning-metric drift probe
diag_drift.pytests one explanation for the falling success: representation distance, which the planner uses, stops tracking true goal distance as the encoder specialises.exp_localfid.pyadds a goal-neighbourhood fidelity term,goal_fid, against a decode-anchor baseline.- Update-field curl probe
exp_curl.pyestimates how antisymmetric the Jacobian of the parameter update field is, using central differences. It does this for no-detach, detached and slow-refresh target rules, then trains each rule.exp_curl_live.pycorrelates landscape motion with later changes in success.- Temporal abstraction in rollouts
exp_e4.pymeasures how the open-loop rollout error of a one-step model grows with horizon.exp_e4b.pycomposes k-step jump predictors to a fixed horizon and measures error on the slow component, testing whether coarse jumps average out unpredictable fast detail.- One-slot episodic tape
exp_tape_loop.pygives the agent one memory slot. Control is hand-wired: the goal is written while visible and read once it is gone, on a delayed-goal task.exp_e11.pycompares a position-pointer tape with an LSTM on a copy task across sequence lengths.- Side-channel leakage bound
exp_channel_bound.pycaps per-step leakage at for channel overlap and computes steps to breach as threshold divided by the cap.exp_align.pyandexp_align_overlay.pymeasure leakage at 90% task gain and check it against the shape and a knee near 0.25.- Masked embedding versus pixel prediction
cifar_exp.pyandtrain.pypatchify images and mask patches. The model predicts either masked patch embeddings with a dim-to-dim head or masked pixels with a dim-to-pixels head. Encoder targets come from EMA, hard-copy, SIGReg or VICReg variants, and each frozen encoder is scored by a linear probe.
Results
From the lab's own experiments and records. They have not been independently replicated.
Free-bits floor prevents collapse
In the E2 kill gate, the free-bits floor kept 16 of 16 latent dimensions active at , against 0 of 16 under plain KL. The result held over 5 seeds with zero variance.
Toy-scale tally of components and experiments
The reference agent's records report 10 components passing, a 10/10 smoke test, and 8 of the experiments E1 to E11 passing. Common-fate binding scored 0.994 against 0.639 for position clustering, and the configurator reached near-optimal reward at about 30% of the compute.
Disagreement separates seen from unseen states
Ensemble disagreement was 0.0007 on trained states and 0.9519 on unseen states, a 1390-fold gap. On a biased region, cross-source disagreement with an independent model reached 15.99 where self-disagreement was 0.0003.
E1 toy gave a negative result
The E1 toy did not show representation-space prediction beating input-space reconstruction. The lab records this as a negative result and treats the scaling experiments as the real test.
SIGReg lifted the E1 probe score
Replacing
variance_floorwith SIGReg raised the representation-space probe from 0.343 to 0.864 in the lab's records.Core loop bootstraps then drifts
The online loop rose to 0.26 goal success and then fell to 0.06, against the 0.7 the reference documentation expected. The lab records the drift as diagnosed, as distributional narrowing, and the code contains anti-drift experiments whose outcomes these records do not give.
EMA or detached target is necessary
On CIFAR-10 at about 8M parameters, the probe accuracies were 0.531 for EMA-JEPA, 0.423 for MAE, 0.340 for VICReg without EMA and 0.275 for SIGReg without EMA. This refutes the claim that JEPA needs no stabilising tricks, while still supporting representation-space prediction.
Detachment, not timescale, matters
In run 5, a hard copy refreshed every step scored 0.469 and an EMA target 0.472. A hard copy refreshed every 250 steps scored 0.488. The lab concludes that the timescale hypothesis is refuted and that detaching the target is what matters.
JEPA advantage bounded by scale on CIFAR-10
The JEPA lead grew from +6.3 at 2M to +10.8 at 8M and +13.0 at 16M, and was +9.3 for an undertrained, wide and shallow 32M model. Deep runs converged at about 29M parameters tied at 0.619 against 0.621, which the lab attributes to CIFAR-10 running out of signal.
Synthetic occupancy test was a tie
On shapes in noise, JEPA scored 0.733 F1 and the generative model 0.735. The lab records the test as non-discriminative and not evidence either way.
Concepts
- Energy descent as one mechanism
- The thesis of the research line: perception, planning, reasoning, binding and learning are each computed by descending one shared prediction energy, not by separate machinery.
- Representation-space prediction
- Predicting the embedding of missing or future input rather than its pixels. The aim is that the model can discard unpredictable detail such as noise instead of spending capacity reconstructing it.
- JEPA
- Joint-embedding predictive architecture: an encoder and predictor trained to predict the embeddings of masked parts of an input from the visible parts.
- MAE-style generative baseline
- The comparison model: an identical encoder and predictor trained to reconstruct masked pixels, which is prediction in input space.
- Representation collapse
- The failure in which an encoder maps all inputs to nearly the same representation, so effective rank or the count of active dimensions falls toward 1 or 0.
- C-RATE free-bits constraint
- The rate-constraint family of the design. A KL floor per latent dimension leaves no gradient pushing a dimension below the floor. The specification reuses it for latents, hierarchy and binding.
- SIGReg
- Sketched isotropic Gaussian regularisation, the regulariser of LeJEPA, published work by others that the lab adopted. It pushes random projections of the representation distribution toward a standard Gaussian, which prevents collapse without stop-gradient.
- EMA and detached targets
- A target encoder updated as an exponential moving average of the online encoder, or hard-copied and held fixed. Either way its outputs give no gradient to the encoder being trained.
- Kill gate
- A go/no-go experiment run before anything else. If the free-bits floor fails to hold effective rank in E2, the specification says to stop and fix the formulation.
- CORE-DRIFT
- The lab's name for the online core loop's pattern of rising goal success followed by decline. It is diagnosed as distributional narrowing caused by the agent's own policy.
- Anti-drift conjunction
- The set of interventions the lab tests together against drift: epistemic curiosity, an uncertainty penalty in planning, large replay and grounding or anchoring terms.
- Noisy-TV problem
- An agent driven by raw prediction error stays near unpredictable noise because the error never falls there. Ensemble disagreement does fall on such regions, so a disagreement-driven agent avoids them.
- Confidently wrong region
- Inputs where all heads of an ensemble learned the same biased answer, so their disagreement is low although they are wrong. Within-ensemble uncertainty cannot detect it.
- Mode-1 and Mode-2 control
- Mode-1 is a cheap reflex plan and Mode-2 is expensive deliberative planning. The configurator chooses between them by value of computation against a cost .
- Tail over peak
- The sustain metric of the drift experiments: success late in a run divided by the best success reached.
exp_sustain.pytests whether grounding lifts it toward 0.95. - Verdict rule fixed before the run
- The lab fixed the outcome criteria of the scaling tests itself before running them, with no outside registry. For the synthetic test the thesis counts as supported if JEPA F1 exceeds generative F1 by 0.02, and refuted if the generative model leads by 0.02.
- Occupancy probe
- The metric of the synthetic scaling test: a frozen encoder with a linear per-patch readout of where low-contrast squares sit in high-amplitude noise on 32×32 images, scored by F1.
About this page
Written from the lab's own documents and source code. Figures and results are the lab's measurements as it recorded them at the time, and have not been independently replicated.
Published under the PolyForm Noncommercial License 1.0.0: free for noncommercial use.