Introduction
Sparse autoencoders (SAEs) infer sparse representations of data in terms of a learned, overcomplete dictionary of features. Their roots lie in sparse coding [60 , 49 ] , motivated by the organization of sensory representations in biological systems [61 , 62 ] . SAEs have since become central in interpreting neural network representations (reviewed in Klindt et al. [47 ] ), especially those of language models [77 , 15 , 25 , 72 , 31 ] .
Despite these successes, SAEs face challenges in both inference and dictionary learning. Standard SAEs use a trained neural network to perform one-pass inference—known as amortized inference —which can struggle to disentangle overlapping features in superposition [63 ] . But improving inference alone is insufficient. In controlled experiments, Barin-Pacela et al. [10 ] identified dictionary learning as the bottleneck: replacing an SAE’s encoder with iterative inference on the same learned dictionary failed to close the feature-recovery gap. These problems are coupled during training: the dictionary determines which explanations of the data are available, while inferred feature activations shape the learning signal used to update the dictionary. Therefore, inference errors can compromise dictionary learning, and a poor dictionary can limit what inference can recover.
Unlike standard SAEs, classical sparse coding methods typically perform inference through iterative, per-sample optimization [68 , 33 ] . More recently in this lineage, Vafaii et al. [74 ] introduced the Free-energy Online Natural-gradient Dynamics (FOND) framework, which formulates inference as natural-gradient flow on variational free energy. FOND’s guiding principle is to respect the intrinsic geometry of the statistical manifold: updates are measured by their effect on the represented probability distribution through the Fisher information metric [4 , 55 , 44 ] . However, FOND did not address learning through the same geometric principle. Its generative model parameters were learned by backpropagating through the inference trajectory, with the associated computational and memory costs.
Figure 1. Feature quality and sample efficiency on Gemma-2-2B activations. a,c: Training dynamics at 524k width. b,d: Final performance across dictionary widths. Details in § 5 .
Here, we extend this principle to learning. Just as inference follows natural-gradient flow on free energy with respect to variational parameters, we define learning as natural-gradient flow on the same objective with respect to generative parameters. Both processes thus respect the statistical geometry of the distributions they update. We instantiate this extended FOND framework as BeFOND: an encoder-free iterative SAE with Bernoulli latents, a factorized prior, and a linear Gaussian decoder. We derive closed-form expressions for its inference and learning dynamics, allowing the dictionary to be learned without backpropagating through the inference trajectory.
On the inference side, BeFOND implements explaining away through recurrent interactions between overlapping features, enabling lateral competition leading to sparse, disentangled representations. We isolate the contribution of these interactions and show that they become increasingly important as feature superposition increases. On the learning side, we show how infrequent activation slows Euclidean dictionary learning. We prove that Fisher preconditioning removes this frequency dependence, giving rare and common features the same local learning rate. Motivated by this result, we hypothesize that Fisher preconditioning would improve rare-feature recovery in BeFOND. Empirically, BeFOND learns more accurate dictionaries and detects rare features with few misses or false positives, while using substantially fewer training samples than SAE baselines and Euclidean ablations.
We evaluate BeFOND on synthetic data with known ground-truth features using SynthSAEBench ([20 ] ), and on language-model representations using SAEBench ([43 ] ). Baselines include amortized SAEs—BatchTopK ([16 ] ), Matryoshka BatchTopK ([17 ] ), and JumpReLU ([66 ] )—and an iterative mean-field variational baseline with Adam-based decoder learning ([45 ] ).
On Gemma-2-2B layer-12 activations, BeFOND outperforms all evaluated baselines on both sparse probing [42 ] and RAVEL disentanglement [38 ] . BeFOND’s performance continues to improve as we increase dictionary width from 16k to 524k latents, whereas the baselines plateau (Fig. 1b,d). These gains also emerge with substantially less training data: at a dictionary width of 524k, BeFOND matches the evaluated Gemma Scope JumpReLU checkpoints [50 ] in sparse probing after just ∼ 6 \sim6 ∼ 6 M training tokens, compared with the 8B tokens used to train those checkpoints, achieving over 1,000× \times × reduction in training tokens (Fig. 1a).
Summary of our contributions and paper outline:
We review necessary background (§ 2 ). We then extend FOND [74 ] to unify inference and learning as natural-gradient flows on variational free energy, instantiate it as Bernoulli-distributed BeFOND, and derive its dynamics in closed-form (§ 3 and section B).
We analyze BeFOND’s recurrent “explaining away” (§ 4.1 ) and use ablations to establish its contribution to feature recovery under increasing superposition (section C.3.1).
We characterize how Fisher preconditioning in BeFOND’s learning rule compensates for feature rarity (§ 4.2 ), and test its consequences for dictionary learning through theoretical analysis (theorem 4.2), synthetic experiments, and optimizer ablations (sections C.3.2, C.4 and C.5).
We evaluate BeFOND on language-model representations, examining feature quality, sample efficiency, and scaling with dictionary width (§ 5 ).
Background and Related Work
Notation. Bold lowercase and uppercase symbols denote vectors and matrices, such as a \mathbf{a} a and A \mathbf{A} A . Inference and learning quantities appear in red and blue, respectively.
Sparse coding. Classical sparse coding [60 , 61 , 49 , 1 , 68 , 33 , 52 ] models each observation x ∈ R M \mathbf{x} \in\mathbb{R}^{M} x ∈ R M as a linear combination of dictionary atoms with sparse coefficients z \mathbf{z} z :
x = Φ z + ϵ , ϵ ∼ N ( 0 , I M ) (1) \mathbf{x} = \mathbf{\Phi}\mathbf{z} + \boldsymbol{\epsilon}, \qquad\boldsymbol{\epsilon} \sim\mathcal{N}(\mathbf{0}, \mathbf{I}_{M}) \tag*{(1)} x = Φz + ϵ , ϵ ∼ N ( 0 , I M ) (1)
The dictionary Φ ∈ R M × K \mathbf{\Phi} \in\mathbb{R}^{M \times K} Φ ∈ R M × K has atoms Φ ⋅ i ≡ ϕ ( i ) \mathbf{\Phi}_{\cdot i} \equiv\boldsymbol{\phi}^{(i)} Φ ⋅ i ≡ ϕ ( i ) as its columns.
We consider overcomplete dictionaries, whose atoms outnumber the input dimensions (K > M K > M K > M ), and therefore cannot all be mutually orthogonal, making some overlap between atoms unavoidable.
Learning estimates the dictionary from data, while inference finds sparse codes that explain each input. These processes are coupled because inference uses the current dictionary, and dictionary updates depend on the inferred codes. In the overcomplete setting, superposition —overlap between atoms—makes sparse code inference particularly challenging (see section A.1).
Amortized versus iterative inference. Standard SAEs learn an encoder z = f ϕ ( x ) \mathbf{z} = f_{\boldsymbol{\phi}}(\mathbf{x}) z = f ϕ ( x ) that predicts a sparse code in one forward pass. These include ReLU [15 , 25 , 72 ] , JumpReLU [66 ] , gated [65 ] , TopK [53 , 31 ] , BatchTopK [16 ] , and Matryoshka BatchTopK [17 ] SAEs. Training this mapping across samples amortizes inference, replacing a separate test-time optimization for each input.
Iterative sparse coding instead refines the code for each observation [68 , 11 , 30 ] . In continuous time, this takes the schematic form, z ˙ = g ( z , Φ , x ) \dot{\mathbf{z}} = g(\mathbf{z}, \mathbf{\Phi}, \mathbf{x}) z ˙ = g ( z , Φ , x ) . Iterative inference has yielded mixed results on language-model representations [19 , 71 ] . See section A.2 for further discussion.
Variational inference and free energy. A generative model combines a prior with a likelihood:
p θ ( x , z ) = p θ ( x ∣ z ) ⏟ conditional likelihood p θ ( z ) ⏟ prior , e.g., p θ ( x ∣ z ) = N ( x ; Φ z , I M ) (2) p_{\boldsymbol{\theta}}(\mathbf{x}, \mathbf{z}) = \underbrace{p_{\boldsymbol{\theta}}(\mathbf{x} \mid\mathbf{z})}_{\text{conditional likelihood}} \underbrace{p_{\boldsymbol{\theta}}(\mathbf{z})}_{\text{prior}}, \qquad\text{e.g.,}\quad p_{\boldsymbol{\theta}}(\mathbf{x} \mid\mathbf{z}) = \mathcal{N}(\mathbf{x}; \mathbf{\Phi}\mathbf{z}, \mathbf{I}_{M}) \tag*{(2)} p θ ( x , z ) = conditional likelihood p θ ( x ∣ z ) prior p θ ( z ) , e.g., p θ ( x ∣ z ) = N ( x ; Φz , I M ) (2)
Bayes’ rule gives p θ ( z ∣ x ) = p θ ( x , z ) / p θ ( x ) p_{\boldsymbol{\theta}}(\mathbf{z} \mid\mathbf{x}) = p_{\boldsymbol{\theta}}(\mathbf{x}, \mathbf{z}) / p_{\boldsymbol{\theta}}(\mathbf{x}) p θ ( z ∣ x ) = p θ ( x , z ) / p θ ( x ) . Computing the evidence p θ ( x ) p_{\boldsymbol{\theta}}(\mathbf{x}) p θ ( x ) requires summing or integrating over latent configurations, which is generally intractable for large overcomplete models.
Variational inference (section A.3; [41 , 13 ] ) turns this problem into optimization: choose an approximate posterior q u ( z ∣ x ) q_{\mathbf{u}}(z \mid x) q u ( z ∣ x ) and optimize its parameters u \mathbf{u} u . For example, u \mathbf{u} u can be Gaussian means and variances, or Bernoulli logits. Define the variational free energy :
F ( x ; u , θ ) : = E q u [ − log p θ ( x , z ) q u ( z ∣ x ) ] = − E q u [ log p θ ( x ∣ z ) ] + D K L ( q u ( z ∣ x ) ∥ p θ ( z ) ) . (3) \mathcal{F}(x; \mathbf{u}, \theta) := \mathbb{E}_{q_{\mathbf{u}}}\left[-\log\frac{p_{\theta}(x,z)}{q_{\mathbf{u}}(z \mid x)}\right] = -\mathbb{E}_{q_{\mathbf{u}}}\left[\log p_{\theta}(x \mid z)\right] + D_{\mathrm{KL}}\left(q_{\mathbf{u}}(z \mid x) \mathrel{\|} p_{\theta}(z)\right) . \tag*{(3)} F ( x ; u , θ ) := E q u [ − log q u ( z ∣ x ) p θ ( x , z ) ] = − E q u [ log p θ ( x ∣ z ) ] + D KL ( q u ( z ∣ x ) ∥ p θ ( z ) ) . (3)
Free energy is the same quantity as the negative evidence lower bound, F = − E L B O \mathcal{F}=-\mathrm{ELBO} F = − ELBO . Its terms balance explaining the observation against departing from the prior. The connection between free-energy minimization and posterior inference follows from the following identity:
F ( x ; u , θ ) = D K L ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) − log p θ ( x ) . (4) \mathcal{F}(x; \mathbf{u}, \theta) = D_{\mathrm{KL}}\left(q_{\mathbf{u}}(z \mid x) \mathrel{\|} p_{\theta}(z \mid x)\right) - \log p_{\theta}(x) . \tag*{(4)} F ( x ; u , θ ) = D KL ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) − log p θ ( x ) . (4)
This shows that, with x x x and θ \theta θ fixed, reducing F \mathcal{F} F reduces the KL divergence to the true posterior because the evidence is independent of u \mathbf{u} u (section A.3). An amortized encoder can predict u = f ϕ ( x ) \mathbf{u}=f_{\phi}(x) u = f ϕ ( x ) , as in VAEs ([46 ] ), or inference can optimize it separately for each input:
u ∗ ( x ) = argmin u F ( x ; u , θ ) . (5) \mathbf{u}^{*}(x) = \underset{\mathbf{u}}{\operatorname{argmin}}\ \mathcal{F}(x; \mathbf{u}, \theta) . \tag*{(5)} u ∗ ( x ) = u argmin F ( x ; u , θ ) . (5)
Holding x x x and θ \theta θ fixed, write the objective as F ( u ) \mathcal{F}(\mathbf{u}) F ( u ) . Starting from some initialization u 0 \mathbf{u}_0 u 0 , gradient descent with step size η > 0 \eta>0 η > 0 gives:
u t + 1 = u t − η ∇ u F ( u t ) . (6) \mathbf{u}_{t+1} = \mathbf{u}_t - \eta\nabla_{\mathbf{u}}\mathcal{F}(\mathbf{u}_t) . \tag*{(6)} u t + 1 = u t − η ∇ u F ( u t ) . (6)
This update measures movement using Euclidean distance in parameter space (section A.4). However, equal-sized parameter changes can produce different changes in beliefs q u q_{\mathbf{u}} q u , and reparameterizing the same distributions can change the descent trajectory. Measuring movement between distributions instead leads to the geometry of their statistical manifold ([6 ] ).
From gradient descent to natural gradients. Swapping the Euclidean geometry of gradient descent with the Fisher metric gives the natural-gradient update:
u t + 1 = u t − η G u − 1 ( u t ) ∇ u F ( u t ) . (7) \mathbf{u}_{t+1} = \mathbf{u}_t - \eta G_{\mathbf{u}}^{-1}(\mathbf{u}_t)\nabla_{\mathbf{u}}\mathcal{F}(\mathbf{u}_t) . \tag*{(7)} u t + 1 = u t − η G u − 1 ( u t ) ∇ u F ( u t ) . (7)
where G u G_{\mathbf{u}} G u is the Fisher information matrix of the variational family:
G u ( u ) = E z ∼ q u ( ⋅ ∣ x ) [ ( ∇ u log q u ( z ∣ x ) ) ( ∇ u log q u ( z ∣ x ) ) T ] . (8) G_{\mathbf{u}}(\mathbf{u}) = \mathbb{E}_{z \sim q_{\mathbf{u}}(\cdot\mid x)}\left[\left(\nabla_{\mathbf{u}}\log q_{\mathbf{u}}(z \mid x)\right)\left(\nabla_{\mathbf{u}}\log q_{\mathbf{u}}(z \mid x)\right)^{\mathsf{T}}\right] . \tag*{(8)} G u ( u ) = E z ∼ q u ( ⋅ ∣ x ) [ ( ∇ u log q u ( z ∣ x ) ) ( ∇ u log q u ( z ∣ x ) ) T ] . (8)
The Fisher matrix measures local statistical distinguishability, so the update accounts for how parameter changes affect the represented distribution ([4 , 6 , 5 ] ). Natural gradients have a long history in variational inference, underpinning stochastic variational inference ([37 ] ), the Bayesian learning rule ([44 ] ), and Bayesian Online Natural Gradient ([40 ] ). Closed-form natural gradients need not be available, and computing the Fisher and applying its inverse can be expensive, motivating approximations ([56 , 55 ] ). Natural Reweighted Wake–Sleep uses natural gradients for generative and recognition networks ([75 ] ), and recent work preconditions TopK SAE decoder updates using a damped empirical code Gram matrix ([64 ] ). Both approaches retain learned encoders, whereas BeFOND directly optimizes variational posterior parameters for each input through recurrent inference.
Building on this geometric perspective, Vafaii et al. [74 ] introduced FOND by prescribing natural-gradient flow on F \mathcal{F} F with respect to u \mathbf{u} u . A forward Euler discretization yields eq. (7) .
In the appendix, we motivate natural gradients using the standard trust region argument (section A.4; [55 , 22 , 59 ] ), as well as a broader “physics of adaptation” perspective (section A.5), inspired by the principle of general covariance ([28 ] ).
FOND unifies inference and learning as natural gradient flow
FOND (Vafaii et al. [74 ] ) formulated inference as natural gradient descent on variational free energy (eq. (7) ). But it stopped short of prescribing learning dynamics through the same principle. The geometric argument applies equally to learning: just as u u u changes the approximate posterior q u q_u q u , the generative parameters θ \theta θ change the joint distribution p θ ( x , z ) p_\theta(x,z) p θ ( x , z ) . This motivates extending FOND by defining learning as natural-gradient flow on the same free energy with respect to θ \theta θ .
Thus, inference and learning are both treated as dynamical processes within a unified framework:
FOND: Free-energy Online Natural-gradient Dynamics
Flexible choices: Choose a generative model p θ ( x , z ) p_\theta(x,z) p θ ( x , z ) , an inference model q u ( z ∣ x ) q_u(z \mid x) q u ( z ∣ x ) , and calculate the variational free energy F ( u , θ ) F(u,\theta) F ( u , θ ) .
FOND’s prescription: Define inference and learning as natural gradient flows on F F F :
Inference: u ˙ : = − G u − 1 ( u ) ∂ F ( u , θ ) ∂ u \dot{u}:=-G_u^{-1}(u)\frac{\partial F(u,\theta)}{\partial u} u ˙ := − G u − 1 ( u ) ∂ u ∂ F ( u , θ ) , Learning: θ ˙ : = − G θ − 1 ( θ ) ∂ F ( u , θ ) ∂ θ \dot{\theta}:=-G_\theta^{-1}(\theta)\frac{\partial F(u,\theta)}{\partial\theta} θ ˙ := − G θ − 1 ( θ ) ∂ θ ∂ F ( u , θ ) .
Be FOND: a Bernoulli-distributed iterative sparse coding model
We instantiate our extended FOND by following its three steps: choose the distributions, compute the free energy, and derive the dynamics.
Distribution specifications. A generative model requires a prior and a conditional likelihood (2) . We choose a factorized Bernoulli prior and a linear Gaussian decoder, together with a factorized Bernoulli variational posterior:
Here z ∈ { 0 , 1 } K z \in\{0,1\}^{K} z ∈ { 0 , 1 } K , and σ ( ⋅ ) \sigma(\cdot) σ ( ⋅ ) is the logistic sigmoid. The generative parameters are θ ≡ ( Φ , Σ , u 0 ) \theta\equiv(\Phi,\Sigma,u_0) θ ≡ ( Φ , Σ , u 0 ) , and the variational parameters u u u are the posterior logits.
Free energy. Define e : = x − Φ r e := x-\Phi r e := x − Φ r as the mean reconstruction residual, W : = Φ T Σ − 1 Φ W := \Phi^{\mathsf{T}}\Sigma^{-1}\Phi W := Φ T Σ − 1 Φ as the precision-weighted Gram matrix, and C : = diag [ r ⊙ ( 1 − r ) ] C := \operatorname{diag}[r\odot(1-r)] C := diag [ r ⊙ ( 1 − r )] as the posterior covariance. We weight the prior KL by β > 0 \beta>0 β > 0 , with β = 1 \beta=1 β = 1 recovering the usual variational free energy. Because of the linear Gaussian assumption (9), the log-likelihood expectation can be evaluated exactly (section B.1):
F ( x ; u , θ ) = 1 2 e T Σ − 1 e + 1 2 Tr ( W C ) + 1 2 log det Σ + β ∑ i = 1 K [ r i log r i π 0 , i + ( 1 − r i ) log 1 − r i 1 − π 0 , i ] . (9) F(x;u,\theta)=\frac{1}{2}e^{\mathsf{T}}\Sigma^{-1}e+\frac{1}{2}\operatorname{Tr}(WC)+\frac{1}{2}\log\det\Sigma+\beta\sum_{i=1}^{K}\left[r_i\log\frac{r_i}{\pi_{0,i}}+(1-r_i)\log\frac{1-r_i}{1-\pi_{0,i}}\right]. \tag*{(9)} F ( x ; u , θ ) = 2 1 e T Σ − 1 e + 2 1 Tr ( W C ) + 2 1 log det Σ + β i = 1 ∑ K [ r i log π 0 , i r i + ( 1 − r i ) log 1 − π 0 , i 1 − r i ] . (9)
Dynamics. Applying FOND’s natural-gradient prescription, u ˙ : = − G u − 1 ( u ) ∇ u F ( u , θ ) \dot{u}:=-G_u^{-1}(u)\nabla_uF(u,\theta) u ˙ := − G u − 1 ( u ) ∇ u F ( u , θ ) and θ ˙ : = − G θ − 1 ( θ ) ∇ θ F ( u , θ ) \dot{\theta}:=-G_\theta^{-1}(\theta)\nabla_\theta F(u,\theta) θ ˙ := − G θ − 1 ( θ ) ∇ θ F ( u , θ ) , with the Fisher metrics of the variational posterior and generative joint distribution, yields the following closed-form inference and learning dynamics (section B.2.1):
u ˙ = Φ T Σ − 1 x ⏟ feedforward drive − W r ⏟ recurrent interactions − 1 2 diag ( W ) ⊙ ( 1 − 2 r ) ⏟ variance penalty − β ( u − u 0 ) ⏟ homeostatic leak (10) \dot{u}=\underbrace{\Phi^{\mathsf{T}}\Sigma^{-1}x}_{\text{feedforward drive}}-\underbrace{Wr}_{\text{recurrent interactions}}-\underbrace{\frac{1}{2}\operatorname{diag}(W)\odot(1-2r)}_{\text{variance penalty}}-\underbrace{\beta(u-u_0)}_{\text{homeostatic leak}} \tag*{(10)} u ˙ = feedforward drive Φ T Σ − 1 x − recurrent interactions W r − variance penalty 2 1 diag ( W ) ⊙ ( 1 − 2 r ) − homeostatic leak β ( u − u 0 ) (10)
Φ ˙ = η Φ ( x r T − Φ E ) E p − 1 (11) \dot{\Phi}=\eta_\Phi(xr^{\mathsf{T}}-\Phi E)E_p^{-1} \tag*{(11)} Φ ˙ = η Φ ( x r T − Φ E ) E p − 1 (11)
Σ ˙ = η Σ ( V − Σ ) (12) \dot{\Sigma}=\eta_\Sigma(V-\Sigma) \tag*{(12)} Σ ˙ = η Σ ( V − Σ ) (12)
π ˙ 0 = η 0 β ( r − π 0 ) (13) \dot{\pi}_0=\eta_0\beta(r-\pi_0) \tag*{(13)} π ˙ 0 = η 0 β ( r − π 0 ) (13)
Here η Φ , η Σ , η 0 > 0 \eta_\Phi,\eta_\Sigma,\eta_0>0 η Φ , η Σ , η 0 > 0 set the learning timescales, and prior learning is expressed in mean coordinates π 0 = σ ( u 0 ) \pi_0=\sigma(u_0) π 0 = σ ( u 0 ) . The posterior and prior second moments are:
E = C + r r T ≡ diag [ r ⊙ ( 1 − r ) ] + r r T , E p = diag [ π 0 ⊙ ( 1 − π 0 ) ] + π 0 π 0 T (14) E=C+rr^{\mathsf{T}}\equiv\operatorname{diag}[r\odot(1-r)]+rr^{\mathsf{T}},\qquad E_p=\operatorname{diag}[\pi_0\odot(1-\pi_0)]+\pi_0\pi_0^{\mathsf{T}} \tag*{(14)} E = C + r r T ≡ diag [ r ⊙ ( 1 − r )] + r r T , E p = diag [ π 0 ⊙ ( 1 − π 0 )] + π 0 π 0 T (14)
and V \mathbf{V} V is diagonal, with V m m = e m 2 + ( Φ C Φ ⊤ ) m m V_{mm}=e_m^2+(\mathbf{\Phi}\mathbf{C}\mathbf{\Phi}^{\top})_{mm} V mm = e m 2 + ( ΦC Φ ⊤ ) mm , the expected squared reconstruction error in each observed dimension. Learning holds the inferred posterior fixed. For minibatches, we average x r ⊤ \mathbf{x}\mathbf{r}^{\top} x r ⊤ , E \mathbf{E} E , V \mathbf{V} V , and r \mathbf{r} r before applying the learning rules. These equations keep the prior fixed during inference. Our implementation uses a rolling-reference variant (section B.1.1).
Time discretization. Turning continuous flows into an implementable algorithm requires time discretization, which can affect stability. We use exponential integration for both inference (ETD1; Cox & Matthews, [24 ] ; Hochbruck & Ostermann, [36 ] ) and learning (including matrix-free decoder updates; Al-Mohy & Higham [2 ] ; Trefethen [73 ] ) to preserve linear relaxation within each step. See section B.6 for derivations and Alg. 1 for the full discretized algorithm.
Theoretical analyses, synthetic experiments, and ablations
We study inference and learning using theory and synthetic data with known features and activations. Ablations test lateral interactions and compare separately tuned natural and Euclidean recipes.
Inference: BeFOND's recurrent term enables explaining away
Superposition mixes evidence from overlapping features ([29 , 47 ] ), making inference of sparse codes difficult (section A.1). Here, we show how BeFOND's iterative inference mitigates this interference through a mechanism known as explaining away . As an example, wet grass could be explained by rain or a sprinkler. Observing a wet roof supports rain without changing the sprinkler's direct evidence from the grass. As rain explains more of the wetness, the sprinkler becomes less likely. This reduction in belief in one explanation through evidence for another is known as explaining away (Murphy, 2012). The challenge is that the influence of one piece of evidence depends on the others. An encoder that compresses the input to one fixed projection cannot generally capture the full dependence, as the following proposition establishes.
Proposition 4.1 (A limitation of single-layer inference). Suppose the data are generated by the Bernoulli–Gaussian model:
x = Φ z + ϵ , z j ∼ i n d Bernoulli ( π j ) , ϵ ∼ N ( 0 , I ) , \mathbf{x}=\mathbf{\Phi}\mathbf{z}+\boldsymbol{\epsilon}, \qquad z_j \mathrel{\overset{\mathrm{ind}}{\sim}} \operatorname{Bernoulli}(\pi_j), \qquad\boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\mathbf{I}), x = Φz + ϵ , z j ∼ ind Bernoulli ( π j ) , ϵ ∼ N ( 0 , I ) , where 0 < π j < 1 0<\pi_j<1 0 < π j < 1 for every j j j , and the noise is independent of z \mathbf{z} z .
Suppose a dictionary atom ϕ ( i ) \boldsymbol{\phi}^{(i)} ϕ ( i ) is neither orthogonal nor parallel to another atom ϕ ( j ) \boldsymbol{\phi}^{(j)} ϕ ( j ) . Then there exist no weights w i \mathbf{w}_i w i , bias b i b_i b i , and scalar function f i f_i f i such that:
f i ( w i ⊤ x + b i ) = p ( z i = 1 ∣ x ) = E [ z i ∣ x ] , for every x ∈ R d . f_i(\mathbf{w}_i^{\top}\mathbf{x}+b_i)=p(z_i=1\mid\mathbf{x})=\mathbb{E}[z_i\mid\mathbf{x}], \qquad\text{for every }\mathbf{x}\in\mathbb{R}^{d}. f i ( w i ⊤ x + b i ) = p ( z i = 1 ∣ x ) = E [ z i ∣ x ] , for every x ∈ R d .
For almost every dictionary with K , M ≥ 2 K,M\geq2 K , M ≥ 2 , no latent falls under the exception, so for generic dictionaries a feature's exact posterior probability cannot be computed from one fixed input projection followed by a scalar nonlinearity. The proof shows that overlapping, nonparallel atoms make the posterior log-odds gradient change direction with the input, which is impossible for a function of one fixed projection (section C.2.1). This result generalizes O'Neill et al. [63 ] and covers ReLU (Bricken et al., [15 ] ; Cunningham et al., [25 ] ), JumpReLU (including Gemma Scope) (Rajamanoharan et al., [66 ] ; Lieberum et al., [50 ] ), weight-sharing gated (Rajamanoharan et al., [65 ] ), and fixed-threshold BatchTopK and Matryoshka BatchTopK SAEs (Bussmann et al., [16 ] ; Bussmann et al., [17 ] ), all of which compute each latent from a single projection of the input (section C.2.1). TopK SAEs fall outside this class, since whether a latent fires depends on every other pre-activation.
BeFOND's inference dynamics (eq. (10) ) couple explanations through the off-diagonal entries of − ( Φ ⊤ Φ ) r -(\mathbf{\Phi}^{\top}\mathbf{\Phi})\mathbf{r} − ( Φ ⊤ Φ ) r : positively overlapping features suppress one another's activation drive. A wet roof strengthens rain, which explains the lawn's wetness and suppresses the sprinkler. Repeated updates make this competition depend on the full observation (Figure 2 ).
Figure 2. Heatmaps show sprinkler probabilities under exact inference, converged BeFOND with a fixed prior, and a numerically optimized single-projection encoder. The marked observations have identical lawn wetness but different roof evidence: neutral (white, halfway dry / wet) or wet (blue). Fixed-prior inference and encoder fitting are detailed in section C.2.3.
Section C.2.2 gives an approximate-inference counterpart to theorem 4.1 and sufficient conditions under which BeFOND can achieve strictly lower expected posterior KL than the best possible single-projection amortized encoder. We now empirically quantify the effects of explaining away.
Explaining away under superposition. SynthSAEBench [20 ] makes this problem measurable by providing synthetic data with known atoms and activations, together with feature correlations. Superposition is measured as the mean maximum (mm) absolute cosine similarity:
ρ m m = 1 K ⋆ ∑ i = 1 K ⋆ max j ≠ i ∣ ( ϕ ⋆ ( i ) ) T ϕ ⋆ ( j ) ∣ ∥ ϕ ⋆ ( i ) ∥ ∥ ϕ ⋆ ( j ) ∥ (15) \rho_{\mathrm{mm}} = \frac{1}{K_{\star}}\sum_{i=1}^{K_{\star}}\max_{j\ne i}\frac{\left|\left(\phi_{\star}^{(i)}\right)^{\mathsf{T}}\phi_{\star}^{(j)}\right|}{\left\|\phi_{\star}^{(i)}\right\|\left\|\phi_{\star}^{(j)}\right\|} \tag*{(15)} ρ mm = K ⋆ 1 i = 1 ∑ K ⋆ j = i max ϕ ⋆ ( i ) ϕ ⋆ ( j ) ( ϕ ⋆ ( i ) ) T ϕ ⋆ ( j ) (15)
where ϕ ⋆ ( i ) \phi_{\star}^{(i)} ϕ ⋆ ( i ) are the K ⋆ K_{\star} K ⋆ ground-truth feature directions.
Larger ρ m m \rho_{\mathrm{mm}} ρ mm means that each feature has, on average, a more strongly overlapping alternative. Reducing the input dimension at fixed feature count increases this overlap, modeling the interference created when many features share a real network’s activation space.
As overlap increases, a strong detection score becomes less diagnostic of a feature’s presence: another feature may explain the same evidence. Explaining away addresses this ambiguity by discounting evidence already accounted for by competing causes.
We measure dictionary recovery using the mean correlation coefficient (MCC), which quantifies alignment between learned and ground-truth feature directions. BeFOND achieves the highest MCC throughout the sweep, declining only modestly as superposition increases, while maintaining zero dead latents (Figure 3 ).
Figure 3. BeFOND maintains the highest recovery, and without dead latents (K = 4,096 K = 4{,}096 K = 4 , 096 ). Means and 95% confidence intervals over 3 seeds. Exact values are reported in section C.3.1 and Table 4 .
Ablating lateral interactions. In section C.3.1, we investigate the impact of ablating lateral interactions on dictionary recovery. Figure 6 shows that removing lateral interactions reduces dictionary recovery as feature overlap increases. Restoring suppressive interactions substantially improves recovery, whereas excitatory-only inference activates nearly the entire dictionary without comparable recovery.
Figure 6. Lateral suppression supports feature recovery under superposition. Hollow markers denote early-stopped excitatory runs (K = 4,096 K = 4{,}096 K = 4 , 096 ).
Learning: Be FOND's natural gradient flow improves rare feature learning
Features extracted from language models vary widely in activation frequency [31 ] , and larger SAE dictionaries recover increasingly rare concepts [15 , 72 ] . Scaling dictionary width therefore places greater demands on learning from rare examples: additional neurons must capture infrequent features to expand the model’s coverage.
Learning an infrequently active feature. For an isolated feature active with probability ρ \rho ρ , averaging over inputs scales the decoder gradient by ρ \rho ρ . The same decoder error therefore produces a smaller update for a rarer feature. Matched Fisher preconditioning divides out this frequency factor.
Theorem 4.2 (Exact rarity compensation). For p ( x ∣ z ) = N ( x ; Φ z , I ) p(x \mid z) = \mathcal{N}(x; \Phi z, I) p ( x ∣ z ) = N ( x ; Φ z , I ) , fix a training minibatch and hold its inferred distributions and prior references fixed. Let Φ ∗ \Phi^{*} Φ ∗ minimize F \mathcal{F} F . If the averaged second moments satisfy E p = E ≻ 0 \mathbb{E}_{p} = \mathbb{E} \succ0 E p = E ≻ 0 , then:
Euclidean gradient: Φ ˙ = − η Φ ∇ Φ F = − η Φ ( Φ − Φ ∗ ) E , \text{Euclidean gradient:}\qquad\dot{\Phi} = -\eta_{\Phi}\nabla_{\Phi}\mathcal{F} = -\eta_{\Phi}(\Phi- \Phi^{*})\mathbb{E}, Euclidean gradient: Φ ˙ = − η Φ ∇ Φ F = − η Φ ( Φ − Φ ∗ ) E , Natural gradient: Φ ˙ = − η Φ G Φ − 1 ∇ Φ F = − η Φ ( Φ − Φ ∗ ) , \text{Natural gradient:}\qquad\dot{\Phi} = -\eta_{\Phi}G_{\Phi}^{-1}\nabla_{\Phi}\mathcal{F} = -\eta_{\Phi}(\Phi- \Phi^{*}), Natural gradient: Φ ˙ = − η Φ G Φ − 1 ∇ Φ F = − η Φ ( Φ − Φ ∗ ) , where G Φ = E p ⊗ I G_{\Phi} = \mathbb{E}_{p} \otimes I G Φ = E p ⊗ I and η Φ > 0 \eta_{\Phi} > 0 η Φ > 0 .
Natural flow reduces every decoder error by e − η Φ Δ t e^{-\eta_{\Phi}\Delta t} e − η Φ Δ t over an interval Δ t ≥ 0 \Delta t \ge0 Δ t ≥ 0 . For the same fractional error reduction, Euclidean flow takes κ ( E ) ≥ ρ max / ρ min \kappa(\mathbb{E}) \ge\rho_{\max}/\rho_{\min} κ ( E ) ≥ ρ m a x / ρ m i n times as long in its slowest eigendirection as in its fastest, where ρ i = E i i \rho_i = \mathbb{E}_{ii} ρ i = E ii is the minibatch-averaged posterior activation probability.
The rate difference becomes more pronounced as the frequency range widens. If ρ i = c i − α \rho_i = c\,i^{-\alpha} ρ i = c i − α , with α > 0 \alpha> 0 α > 0 and i = 1 , … , K i = 1,\ldots,K i = 1 , … , K , the slowest Euclidean direction takes at least K α K^{\alpha} K α times as long as the fastest to achieve the same fractional error reduction. Under the theorem’s matched-moment assumptions, natural flow gives every direction the same rate. For the proof and the extension to unequal prior and posterior second moments, see section C.4. Section C.4.2 shows that, with known codes and frozen Adam normalization, an optimer used by many common SAE baselines [16 , 66 ] , Zipfian feature frequencies leave a local condition number of at least K α / 2 K^{\alpha/2} K α /2 , whereas matched Fisher preconditioning reduces it to one.
Recovering rare features. The full-width SynthSAEBench setting [20 ] tests whether decoder capacity recovers the rare tail, with 16,384 learned latents for 16,384 generating features. This supplies one decoder slot per true feature, so complete recovery requires representing rare features alongside common ones. MCC measures recovery of the feature directions, while Rare F1 measures detection of the 25% least frequent generating features, averaging their activation F1 scores. BeFOND leads all metrics, exceeding the evaluated baselines (Figure 4 ; Table 5 ).
Figure 4. BeFOND outperforms all evaluated baselines on dictionary recover (MCC) and feature detection (Macro F1, Rare F1) in SynthSAEBench (d = 768 d = 768 d = 768 , K = K ⋆ = 16,384 K = K_{\star} = 16{,}384 K = K ⋆ = 16 , 384 ). Rare F1 covers the least frequent quarter of features. Bars show means over 3 initialization seeds with 95% confidence intervals, evaluated on 10 6 10^6 1 0 6 held-out samples. Table 5 gives individual-seed results.
Table 5: Full-width SynthSAEBench results (d = 768 d = 768 d = 768 , K = K ⋆ = 16,384 K = K_{\star} = 16{,}384 K = K ⋆ = 16 , 384 ). Individual rows report initialization seeds 0–2; mean rows give pointwise 95% Student-t confidence intervals for the three recovery metrics, as in Figure 4 . Each evaluation uses 10 6 10^6 1 0 6 held-out examples. L 0 L_0 L 0 and dead counts in mean rows are arithmetic means. The lower block retains the modified recipes (+) and continuous-run checkpoint, each at seed 0. The BeFOND runs use 181.82M decoder-update plus 18.18M prior examples.
Table 5.
Ablating inference and learning geometry. The natural-inference/natural-learning recipe reaches stronger recovery with fewer decoder updates than the separately tuned Euclidean variants (Figure 7 ; section C.3.2). Section C.5.2 reports learning curves against the other baselines, and Table 5 reports dead-latent counts alongside recovery.
Figure 7. The natural-inference/natural-learning recipe reaches higher recovery with fewer samples. Panels show MCC, Macro F1, and Rare F1 on SynthSAEBench (d = 768 d = 768 d = 768 , K = K ⋆ = 16,384 K = K_{\star} = 16{,}384 K = K ⋆ = 16 , 384 ). N/E denotes inference/learning geometry: natural (N) or Euclidean (E). Recipes are tuned separately (Section C.1.2).
Evaluating BeFOND on language-model activations
We evaluate whether BeFOND’s inference and learning benefits studied in § 4 translate to improved feature quality in language-model representations. We focus on three questions: (1) whether BeFOND outperforms widely used SAE baselines on Gemma 2B scale activations, (2) whether these benefits increase with dictionary width, and (3) how early they emerge during training.
Experimental setup. We evaluate feature quality under a 50M-token training budget, alongside released Gemma Scope JumpReLU checkpoints trained on 4B tokens at 16k width and 8B tokens at widths 32k–524k [50 , 66 ] . Our primary comparison trains BeFOND, BatchTopK [16 ] , Matryoshka BatchTopK [17 ] , and a mean-field variational baseline with Adam decoder learning [45 ] .
These models use whitened Gemma-2-2B ([32 ] ) layer-12 residual-stream activations (d = 2,304 d = 2{,}304 d = 2 , 304 ) extracted from Pile Uncopyrighted ((monology, 2023)), with dictionary widths from 16,384 to 524,288 latents. We report means and sample standard deviations over three BeFOND training seeds and five baseline training seeds, using T = 10 T = 10 T = 10 inference steps for BeFOND and T = 20 T = 20 T = 20 for mean-field at evaluation. Amortized baselines use the selected target sparsities in Table 6 . Gemma Scope checkpoints retain their original preprocessing. Section D provides further details.
Table 6: SAEBench results on whitened Gemma-2-2B layer-12 activations after 49,999,872 training tokens. Entries are mean ± \pm ± sample standard deviation over three training seeds for BeFOND and five for each baseline. For SAE baselines, we selected target L 0 L_0 L 0 values by mean top-1 accuracy, and then used it for all probing columns, and the model selected by mean disentanglement supplies all RAVEL columns. Parentheses give both values when they differ. Sparse probing measures how well k = 1 k = 1 k = 1 or k = 5 k = 5 k = 5 features predict concepts, averaged equally across 113 tasks: accuracy is the fraction of correct predictions; AUC measures how well positives rank above negatives across thresholds; F1 balances precision (correctness of positive predictions) and recall (coverage of positives). RAVEL measures whether interventions change a targeted attribute (cause) while preserving other attributes (isolation), and disentanglement is their mean. Higher is better throughout. Within each width and metric, bold marks the highest mean, selected before rounding.
Table 6.
Evaluation metrics. Reconstruction quality alone does not establish whether an SAE has learned useful features ([31 , 43 ] ). We therefore evaluate two complementary capabilities using SAEBench ([43 ] ).
Sparse probing ([42 ] ) tests concept detection using a logistic probe restricted to k = 1 k = 1 k = 1 or k = 5 k = 5 k = 5 selected SAE features. We average task-level accuracy, ROC-AUC, and F1 across 113 classification tasks. Accuracy measures correct predictions, ROC-AUC measures the ranking of positive versus negative examples, and F1 summarizes the balance between precision and recall.
RAVEL (Resolving Attribute–Value Entanglements in Language Models; [38 ] ) tests selective intervention on represented attributes. Its cause score measures successful changes to a target attribute, while isolation measures preservation of other attributes, and disentanglement is the mean of these two scores.
Higher scores are better for all reported metrics. We report full numerical results in Table 6 .
Scaling with dictionary width. BeFOND achieves the highest mean RAVEL disentanglement at every tested width, including comparisons with the evaluated Gemma Scope checkpoints (Fig. 1d). At 524k latents, its score is 0.827 ± \pm ± 0.001, compared with 0.748 ± \pm ± 0.004 for BatchTopK, the strongest amortized baseline trained on 50M tokens (Table 6 ). This 7.9 percentage-point advantage reflects improvements in both cause and isolation: BeFOND scores 0.800 and 0.854, respectively, versus 0.719 and 0.776 for BatchTopK.
Single-feature probing also favors BeFOND at large widths. At 524k, its accuracy is 0.789 ± \pm ± 0.002, versus 0.774 ± \pm ± 0.002 for Matryoshka BatchTopK, an improvement of 1.5 percentage points. Across widths from 16k to 524k, BeFOND’s single-feature accuracy increases from 0.771 to 0.789, and its RAVEL score increases from 0.786 to 0.827 (Fig. 1b,d). Over the same range, BatchTopK and Matryoshka each improve by approximately 0.6 percentage points in single-feature accuracy. Thus, increasing dictionary width produces larger gains for BeFOND than for either amortized baseline.
Differences between methods are smaller in five-feature probing accuracy, and the AUC and F1 rankings vary across widths (Table 9 ).
Table 9: SAEBench evaluations of released Gemma Scope layer-12 checkpoints ([50 , 43 ] ), organized by dictionary width and average sparsity L 0 L_0 L 0 .
Table 9.
High feature quality emerges early in training. At 524k latents, BeFOND reaches the evaluated Gemma Scope single-feature probing score by ∼ \sim ∼ 6M training tokens (Fig. 1a). The corresponding Gemma Scope checkpoints were trained on 8B tokens, a training-budget ratio of over 1,000× \times × . By 50M tokens, BeFOND exceeds their single-feature accuracy (0.789 versus 0.7735) and RAVEL disentanglement (0.827 versus 0.7555), using 160× \times × fewer training tokens.
Comparison with iterative mean-field inference. The mean-field baseline performs iterative variational inference and learns its decoder using Adam. At 524k, it reaches single-feature accuracy of 0.751 ± \pm ± 0.007 and RAVEL disentanglement of 0.685 ± \pm ± 0.029, significantly underperforming BeFOND on both metrics (Table 6 ).
Conclusion and Discussion
We formulate inference and dictionary learning as natural-gradient flows on a shared variational free energy (the FOND framework). Our theory establishes limitations of single-projection encoders and shows how Fisher preconditioning compensates for infrequent activation under frozen, matched moments. We introduce BeFOND, which improves synthetic feature recovery and supports increasing feature quality at larger dictionary widths on Gemma.
Limitations. Repeated inference steps and numerical decoder updates increase BeFOND’s computational cost (sections B.8 and D.3). Future work will focus on improving computational efficiency, speeding up inference convergence by adding momentum, and extending the factorized variational family with pairwise interactions to represent dependencies between latent features.
On Gemma-2-2B layer-12 activations, BeFOND improves concept detection and selective intervention. Its gains increase with dictionary width while the evaluated baselines largely plateau. Together with recurrent explaining away and improved rare-feature recovery, these results show the practical value of taking the statistical geometry of inference and learning seriously.
The broader lesson is how adaptation dynamics should be derived:
Physics of Adaptation: deriving covariant adaptation dynamics
Inference and learning dynamics should respect the intrinsic geometry and symmetries of the underlying model (section A.5).
Code and Data
Our code, data, and model checkpoints are available here:
https://github.com/hadivafaii/BeFOND
AI Use Statement
We used generative AI tools to assist with mathematical derivations, software implementation and debugging, experimental analysis and visualization, literature searches, and manuscript drafting and editing. The authors are responsible for the final text, results, and claims.
Extended background
Superposition and inference
Inferring a sparse code can be difficult even with a perfectly learned dictionary. To isolate the inference problem, consider the noiseless generative process x = Φ ∗ z x = \Phi^{*}z x = Φ ∗ z , where the ground truth dictionary Φ ∗ ∈ R M × K \Phi^{*} \in\mathbb{R}^{M \times K} Φ ∗ ∈ R M × K has unit-norm columns, and suppose we have learned the true dictionary Φ = Φ ∗ \Phi= \Phi^{*} Φ = Φ ∗ . Projecting the observation onto each dictionary atom gives:
( Φ T x ) i = z i + ∑ j ≠ i ( ϕ ( i ) ) T ϕ ( j ) z j ⏟ interference from other features . (16) (\Phi^{\mathsf{T}}x)_i = z_i + \underbrace{\sum_{j \ne i}(\phi^{(i)})^{\mathsf{T}}\phi^{(j)}z_j}_{\text{interference from other features}}. \tag*{(16)} ( Φ T x ) i = z i + interference from other features j = i ∑ ( ϕ ( i ) ) T ϕ ( j ) z j . (16)
The projection combines the feature’s own activity with contributions from other active features, weighted by their overlap with its dictionary atom. Even when only one feature j j j is active, an inactive feature i i i can receive a nonzero projection. When several features are active, their contributions can reinforce or cancel one another, making projection scores less reliable indicators of individual feature activity [29 ] .
For an orthonormal dictionary, all interference terms vanish, and inference reduces to a single projection: z = Φ T x z = \Phi^{\mathsf{T}}x z = Φ T x . However, an overcomplete dictionary (K > M K > M K > M ) cannot have mutually orthogonal columns, so this interference cannot be eliminated for all feature pairs.
Therefore, inference should distinguish a feature’s own contribution from evidence attributable to other active features. This motivates explaining away : support for a candidate feature decreases when other features already explain the evidence that initially supported it (Murphy, 2012). Such interactions allow inference to account for overlap between dictionary atoms rather than interpreting each projection independently [68 ] .
Iterative sparse encoders.
Iterative encoders refine sparse representations through successive updates rather than a single feed-forward prediction. ISTA, FISTA, and soft-thresholding LCA optimize ℓ 1 \ell_1 ℓ 1 -regularized reconstruction [26 , 11 , 68 ] , with LCA implementing lateral competition. LISTA learns a finite-step approximation [33 ] , while matching pursuit (MP) greedily selects atoms to explain the remaining residual [54 ] .
With a fixed pretrained dictionary, better inference remains limited by the learned feature directions. Additional ISTA refinement improves reconstruction with little change in BatchTopK probe scores; non-amortized ISTA worsens splitting for Gemma TopK and increases dead latents for Pythia Standard SAEs [71 ] . FISTA applied to fixed SAE dictionaries also fails to close the feature-recovery gap in controlled experiments, implicating the learned dictionary as a bottleneck [10 ] . On Pythia-160M, however, Sun et al. report improved targeted-probe selectivity and generally higher generative intervention scores with semi- and non-amortized inference [71 Appendix C] .
Approaches that also learn the dictionary have shown promising results: MP-SAE captures hierarchical features through residual-guided selection and supports different inference-time sparsity levels [23 ] , while LocA-SAE seeks similar feature-quality benefits through grouped amortized encoders rather than explicit iterative refinement [71 ] . But better reconstruction has not consistently translated into better interpretability tools. On Gemma-2-2B, MP-SAEs improve reconstruction but underperform the tested feed-forward baselines on sparse probing, with substantially longer training. The evaluator therefore recommends against them as a first choice for practical interpretability [19 ] . LocA-SAE eliminates dead latents on Gemma but scores below the Standard SAE on the same proxy probes, so improved utilization need not yield more predictive features [71 ] . Across these evaluations, reconstruction, probing, and intervention metrics need not improve together, and the practical benefit of iterative refinement in these prior work remains task-dependent.
Variational inference and the free energy objective
We provide a pedagogical introduction to variational inference and derive the free energy objective. In this derivation, we distinguish two KL divergences: one measures how well we approximate the true posterior, while the other measures departure from the prior. They play different roles in the same exact identity.
Finally, we explain why minimizing free energy improves inference using a few lines of algebra.
Variational posterior inference. Consider an observation x ∈ R M x \in\mathbb{R}^{M} x ∈ R M and K K K -dimensional latent variables z z z . For Bernoulli latents, z ∈ { 0 , 1 } K z \in\{0,1\}^{K} z ∈ { 0 , 1 } K . A generative model specifies a prior p θ ( z ) p_{\theta}(z) p θ ( z ) and a likelihood p θ ( x ∣ z ) p_{\theta}(x \mid z) p θ ( x ∣ z ) , whose product is the joint distribution. Bayes’ rule gives:
p θ ( z ∣ x ) = p θ ( x , z ) p θ ( x ) , p θ ( x ) = ∑ z ∈ { 0 , 1 } K p θ ( x ∣ z ) p θ ( z ) . (17) p_{\theta}(z \mid x) = \frac{p_{\theta}(x,z)}{p_{\theta}(x)}, \qquad p_{\theta}(x) = \sum_{z \in\{0,1\}^{K}} p_{\theta}(x \mid z)\,p_{\theta}(z). \tag*{(17)} p θ ( z ∣ x ) = p θ ( x ) p θ ( x , z ) , p θ ( x ) = z ∈ { 0 , 1 } K ∑ p θ ( x ∣ z ) p θ ( z ) . (17)
The denominator is the model evidence : the probability density of the observation after summing over all latent explanations. This sum contains 2 K 2^{K} 2 K terms, making direct evaluation generally infeasible for large K K K . The “true posterior” here means the exact posterior under the chosen generative model.
Variational inference is a powerful approximation method that replaces this computation with an optimization problem [41 , 13 ] . In variational inference, we introduce a tractable approximate posterior q u ( z ∣ x ) q_{u}(z \mid x) q u ( z ∣ x ) and adjust its variational parameters u u u to minimize
D K L ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) : = ∑ z q u ( z ∣ x ) log q u ( z ∣ x ) p θ ( z ∣ x ) . (18) D_{\mathrm{KL}}\left(q_{u}(z \mid x)\mathbin{\|}p_{\theta}(z \mid x)\right) := \sum_{z} q_{u}(z \mid x)\log\frac{q_{u}(z \mid x)}{p_{\theta}(z \mid x)}. \tag*{(18)} D KL ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) := z ∑ q u ( z ∣ x ) log p θ ( z ∣ x ) q u ( z ∣ x ) . (18)
This KL divergence is nonnegative and vanishes exactly when the two distributions agree [13 ] . But its value still depends on the intractable posterior, so we can’t directly compute and optimize it. The next step isolates that dependence, leaving an objective we can optimize without evaluating the evidence.
Free-energy derivation. Fix x x x and θ \theta θ throughout the derivation. To keep the algebra readable, write q ( z ) ≡ q u ( z ∣ x ) q(z) \equiv q_{u}(z \mid x) q ( z ) ≡ q u ( z ∣ x ) and suppress the parameter subscript on p p p . All expectations below are over z ∼ q z \sim q z ∼ q . For finite Bernoulli logits and a positive Gaussian covariance, the distributions are strictly positive, so the following ratios are well defined.
Since q q q is normalized, ∑ z q ( z ) = 1 \sum_{z}q(z)=1 ∑ z q ( z ) = 1 . Multiply the log evidence by this sum, apply Bayes’ rule, and insert q ( z ) / q ( z ) = 1 q(z)/q(z)=1 q ( z ) / q ( z ) = 1 :
log p ( x ) = log p ( x ) ∑ z q ( z ) ⏟ = 1 = E q [ log p ( x ) ] = E q [ log p ( x , z ) p ( z ∣ x ) ] = E q [ log p ( x , z ) p ( z ∣ x ) q ( z ) q ( z ) ] = E q [ log p ( x , z ) q ( z ) ] + E q [ log q ( z ) p ( z ∣ x ) ] = E q [ log p ( x , z ) q ( z ) ] ⏟ E L B O = − F + D K L ( q ( z ) ∥ p ( z ∣ x ) ) . (19) \begin{aligned}
\log p(x) &= \log p(x)\underbrace{\sum_{z}q(z)}_{=1} = \mathbb{E}_{q}[\log p(x)] \\
&= \mathbb{E}_{q}\left[\log\frac{p(x,z)}{p(z \mid x)}\right] \\
&= \mathbb{E}_{q}\left[\log\frac{p(x,z)}{p(z \mid x)}\frac{q(z)}{q(z)}\right] \\
&= \mathbb{E}_{q}\left[\log\frac{p(x,z)}{q(z)}\right] + \mathbb{E}_{q}\left[\log\frac{q(z)}{p(z \mid x)}\right] \\
&= \underbrace{\mathbb{E}_{q}\left[\log\frac{p(x,z)}{q(z)}\right]}_{\mathrm{ELBO}=-\mathcal{F}} + D_{\mathrm{KL}}\left(q(z)\mathbin{\|}p(z \mid x)\right). \tag*{(19)}
\end{aligned} log p ( x ) = log p ( x ) = 1 z ∑ q ( z ) = E q [ log p ( x )] = E q [ log p ( z ∣ x ) p ( x , z ) ] = E q [ log p ( z ∣ x ) p ( x , z ) q ( z ) q ( z ) ] = E q [ log q ( z ) p ( x , z ) ] + E q [ log p ( z ∣ x ) q ( z ) ] = ELBO = − F E q [ log q ( z ) p ( x , z ) ] + D KL ( q ( z ) ∥ p ( z ∣ x ) ) . (19)
All we did was multiply by one twice, then rearrange logarithms. We didn’t have to invoke Jensen’s inequality as it is typically done. Instead, we have an exact decomposition of the log evidence. Nonnegativity of the final KL gives the evidence lower bound , E L B O ≤ log p ( x ) \mathrm{ELBO} \leq\log p(x) ELBO ≤ log p ( x ) . Its negative is the variational free energy, F = − E L B O \mathcal{F}=-\mathrm{ELBO} F = − ELBO [58 , 46 ] .
Posterior and prior KL divergences. Expanding p θ ( x , z ) = p θ ( x ∣ z ) p θ ( z ) p_\theta(x,z)=p_\theta(x\mid z)p_\theta(z) p θ ( x , z ) = p θ ( x ∣ z ) p θ ( z ) inside the ELBO reveals a second KL Kingma & Welling, [46 ] . With F ≡ F ( x ; u , θ ) \mathcal{F}\equiv\mathcal{F}(x;u,\theta) F ≡ F ( x ; u , θ ) , we have:
log p θ ( x ) = − F + D K L ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) , F = E q u [ − log p θ ( x ∣ z ) ] + D K L ( q u ( z ∣ x ) ∥ p θ ( z ) ) . (20) \begin{aligned}
\log p_\theta(x) &= -\mathcal{F} + D_{\mathrm{KL}}\left(q_u(z\mid x)\mathbin{\|}p_\theta(z\mid x)\right),\\
\mathcal{F} &= \mathbb{E}_{q_u}\left[-\log p_\theta(x\mid z)\right] + D_{\mathrm{KL}}\left(q_u(z\mid x)\mathbin{\|}p_\theta(z)\right). \tag*{(20)}
\end{aligned} log p θ ( x ) F = − F + D KL ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) , = E q u [ − log p θ ( x ∣ z ) ] + D KL ( q u ( z ∣ x ) ∥ p θ ( z ) ) . (20)
The inference KL compares the approximate posterior with the true posterior, p θ ( z ∣ x ) p_\theta(z\mid x) p θ ( z ∣ x ) . This is the original objective in eq. (18) . The prior KL , by contrast, compares the approximate posterior with p θ ( z ) p_\theta(z) p θ ( z ) , before conditioning on the observation. It is a component of free energy, and can be interpreted as a coding rate : the cost of representing the input-dependent distribution relative to the prior Alemi et al., [3 ] . We use natural logarithms, so this cost is measured in nats.
These quantities need not decrease together. If inference starts at the prior, the prior KL is initially zero. Explaining an informative observation generally requires moving away from that prior, increasing the coding rate while reducing the inference KL. Free energy balances this cost against the improvement in expected log likelihood. Minimizing the prior KL alone would simply return the prior and ignore the observation.
Free energy and posterior approximation. Rearranging the first line of eq. (20) yields
F ( x ; u , θ ) = D K L ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) − log p θ ( x ) . (21) \mathcal{F}(x;u,\theta)=D_{\mathrm{KL}}\left(q_u(z\mid x)\mathbin{\|}p_\theta(z\mid x)\right)-\log p_\theta(x). \tag*{(21)} F ( x ; u , θ ) = D KL ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) − log p θ ( x ) . (21)
The evidence depends on the generative model and observation, but not on the variational parameters. Therefore, with x x x and θ \theta θ fixed, every decrease in F \mathcal{F} F is an equal decrease in the inference KL Blei et al., [13 ] . Equivalently, we have:
∇ u F = ∇ u D K L ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) . (22) \nabla_u\mathcal{F}=\nabla_uD_{\mathrm{KL}}\left(q_u(z\mid x)\mathbin{\|}p_\theta(z\mid x)\right). \tag*{(22)} ∇ u F = ∇ u D KL ( q u ( z ∣ x ) ∥ p θ ( z ∣ x ) ) . (22)
This is the sense in which free energy minimization improves inference. It holds regardless of whether the variational parameters are produced by an amortized encoder or refined iteratively. The bound becomes tight, F = − log p θ ( x ) \mathcal{F}=-\log p_\theta(x) F = − log p θ ( x ) , only when the approximate posterior equals the true posterior. A restricted variational family may not contain that posterior [76 , 13 ] ; for example, a factorized Bernoulli distribution cannot represent all the dependencies induced by overlapping dictionary atoms. Optimization can reduce the KL without eliminating this approximation gap.
Trust regions and natural-gradient inference
Inference moves the approximate posterior q u q_u q u to reduce free energy. But specifying the objective is only part of specifying the dynamics. We also need to decide how far beliefs should move at each step, and what counts as a small change. This choice of distance is what takes us from ordinary gradient descent to the Fisher geometry used by FOND Vafaii et al., [74 ] .
Throughout this derivation, we hold the observation x x x , generative parameters θ \theta θ , and prior reference fixed. We write the objective as F ( u ) \mathcal{F}(u) F ( u ) and suppress conditioning on x x x in q u q_u q u .
From a gradient to a step. At the current iterate u t u_t u t , define g t : = ∇ u F ( u t ) g_t:=\nabla_u\mathcal{F}(u_t) g t := ∇ u F ( u t ) . For a small displacement Δ u \Delta u Δ u , the gradient predicts the change in free energy:
F ( u t + Δ u ) = F ( u t ) + g t ⊤ Δ u + o ( ∥ Δ u ∥ 2 ) . (23) \mathcal{F}(u_t+\Delta u)=\mathcal{F}(u_t)+g_t^\top\Delta u+o(\lVert\Delta u\rVert_2). \tag*{(23)} F ( u t + Δ u ) = F ( u t ) + g t ⊤ Δ u + o (∥ Δ u ∥ 2 ) . (23)
There is a catch: if g t ≠ 0 g_t\ne0 g t = 0 , the linear term keeps decreasing as we move farther along − g t -g_t − g t . Taken literally, it would tell us to take an infinitely large step. Yet, the prediction in eq. (23) is only useful nearby. We can keep the step finite by attaching a quadratic cost to movement:
Δ u = argmin δ { g t ⊤ δ + 1 2 η ∥ δ ∥ 2 2 } = − η g t , η > 0. (24) \Delta u=\underset{\delta}{\operatorname{argmin}}\left\{g_t^\top\delta+\frac{1}{2\eta}\lVert\delta\rVert_2^2\right\}=-\eta g_t,\qquad\eta>0. \tag*{(24)} Δ u = δ argmin { g t ⊤ δ + 2 η 1 ∥ δ ∥ 2 2 } = − η g t , η > 0. (24)
The last equality follows by differentiating with respect to δ \delta δ and setting g t + δ / η = 0 g_t + \delta/\eta= 0 g t + δ / η = 0 . This is ordinary gradient descent: a balance between the predicted improvement and the cost of moving away from the current iterate [55 ] . Increasing η \eta η makes movement cheaper, allowing a longer step. The quadratic term belongs to the update rule; the approximation to F \mathcal{F} F itself remains first order.
Trust-region formulation. We can express the same tradeoff as a movement budget [14 Sec. 9.4] . Allow a step only within a ball around the current iterate, and choose the one that most reduces the linearized objective:
minimize δ g t T δ subject to ∥ δ ∥ 2 2 ≤ ϵ . (25) \underset{\delta}{\operatorname{minimize}}\quad g_t^{\mathsf{T}}\delta\qquad\text{subject to}\qquad\lVert\delta\rVert_2^2 \le\epsilon. \tag*{(25)} δ minimize g t T δ subject to ∥ δ ∥ 2 2 ≤ ϵ . (25)
The radius ϵ \sqrt{\epsilon} ϵ sets how far we are willing to trust the local prediction. For ϵ > 0 \epsilon> 0 ϵ > 0 and g t ≠ 0 g_t \ne0 g t = 0 , the optimum uses the full budget, giving Δ u = − ϵ g t / ∥ g t ∥ 2 \Delta u = -\sqrt{\epsilon}\,g_t/\lVert g_t\rVert_2 Δ u = − ϵ g t / ∥ g t ∥ 2 . It agrees with eq. (24) when ϵ = η 2 ∥ g t ∥ 2 2 \epsilon= \eta^2\lVert g_t\rVert_2^2 ϵ = η 2 ∥ g t ∥ 2 2 . Thus, a fixed step size η \eta η lets a large gradient spend more of the movement budget, while a fixed ϵ \epsilon ϵ enforces the same radius at each step.
Changing the geometry of the step. Euclidean distance measures every direction with the same ruler. More generally, a positive-definite matrix M t \mathbf{M}_t M t assigns the squared length δ T M t δ \delta^{\mathsf{T}}\mathbf{M}_t\delta δ T M t δ to a displacement. We evaluate this metric at the current iterate and hold it fixed while choosing the step. Replacing the Euclidean penalty gives:
Δ u = argmin δ { g t T δ + 1 2 η δ T M t δ } = − η M t − 1 g t . (26) \Delta u = \underset{\delta}{\operatorname{argmin}}\left\{g_t^{\mathsf{T}}\delta+ \frac{1}{2\eta}\delta^{\mathsf{T}}\mathbf{M}_t\delta\right\} = -\eta\mathbf{M}_t^{-1}g_t . \tag*{(26)} Δ u = δ argmin { g t T δ + 2 η 1 δ T M t δ } = − η M t − 1 g t . (26)
The corresponding constraint, δ T M t δ ≤ ϵ \delta^{\mathsf{T}}\mathbf{M}_t\delta\le\epsilon δ T M t δ ≤ ϵ , has solution
Δ u = − ϵ g t T M t − 1 g t M t − 1 g t , g t ≠ 0. (27) \Delta u = -\sqrt{\frac{\epsilon}{g_t^{\mathsf{T}}\mathbf{M}_t^{-1}g_t}}\,\mathbf{M}_t^{-1}g_t,\qquad g_t \ne0 . \tag*{(27)} Δ u = − g t T M t − 1 g t ϵ M t − 1 g t , g t = 0. (27)
The ball has become an ellipsoid. Along an eigenvector with a large metric eigenvalue, movement costs more, so the same gradient component produces a smaller update. This is why “steepest descent” needs a geometry: the best direction depends on how we measure the cost of getting there [4 , 14 ] .
Measuring changes in beliefs. So far, we have measured movement in parameter space. But u u u is a description of a belief, and equal parameter changes can mean very different belief changes. For example, a small change in a Bernoulli logit shifts the activation probability most strongly near 1 / 2 1/2 1/2 , and much less near 0 or 1. A unit of logit displacement therefore has no fixed meaning as a change in belief. We should price the step by how much it changes the distribution it represents.
KL divergence gives us such a measure:
D K L ( q u + Δ u ∥ q u ) = E q u + Δ u [ log q u + Δ u ( z ) q u ( z ) ] . (28) D_{\mathrm{KL}}(q_{u+\Delta u}\mathbin{\|}q_u) = \mathbb{E}_{q_{u+\Delta u}}\left[\log\frac{q_{u+\Delta u}(z)}{q_u(z)}\right]. \tag*{(28)} D KL ( q u + Δ u ∥ q u ) = E q u + Δ u [ log q u ( z ) q u + Δ u ( z ) ] . (28)
Hobson [35 ] characterized KL as an information measure for finite-outcome belief revision; section A.5 develops this motivation further. Here, it measures the change between successive approximate posteriors. The prior KL in free energy has a different job: it helps define the objective by comparing the posterior with its prior reference (section A.3). The stepwise KL tells us how much we change our mind in one update. Many small updates can still carry beliefs far from the prior.
From local KL divergence to the Fisher metric. For a smooth family with common positive support and sufficient regularity to differentiate under the expectation, define the score s u ( z ) : = ∇ u log q u ( z ) s_u(z) := \nabla_u \log q_u(z) s u ( z ) := ∇ u log q u ( z ) . Normalization gives E q u [ s u ] = 0 \mathbb{E}_{q_u}[s_u] = 0 E q u [ s u ] = 0 . When the two distributions coincide, the KL divergence and its first derivative vanish. Its leading contribution is therefore quadratic, and its Hessian is the Fisher information:
G u ( u ) = E q u [ s u ( z ) s u ( z ) T ] , (29) \mathbf{G}_u(u) = \mathbb{E}_{q_u}\left[s_u(z)s_u(z)^{\mathsf{T}}\right], \tag*{(29)} G u ( u ) = E q u [ s u ( z ) s u ( z ) T ] , (29)
D K L ( q u + Δ u ∥ q u ) = 1 2 Δ u T G u ( u ) Δ u + o ( ∥ Δ u ∥ 2 2 ) . (30) D_{\mathrm{KL}}(q_{u+\Delta u}\mathbin{\|}q_u) = \frac{1}{2}\Delta u^{\mathsf{T}}\mathbf{G}_u(u)\Delta u + o\left(\lVert\Delta u\rVert_2^2\right). \tag*{(30)} D KL ( q u + Δ u ∥ q u ) = 2 1 Δ u T G u ( u ) Δ u + o ( ∥ Δ u ∥ 2 2 ) . (30)
The Fisher metric measures how sensitive the distribution is to movement in each direction. A large Fisher length means the step makes the old and new beliefs easier to distinguish, spending more of the same KL budget. Reversing the KL arguments gives the same quadratic term [55 ] : KL is asymmetric beyond this local approximation, but both orientations supply the same local ruler.
There is also a statistical reason to favor this ruler. A sufficient statistic retains all the information about the parameter; replacing the full observation by that statistic should preserve statistical lengths. For regular minimal exponential families, Dowty’s Chentsov-type theorem makes this requirement precise. Together with the appropriate scaling for independent replication and additional compatibility and continuity assumptions, preservation by canonical sufficient statistics characterizes the Fisher metric up to a positive constant [27 ] .
The natural-gradient update. Set M t = G u ( u t ) M_t = G_u(u_t) M t = G u ( u t ) in eq. (26) . To leading order, the movement cost is now the KL divergence divided by η \eta η . Balancing this cost against the predicted decrease in free energy yields:
u t + 1 = u t − η G u ( u t ) − 1 ∇ u F ( u t ) . (31) u_{t+1} = u_t - \eta G_u(u_t)^{-1}\nabla_u \mathcal{F}(u_t). \tag*{(31)} u t + 1 = u t − η G u ( u t ) − 1 ∇ u F ( u t ) . (31)
This is natural-gradient descent wherever the Fisher is nonsingular [4 , 55 ] . Constraining D K L ( q u + Δ u ∥ q u ) ≤ ϵ / 2 D_{\mathrm{KL}}(q_{u+\Delta u} \mathbin\Vert q_u) \le\epsilon/2 D KL ( q u + Δ u ∥ q u ) ≤ ϵ /2 and using its quadratic approximation gives the same direction, with the budget-dependent normalization in eq. (27) .
For the continuous flow u ˙ = − G u − 1 ∇ u F \dot{u} = -G_u^{-1}\nabla_u\mathcal{F} u ˙ = − G u − 1 ∇ u F , the rate of change of free energy is:
d F d t = − ( ∇ u F ) T G u − 1 ∇ u F ≤ 0. (32) \frac{d\mathcal{F}}{dt} = -(\nabla_u\mathcal{F})^{\mathsf{T}}G_u^{-1}\nabla_u\mathcal{F} \le0. \tag*{(32)} d t d F = − ( ∇ u F ) T G u − 1 ∇ u F ≤ 0. (32)
Wherever the gradient is nonzero, free energy strictly decreases along the flow. After discretization, the step size still matters: a large jump can leave the region where the local prediction is accurate, so an arbitrary finite update need not decrease F \mathcal{F} F .
A Gaussian inference example. To see what changing the ruler buys us, consider a Gaussian target posterior p ( z ∣ x ) = N ( z ; μ , S ) p(z \mid x) = \mathcal{N}(z;\mu,S) p ( z ∣ x ) = N ( z ; μ , S ) and a variational family q u ( z ) = N ( z ; u , S ) q_u(z) = \mathcal{N}(z;u,S) q u ( z ) = N ( z ; u , S ) , with fixed S ≻ 0 S \succ0 S ≻ 0 . In this illustration, u u u denotes the posterior mean, rather than the Bernoulli logits used in BeFOND. For the ordinary variational free energy (β = 1 \beta= 1 β = 1 ), eq. (21) gives:
F ( u ) − F ( μ ) = D K L ( q u ∥ p ( ⋅ ∣ x ) ) = 1 2 ( u − μ ) T S − 1 ( u − μ ) . (33) \mathcal{F}(u) - \mathcal{F}(\mu) = D_{\mathrm{KL}}(q_u \mathbin\Vert p(\cdot\mid x)) = \frac{1}{2}(u-\mu)^{\mathsf{T}}S^{-1}(u-\mu). \tag*{(33)} F ( u ) − F ( μ ) = D KL ( q u ∥ p ( ⋅ ∣ x )) = 2 1 ( u − μ ) T S − 1 ( u − μ ) . (33)
The score is S − 1 ( z − u ) S^{-1}(z-u) S − 1 ( z − u ) , giving G u = S − 1 G_u = S^{-1} G u = S − 1 . Hence:
∇ u F = S − 1 ( u − μ ) , \nabla_u\mathcal{F} = S^{-1}(u-\mu), ∇ u F = S − 1 ( u − μ ) ,
G u − 1 ∇ u F = u − μ . (34) G_u^{-1}\nabla_u\mathcal{F} = u-\mu. \tag*{(34)} G u − 1 ∇ u F = u − μ . (34)
Suppose the target posterior is very certain along one direction, but uncertain along another. Along an eigenvector of S S S with eigenvalue λ j \lambda_j λ j , a Euclidean step multiplies the mean error by 1 − η / λ j 1-\eta/\lambda_j 1 − η / λ j . The narrow, certain direction forces a small η \eta η to avoid overshooting; with that same step size, the broad direction barely moves. Convergence in all directions requires 0 < η < 2 λ min ( S ) 0 < \eta< 2\lambda_{\min}(S) 0 < η < 2 λ m i n ( S ) .
The natural-gradient step instead removes the precision factor S − 1 S^{-1} S − 1 : every component of the mean error contracts by 1 − η 1-\eta 1 − η . It corrects the same fraction of the remaining error in each direction, with convergence for 0 < η < 2 0 < \eta< 2 0 < η < 2 . For this mean-only quadratic problem, η = 1 \eta= 1 η = 1 reaches the target mean in one step.
Reparameterization invariance. The belief itself should not care whether we describe it by a probability, a logit, or some other smooth coordinate. Let v = f ( u ) v = f(u) v = f ( u ) be a smooth invertible reparameterization, with Jacobian J = ∂ v ∂ u \mathbf{J} = \frac{\partial v}{\partial u} J = ∂ u ∂ v . The chain rule and the score definition give:
∇ v F = J − T ∇ u F , \nabla_v\mathcal{F} = \mathbf{J}^{-\mathsf{T}}\nabla_u\mathcal{F}, ∇ v F = J − T ∇ u F ,
G v = J − T G u J − 1 , G_v = \mathbf{J}^{-\mathsf{T}}G_u\mathbf{J}^{-1}, G v = J − T G u J − 1 ,
G v − 1 ∇ v F = J G u − 1 ∇ u F . (35) G_v^{-1}\nabla_v\mathcal{F} = \mathbf{J}G_u^{-1}\nabla_u\mathcal{F}. \tag*{(35)} G v − 1 ∇ v F = J G u − 1 ∇ u F . (35)
The gradient and metric change together, so the natural-gradient velocity obeys v ˙ = J u ˙ \dot{v} = J\dot{u} v ˙ = J u ˙ , exactly as a velocity should. Wherever the flow is well defined, both coordinate systems describe the same evolution of distributions [4 , 55 ] . This is the optimization counterpart of the covariance principle developed in section A.5.
This invariance is a property of the continuous dynamics. A finite Euler step preserves it exactly under affine coordinate changes, but generally only to first order under nonlinear ones [55 ] . The geometry fixes the direction of motion, and discretization determines how faithfully our finite steps follow it.
“Physics of Adaptation”: deriving covariant inference and learning rules
In this section, we take a physics-inspired approach to dynamics and motivate the use of natural gradients through this angle. Specifically, we argue that the dynamics of inference and learning can be derived from stationary-action principles [48 ] , supplemented by dissipative forces. We emphasize how the underlying geometry of the system must constrain our choice of the kinetic Lagrangian. For beliefs existing on statistical manifolds, we will introduce the kinetic energy of beliefs as a natural choice, and use it to derive natural gradient descent in the overdamped (massless) limit of belief dynamics.
The principle of stationary action. Physics is fundamentally about dynamics. The most successful theories in physics—including Newtonian mechanics, special and general relativity, electromagnetism, and quantum field theory—share two core attributes. They all: (1) identify some dynamical objects of interest, and (2) derive their dynamics via the principle of stationary action :
Principle of stationary action: The closest physics has come to a theory of everything
Physical systems evolve to extremize action S S S (time integral of the Lagrangian L L L ):
S = ∫ L d t , real physical systems follow trajectories that extremize action ⟶ δ S = 0 (36) S = \int L\,\mathrm{d}t,\qquad\text{real physical systems follow trajectories that extremize action} \longrightarrow\delta S = 0 \tag*{(36)} S = ∫ L d t , real physical systems follow trajectories that extremize action ⟶ δ S = 0 (36)
Euler–Lagrange equations. Extremizing the action leads directly to the Euler–Lagrange equations:
δ S = 0 ⟹ d d t ( ∂ L ∂ x ˙ ) − ∂ L ∂ x = 0. (37) \delta S = 0 \Longrightarrow\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial L}{\partial\dot{x}}\right) - \frac{\partial L}{\partial x} = 0. \tag*{(37)} δ S = 0 ⟹ d t d ( ∂ x ˙ ∂ L ) − ∂ x ∂ L = 0. (37)
Here, x x x is position, x ˙ = d x / d t \dot{x} = \mathrm{d}x/\mathrm{d}t x ˙ = d x / d t is velocity, and L L L is the Lagrangian. In classical mechanics, the Lagrangian is simply kinetic minus potential energy, L = T − V L = T - V L = T − V , and the kinetic energy is given by T c l a s s i c a l = 1 2 m ∥ x ˙ ∥ 2 2 T_{\mathrm{classical}} = \frac{1}{2}m\lVert\dot{x}\rVert_2^2 T classical = 2 1 m ∥ x ˙ ∥ 2 2 , where m m m is the rest mass.
As an illustrative example, apply eq. (37) to L c l a s s i c a l ( x , x ˙ ) = T c l a s s i c a l ( x ˙ ) − V ( x ) L_{\mathrm{classical}}(x,\dot{x}) = T_{\mathrm{classical}}(\dot{x}) - V(x) L classical ( x , x ˙ ) = T classical ( x ˙ ) − V ( x ) :
d d t ( ∂ L c l a s s i c a l ∂ x ˙ ) − ∂ L c l a s s i c a l ∂ x = d d t ( ∂ T c l a s s i c a l ∂ x ˙ ) + ∂ V ( x ) ∂ x = d d t ( m x ˙ ) + ∇ V = m x ¨ + ∇ V = 0. (38) \begin{aligned}
\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial L_{\mathrm{classical}}}{\partial\dot{x}}\right) - \frac{\partial L_{\mathrm{classical}}}{\partial x}
&= \frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial T_{\mathrm{classical}}}{\partial\dot{x}}\right) + \frac{\partial V(x)}{\partial x} \\
&= \frac{\mathrm{d}}{\mathrm{d}t}(m\dot{x}) + \nabla V = m\ddot{x} + \nabla V = 0. \tag*{(38)}
\end{aligned} d t d ( ∂ x ˙ ∂ L classical ) − ∂ x ∂ L classical = d t d ( ∂ x ˙ ∂ T classical ) + ∂ x ∂ V ( x ) = d t d ( m x ˙ ) + ∇ V = m x ¨ + ∇ V = 0. (38)
Defining force F : = − ∇ V \mathbf{F} := -\nabla V F := − ∇ V and acceleration a : = x ¨ \mathbf{a} := \ddot{x} a := x ¨ , we recover Newton’s second law, F = m a \mathbf{F} = m\mathbf{a} F = m a .
Generalized Euler–Lagrange equations. Equation (37) describes the dynamics when all forces are represented in the Lagrangian. To include dissipation and other non-conservative forces not represented in L L L , we add a generalized force vector Q \mathbf{Q} Q . This gives:
d d t ( ∂ L ∂ x ˙ ) − ∂ L ∂ x = Q . (39) \frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial L}{\partial\dot{x}}\right) - \frac{\partial L}{\partial x} = \mathbf{Q}. \tag*{(39)} d t d ( ∂ x ˙ ∂ L ) − ∂ x ∂ L = Q . (39)
Defining the canonical momentum p : = ∂ L / ∂ x ˙ p := \partial L/\partial\dot{x} p := ∂ L / ∂ x ˙ , the generalized Euler-Lagrange equation is:
d d t p − ∂ L ∂ x = Q . (40) \frac{d}{dt}p-\frac{\partial L}{\partial x}=\mathbf{Q}. \tag*{(40)} d t d p − ∂ x ∂ L = Q . (40)
Adaptation dynamics. The dynamics of various physical systems can be derived from eq. (40) , by making different choices for the Lagrangian L L L and the non-conservative forces Q \mathbf{Q} Q . We argue that the dynamics of adaptation is no different. We treat the belief state u ( t ) \mathbf{u}(t) u ( t ) as the position of a fictitious particle moving in a potential V ( u ) V(\mathbf{u}) V ( u ) , which we identify as the loss function. The same picture applies to the generative parameters θ ( t ) \boldsymbol{\theta}(t) θ ( t ) during learning with potential V ( θ ) V(\boldsymbol{\theta}) V ( θ ) .
FOND unifies both processes as variational free energy minimization, giving F ( u , θ ) ≡ V ( u , θ ) \mathcal{F}(\mathbf{u},\boldsymbol{\theta}) \equiv V(\mathbf{u},\boldsymbol{\theta}) F ( u , θ ) ≡ V ( u , θ ) as one shared potential energy: inference changes u \mathbf{u} u with θ \boldsymbol{\theta} θ held fixed, while learning changes θ \boldsymbol{\theta} θ with u \mathbf{u} u held fixed. This leaves two modeling choices open: the kinetic part of the Lagrangian T T T , and the dissipation force Q \mathbf{Q} Q . Different choices lead to different inference and learning dynamics and, after discretization, different optimization algorithms, as we demonstrate below.
The principle of general covariance. With the potential energy fixed by the loss, let us turn to the kinetic part of the Lagrangian. How should we choose it? Should we just do a bunch of trial and error? Or is there a principled way to approach this? Physics gives us a basic requirement:
Figure 1 (PDF p. 24). The principle of general covariance. “The general laws of nature are to be expressed by equations which hold good for all systems of co-ordinates, that is, are co-variant with respect to any substitutions whatever (generally co-variant).” — Einstein [28 ]
Imagine tossing a ball across a room. If two people track its motion—one standing upright and one tilted sideways—they will record different numbers for its horizontal and vertical motion. Yet, both of them watch the ball land in the exact same spot. The ball has no idea about the observers watching it; it follows a physical path that does not change simply because different observers choose to describe it in different ways.
More concretely, consider Newton’s second law, F = m a \mathbf{F}=m\mathbf{a} F = m a . When you change your coordinate system, the actual numerical values of force and acceleration change, but the mathematical form of the law does not: F = m a \mathbf{F}=m\mathbf{a} F = m a becomes F ′ = m a ′ \mathbf{F}'=m\mathbf{a}' F ′ = m a ′ because both sides “co-vary” in lockstep under the transformation. In this sense, Newton’s law describes a “co-variant” dynamical rule under Galilean transformations. If rotating or shifting our reference frame altered where the ball landed, the equation wouldn’t be describing the ball at all—it would merely be describing our choice of coordinates.
Descartes, geometry, and algebra. This idea is not new. It goes back to Descartes’ link between geometry and algebra: choose a coordinate system, and a point becomes a tuple of numbers. We have done this so often that it is easy to forget what comes with it: redundancy in the description. The origin, the orientation of the axes, and the units are all choices of the modeler. The same physical trajectory admits many different numerical descriptions. Covariance requires the equations to transform consistently between them, so that they all predict the same physical motion.
The principle of general covariance for inference and learning. Once again, we argue that the dynamics of adaptation are no different. A Bernoulli belief can be described by its activation probability or by its logit. These describe exactly the same distribution. Why should the learner’s response to evidence change just because we switched between these two descriptions? We require the continuous dynamics of inference and learning to describe the same evolution of distributions under smooth, invertible reparameterizations ([4 , 55 ] ).
There is also a concrete computational reason for this requirement. Take a scalar belief parameter u \mathbf{u} u and write it instead as v = 10 u v=10u v = 10 u . If we apply ordinary Euclidean gradient descent in v v v , the gradient becomes ten times smaller, and converting the step back to u \mathbf{u} u introduces another factor of ten.
Therefore, with the same learning rate, the update in u u u becomes 100× smaller. Same belief, same evidence, same objective, but a different pace of adaptation, just because we changed the units.
We can fix this scalar example by re-tuning the learning rate. But when different coordinates are rescaled differently, a single learning rate cannot generally restore all their relative update speeds. Such artificial conditioning can force small steps for stability in some directions while leaving others barely moving ([55 ] ). With a limited inference or training budget, this can determine which beliefs or features we have time to learn. We may then spend extra computation, and extra stochastic training samples, compensating for arbitrary scales chosen by the engineer.
A coordinate choice should not get to decide how well we can adapt. Therefore, we draw inspiration from Einstein [28 ] and postulate the same thing for physics of adaptation:
The principle of general covariance, applied to inference and learning
The physics of adaptation must not depend on your choice of coordinate system.
To implement this principle, we need a measure of motion that remain invariant under coordinate transformations. This is what motivates the kinetic energy of beliefs below.
The kinetic energy of beliefs. We can arrive at a suitable kinetic term from two directions. The first is geometric. Suppose some parameters λ \boldsymbol{\lambda} λ live on a manifold with Riemannian metric G ( λ ) \mathbf{G}(\boldsymbol{\lambda}) G ( λ ) . What is the simplest scalar, quadratic in velocity, that measures how fast they move? The metric gives us the squared speed, so for the kinetic energy, the natural choice is:
T ( λ , λ ˙ ) = 1 2 m λ ˙ T G ( λ ) λ ˙ . (41) T(\boldsymbol{\lambda},\dot{\boldsymbol{\lambda}})=\frac{1}{2}m\dot{\boldsymbol{\lambda}}^{\mathsf{T}}\mathbf{G}(\boldsymbol{\lambda})\dot{\boldsymbol{\lambda}}. \tag*{(41)} T ( λ , λ ˙ ) = 2 1 m λ ˙ T G ( λ ) λ ˙ . (41)
Here, λ ˙ = d λ / d t \dot{\boldsymbol{\lambda}}=d\boldsymbol{\lambda}/dt λ ˙ = d λ / d t , and m > 0 m>0 m > 0 is a scalar that sets the relative scale of kinetic and potential energy. This expression is nonnegative, vanishes at rest, and treats motion in either direction equally. Crucially, it is invariant under a change of coordinates: the velocity and metric transform together, leaving their contraction unchanged. In Euclidean space, G = I \mathbf{G}=\mathbf{I} G = I , and we recover the familiar 1 2 m ∥ λ ˙ ∥ 2 \frac{1}{2}m\lVert\dot{\boldsymbol{\lambda}}\rVert^2 2 1 m ∥ λ ˙ ∥ 2 .
This gives us the correct form of a kinetic energy on Riemannian manifolds, but we still need to choose the geometry of belief space.
The second route starts with a more physical question: what does it cost to change one’s mind?
Zellner [78 ] derived Bayes’ rule as an optimal information processor, with no information lost between its inputs and outputs. Later, Zellner [79 ] showed that introducing costs of changing beliefs can alter the optimal update, producing dynamic partial adjustment rather than an immediate revision. This is the distinction we need: specifying the posterior we ought to reach does not tell us how a physical learner gets there, or what the journey costs. We take the next step by giving beliefs a kinetic term, representing their resistance to change as inertia.
For a brain, this cost has a concrete physical basis. Brains are made of matter, and changing their state takes energy. Fast changes in neural activity involve ion flows across cell membranes, and restoring the ion gradients costs ATP ([7 ] ). Slower changes in synaptic strength can involve protein synthesis and physical remodeling of dendritic spines, supported by local metabolic resources ([67 ] ). Inference and learning take place through these physical processes. Why should the beliefs they implement be free to move?
To quantify this motion, let q X ( t ) q_{\mathcal{X}}(t) q X ( t ) represent the learner’s current belief. How much information separates it from the belief a short time h h h later? Hobson [35 ] asked how to measure the information in a message that changes probabilities from P P P to Q Q Q . He made a list of intuitive requirements: the measure should be continuous, independent of how outcomes are labeled, zero when nothing changes, and larger when a message rules out more equally likely possibilities. It should also obey a composition rule: describing an outcome in stages should give the same information as describing it all at once. For finite outcome spaces, these requirements uniquely select D K L ( Q ∥ P ) D_{\mathrm{KL}}(Q\mathbin{\|}P) D KL ( Q ∥ P ) , up to a positive constant. Its continuous counterpart retains coordinate invariance because the density Jacobians cancel in the ratio.
Following Hobson, [35 ] , we measure the information in a local belief change by:
I t ( h ) : = D K L ( q λ ( t + h ) ∥ q λ ( t ) ) . (42) \mathcal{I}_t(h) := D_{\mathrm{KL}}\left(q_{\lambda(t+h)} \,\middle\|\, q_{\lambda(t)}\right). \tag*{(42)} I t ( h ) := D KL ( q λ ( t + h ) q λ ( t ) ) . (42)
For a regular, smooth family with common support, the KL divergence and its first derivative vanish when the two distributions coincide. Its leading contribution is therefore quadratic, with the Fisher information as its Hessian [6 , 5 ] :
D K L ( q λ + Δ λ ∥ q λ ) = 1 2 Δ λ T G ( λ ) Δ λ + o ( ∥ Δ λ ∥ 2 ) , (43) D_{\mathrm{KL}}(q_{\lambda+\Delta\lambda} \,\|\, q_\lambda) = \frac{1}{2}\Delta\lambda^{\mathsf{T}}G(\lambda)\Delta\lambda+ o\left(\lVert\Delta\lambda\rVert^2\right), \tag*{(43)} D KL ( q λ + Δ λ ∥ q λ ) = 2 1 Δ λ T G ( λ ) Δ λ + o ( ∥ Δ λ ∥ 2 ) , (43)
G ( λ ) = E q λ [ ( ∇ λ log q λ ) ( ∇ λ log q λ ) T ] . G(\lambda) = \mathbb{E}_{q_\lambda}\left[(\nabla_\lambda\log q_\lambda)(\nabla_\lambda\log q_\lambda)^{\mathsf{T}}\right]. G ( λ ) = E q λ [ ( ∇ λ log q λ ) ( ∇ λ log q λ ) T ] .
Along a smooth trajectory, Δ λ = h λ ˙ + O ( h 2 ) \Delta\lambda= h\dot{\lambda} + O(h^2) Δ λ = h λ ˙ + O ( h 2 ) . Dividing the local information gain by h 2 h^2 h 2 and taking the limit gives what we call the kinetic energy of beliefs :
T b e l i e f ( λ , λ ˙ ) : = lim h → 0 I t ( h ) h 2 = 1 2 d 2 I t ( h ) d h 2 ∣ h = 0 = 1 2 λ ˙ T G ( λ ) λ ˙ . (44) \begin{aligned}
T_{\mathrm{belief}}(\lambda,\dot{\lambda}) &:= \lim_{h\to0}\frac{\mathcal{I}_t(h)}{h^2}\\
&= \frac{1}{2}\left.\frac{d^2\mathcal{I}_t(h)}{dh^2}\right|_{h=0}
= \frac{1}{2}\dot{\lambda}^{\mathsf{T}}G(\lambda)\dot{\lambda}. \tag*{(44)}
\end{aligned} T belief ( λ , λ ˙ ) := h → 0 lim h 2 I t ( h ) = 2 1 d h 2 d 2 I t ( h ) h = 0 = 2 1 λ ˙ T G ( λ ) λ ˙ . (44)
The two arguments yield the same quadratic form (eqs. (41) and (44) ). From the geometry argument, we derived a squared speed, and information processing supplied the Fisher metric that measures it. This speed tracks changes in the distribution itself, so it is invariant to rescaling the parameters. Doubling it quadruples T b e l i e f T_{\mathrm{belief}} T belief , just as doubling a classical particle’s speed quadruples T c l a s s i c a l T_{\mathrm{classical}} T classical .
At this stage, T b e l i e f T_{\mathrm{belief}} T belief has units of information per time squared. Multiplying by m m m gives the kinetic term T = m T b e l i e f T = mT_{\mathrm{belief}} T = m T belief in eq. (41) , with m G ( λ ) mG(\lambda) m G ( λ ) acting as a position-dependent mass matrix. We interpret m m m as setting the price of belief motion relative to reducing the loss. For a biological learner, this suggests a metabolic interpretation: moving beliefs faster requires more physical resources. Whether the brain’s ATP expenditure follows this precise quadratic form, and whether it shares the Fisher metric’s directional dependence, are open questions. We adopt this as a speculative interpretation of the kinetic term. The geometric derivation (eq. (41) ) stands on its own.
Before we move on, we briefly mention a direct connection to recent stochastic thermodynamics. Auconi & Ito [8 ] study the intrinsic speed of an evolving distribution, whose square is the temporal Fisher information, v i n f o 2 = E q t [ ( ∂ t log q t ) 2 ] = 2 T b e l i e f v_{\mathrm{info}}^2 = \mathbb{E}_{q_t}\left[(\partial_t \log q_t)^2\right] = 2T_{\mathrm{belief}} v info 2 = E q t [ ( ∂ t log q t ) 2 ] = 2 T belief . For Markov jump and Fokker–Planck dynamics near a steady state, they relate 2 v i n f o 2 2v_{\mathrm{info}}^2 2 v info 2 to the second time derivative of the KL divergence toward that state, and use their difference to bound steady-state entropy production. Thus, the same geometric measure of motion appears in physical constraints on dissipation.
Finally, this construction (eqs. (41) and (44) ) applies to both sides of FOND: inference uses the Fisher metric of the variational posterior, G u G_u G u , while learning uses that of the generative joint distribution, G θ G_\theta G θ . With the kinetic term chosen, we can now turn to the remaining ingredient: dissipation.
Dissipative equations of motion for beliefs. We now have both parts of the Lagrangian, L = T − V L = T - V L = T − V . Below, we will address the last missing piece: dissipation force Q Q Q .
But first, we make the Lagrangian and the canonical momentum explicit. Let g i j g_{ij} g ij denote the entries of G ( λ ) G(\lambda) G ( λ ) and g i j g^{ij} g ij those of its inverse, with repeated indices summed. During each inference or learning phase, we hold the other parameter block fixed and take V V V and G G G to have no explicit time dependence. The Lagrangian and canonical momentum are then:
L ( λ , λ ˙ ) = m 2 g i j ( λ ) λ ˙ i λ ˙ j − V ( λ ) , L(\lambda,\dot{\lambda}) = \frac{m}{2}g_{ij}(\lambda)\dot{\lambda}^{i}\dot{\lambda}^{j} - V(\lambda), L ( λ , λ ˙ ) = 2 m g ij ( λ ) λ ˙ i λ ˙ j − V ( λ ) ,
p i : = ∂ L ∂ λ ˙ i = m g i j ( λ ) λ ˙ j , λ ˙ i = 1 m g i j ( λ ) p j . (45) p_i := \frac{\partial L}{\partial\dot{\lambda}^{i}} = m g_{ij}(\lambda)\dot{\lambda}^{j}, \qquad\dot{\lambda}^{i} = \frac{1}{m}g^{ij}(\lambda)p_j. \tag*{(45)} p i := ∂ λ ˙ i ∂ L = m g ij ( λ ) λ ˙ j , λ ˙ i = m 1 g ij ( λ ) p j . (45)
For dissipation, a reasonable standard choice is linear damping proportional to canonical momentum, Q i : = − p i / τ d a m p Q_i := -p_i/\tau_{\mathrm{damp}} Q i := − p i / τ damp , where τ d a m p > 0 \tau_{\mathrm{damp}} > 0 τ damp > 0 is a constant damping time. This is *isotropic with respect to the belief-space metric : every direction has the same damping rate when measured in that geometry. It introduces no preferred direction beyond the metric we already chose. Other dissipation laws are possible, but we use this one as a simple, covariant starting point.
This force follows from the quadratic Rayleigh dissipation function:
R ( λ , λ ˙ ) = T τ d a m p = m 2 τ d a m p λ ˙ T G ( λ ) λ ˙ , (46) \mathcal{R}(\lambda,\dot{\lambda}) = \frac{T}{\tau_{\mathrm{damp}}} = \frac{m}{2\tau_{\mathrm{damp}}}\dot{\lambda}^{\mathsf{T}}G(\lambda)\dot{\lambda}, \tag*{(46)} R ( λ , λ ˙ ) = τ damp T = 2 τ damp m λ ˙ T G ( λ ) λ ˙ , (46)
Q i = − ∂ R ∂ λ ˙ i = − p i τ d a m p . Q_i = -\frac{\partial\mathcal{R}}{\partial\dot{\lambda}^i} = -\frac{p_i}{\tau_{\mathrm{damp}}}. Q i = − ∂ λ ˙ i ∂ R = − τ damp p i .
It removes energy at a rate d ( T + V ) / d t = − 2 T / τ d a m p ≤ 0 d(T+V)/dt=-2T/\tau_{\mathrm{damp}}\le0 d ( T + V ) / d t = − 2 T / τ damp ≤ 0 . Thus, the learner can lose momentum and settle, rather than oscillating or orbiting indefinitely under conservative forces.
Substituting L L L and Q i Q_i Q i into the generalized Euler–Lagrange equation (eq. (40) ) gives:
d p i d t − m 2 ∂ i g j k λ ˙ j λ ˙ k + ∂ i V = − p i τ d a m p , (47) \frac{dp_i}{dt}-\frac{m}{2}\partial_i g_{jk}\dot{\lambda}^j\dot{\lambda}^k+\partial_iV=-\frac{p_i}{\tau_{\mathrm{damp}}}, \tag*{(47)} d t d p i − 2 m ∂ i g j k λ ˙ j λ ˙ k + ∂ i V = − τ damp p i , (47)
where ∂ i : = ∂ / ∂ λ i \partial_i:=\partial/\partial\lambda^i ∂ i := ∂ / ∂ λ i . Using λ ˙ i = g i j p j / m \dot{\lambda}^i=g^{ij}p_j/m λ ˙ i = g ij p j / m and the inverse-metric identity ∂ i g j k = − g j a ( ∂ i g a b ) g b k \partial_i g^{jk}=-g^{ja}(\partial_i g_{ab})g^{bk} ∂ i g j k = − g j a ( ∂ i g ab ) g bk , we obtain the full, dissipative equations of motion:
d p i d t + 1 2 m ∂ i g j k p j p k + p i τ d a m p = − ∂ i V . (48) \frac{dp_i}{dt}+\frac{1}{2m}\partial_i g^{jk}p_jp_k+\frac{p_i}{\tau_{\mathrm{damp}}}=-\partial_iV. \tag*{(48)} d t d p i + 2 m 1 ∂ i g j k p j p k + τ damp p i = − ∂ i V . (48)
The geometric corrections arise because the metric changes as the learner moves. They are needed for the inertial dynamics to transform consistently between coordinate systems (i.e., to remain covariant). Equivalently, writing the equations in terms of velocity gives:
m ( λ ¨ i + Γ j k i λ ˙ j λ ˙ k ) + m τ d a m p λ ˙ i = − g i j ∂ j V , (49) m\left(\ddot{\lambda}^i+\Gamma^i_{jk}\dot{\lambda}^j\dot{\lambda}^k\right)+\frac{m}{\tau_{\mathrm{damp}}}\dot{\lambda}^i=-g^{ij}\partial_jV, \tag*{(49)} m ( λ ¨ i + Γ j k i λ ˙ j λ ˙ k ) + τ damp m λ ˙ i = − g ij ∂ j V , (49)
where Γ j k i = 1 2 g i ℓ ( ∂ j g ℓ k + ∂ k g ℓ j − ∂ ℓ g j k ) \Gamma^i_{jk}=\frac{1}{2}g^{i\ell}(\partial_jg_{\ell k}+\partial_kg_{\ell j}-\partial_\ell g_{jk}) Γ j k i = 2 1 g i ℓ ( ∂ j g ℓ k + ∂ k g ℓ j − ∂ ℓ g j k ) are the Christoffel symbols of the metric. The acceleration and geometric correction together describe acceleration on the statistical manifold.
The overdamped (massless) limit. To recover first-order adaptation dynamics, we assume that momentum relaxes much faster than beliefs change. We make this precise by taking:
m → 0 , τ d a m p → 0 , m τ d a m p → ζ ∈ ( 0 , ∞ ) . (50) m\to0,\qquad\tau_{\mathrm{damp}}\to0,\qquad\frac{m}{\tau_{\mathrm{damp}}}\to\zeta\in(0,\infty). \tag*{(50)} m → 0 , τ damp → 0 , τ damp m → ζ ∈ ( 0 , ∞ ) . (50)
The last condition matters: inertia vanishes while friction remains finite. Heuristically, we can think of this as a “massless” learner. Imagine pushing a feather through thick honey. Its motion responds almost immediately to the balance between your push and the viscous drag, with very little coasting from its own momentum. The same intuition applies here: beliefs keep moving under the task force, but retain negligible momentum on the timescale of adaptation.
Consider the slower dynamics after the initial rapid relaxation of momentum, in a smooth region where the metric is nonsingular and the velocity, acceleration, and metric derivatives remain bounded as m m m decreases. Then p i = O ( m ) p_i=O(m) p i = O ( m ) , so both d p i / d t dp_i/dt d p i / d t and the geometric correction in eq. (48) are O ( m ) O(m) O ( m ) . The damping term, however, approaches ζ g i j λ ˙ j \zeta g_{ij}\dot{\lambda}^j ζ g ij λ ˙ j and remains finite. The surviving force balance is:
ζ G ( λ ) λ ˙ = − ∇ λ V ( λ ) . (51) \zeta G(\lambda)\dot{\lambda}=-\nabla_\lambda V(\lambda). \tag*{(51)} ζ G ( λ ) λ ˙ = − ∇ λ V ( λ ) . (51)
Natural-gradient dynamics and FOND’s dual flows. Solving this balance for velocity gives:
λ ˙ = − 1 ζ G ( λ ) − 1 ∇ λ V ( λ ) . (52) \dot{\lambda}=-\frac{1}{\zeta}G(\lambda)^{-1}\nabla_\lambda V(\lambda). \tag*{(52)} λ ˙ = − ζ 1 G ( λ ) − 1 ∇ λ V ( λ ) . (52)
This is natural-gradient flow. The inverse metric appears because friction converts force into velocity through the geometry of belief space. The geometric corrections have vanished with inertia, but the geometry itself remains. Setting V = F V = \mathcal{F} V = F and applying this result separately to inference and learning gives the two FOND natural-gradient flows:
u ˙ = − 1 ζ u G u ( u ) − 1 ∇ u F ( u , θ ) , θ ˙ = − 1 ζ θ G θ ( θ ) − 1 ∇ θ F ( u , θ ) . (53) \begin{aligned}
\dot{u} &= -\frac{1}{\zeta_u}\mathbf{G}_u(\mathbf{u})^{-1}\nabla_u\mathcal{F}(\mathbf{u},\boldsymbol{\theta}),\\
\dot{\boldsymbol{\theta}} &= -\frac{1}{\zeta_{\theta}}\mathbf{G}_{\theta}(\boldsymbol{\theta})^{-1}\nabla_{\theta}\mathcal{F}(\mathbf{u},\boldsymbol{\theta}). \tag*{(53)}
\end{aligned} u ˙ θ ˙ = − ζ u 1 G u ( u ) − 1 ∇ u F ( u , θ ) , = − ζ θ 1 G θ ( θ ) − 1 ∇ θ F ( u , θ ) . (53)
Here, ζ u , ζ θ > 0 \zeta_u, \zeta_{\theta} > 0 ζ u , ζ θ > 0 set the pace of the respective processes and can be absorbed into their inference and learning timescales. Each flow uses its own Fisher metric, with the other parameter block held fixed.
Deriving the Bayesian learning rule (BLR, Khan & Rue [44 ] ). An Euler discretization of eq. (52) , with η : = Δ t / ζ \eta:= \Delta t/\zeta η := Δ t / ζ , gives the familiar update:
λ k + 1 = λ k − η G ( λ k ) − 1 ∇ λ V ( λ k ) . (54) \boldsymbol{\lambda}_{k+1} = \boldsymbol{\lambda}_k - \eta\,\mathbf{G}(\boldsymbol{\lambda}_k)^{-1}\nabla_{\lambda}V(\boldsymbol{\lambda}_k). \tag*{(54)} λ k + 1 = λ k − η G ( λ k ) − 1 ∇ λ V ( λ k ) . (54)
This is just natural gradient descent, and replacing the gradient by a minibatch estimate gives its stochastic version.
For exponential-family variational beliefs, writing eq. (54) in natural parameters and setting V = F V = \mathcal{F} V = F recovers the Bayesian learning rule (BLR) of Khan & Rue [44 ] . By varying the candidate distributions and the approximations to their natural gradients, BLR unified learning rules ranging from SGD and Newton’s method to Kalman filtering. Here, we have derived the BLR from the physics of adaptation: it emerges as the overdamped limit of covariant belief dynamics.
Table 1 summarizes how the same update gives familiar learning rules under different choices of metric and loss.
Table 1. Special cases of eq. (54) under different choices of metric G and loss V V V . The BLR row uses exponential-family variational beliefs in natural parameters.
Summary. Let us take stock of what we have done. We started from a physics-centered view of “dynamics is everything,” and demonstrated how dynamics can be derived from applying the principle of stationary action plus dissipation. We then identified the loss as a potential, required adaptation to be independent of arbitrary coordinates (principle of general covariance), and used local information gain to construct the kinetic energy of beliefs. A standard choice of friction then gave us the full dissipative equations of motion, including inertia and geometric corrections. Natural-gradient inference and learning followed in the overdamped (massless) limit, where that inertia is negligible.
Physics of adaptation as a broad framework for deriving inference and learning dynamics. We could have motivated the same practical update through a KL trust region (section A.4), or appealed directly to Amari’s natural gradient ([4 ] ). Those arguments are enough to justify the rule. We hope this route also reveals the richer framework underneath it: beliefs moving through a statistical manifold, driven by a task and constrained by the physical cost of adaptation. Future work should consider deriving other dynamics within that same framework by keeping inertia, changing the dissipation law, or considering more generalized belief states with different, perhaps adaptive, geometries that evolve in time in response to experience.
Extended FOND model and dynamics
Model and objective
Bernoulli instantiation of FOND. Recovering a feature dictionary requires two coupled operations: infer which features explain each observation, and use those explanations to improve the dictionary. FOND derives the first operation as recurrent natural-gradient descent on variational free energy (Vafaii et al. [74 ] ). Its original Poisson instantiation learns the decoder by backpropagating through the inference trajectory. Here we extend the natural-gradient prescription to learning itself. Inference changes the approximate posterior q u q_{\mathbf{u}} q u , and learning changes the generative distribution p θ p_{\boldsymbol{\theta}} p θ . The two natural-gradient flows use their respective Fisher metrics to measure local changes in these distributions (Amari [4 ] ; Martens [55 ] ). Section A.4 develops this geometric motivation.
Bernoulli features and a Gaussian decoder. In BeFOND, each latent indicates whether a feature is present, and its decoder atom specifies that feature’s contribution to the observation. The posterior mean r \mathbf{r} r therefore expresses confidence in feature presence. For K K K binary latents and an M M M -dimensional observation, the local inference model is
p ( z ) = ∏ i = 1 K Bernoulli ( z i ; π r e f , i ) , q u ( z ∣ x ) = ∏ i = 1 K Bernoulli ( z i ; r i ) , r = σ ( u ) , p ( x ∣ z ) = N ( x ; Φ z , Σ ) , (55) \begin{aligned}
p(\mathbf{z}) &= \prod_{i=1}^{K} \operatorname{Bernoulli}(z_i;\pi_{\mathrm{ref},i}), \qquad q_{\mathbf{u}}(\mathbf{z}\mid\mathbf{x}) = \prod_{i=1}^{K} \operatorname{Bernoulli}(z_i;r_i),\\
\mathbf{r} &= \sigma(\mathbf{u}), \qquad p(\mathbf{x}\mid\mathbf{z}) = \mathcal{N}(\mathbf{x};\boldsymbol{\Phi}\mathbf{z},\boldsymbol{\Sigma}), \tag*{(55)}
\end{aligned} p ( z ) r = i = 1 ∏ K Bernoulli ( z i ; π ref , i ) , q u ( z ∣ x ) = i = 1 ∏ K Bernoulli ( z i ; r i ) , = σ ( u ) , p ( x ∣ z ) = N ( x ; Φ z , Σ ) , (55)
where Σ \boldsymbol{\Sigma} Σ is diagonal and positive. Equivalently, x = Φ z + ϵ \mathbf{x}=\boldsymbol{\Phi}\mathbf{z}+\boldsymbol{\epsilon} x = Φ z + ϵ with ϵ ∼ N ( 0 , Σ ) \boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\boldsymbol{\Sigma}) ϵ ∼ N ( 0 , Σ ) : the noise describes variation not explained by the selected atoms, while the atom itself sets the amplitude and direction of a present feature. The learned initial prior π 0 \boldsymbol{\pi}_0 π 0 supplies the first reference, and the rolling rule in section B.1.1 updates that reference as inference proceeds. A learned decoder bias accounts for a nonzero observation mean by replacing x \mathbf{x} x with x − b \mathbf{x}-\mathbf{b} x − b . Section B.3 gives its update and inference-response correction.
Conditioning on the observation couples otherwise independent latent features: the likelihood contains cross-terms W i j z i z j W_{ij}z_i z_j W ij z i z j , where W i j = ϕ i T Σ − 1 ϕ j W_{ij}=\boldsymbol{\phi}_i^{\mathsf{T}}\boldsymbol{\Sigma}^{-1}\boldsymbol{\phi}_j W ij = ϕ i T Σ − 1 ϕ j . When atoms overlap, the evidence for one feature depends on which others explain the input. Factorizing q q q restricts the represented posterior dependencies, but each optimized mean can still depend on the other means through the shared reconstruction (section B.2).
The Poisson and Bernoulli choices both admit analytic moments and Fisher metrics (Wainwright & Jordan [76 ] ). In canonical coordinates,
Table 59.
The variance in the last column enters both the expected reconstruction loss and the geometry of inference. This is the connection that allows the distributional assumptions to determine the dynamics.
Free-energy decomposition. Section A.3 derives the fixed-prior ELBO identity. Here we evaluate its two terms for the Bernoulli–Gaussian model, holding the current reference fixed. A distribution over codes assigns probability to several possible reconstructions. Write δ = z − r \boldsymbol{\delta}=\mathbf{z}-\mathbf{r} δ = z − r and e = x − Φ r \mathbf{e}=\mathbf{x}-\boldsymbol{\Phi}\mathbf{r} e = x − Φ r . Since E q [ δ ] = 0 \mathbb{E}_q[\boldsymbol{\delta}]=\mathbf{0} E q [ δ ] = 0 and E q [ δ δ T ] = C \mathbb{E}_q[\boldsymbol{\delta}\boldsymbol{\delta}^{\mathsf{T}}]=\mathbf{C} E q [ δ δ T ] = C , expanding the square gives:
E q [ ∥ x − Φ z ∥ Σ − 1 2 ] = e T Σ − 1 e − 2 e T Σ − 1 Φ E q [ δ ] + E q [ δ T W δ ] = ∥ e ∥ Σ − 1 2 + Tr ( W C ) , (56) \begin{aligned}
\mathbb{E}_q\left[\left\|\mathbf{x}-\boldsymbol{\Phi}\mathbf{z}\right\|_{\boldsymbol{\Sigma}^{-1}}^2\right] = \mathbf{e}^{\mathsf{T}}\boldsymbol{\Sigma}^{-1}\mathbf{e} - 2\mathbf{e}^{\mathsf{T}}\boldsymbol{\Sigma}^{-1}\boldsymbol{\Phi}\mathbb{E}_q[\boldsymbol{\delta}] + \mathbb{E}_q[\boldsymbol{\delta}^{\mathsf{T}}\mathbf{W}\boldsymbol{\delta}] \\
&= \|\mathbf{e}\|_{\boldsymbol{\Sigma}^{-1}}^2+\operatorname{Tr}(\mathbf{W}\mathbf{C}), \tag*{(56)}
\end{aligned} E q [ ∥ x − Φ z ∥ Σ − 1 2 ] = e T Σ − 1 e − 2 e T Σ − 1 Φ E q [ δ ] + E q [ δ T W δ ] = ∥ e ∥ Σ − 1 2 + Tr ( WC ) , (56)
where W = Φ T Σ − 1 Φ \mathbf{W}=\boldsymbol{\Phi}^{\mathsf{T}}\boldsymbol{\Sigma}^{-1}\boldsymbol{\Phi} W = Φ T Σ − 1 Φ and C = diag [ r ⊙ ( 1 − r ) ] \mathbf{C}=\operatorname{diag}[\mathbf{r}\odot(\mathbf{1}-\mathbf{r})] C = diag [ r ⊙ ( 1 − r )] . The cross-term vanishes because the centered code has zero mean. For the KL term, factorization turns the log ratio of products into a sum:
D K L ( q ∥ p ) = ∑ i E q [ z i log r i π r e f , i + ( 1 − z i ) log 1 − r i 1 − π r e f , i ] = ∑ i [ r i log r i π r e f , i + ( 1 − r i ) log 1 − r i 1 − π r e f , i ] . (57) \begin{aligned}
D_{\mathrm{KL}}(q\|p)=\sum_i\mathbb{E}_q\left[z_i\log\frac{r_i}{\pi_{\mathrm{ref},i}}+(1-z_i)\log\frac{1-r_i}{1-\pi_{\mathrm{ref},i}}\right] \\
&=\sum_i\left[r_i\log\frac{r_i}{\pi_{\mathrm{ref},i}}+(1-r_i)\log\frac{1-r_i}{1-\pi_{\mathrm{ref},i}}\right]. \tag*{(57)}
\end{aligned} D KL ( q ∥ p ) = i ∑ E q [ z i log π ref , i r i + ( 1 − z i ) log 1 − π ref , i 1 − r i ] = i ∑ [ r i log π ref , i r i + ( 1 − r i ) log 1 − π ref , i 1 − r i ] . (57)
A decoder that reconstructs x x x from r r r can therefore still have a large expected error if the individual latent configurations produce different observations. Including this uncertainty cost and the KL penalty gives
F = 1 2 ( x − Φ r ) T Σ − 1 ( x − Φ r ) + 1 2 ∑ i W i i r i ( 1 − r i ) + 1 2 log det Σ + β ∑ i [ r i log r i π r e f , i + ( 1 − r i ) log 1 − r i 1 − π r e f , i ] + const , (58) \mathcal{F} = \frac{1}{2}(x-\Phi r)^{\mathsf{T}}\Sigma^{-1}(x-\Phi r) + \frac{1}{2}\sum_i W_{ii}r_i(1-r_i) + \frac{1}{2}\log\det\Sigma
+ \beta\sum_i\left[r_i\log\frac{r_i}{\pi_{\mathrm{ref},i}}+(1-r_i)\log\frac{1-r_i}{1-\pi_{\mathrm{ref},i}}\right] + \text{const}, \tag*{(58)} F = 2 1 ( x − Φ r ) T Σ − 1 ( x − Φ r ) + 2 1 i ∑ W ii r i ( 1 − r i ) + 2 1 log det Σ + β i ∑ [ r i log π ref , i r i + ( 1 − r i ) log 1 − π ref , i 1 − r i ] + const , (58)
with W = Φ T Σ − 1 Φ W=\Phi^{\mathsf{T}}\Sigma^{-1}\Phi W = Φ T Σ − 1 Φ . The log determinant normalizes the Gaussian likelihood, and β \beta β weights departure from the current prior reference. At β = 1 \beta=1 β = 1 and a fixed generative prior, this is the negative evidence lower bound. The Bernoulli uncertainty term also cancels the quadratic self-interaction in each coordinate, leaving reconstruction affine in r i r_i r i when the other means are fixed (section B.4). Overlapping atoms still couple different coordinates, so a factorized posterior does not imply independent inference updates.
The moments needed for inference and learning are available without sampling latent codes:
C = diag [ r ⊙ ( 1 − r ) ] , E = C + r r T , E p = diag [ π r e f ⊙ ( 1 − π r e f ) ] + π r e f π r e f T , V m m = ( x − Φ r ) m 2 + ( Φ C Φ T ) m m . (59) \begin{aligned}
C &= \operatorname{diag}[r\odot(1-r)], \qquad E = C+rr^{\mathsf{T}},\\
E_p &= \operatorname{diag}[\pi_{\mathrm{ref}}\odot(1-\pi_{\mathrm{ref}})]+\pi_{\mathrm{ref}}\pi_{\mathrm{ref}}^{\mathsf{T}}, \qquad
V_{mm}=(x-\Phi r)_m^2+(\Phi C\Phi^{\mathsf{T}})_{mm}. \tag*{(59)}
\end{aligned} C E p = diag [ r ⊙ ( 1 − r )] , E = C + r r T , = diag [ π ref ⊙ ( 1 − π ref )] + π ref π ref T , V mm = ( x − Φ r ) m 2 + ( Φ C Φ T ) mm . (59)
Here E E E and E p E_p E p are the posterior and prior second moments, and V m m V_{mm} V mm is the posterior-expected squared residual in observed dimension m m m .
Bernoulli inference in BeFOND. For our factorized Bernoulli posterior, u u u contains logits and r i = σ ( u i ) r_i=\sigma(u_i) r i = σ ( u i ) . The score is z − r z-r z − r , so
G u = diag ( r ⊙ ( 1 − r ) ) , Δ u T G u Δ u = ∑ i r i ( 1 − r i ) ( Δ u i ) 2 . (60) G_u=\operatorname{diag}(r\odot(1-r)), \qquad\Delta u^{\mathsf{T}}G_u\Delta u=\sum_i r_i(1-r_i)(\Delta u_i)^2. \tag*{(60)} G u = diag ( r ⊙ ( 1 − r )) , Δ u T G u Δ u = i ∑ r i ( 1 − r i ) ( Δ u i ) 2 . (60)
For a fixed small logit displacement, the distribution changes less when a Bernoulli probability is near zero or one. In probability coordinates, the same infinitesimal length is ∑ i ( d r i ) 2 / [ r i ( 1 − r i ) ] \sum_i (dr_i)^2/[r_i(1-r_i)] ∑ i ( d r i ) 2 / [ r i ( 1 − r i )] : a fixed probability displacement is more costly near the boundary. For finite logits, all these variances are positive. Applying the inverse Fisher cancels the variance factor in the Euclidean logit gradient, yielding the inference dynamics derived in section B.2. The update therefore accounts for how much a parameter movement changes the inferred beliefs.
Natural-gradient inference and learning. For Bernoulli logits, the Fisher is G u = C G_u=C G u = C . The same factor r i ( 1 − r i ) r_i(1-r_i) r i ( 1 − r i ) multiplies the ordinary logit gradient, so applying G u − 1 G_u^{-1} G u − 1 removes this attenuation from the inference drive. The remaining terms combine evidence from the input, recurrent interactions through the dictionary, and relaxation toward the reference. Section B.2 derives these terms and their cancellation explicitly.
Learning then holds the inferred moments fixed. The decoder gradient compares the observed input–latent moment ⟨ x r T ⟩ \langle xr^{\mathsf{T}}\rangle ⟨ x r T ⟩ with the model prediction Φ E \Phi E Φ E . Its Fisher uses the prior second moment, G Φ = E p ⊗ Σ − 1 G_{\Phi}=E_p\otimes\Sigma^{-1} G Φ = E p ⊗ Σ − 1 , giving a correction by E p − 1 E_p^{-1} E p − 1 rather than the posterior's diagonal Fisher. This correction is what can compensate for weak learning signals in rarely active directions. Exact compensation requires matching the minibatch-averaged second moments (section C.4). The covariance update tracks expected squared residuals, while the learned initial prior tracks detached posterior means across inputs. These decoder, covariance, and initial-prior updates use the inferred statistics directly, without backpropagating through the inference trajectory. Their explicit flows and derivations appear in sections B.2 and B.2.1. The decoder evolves in learning time τ \tau τ over an interval Δ t \Delta t Δ t , and h h h denotes the separate inference integration interval.
Online prior and working memory
Consider observing a scene whose underlying features persist. After the first observation, the inferred distribution contains information about that particular scene that the population prior did not contain. The next update should start from this informed belief. FOND’s rolling rule makes it the new prior reference ((Vafai et al., 2025)): the KL penalty now measures departure from the current prediction, while the likelihood supplies evidence for revising it. The learned initial prior starts the sequence, and the rolling reference carries its evolving, input-specific belief forward. Figure 5 shows this predict–update sequence and its fixed-input specialization. Section B.5 derives its activation threshold, and section C.3.3 reports the rolling-prior experiments varying β \beta β and the initial-prior cap.
Figure 5. Online inference with a rolling prior. The learned initial prior initializes the first belief. Under identity state dynamics, prediction carries each posterior into the next reference (green arrows). The observation model is shown by black arrows and inference by red dashed arrows. The fixed-input case presents the same observation at each step.
Prior prediction. Let q t q_t q t be the inferred distribution after observation x t x_t x t . To form the next reference, a state-transition model predicts which latent configurations remain plausible. For a transition kernel K ( z ′ ∣ z ) \mathcal{K}(z' \mid z) K ( z ′ ∣ z ) , prediction averages over the preceding belief (Särkkä & Svensson, [70 ] , Chapter 6):
p r e f , t ( z ′ ) = ∑ z K ( z ′ ∣ z ) q t − 1 ( z ) . (61) p_{\mathrm{ref},t}(z') = \sum_z \mathcal{K}(z' \mid z)q_{t-1}(z). \tag*{(61)} p ref , t ( z ′ ) = z ∑ K ( z ′ ∣ z ) q t − 1 ( z ) . (61)
If the latent state persists without process noise, then K ( z ′ ∣ z ) = 1 [ z ′ = z ] \mathcal{K}(z' \mid z) = 1[z' = z] K ( z ′ ∣ z ) = 1 [ z ′ = z ] , so prediction simply copies the belief:
p r e f , 0 = p 0 , p r e f , t = q t − 1 ( t ≥ 1 ) , p 0 ( z ) = ∏ i Bernoulli ( z i ; π 0 , i ) . (62) p_{\mathrm{ref},0} = p_0,\qquad p_{\mathrm{ref},t} = q_{t-1}\quad(t \ge1),\qquad p_0(z) = \prod_i \operatorname{Bernoulli}(z_i; \pi_{0,i}). \tag*{(62)} p ref , 0 = p 0 , p ref , t = q t − 1 ( t ≥ 1 ) , p 0 ( z ) = i ∏ Bernoulli ( z i ; π 0 , i ) . (62)
The identity transition means that the causes persist, not that we know which causes are present. Copying q t − 1 q_{t-1} q t − 1 therefore retains both its feature preferences and its uncertainty. With no new likelihood contribution, the belief is preserved unchanged. This is the working memory supplied by the rolling reference. A new independent input starts again from the learned initial prior.
Posterior update. The observation can support the prediction or require it to change. Expected reconstruction error rewards explanations of the current input, while the KL penalty controls departure from the prediction. For a Bernoulli reference with means π r e f , t \pi_{\mathrm{ref},t} π ref , t and logits u r e f , t = logit ( π r e f , t ) u_{\mathrm{ref},t} = \operatorname{logit}(\pi_{\mathrm{ref},t}) u ref , t = logit ( π ref , t ) , the local objective is
F t ( u ) = − E q u log p θ ( x t ∣ z ) + β D K L ( q u ∥ p r e f , t ) , r = σ ( u ) . (63) \mathcal{F}_t(\mathbf{u}) = -\mathbb{E}_{q_{\mathbf{u}}}\log p_\theta(x_t \mid z) + \beta D_{\mathrm{KL}}(q_{\mathbf{u}} \mathbin\Vert p_{\mathrm{ref},t}),\qquad\mathbf{r} = \sigma(\mathbf{u}). \tag*{(63)} F t ( u ) = − E q u log p θ ( x t ∣ z ) + β D KL ( q u ∥ p ref , t ) , r = σ ( u ) . (63)
The decoder and reference remain fixed during this local update. At β = 1 \beta= 1 β = 1 , minimizing over unrestricted distributions gives the Bayesian posterior for the reference and observation. For general β > 0 \beta> 0 β > 0 , it gives a distribution proportional to p r e f , t ( z ) p θ ( x t ∣ z ) 1 / β p_{\mathrm{ref},t}(z)p_\theta(x_t \mid z)^{1/\beta} p ref , t ( z ) p θ ( x t ∣ z ) 1/ β (Bissiri et al., [12 ] ). The factorized Bernoulli family gives tractable expectations and local updates while retaining marginal uncertainty and approximating posterior dependencies.
Recurrent belief revision. Write the negative mean-coordinate reconstruction gradient as a t ( r ) a_t(r) a t ( r ) . Including the Bernoulli uncertainty term, its i i i th coordinate is
[ a t ( r ) ] i = ( ϕ ( i ) ) ⊤ Σ − 1 x t − 1 2 W i i − ∑ j ≠ i W i j r j . (64) [a_t(r)]_i = (\boldsymbol{\phi}^{(i)})^\top\boldsymbol{\Sigma}^{-1}x_t - \frac{1}{2}W_{ii} - \sum_{j\ne i}W_{ij}r_j. \tag*{(64)} [ a t ( r ) ] i = ( ϕ ( i ) ) ⊤ Σ − 1 x t − 2 1 W ii − j = i ∑ W ij r j . (64)
The first term supplies evidence for feature i i i , while the last adjusts it for other active explanations. When W i j > 0 W_{ij}>0 W ij > 0 , increasing belief in feature j j j reduces the drive for i i i . Repeated updates thus let explanations revise one another even though q q q is factorized.
Applying the posterior Fisher inverse gives:
u ˙ = a t ( r ) − β ( u − u r e f , t ) . (65) \dot{u}=a_t(r)-\beta(u-u_{\mathrm{ref},t}). \tag*{(65)} u ˙ = a t ( r ) − β ( u − u ref , t ) . (65)
Initialize at the predictive logits. The KL force is initially zero, so evidence can change the belief before the fixed reference exerts a restoring force. One ETD1 step with interval h h h integrates this relaxation while freezing the reconstruction drive (section B.6):
u t = u r e f , t + 1 − e − β h β a t ( π r e f , t ) , β > 0. (66) u_t=u_{\mathrm{ref},t}+\frac{1-e^{-\beta h}}{\beta}a_t(\boldsymbol{\pi}_{\mathrm{ref},t}),\qquad\beta>0. \tag*{(66)} u t = u ref , t + β 1 − e − β h a t ( π ref , t ) , β > 0. (66)
The resulting posterior becomes the reference for the next outer step. The next update therefore retains the inferred changes instead of pulling them back toward the original population prior. If several inner steps are taken, their reference stays fixed and the restoring force generally becomes nonzero. The parameter β \beta β controls resistance to local belief change, and h h h controls how far the local flow is integrated.
Evidence accumulation and sparsity. Rolling also changes the influence of the initial prior as a sequence proceeds. To see this, suppose the initial prior and likelihood are positive and each local objective is minimized exactly over unrestricted distributions. Repeated substitution of the posterior for the next reference gives
q t ( z ) ∝ p 0 ( z ) ∏ j = 0 t p θ ( x j ∣ z ) 1 / β . (67) q_t(z)\propto p_0(z)\prod_{j=0}^{t}p_\theta(x_j\mid z)^{1/\beta}. \tag*{(67)} q t ( z ) ∝ p 0 ( z ) j = 0 ∏ t p θ ( x j ∣ z ) 1/ β . (67)
Each observation contributes a likelihood factor, while the initial prior enters once. For a fixed repeated input, the likelihood power is ( t + 1 ) / β (t+1)/\beta ( t + 1 ) / β : the initial prior becomes weaker relative to reconstruction evidence. Replaying one stored observation supplies no new measurement, so this computation is not ordinary conditioning on one observation. Finite mean-field ETD1 steps approximate the local updates and need not attain this unrestricted endpoint.
This explains why a sparse initial prior need not enforce the same sparsity throughout a rollout. Its low probabilities set a high initial activation threshold, but the rolling reference can retain increases supported by reconstruction evidence. A cap on mean initial-prior activity therefore constrains the starting belief, not final posterior activity.
Natural-gradient dynamics
For the free energy in Section B.1, inference changes the posterior while holding the model fixed. Learning then changes the model with the inferred statistics fixed:
u ˙ = Φ ⊤ Σ − 1 x − W r − 1 2 diag ( W ) ⊙ ( 1 − 2 r ) − β ( u − u r e f ) , (68) \dot{u}=\boldsymbol{\Phi}^{\top}\boldsymbol{\Sigma}^{-1}x-\mathbf{W}r-\frac{1}{2}\operatorname{diag}(\mathbf{W})\odot(1-2r)-\beta(u-u_{\mathrm{ref}}), \tag*{(68)} u ˙ = Φ ⊤ Σ − 1 x − W r − 2 1 diag ( W ) ⊙ ( 1 − 2 r ) − β ( u − u ref ) , (68)
Φ ˙ = η Φ ( x r ⊤ − Φ E ) E p − 1 , (69) \dot{\boldsymbol{\Phi}}=\eta_{\Phi}(x r^{\top}-\boldsymbol{\Phi}\mathbf{E})\mathbf{E}_{p}^{-1}, \tag*{(69)} Φ ˙ = η Φ ( x r ⊤ − Φ E ) E p − 1 , (69)
Σ ˙ = η Σ ( V − Σ ) , (70) \dot{\boldsymbol{\Sigma}}=\eta_{\Sigma}(\mathbf{V}-\boldsymbol{\Sigma}), \tag*{(70)} Σ ˙ = η Σ ( V − Σ ) , (70)
π ˙ 0 = η 0 β ( r − π 0 ) . (71) \dot{\boldsymbol{\pi}}_0=\eta_0\beta(r-\boldsymbol{\pi}_0). \tag*{(71)} π ˙ 0 = η 0 β ( r − π 0 ) . (71)
Here u r e f = logit ( π r e f ) u_{\mathrm{ref}}=\operatorname{logit}(\boldsymbol{\pi}_{\mathrm{ref}}) u ref = logit ( π ref ) . The initial prior π 0 \boldsymbol{\pi}_0 π 0 tracks detached posterior means, and the rolling reference is refreshed within inference (section B.1.1). For minibatches, average x r ⊤ xr^{\top} x r ⊤ , E \mathbf{E} E , E p \mathbf{E}_p E p , and V \mathbf{V} V before applying the updates. Derivations appear in Section B.2.1.
Fisher preconditioning for inference. For the Bernoulli posterior, ∂ log q / ∂ u i = z i − r i \partial\log q/\partial u_i = z_i-r_i ∂ log q / ∂ u i = z i − r i . Independence under q q q gives
G u = E q [ ( z − r ) ( z − r ) ⊤ ] = C , (72) G_u=\mathbb{E}_q[(z-r)(z-r)^\top]=C, \tag*{(72)} G u = E q [( z − r ) ( z − r ) ⊤ ] = C , (72)
∇ u F = C [ W r − Φ ⊤ Σ − 1 x + 1 2 diag ( W ) ⊙ ( 1 − 2 r ) ] \nabla_u F=C\left[Wr-\Phi^\top\Sigma^{-1}x+\frac{1}{2}\operatorname{diag}(W)\odot(1-2r)\right] ∇ u F = C [ W r − Φ ⊤ Σ − 1 x + 2 1 diag ( W ) ⊙ ( 1 − 2 r ) ]
+ C β ( u − u r e f ) . (73) \quad+C\beta(u-u_{\mathrm{ref}}). \tag*{(73)} + C β ( u − u ref ) . (73)
Multiplication by − G u − 1 -G_u^{-1} − G u − 1 cancels C C C and yields eq. (68) whenever 0 < r i < 1 0<r_i<1 0 < r i < 1 . Ordinary logit-gradient descent instead multiplies the same drive by r i ( 1 − r i ) r_i(1-r_i) r i ( 1 − r i ) , making it small near either boundary. The natural flow removes this factor from the logit update, while the probability still changes according to r ˙ = C u ˙ \dot r=C\dot u r ˙ = C u ˙ . This distinction matters when interpreting the revival of a nearly inactive latent.
Decoder Fisher information. Let ⟨ ⋅ ⟩ \langle\cdot\rangle ⟨ ⋅ ⟩ denote the minibatch average. The Gaussian decoder score is Σ − 1 ( x − Φ z ) z ⊤ \Sigma^{-1}(x-\Phi z)z^\top Σ − 1 ( x − Φ z ) z ⊤ . Averaging its outer product over the complete-data model, with the chosen prior references held fixed, gives
G Φ = E p ⊗ Σ − 1 , ∇ Φ F = Σ − 1 ( Φ E − ⟨ x r ⊤ ⟩ ) , (74) G_\Phi=E_p\otimes\Sigma^{-1},\qquad\nabla_\Phi F=\Sigma^{-1}\left(\Phi E-\langle xr^\top\rangle\right), \tag*{(74)} G Φ = E p ⊗ Σ − 1 , ∇ Φ F = Σ − 1 ( Φ E − ⟨ x r ⊤ ⟩ ) , (74)
where both second moments are averaged across the minibatch before the Fisher action. Vectorization of decoder entries is implicit. The resulting matrix-form flow is eq. (69) , with x r ⊤ xr^\top x r ⊤ replaced by its minibatch average. This is the complete-data model Fisher, rather than the observed-data Fisher or an outer product of empirical loss gradients [4 , 55 ] .
The distinction between E p E_p E p and E E E is essential: the former supplies the metric, and the latter the curvature of the frozen reconstruction objective. Averaging per-example inverses would give a different update. Likewise, matching average firing rates alone does not match second moments. For example, a shared factorized prior with mean ⟨ r ⟩ \langle r\rangle ⟨ r ⟩ has off-diagonal moments ⟨ r i ⟩ ⟨ r j ⟩ \langle r_i\rangle\langle r_j\rangle ⟨ r i ⟩ ⟨ r j ⟩ , whereas the averaged posterior has ⟨ r i r j ⟩ \langle r_i r_j\rangle ⟨ r i r j ⟩ . Their difference is the across-input covariance of the inferred means. Section C.4 states the exact matching condition and the unequal-moment extension.
Model updates
Proof of Equations (68) and (71) . For Bernoulli inference, differentiating eq. (58) gives
∇ r F = − Φ ⊤ Σ − 1 x + W r + 1 2 diag ( W ) ⊙ ( 1 − 2 r ) + β ( u − u r e f ) . \nabla_r F=-\Phi^\top\Sigma^{-1}x+Wr+\frac{1}{2}\operatorname{diag}(W)\odot(1-2r)+\beta(u-u_{\mathrm{ref}}). ∇ r F = − Φ ⊤ Σ − 1 x + W r + 2 1 diag ( W ) ⊙ ( 1 − 2 r ) + β ( u − u ref ) .
The posterior Fisher C C C cancels the logit Jacobian, yielding eq. (68) . For the decoder, the complete-data Fisher block is E p ⊗ Σ − 1 E_p\otimes\Sigma^{-1} E p ⊗ Σ − 1 , which cancels the precision in the gradient and gives eq. (69) .
For each diagonal variance and each initial-prior probability,
∂ F ∂ Σ m m = Σ m m − V m m 2 Σ m m 2 , G Σ m m = 1 2 Σ m m 2 , \frac{\partial F}{\partial\Sigma_{mm}}=\frac{\Sigma_{mm}-V_{mm}}{2\Sigma_{mm}^{2}},\qquad G_{\Sigma_{mm}}=\frac{1}{2\Sigma_{mm}^{2}}, ∂ Σ mm ∂ F = 2 Σ mm 2 Σ mm − V mm , G Σ mm = 2 Σ mm 2 1 ,
∂ [ β D K L ( q ∥ p 0 ) ] ∂ π 0 , i = β π 0 , i − r i π 0 , i ( 1 − π 0 , i ) , G π 0 , i = 1 π 0 , i ( 1 − π 0 , i ) . (75) \frac{\partial[\beta D_{\mathrm{KL}}(q\mathbin{\|}p_0)]}{\partial\pi_{0,i}}=\beta\frac{\pi_{0,i}-r_i}{\pi_{0,i}(1-\pi_{0,i})},\qquad G_{\pi_{0,i}}=\frac{1}{\pi_{0,i}(1-\pi_{0,i})}. \tag*{(75)} ∂ π 0 , i ∂ [ β D KL ( q ∥ p 0 )] = β π 0 , i ( 1 − π 0 , i ) π 0 , i − r i , G π 0 , i = π 0 , i ( 1 − π 0 , i ) 1 . (75)
Preconditioning proves eqs. (70) and (71) . With frozen targets, integration yields:
Σ ( Δ t ) = V + [ Σ ( 0 ) − V ] e − η Σ Δ t \Sigma(\Delta t)=V+[\Sigma(0)-V]e^{-\eta_\Sigma\Delta t} Σ ( Δ t ) = V + [ Σ ( 0 ) − V ] e − η Σ Δ t
π 0 ( Δ t ) = r + [ π 0 ( 0 ) − r ] e − η 0 β Δ t . (76) \pi_0(\Delta t)=r+[\pi_0(0)-r]e^{-\eta_0\beta\Delta t}. \tag*{(76)} π 0 ( Δ t ) = r + [ π 0 ( 0 ) − r ] e − η 0 β Δ t . (76)
Decoder-bias correction.
Proof of Equation (77) . Hold the incoming reference and covariance fixed during one unclamped inference step. Only the feedforward drive depends on the bias, so
∂ u n e w ∂ b = − 1 − e − β h β Φ ⊤ Σ − 1 , ∇ u F = − C u ˙ . \frac{\partial u^{\mathrm{new}}}{\partial b}=-\frac{1-e^{-\beta h}}{\beta}\Phi^\top\Sigma^{-1},\qquad\nabla_u F=-C\dot u. ∂ b ∂ u new = − β 1 − e − β h Φ ⊤ Σ − 1 , ∇ u F = − C u ˙ .
Applying the chain rule at the updated posterior gives
∇ b F = − Σ − 1 ( x − b − Φ r ) + 1 − e − β h β Σ − 1 Φ C u ˙ . \nabla_b F=-\Sigma^{-1}(x-b-\Phi r)+\frac{1-e^{-\beta h}}{\beta}\Sigma^{-1}\Phi C\dot u. ∇ b F = − Σ − 1 ( x − b − Φ r ) + β 1 − e − β h Σ − 1 Φ C u ˙ .
Multiplication by the inverse bias Fisher block Σ \Sigma Σ and minibatch averaging gives eq. (77) .
Decoder bias
A learned bias gives p ( x ∣ z ) = N ( x ; b + Φ z , Σ ) p(x \mid z) = \mathcal{N}(x; b + \Phi z, \Sigma) p ( x ∣ z ) = N ( x ; b + Φ z , Σ ) , and inference uses x − b x-b x − b . With a fixed posterior, the bias fits the mean residual. Differentiating through one unclamped ETD1 inference step adds a response term:
b ˙ = η b E b a t c h [ x − b − Φ r ⏟ reconstruction residual − 1 − e − β h β Φ C u ˙ ⏟ inference response ] . (77) \dot{b}=\eta_b\mathbb{E}_{\mathrm{batch}}\left[\underbrace{x-b-\Phi r}_{\text{reconstruction residual}}-\underbrace{\frac{1-e^{-\beta h}}{\beta}\Phi C\dot{u}}_{\text{inference response}}\right]. \tag*{(77)} b ˙ = η b E batch reconstruction residual x − b − Φ r − inference response β 1 − e − β h Φ C u ˙ . (77)
The incoming reference is fixed, and C C C and u ˙ \dot{u} u ˙ are evaluated after that step. This expression assumes one shared covariance across the batch. Section B.2.1 derives the correction. The full-width synthetic experiment freezes the bias.
Bernoulli uncertainty and sparse coding
The Bernoulli posterior variance is Var q ( z i ) = r i ( 1 − r i ) \operatorname{Var}_q(z_i)=r_i(1-r_i) Var q ( z i ) = r i ( 1 − r i ) , which vanishes at 0 and 1 and is maximal at 1 / 2 1/2 1/2 . In isolation, its cost favors confident absence or presence. In the full expected reconstruction loss, it cancels the quadratic self-term:
1 2 W i i r i 2 ⏟ mean reconstruction + 1 2 W i i r i ( 1 − r i ) ⏟ posterior uncertainty = 1 2 W i i r i . (78) \underbrace{\frac{1}{2}W_{ii}r_i^2}_{\text{mean reconstruction}}+\underbrace{\frac{1}{2}W_{ii}r_i(1-r_i)}_{\text{posterior uncertainty}}=\frac{1}{2}W_{ii}r_i. \tag*{(78)} mean reconstruction 2 1 W ii r i 2 + posterior uncertainty 2 1 W ii r i ( 1 − r i ) = 2 1 W ii r i . (78)
Consequently, with the other coordinates fixed, reconstruction is affine in r i r_i r i and the KL term is strictly convex for β > 0 \beta>0 β > 0 . The full objective has an interior coordinate optimum at finite evidence.
Activation threshold under a rolling prior
Section B.1.1 motivates the rolling rule. Here we make its sparsity effect explicit. Starting one ETD1 step at the reference, the gain in eq. (66) tends to 1 / β 1/\beta 1/ β as h → ∞ h\to\infty h → ∞ . Since σ ( u ) > 1 / 2 \sigma(u)>1/2 σ ( u ) > 1/2 exactly when u > 0 u>0 u > 0 , for β > 0 \beta>0 β > 0 we obtain
r i n e w > 1 2 ⟺ ( ϕ ( i ) ) T Σ − 1 x − 1 2 W i i − ∑ j ≠ i W i j π r e f , j > β log 1 − π r e f , i π r e f , i . (79) r_i^{\mathrm{new}}>\frac{1}{2}\quad\Longleftrightarrow\quad\left(\phi^{(i)}\right)^{\mathsf{T}}\Sigma^{-1}x-\frac{1}{2}W_{ii}-\sum_{j\ne i}W_{ij}\pi_{\mathrm{ref},j}>\beta\log\frac{1-\pi_{\mathrm{ref},i}}{\pi_{\mathrm{ref},i}}. \tag*{(79)} r i new > 2 1 ⟺ ( ϕ ( i ) ) T Σ − 1 x − 2 1 W ii − j = i ∑ W ij π ref , j > β log π ref , i 1 − π ref , i . (79)
The right side is positive for a reference probability below 1 / 2 1/2 1/2 and grows as that probability decreases. It sets the reconstruction evidence needed to activate the feature, after accounting for the other features’ contributions on the left. Updating the reference changes this threshold at the next outer step. The prior cap and inference depth can therefore affect posterior sparsity through different parts of the rollout (section C.3.3).
Numerical integration and matrix-free updates
Stiffness and exponential integration. Natural gradients specify the continuous-time evolution of beliefs and model parameters, but implementing these dynamics requires a numerical update. A difficulty with explicit Euler is that stable continuous dynamics can become unstable after discretization. For the simple relaxation v ˙ = − β v \dot{v}=-\beta v v ˙ = − β v , Euler multiplies v v v by 1 − β h 1-\beta h 1 − β h , whereas exact integration multiplies it by e − β h e^{-\beta h} e − β h . Euler therefore requires 0 < β h < 2 0<\beta h<2 0 < β h < 2 for decay. When fast relaxation accompanies slower dynamics, this stability restriction can force small steps even when the solution changes slowly. Exponential integrators address this source of stiffness by integrating the linear component exactly ([24 , 36 ] ).
Inference integration. Write eq. (68) as u ˙ = a ( r ) − β ( u − u r e f ) \dot{u}=a(r)-\beta(u-u_{\mathrm{ref}}) u ˙ = a ( r ) − β ( u − u ref ) , where a a a contains the reconstruction and Bernoulli uncertainty terms. Holding the reference fixed and freezing a a a during one interval gives the first-order exponential time-differencing update (ETD1; [24 , 36 ] ):
u n e w = u r e f + e − β h ( u − u r e f ) + 1 − e − β h β a ( r ) , β > 0. (80) u_{\mathrm{new}}=u_{\mathrm{ref}}+e^{-\beta h}(u-u_{\mathrm{ref}})+\frac{1-e^{-\beta h}}{\beta}a(r),\qquad\beta>0. \tag*{(80)} u new = u ref + e − β h ( u − u ref ) + β 1 − e − β h a ( r ) , β > 0. (80)
The reference relaxation is thus preserved exactly. Here ETD1 follows the same natural-gradient direction as Euler, with effective step ( 1 − e − β h ) / β (1-e^{-\beta h})/\beta ( 1 − e − β h ) / β , bounded by 1 / β 1/\beta 1/ β . Starting from the reference removes the middle term. Section B.1.1 describes how that reference is passed between inference steps. At h → ∞ h \to\infty h → ∞ , ETD1 solves the subproblem with the reconstruction drive held fixed. We apply a finite number of recurrent inference steps before each decoder update.
Frozen-statistics learning. The same principle applies to learning. With minibatch statistics, prior references, and covariance fixed, and E , E p ≻ 0 \mathbf{E},\mathbf{E}_p \succ0 E , E p ≻ 0 , the decoder flow has the exact solution (section C.4)
Φ ( Δ t ) − Φ ∗ = ( Φ ( 0 ) − Φ ∗ ) exp [ − η Φ Δ t E E p − 1 ] . (81) \mathbf{\Phi}(\Delta t)-\mathbf{\Phi}^{*}=(\mathbf{\Phi}(0)-\mathbf{\Phi}^{*})\exp\left[-\eta_{\Phi}\Delta t\mathbf{E}\mathbf{E}_p^{-1}\right]. \tag*{(81)} Φ ( Δ t ) − Φ ∗ = ( Φ ( 0 ) − Φ ∗ ) exp [ − η Φ Δ t E E p − 1 ] . (81)
Euler must accommodate the fastest relaxation mode, but exponential integration instead applies each mode’s exact decay over the chosen interval. When E = E p \mathbf{E}=\mathbf{E}_p E = E p , every mode contracts by the same factor, recovering exact rarity compensation.
The configured decoder solver, matrix_free_phi1_auto, evaluates a matrix-function action on the decoder residual. Let s = η Φ Δ t s=\eta_{\Phi}\Delta t s = η Φ Δ t , E p , λ = E p + λ I \mathbf{E}_{p,\lambda}=\mathbf{E}_p+\lambda\mathbf{I} E p , λ = E p + λ I with Fisher damping λ ≥ 0 \lambda\ge0 λ ≥ 0 , and A = E E p , λ − 1 \mathbf{A}=\mathbf{E}\mathbf{E}_{p,\lambda}^{-1} A = E E p , λ − 1 . The corresponding frozen update is:
Φ ( Δ t ) = Φ ( 0 ) + s ( ⟨ x r T ⟩ − Φ ( 0 ) E ) E p , λ − 1 φ 1 ( − s A ) , (82) \begin{aligned}
\mathbf{\Phi}(\Delta t)&=\mathbf{\Phi}(0)\\
&\quad+s\left(\langle\mathbf{x}\mathbf{r}^{\mathsf{T}}\rangle-\mathbf{\Phi}(0)\mathbf{E}\right)\mathbf{E}_{p,\lambda}^{-1}\varphi_1(-s\mathbf{A}), \tag*{(82)}
\end{aligned} Φ ( Δ t ) = Φ ( 0 ) + s ( ⟨ x r T ⟩ − Φ ( 0 ) E ) E p , λ − 1 φ 1 ( − s A ) , (82)
where brackets denote minibatch averages and φ 1 ( Z ) = ∑ m = 0 ∞ Z m / ( m + 1 ) ! \varphi_1(\mathbf{Z})=\sum_{m=0}^{\infty}\mathbf{Z}^{m}/(m+1)! φ 1 ( Z ) = ∑ m = 0 ∞ Z m / ( m + 1 )! is the entire matrix function used in exponential integration (Hochbruck & Ostermann, [36 ] ). For λ = 0 \lambda=0 λ = 0 , this recovers the exact frozen-statistics solution above. The residual form avoids explicitly computing Φ ∗ \mathbf{\Phi}^{*} Φ ∗ or subtracting a near-identity exponential from the identity. The implementation applies this function without constructing a dense K × K K\times K K × K matrix. For a matrix R \mathbf{R} R whose rows are minibatch posterior means,
E v = diag ( ⟨ r ⊙ ( 1 − r ) ⟩ ) v + 1 B R T ( R v ) , (83) \mathbf{E}\mathbf{v}=\operatorname{diag}\left(\langle\mathbf{r}\odot(1-\mathbf{r})\rangle\right)\mathbf{v}+\frac{1}{B}\mathbf{R}^{\mathsf{T}}(\mathbf{R}\mathbf{v}), \tag*{(83)} Ev = diag ( ⟨ r ⊙ ( 1 − r )⟩ ) v + B 1 R T ( Rv ) , (83)
and the same representation applies to E p \mathbf{E}_p E p .
Low-rank solves use the Woodbury identity (Hager, [34 ] ) when the rank is at most 1,024. Larger ranks use Jacobi-preconditioned conjugate gradients (Saad, [69 ] ). Thus the minibatch rank and conditioning also affect cost (section B.8).
The solver combines scaled Taylor evaluation (Al-Mohy & Higham, [2 ] ) with Chebyshev polynomial approximation (Trefethen, [73 ] ). It selects Taylor evaluation when the predicted work is within 32 operator applications, and otherwise uses a Chebyshev recurrence with degree chosen from the coefficient tail. Each operator application requires a posterior-moment product and a solve with the damped prior moment, so the polynomial degree and linear-solve iterations contribute to decoder-update cost. The selected synthetic recipes and audited whitened Gemma configurations request Chebyshev tolerance 10 − 5 10^{-5} 1 0 − 5 and maximum degree 2,048 (512 for the raw 16K Gemma run). These control the matrix-function approximation.
The variance and initial-prior flows likewise integrate to exponential averages of their frozen targets (section B.2.1). These updates exploit solvable components of the derived dynamics while leaving approximation to the remaining nonlinear terms and numerical matrix-function evaluation. Parameter floors, a mean initial-prior cap, and decoder constraints are applied as specified by each recipe. All inferred statistics are detached during learning, so the decoder update does not backpropagate through the inference trajectory.
Algorithm
Algorithm 1 gives the Bernoulli inference and moment updates. During inference, the generative parameters remain fixed. Learning uses the inferred minibatch moments.
Algorithm 1 FOND with a rolling inference reference
Require: Decoder Φ \boldsymbol{\Phi} Φ , diagonal covariance Σ ≻ 0 \boldsymbol{\Sigma} \succ0 Σ ≻ 0 , initial prior π 0 ∈ ( 0 , 1 ) K \boldsymbol{\pi}_0 \in(0,1)^K π 0 ∈ ( 0 , 1 ) K , inference depths, β > 0 \beta> 0 β > 0 , integration parameter h h h , and learning schedules.
for each training minibatch do
Center observations by the decoder bias, if learned.
u ← logit ( π 0 ) \boldsymbol{u} \leftarrow\operatorname{logit}(\boldsymbol{\pi}_0) u ← logit ( π 0 ) , independently for each observation.
for each outer step up to the sampled training horizon do
u r e f ← u \boldsymbol{u}_{\mathrm{ref}} \leftarrow\boldsymbol{u} u ref ← u , π r e f ← σ ( u r e f ) \boldsymbol{\pi}_{\mathrm{ref}} \leftarrow\sigma(\boldsymbol{u}_{\mathrm{ref}}) π ref ← σ ( u ref ) .
E p ← E b a t c h [ diag ( π r e f ⊙ ( 1 − π r e f ) ) + π r e f π r e f T ] \mathbf{E}_p \leftarrow\mathbb{E}_{\mathrm{batch}}\left[\operatorname{diag}(\boldsymbol{\pi}_{\mathrm{ref}} \odot(1-\boldsymbol{\pi}_{\mathrm{ref}}))+\boldsymbol{\pi}_{\mathrm{ref}}\boldsymbol{\pi}_{\mathrm{ref}}^{\mathsf{T}}\right] E p ← E batch [ diag ( π ref ⊙ ( 1 − π ref )) + π ref π ref T ] .
for each inner inference step do
r ← σ ( u ) \boldsymbol{r} \leftarrow\sigma(\boldsymbol{u}) r ← σ ( u ) , W ← Φ T Σ − 1 Φ \mathbf{W} \leftarrow\boldsymbol{\Phi}^{\mathsf{T}}\boldsymbol{\Sigma}^{-1}\boldsymbol{\Phi} W ← Φ T Σ − 1 Φ .
u ˙ ← Φ T Σ − 1 x − W r − 1 2 diag ( W ) ⊙ ( 1 − 2 r ) − β ( u − u r e f ) \dot{\boldsymbol{u}} \leftarrow\boldsymbol{\Phi}^{\mathsf{T}}\boldsymbol{\Sigma}^{-1}\boldsymbol{x}-\mathbf{W}\boldsymbol{r}-\frac{1}{2}\operatorname{diag}(\mathbf{W})\odot(1-2\boldsymbol{r})-\beta(\boldsymbol{u}-\boldsymbol{u}_{\mathrm{ref}}) u ˙ ← Φ T Σ − 1 x − W r − 2 1 diag ( W ) ⊙ ( 1 − 2 r ) − β ( u − u ref ) .
u ← u + 1 − e − β h β u ˙ \boldsymbol{u} \leftarrow\boldsymbol{u}+\frac{1-e^{-\beta h}}{\beta}\dot{\boldsymbol{u}} u ← u + β 1 − e − β h u ˙ .
end for
if this is the final outer step then
r ← σ ( u ) \boldsymbol{r} \leftarrow\sigma(\boldsymbol{u}) r ← σ ( u ) , C ← diag [ r ⊙ ( 1 − r ) ] \mathbf{C} \leftarrow\operatorname{diag}[\boldsymbol{r}\odot(1-\boldsymbol{r})] C ← diag [ r ⊙ ( 1 − r )] , E ← E b a t c h [ C + r r T ] \mathbf{E} \leftarrow\mathbb{E}_{\mathrm{batch}}[\mathbf{C}+\boldsymbol{r}\boldsymbol{r}^{\mathsf{T}}] E ← E batch [ C + r r T ] .
V m m ← E b a t c h [ ( x − Φ r ) m 2 + ( Φ C Φ T ) m m ] V_{mm} \leftarrow\mathbb{E}_{\mathrm{batch}}[(x-\boldsymbol{\Phi}\boldsymbol{r})_m^2+(\boldsymbol{\Phi}\mathbf{C}\boldsymbol{\Phi}^{\mathsf{T}})_{mm}] V mm ← E batch [( x − Φ r ) m 2 + ( Φ C Φ T ) mm ] .
Φ ∗ ← E b a t c h [ x r T ] E − 1 \boldsymbol{\Phi}^{*} \leftarrow\mathbb{E}_{\mathrm{batch}}[\boldsymbol{x}\boldsymbol{r}^{\mathsf{T}}]\mathbf{E}^{-1} Φ ∗ ← E batch [ x r T ] E − 1 .
Φ ← Φ ∗ + ( Φ − Φ ∗ ) exp [ − η Φ Δ t E E p − 1 ] \boldsymbol{\Phi} \leftarrow\boldsymbol{\Phi}^{*}+(\boldsymbol{\Phi}-\boldsymbol{\Phi}^{*})\exp[-\eta_{\Phi}\Delta t\,\mathbf{E}\mathbf{E}_p^{-1}] Φ ← Φ ∗ + ( Φ − Φ ∗ ) exp [ − η Φ Δ t E E p − 1 ] .
Update enabled variance and bias parameters by eqs. (76) and (77) , then apply the stated decoder constraints.
end if
end for
if an initial-prior update is scheduled then
Infer r \boldsymbol{r} r on the prior-update batch, then detach it.
π 0 ← E b a t c h [ r ] + ( π 0 − E b a t c h [ r ] ) e − η 0 β Δ t \boldsymbol{\pi}_0 \leftarrow\mathbb{E}_{\mathrm{batch}}[\boldsymbol{r}]+(\boldsymbol{\pi}_0-\mathbb{E}_{\mathrm{batch}}[\boldsymbol{r}])e^{-\eta_0\beta\Delta t} π 0 ← E batch [ r ] + ( π 0 − E batch [ r ]) e − η 0 β Δ t .
Apply the specified prior floor and mean-probability cap.
end if
end for
The decoder line is the frozen-moment matrix-exponential update. Implementations can apply its matrix functions without forming dense inverses. ETD1 uses gain 1 / β 1/\beta 1/ β at h = ∞ h=\infty h = ∞ . Evaluation resets the initial prior for each input and performs inference without learning.
Computational complexity
Let B B B be minibatch size, d d d input dimension, K K K dictionary width, and T T T the total number of inner inference steps for an input. A dense SAE encoder costs O ( B d K ) O(BdK) O ( B d K ) ; its training step has the same order, with a larger constant for decoding and backpropagation. BeFOND applies the lateral operator as Φ T [ Φ r ] \boldsymbol{\Phi}^{\mathsf{T}}[\boldsymbol{\Phi}\boldsymbol{r}] Φ T [ Φ r ] (with diagonal observation precision inserted when used), so it does not form a dense K × K K \times K K × K Gram matrix. Its costs are:
BeFOND inference: O ( T B d K ) O(TBdK) O ( T B d K ) ,
BeFOND training step: O ( T B d K + C N G D + C p r i o r ) O(TBdK+C_{\mathrm{NGD}}+C_{\mathrm{prior}}) O ( T B d K + C NGD + C prior ) . {#eq:88}
where C N G D C_{\mathrm{NGD}} C NGD includes the moment products and linear solves used by the decoder update, and C p r i o r C_{\mathrm{prior}} C prior is the amortized cost of the separate initial-prior fits.
Solver work depends on minibatch rank, conditioning, and numerical tolerance. Section B.6 describes the matrix-free evaluation. No gradient is propagated through the T T T inference steps, avoiding storage of that trajectory for backpropagation.
If a conventional SAE update uses c c c units of dense matrix-multiplication work, its cost is O ( c B d K ) O(cBdK) O ( c B d K ) . With T = O ( c ) T=O(c) T = O ( c ) , BeFOND’s inference contribution has that same order. Our current implementation takes approximately 12–14× as long as BatchTopK for the measured training prefix (section D.3).
Extended theoretical analyses, synthetic experiments, and ablations
Experimental setup
Datasets
SynthSAEBench. We measure dictionary and support recovery using the known generating features of SynthSAEBench ([20 ] ). The full-width experiment uses d = 768 d = 768 d = 768 and K = K ⋆ = 16,384 K = K_\star= 16{,}384 K = K ⋆ = 16 , 384 . The superposition experiment fixes K = 4,096 K = 4{,}096 K = 4 , 096 , K ⋆ = 16,384 K_\star= 16{,}384 K ⋆ = 16 , 384 , and varies d d d from 256 to 1,536. Inputs are unwhitened, with parent scaling disabled (scale_children_by_parent=false). Feature probabilities follow a Zipf law with exponent 0.5 over [0.0005, 0.4]. The generator uses 128 roots, branching factor 4, depth 3, and probability compensation.
Training
BeFOND alternates inference and learning as in Alg. 1. Table 2 groups the synthetic settings. Prior-update examples are counted separately from decoder-update examples. Geometry arms are separately tuned. Their early checkpoints include recipe-matched reproductions.
Table 2. SynthSAEBench training settings. Decoder and prior examples are counted separately. Full-width runs use d = 768 d = 768 d = 768 , K = K ⋆ = 16,384 K = K_\star= 16{,}384 K = K ⋆ = 16 , 384 ; superposition runs use K = 4,096 K = 4{,}096 K = 4 , 096 .
Evaluation
Synthetic recovery. MCC is dictionary mean correlation coefficient, feature-macro F1 uses positive-cosine one-to-one matching to the generating dictionary, and rare F1 averages over its least frequent quartile. A latent is dead when it is inactive on every test example. Activity is r i > 0.5 r_i > 0.5 r i > 0.5 for Bernoulli BeFOND/MF and positive native output for the SAE baselines. Mean L 0 L_0 L 0 counts active latents per example. Tests use 10 6 10^6 1 0 6 examples with seed 49100, including the MF reevaluation reported in Table 5 . The independent frequency reference uses 5 × 10 5 5 \times10^5 5 × 1 0 5 examples with seed 315031. BeFOND/MF use 200/20 test inference steps. Geometry validation uses 32,768 examples, seed 813011, and 100 inference steps.
Implementation
Training horizon. Each optimizer step draws one inference horizon for the whole minibatch, resets the posterior, runs that many outer steps, and updates the decoder only at the final step. The exponential sampler assigns:
Pr ( t = j ) = e − λ ( j − 1 ) ∑ s = 1 t o u t e r e − λ ( s − 1 ) , j = 1 , … , t o u t e r , (84) \Pr(t = j) = \frac{e^{-\lambda(j-1)}}{\sum_{s=1}^{t_{\mathrm{outer}}} e^{-\lambda(s-1)}}, \qquad j = 1,\ldots,t_{\mathrm{outer}}, \tag*{(84)} Pr ( t = j ) = ∑ s = 1 t outer e − λ ( s − 1 ) e − λ ( j − 1 ) , j = 1 , … , t outer , (84)
where λ \lambda λ is solved numerically so the truncated discrete distribution has the configured mean.
Probabilities use FP64. Brent’s root solver uses tolerance 10 − 14 10^{-14} 1 0 − 14 . At mean 1 the distribution is a point mass at 1, and at mean ( t o u t e r + 1 ) / 2 (t_{\mathrm{outer}} + 1)/2 ( t outer + 1 ) /2 , it is uniform. Sampling uses NumPy’s default_rng seeded by the model seed and zero-based optimizer step, identically on every device and after resumption. The draw does not advance the data or latent-sampling generators.
K1 uses a fixed horizon of one and one inner step. Its initial-prior fit and test inference can still use longer horizons. Uniform sampling on 1–10 has mean 5.5, Pr ( t = 1 ) = 0.1 \Pr(t = 1) = 0.1 Pr ( t = 1 ) = 0.1 , and 95th percentile 10. Exponential sampling on 1–50 with the same mean has Pr ( t = 1 ) ≈ 0.182 \Pr(t = 1) \approx0.182 Pr ( t = 1 ) ≈ 0.182 and 95th percentile 15.
Synthetic baseline implementations use SAE Lens 6.51.0 (BatchTopK/JumpReLU/Matryoshka) or 6.37.0 (native MP/ReLU-L1).
Inference proofs
Single-layer inference
Proposition C.1 (Two-atom case). Let z i ∈ { 0 , 1 } z_i \in\{0,1\} z i ∈ { 0 , 1 } with z i ∼ Bernoulli ( π i ) z_i \sim\operatorname{Bernoulli}(\pi_i) z i ∼ Bernoulli ( π i ) independently, with 0 < π i < 1 0 < \pi_i < 1 0 < π i < 1 , and let x = ϕ ( 1 ) z 1 + ϕ ( 2 ) z 2 + ϵ x = \phi^{(1)}z_1 + \phi^{(2)}z_2 + \epsilon x = ϕ ( 1 ) z 1 + ϕ ( 2 ) z 2 + ϵ , where ϵ ∼ N ( 0 , I M ) \epsilon\sim\mathcal{N}(0,I_M) ϵ ∼ N ( 0 , I M ) independently of z z z . If the dictionary atoms are linearly independent and W 12 = ( ϕ ( 1 ) ) T ϕ ( 2 ) ≠ 0 W_{12} = (\phi^{(1)})^\mathsf{T}\phi^{(2)} \ne0 W 12 = ( ϕ ( 1 ) ) T ϕ ( 2 ) = 0 , then no encoder z ^ 1 ( x ) = f ( w T x + b ) \hat{z}_1(x) = f(w^\mathsf{T}x + b) z ^ 1 ( x ) = f ( w T x + b ) , for any scalar function f f f , can equal p ( z 1 = 1 ∣ x ) p(z_1 = 1 \mid x) p ( z 1 = 1 ∣ x ) for every input x x x .
Assume independent Bernoulli latents with interior prior probabilities and unit observation covariance. Set:
a i ( x ) = logit ( π i ) + ( ϕ ( i ) ) T x − 1 2 ∥ ϕ ( i ) ∥ 2 , W i j = ( ϕ ( i ) ) T ϕ ( j ) . a_i(x) = \operatorname{logit}(\pi_i) + (\phi^{(i)})^\mathsf{T}x - \frac{1}{2}\lVert\phi^{(i)}\rVert^2,\qquad W_{ij} = (\phi^{(i)})^\mathsf{T}\phi^{(j)}. a i ( x ) = logit ( π i ) + ( ϕ ( i ) ) T x − 2 1 ∥ ϕ ( i ) ∥ 2 , W ij = ( ϕ ( i ) ) T ϕ ( j ) .
Proof of Theorem C.1. Marginalizing z 2 z_2 z 2 gives
logit p ( z 1 = 1 ∣ x ) = a 1 ( x ) + log 1 + e a 2 ( x ) − W 12 1 + e a 2 ( x ) , \operatorname{logit} p(z_1 = 1 \mid x) = a_1(x) + \log\frac{1 + e^{a_2(x)-W_{12}}}{1 + e^{a_2(x)}}, logit p ( z 1 = 1 ∣ x ) = a 1 ( x ) + log 1 + e a 2 ( x ) 1 + e a 2 ( x ) − W 12 ,
∇ x logit p ( z 1 = 1 ∣ x ) = ϕ ( 1 ) + [ σ ( a 2 − W 12 ) − σ ( a 2 ) ] ϕ ( 2 ) . (85) \nabla_x \operatorname{logit} p(z_1 = 1 \mid x) = \phi^{(1)} + [\sigma(a_2 - W_{12}) - \sigma(a_2)]\phi^{(2)}. \tag*{(85)} ∇ x logit p ( z 1 = 1 ∣ x ) = ϕ ( 1 ) + [ σ ( a 2 − W 12 ) − σ ( a 2 )] ϕ ( 2 ) . (85)
When W 12 ≠ 0 W_{12} \ne0 W 12 = 0 , the bracket is nonconstant. Linear independence of the atoms therefore makes the gradient direction vary with x x x . A posterior of the form f ( w T x + b ) f(w^\mathsf{T}x + b) f ( w T x + b ) is constant along every direction orthogonal to w w w , so its log-odds gradient must be parallel to w w w everywhere. This is a contradiction, even if f f f is not assumed differentiable. ◻
Multiple atoms. By assumption, some atom ϕ ( i ) \phi^{(i)} ϕ ( i ) , i ≥ 2 i \ge2 i ≥ 2 , is neither orthogonal to nor a multiple of ϕ ( 1 ) \phi^{(1)} ϕ ( 1 ) .
Proof of Theorem 4.1. Suppose f ( w T x + b ) = p ( z 1 = 1 ∣ x ) f(w^\mathsf{T}x + b) = p(z_1 = 1 \mid x) f ( w T x + b ) = p ( z 1 = 1 ∣ x ) for every x x x , and write L ( x ) = logit p ( z 1 = 1 ∣ x ) L(x) = \operatorname{logit} p(z_1 = 1 \mid x) L ( x ) = logit p ( z 1 = 1 ∣ x ) . As in the proof of Theorem C.1, ∇ L \nabla L ∇ L is then parallel to w w w everywhere. Differentiation of the finite partition functions gives:
∇ L = ϕ ( 1 ) + ∑ k ≥ 2 Δ k ϕ ( k ) , Δ k = E [ z k ∣ z 1 = 1 , x ] − E [ z k ∣ z 1 = 0 , x ] . (86) \nabla L = \phi^{(1)} + \sum_{k\ge2} \Delta_k \phi^{(k)}, \qquad\Delta_k = \mathbb{E}[z_k \mid z_1 = 1, x] - \mathbb{E}[z_k \mid z_1 = 0, x]. \tag*{(86)} ∇ L = ϕ ( 1 ) + k ≥ 2 ∑ Δ k ϕ ( k ) , Δ k = E [ z k ∣ z 1 = 1 , x ] − E [ z k ∣ z 1 = 0 , x ] . (86)
Along x = t d x = td x = t d , with d d d orthogonal to no atom, the fields of all other bits diverge while their couplings remain bounded. Each bit becomes certain independently of z 1 z_1 z 1 . Hence, Δ k → 0 \Delta_k \to0 Δ k → 0 and ∇ L → ϕ ( 1 ) \nabla L \to\phi^{(1)} ∇ L → ϕ ( 1 ) . Therefore, w ∥ ϕ ( 1 ) w \parallel\phi^{(1)} w ∥ ϕ ( 1 ) , and ∇ L ⊤ v = 0 \nabla L^\top v = 0 ∇ L ⊤ v = 0 everywhere for every v ⊥ ϕ ( 1 ) v \perp\phi^{(1)} v ⊥ ϕ ( 1 ) .
Let Q Q Q contain the atoms parallel to the chosen atom i i i , writing ϕ ( j ) = λ j ϕ ( i ) \phi^{(j)} = \lambda_j \phi^{(i)} ϕ ( j ) = λ j ϕ ( i ) . Choose v ⊥ ϕ ( 1 ) v \perp\phi^{(1)} v ⊥ ϕ ( 1 ) with ( ϕ ( i ) ) ⊤ v ≠ 0 (\phi^{(i)})^\top v \ne0 ( ϕ ( i ) ) ⊤ v = 0 , and choose d ⊥ ϕ ( i ) d \perp\phi^{(i)} d ⊥ ϕ ( i ) orthogonal to no atom outside Q Q Q . Such a d d d exists because only finitely many proper hyperplanes are excluded. Along x = x 0 + t d x = x_0 + td x = x 0 + t d , all bits outside Q ∪ { 1 } Q \cup\{1\} Q ∪ { 1 } freeze, leaving finite conditional partition functions Z 0 ( s ) , Z 1 ( s ) Z_0(s), Z_1(s) Z 0 ( s ) , Z 1 ( s ) with s = ( ϕ ( i ) ) ⊤ x 0 s = (\phi^{(i)})^\top x_0 s = ( ϕ ( i ) ) ⊤ x 0 . Thus
∇ L ⊤ v ⟶ ( ( ϕ ( i ) ) ⊤ v ) D ′ ( s ) , D ( s ) = log Z 1 ( s ) Z 0 ( s ) . \nabla L^\top v \longrightarrow((\phi^{(i)})^\top v)D'(s), \qquad D(s) = \log\frac{Z_1(s)}{Z_0(s)}. ∇ L ⊤ v ⟶ (( ϕ ( i ) ) ⊤ v ) D ′ ( s ) , D ( s ) = log Z 0 ( s ) Z 1 ( s ) .
As s s s moves from − ∞ -\infty − ∞ to + ∞ +\infty + ∞ , every bit in Q Q Q switches according to the sign of λ j \lambda_j λ j . Since W 1 j = λ j W 1 i W_{1j} = \lambda_j W_{1i} W 1 j = λ j W 1 i ,
D ( + ∞ ) − D ( − ∞ ) = − W 1 i ∑ j ∈ Q ∣ λ j ∣ ≠ 0. D(+\infty) - D(-\infty) = -W_{1i}\sum_{j\in Q}|\lambda_j| \ne0. D ( + ∞ ) − D ( − ∞ ) = − W 1 i j ∈ Q ∑ ∣ λ j ∣ = 0.
Therefore D ′ D' D ′ is nonzero somewhere, contradicting ∇ L ⊤ v = 0 \nabla L^\top v = 0 ∇ L ⊤ v = 0 for a single-projection encoder.
Orthogonality and parallelism of two atoms are polynomial conditions on Φ \Phi Φ that fail for almost every dictionary when M ≥ 2 M \ge2 M ≥ 2 , so for almost every dictionary with K ≥ 2 K \ge2 K ≥ 2 no latent falls under the exception. If no two atoms are parallel, exceptions must be orthogonal to every other atom. For K > M K > M K > M , at most M − 1 M - 1 M − 1 atoms can have that property. Whitening extends both results to any fixed positive-definite Σ \Sigma Σ , with W = Φ ⊤ Σ − 1 Φ W = \Phi^\top\Sigma^{-1}\Phi W = Φ ⊤ Σ − 1 Φ .
Iterative inference versus single projection encoders
Proposition C.2 (Fixed-prior inference versus single-projection encoders). Consider the Bernoulli–Gaussian model of theorem 4.1 with unit observation covariance. Let
W = Φ ⊤ Φ , J = W − diag ( W ) , W = \Phi^\top\Phi, \qquad J = W - \operatorname{diag}(W), W = Φ ⊤ Φ , J = W − diag ( W ) , and suppose that
λ min ( J ) > − 4 \lambda_{\min}(J) > -4 λ m i n ( J ) > − 4 and that some pair of atoms is neither orthogonal nor parallel. Let A \mathcal{A} A contain all encoders
q f ( z ∣ x ) = ∏ i Bernoulli ( z i ; f i ( w i ⊤ x + b i ) ) q_f(z \mid x) = \prod_i \operatorname{Bernoulli}(z_i; f_i(w_i^\top x + b_i)) q f ( z ∣ x ) = i ∏ Bernoulli ( z i ; f i ( w i ⊤ x + b i )) with arbitrary weights, biases, and measurable f i : R → [ 0 , 1 ] f_i:\mathbb{R} \to[0,1] f i : R → [ 0 , 1 ] , and let
R ( q ) = E x ∼ p ( x ) [ D K L ( q ( ⋅ ∣ x ) ∥ p ( ⋅ ∣ x ) ) ] . R(q) = \mathbb{E}_{x\sim p(x)}\left[D_{\mathrm{KL}}(q(\cdot\mid x)\mathbin\Vert p(\cdot\mid x))\right]. R ( q ) = E x ∼ p ( x ) [ D KL ( q ( ⋅ ∣ x ) ∥ p ( ⋅ ∣ x )) ] . Let q t q_t q t be the factorized posterior with means
r ( t ) = σ ( u ( t ) ) , r(t) = \sigma(u(t)), r ( t ) = σ ( u ( t )) , where u ( t ) u(t) u ( t ) follows eq. (10) with β = 1 \beta= 1 β = 1 and the prior fixed at the generating one,
u 0 = logit π , u ( 0 ) = u 0 . u_0 = \operatorname{logit}\pi, \qquad u(0) = u_0. u 0 = logit π , u ( 0 ) = u 0 . Then the optimal factorized posterior
q ∗ ( ⋅ ∣ x ) = arg min q f a c t o r i z e d D K L ( q ∥ p ( ⋅ ∣ x ) ) q^*(\cdot\mid x) = \underset{q\ \mathrm{factorized}}{\operatorname{arg\,min}}\ D_{\mathrm{KL}}(q \mathbin\Vert p(\cdot\mid x)) q ∗ ( ⋅ ∣ x ) = q factorized arg min D KL ( q ∥ p ( ⋅ ∣ x )) is unique and
lim t → ∞ R ( q t ) = R ( q ∗ ) < inf q f ∈ A R ( q f ) . \lim_{t\to\infty} R(q_t) = R(q^*) < \inf_{q_f\in\mathcal{A}} R(q_f). t → ∞ lim R ( q t ) = R ( q ∗ ) < q f ∈ A inf R ( q f ) . Consequently, for all sufficiently large finite t t t ,
R ( q t ) < inf q f ∈ A R ( q f ) . R(q_t) < \inf_{q_f\in\mathcal{A}} R(q_f). R ( q t ) < q f ∈ A inf R ( q f ) .
Proof. Zero atoms decouple, since their rows of J J J vanish, so we drop them. Write a i ( x ) = logit ( π i ) + ( ϕ ( i ) ) ⊤ x − 1 2 W i i a_i(x) = \operatorname{logit}(\pi_i) + (\phi^{(i)})^\top x - \frac{1}{2}W_{ii} a i ( x ) = logit ( π i ) + ( ϕ ( i ) ) ⊤ x − 2 1 W ii and ψ ( r ) = ∑ i [ r i log r i + ( 1 − r i ) log ( 1 − r i ) ] \psi(r) = \sum_i [r_i \log r_i + (1-r_i)\log(1-r_i)] ψ ( r ) = ∑ i [ r i log r i + ( 1 − r i ) log ( 1 − r i )] for the negative Bernoulli entropy. For a factorized q q q with means r ∈ [ 0 , 1 ] K r \in[0,1]^K r ∈ [ 0 , 1 ] K , using z i 2 = z i z_i^2=z_i z i 2 = z i , the divergence D K L ( q ∥ p ( ⋅ ∣ x ) ) \mathcal{D}_{\mathrm{KL}}(q \mathbin\Vert p(\cdot\mid x)) D KL ( q ∥ p ( ⋅ ∣ x )) equals, up to a term independent of r r r ,
F x ( r ) = ψ ( r ) − a ( x ) ⊤ r + 1 2 r ⊤ J r . F_x(r)=\psi(r)-a(x)^\top r+\frac{1}{2}r^\top Jr. F x ( r ) = ψ ( r ) − a ( x ) ⊤ r + 2 1 r ⊤ J r .
Its Hessian diag ( 1 / ( r i ( 1 − r i ) ) ) + J \operatorname{diag}(1/(r_i(1-r_i)))+J diag ( 1/ ( r i ( 1 − r i ))) + J is smallest at r = 1 2 1 r=\frac{1}{2}\mathbf{1} r = 2 1 1 , where it equals 4 I + J 4I+J 4 I + J , so ∇ 2 F x ⪰ 4 m I \nabla^2F_x\succeq4mI ∇ 2 F x ⪰ 4 m I with m = 1 + λ min ( J ) / 4 > 0 m=1+\lambda_{\min}(J)/4>0 m = 1 + λ m i n ( J ) /4 > 0 . Hence F x F_x F x has a unique minimizer r ∗ ( x ) ∈ ( 0 , 1 ) K r^*(x)\in(0,1)^K r ∗ ( x ) ∈ ( 0 , 1 ) K , which defines q ∗ q^* q ∗ and satisfies u ∗ : = logit r ∗ = a − J r ∗ u^*:=\operatorname{logit}r^*=a-Jr^* u ∗ := logit r ∗ = a − J r ∗ .
Convergence. With β = 1 \beta=1 β = 1 and u 0 = logit π u_0=\operatorname{logit}\pi u 0 = logit π , eq. (10) reads u ˙ = a − J r − u = − ∇ F x ( r ) \dot{u}=a-Jr-u=-\nabla F_x(r) u ˙ = a − J r − u = − ∇ F x ( r ) , a smooth, globally Lipschitz flow in u u u . Let V ( t ) = D K L ( q ∗ ∥ q r ( t ) ) V(t)=\mathcal{D}_{\mathrm{KL}}(q^*\mathbin\Vert q_{r(t)}) V ( t ) = D KL ( q ∗ ∥ q r ( t ) ) , the Bregman divergence of ψ \psi ψ . Then V ˙ = − ⟨ ∇ F x ( r ) , r − r ∗ ⟩ ≤ − [ F x ( r ) − F x ( r ∗ ) ] \dot{V}=-\langle\nabla F_x(r),r-r^*\rangle\leq-[F_x(r)-F_x(r^*)] V ˙ = − ⟨ ∇ F x ( r ) , r − r ∗ ⟩ ≤ − [ F x ( r ) − F x ( r ∗ )] by convexity, while d d t F x ( r ) = − ∇ F x ⊤ diag ( r i ( 1 − r i ) ) ∇ F x ≤ 0 \frac{d}{dt}F_x(r)=-\nabla F_x^\top\operatorname{diag}(r_i(1-r_i))\nabla F_x\leq0 d t d F x ( r ) = − ∇ F x ⊤ diag ( r i ( 1 − r i )) ∇ F x ≤ 0 . Hence
t [ F x ( r ( t ) ) − F x ( r ∗ ) ] ≤ ∫ 0 t [ F x ( r ( s ) ) − F x ( r ∗ ) ] d s ≤ V ( 0 ) ≤ ∑ i − log min { π i , 1 − π i } t[F_x(r(t))-F_x(r^*)]\leq\int_0^t[F_x(r(s))-F_x(r^*)]\,ds\leq V(0)\leq\sum_i-\log\min\{\pi_i,1-\pi_i\} t [ F x ( r ( t )) − F x ( r ∗ )] ≤ ∫ 0 t [ F x ( r ( s )) − F x ( r ∗ )] d s ≤ V ( 0 ) ≤ i ∑ − log min { π i , 1 − π i }
for every x x x . Since R ( q t ) − R ( q ∗ ) = E [ F x ( r ( t ) ) − F x ( r ∗ ) ] R(q_t)-R(q^*)=\mathbb{E}[F_x(r(t))-F_x(r^*)] R ( q t ) − R ( q ∗ ) = E [ F x ( r ( t )) − F x ( r ∗ )] , this gives R ( q t ) → R ( q ∗ ) R(q_t)\to R(q^*) R ( q t ) → R ( q ∗ ) at rate O ( 1 / t ) O(1/t) O ( 1/ t ) .
r i ∗ r_i^* r i ∗ is not a single-projection function.
Choose i , j i,j i , j with W i j ≠ 0 W_{ij}\ne0 W ij = 0 and ϕ ( i ) , ϕ ( j ) \phi^{(i)},\phi^{(j)} ϕ ( i ) , ϕ ( j ) not parallel. Implicit differentiation of ∇ F x ( r ∗ ) = 0 \nabla F_x(r^*)=0 ∇ F x ( r ∗ ) = 0 gives ∂ r ∗ / ∂ x = H x − 1 Φ ⊤ \partial r^*/\partial x=H_x^{-1}\Phi^\top ∂ r ∗ / ∂ x = H x − 1 Φ ⊤ with H x = ∇ 2 F x ( r ∗ ) ⪰ 4 m I H_x=\nabla^2F_x(r^*)\succeq4mI H x = ∇ 2 F x ( r ∗ ) ⪰ 4 m I , and ∂ u ∗ / ∂ x = Φ ⊤ − J H x − 1 Φ ⊤ \partial u^*/\partial x=\Phi^\top-JH_x^{-1}\Phi^\top ∂ u ∗ / ∂ x = Φ ⊤ − J H x − 1 Φ ⊤ . Both are bounded. Along a ray x = t d x=td x = t d with d d d orthogonal to no atom, u ∗ = a − J r ∗ u^*=a-Jr^* u ∗ = a − J r ∗ forces every coordinate to saturate, so ∂ r i ∗ / ∂ x = diag ( r k ∗ ( 1 − r k ∗ ) ) ∂ u ∗ / ∂ x → 0 \partial r_i^*/\partial x=\operatorname{diag}(r_k^*(1-r_k^*))\partial u^*/\partial x\to0 ∂ r i ∗ / ∂ x = diag ( r k ∗ ( 1 − r k ∗ )) ∂ u ∗ / ∂ x → 0 and ∇ x u i ∗ → ϕ ( i ) \nabla_xu_i^*\to\phi^{(i)} ∇ x u i ∗ → ϕ ( i ) .
Now let Q = { k : ϕ ( k ) = λ k ϕ ( j ) } Q=\{k:\phi^{(k)}=\lambda_k\phi^{(j)}\} Q = { k : ϕ ( k ) = λ k ϕ ( j ) } and take a ray x = t v x=tv x = t v with v ⊥ ϕ ( j ) v\perp\phi^{(j)} v ⊥ ϕ ( j ) orthogonal to no atom outside Q Q Q . The coordinates outside Q Q Q saturate, while r Q ∗ r_Q^* r Q ∗ converges to the minimizer s ∈ ( 0 , 1 ) Q s\in(0,1)^Q s ∈ ( 0 , 1 ) Q of the reduced problem, which is strongly convex because λ min ( J Q Q ) ≥ λ min ( J ) \lambda_{\min}(J_{QQ})\geq\lambda_{\min}(J) λ m i n ( J QQ ) ≥ λ m i n ( J ) . With H Q = diag ( 1 / ( s k ( 1 − s k ) ) ) + J Q Q ≻ 0 H_Q=\operatorname{diag}(1/(s_k(1-s_k)))+J_{QQ}\succ0 H Q = diag ( 1/ ( s k ( 1 − s k ))) + J QQ ≻ 0 , the limiting equations give ∂ r Q ∗ / ∂ x → H Q − 1 λ ( ϕ ( j ) ) ⊤ \partial r_Q^*/\partial x\to H_Q^{-1}\lambda(\phi^{(j)})^\top ∂ r Q ∗ / ∂ x → H Q − 1 λ ( ϕ ( j ) ) ⊤ , and since W i k = λ k W i j W_{ik}=\lambda_kW_{ij} W ik = λ k W ij for k ∈ Q k\in Q k ∈ Q ,
∇ x u i ∗ ( t v ) ⟶ ϕ ( i ) − W i j ( λ ⊤ H Q − 1 λ ) ϕ ( j ) . \nabla_xu_i^*(tv)\longrightarrow\phi^{(i)}-W_{ij}(\lambda^\top H_Q^{-1}\lambda)\phi^{(j)}. ∇ x u i ∗ ( t v ) ⟶ ϕ ( i ) − W ij ( λ ⊤ H Q − 1 λ ) ϕ ( j ) .
The coefficient is nonzero, so this limit is not parallel to ϕ ( i ) \phi^{(i)} ϕ ( i ) . The gradient of u i ∗ u_i^* u i ∗ therefore has no fixed direction, and neither u i ∗ u_i^* u i ∗ nor r i ∗ r_i^* r i ∗ is a function of a single projection.
Positive approximation gap. Let δ = inf f , w , b E [ ( f ( w ⊤ x + b ) − r i ∗ ( x ) ) 2 ] \delta=\inf_{f,w,b}\mathbb{E}[(f(w^\top x+b)-r_i^*(x))^2] δ = inf f , w , b E [( f ( w ⊤ x + b ) − r i ∗ ( x ) ) 2 ] over measurable f : R → [ 0 , 1 ] f:\mathbb{R}\to[0,1] f : R → [ 0 , 1 ] . If δ = 0 \delta=0 δ = 0 , take g n = f n ( w n ⊤ x + b n ) → r i ∗ g_n=f_n(w_n^\top x+b_n)\to r_i^* g n = f n ( w n ⊤ x + b n ) → r i ∗ in L 2 ( p ) L^2(p) L 2 ( p ) , with unit w n w_n w n (absorbing scale into f n f_n f n . Constant functions can take any direction) and, along a subsequence, w n → w w_n\to w w n → w . Since p ( x ) p(x) p ( x ) is continuous and positive, the convergence also holds in L l o c 2 L^2_{\mathrm{loc}} L loc 2 . Each g n g_n g n is invariant along w n ⊥ w_n^\perp w n ⊥ , so ∫ g n ∂ v n ψ 0 = 0 \int g_n\,\partial_{v_n}\psi_0=0 ∫ g n ∂ v n ψ 0 = 0 for every test function ψ 0 \psi_0 ψ 0 and v n ⊥ w n v_n\perp w_n v n ⊥ w n . Taking v n = ( I − w n w n ⊤ ) v → v v_n=(I-w_nw_n^\top)v\to v v n = ( I − w n w n ⊤ ) v → v for v ⊥ w v\perp w v ⊥ w and passing to the limit gives ∫ r i ∗ ∂ v ψ 0 = 0 \int r_i^*\partial_v\psi_0=0 ∫ r i ∗ ∂ v ψ 0 = 0 , so the smooth function r i ∗ r_i^* r i ∗ is constant along w ⊥ w^\perp w ⊥ , contradicting the previous paragraph. Hence δ > 0 \delta>0 δ > 0 .
Gap in expected divergence. For q f ∈ A q_f\in\mathcal{A} q f ∈ A with means r f r_f r f , 4 m 4m 4 m -strong convexity and the optimality of r ∗ r^* r ∗ give
R ( q f ) − R ( q ∗ ) = E [ F x ( r f ( x ) ) − F x ( r ∗ ( x ) ) ] ≥ 2 m E ∥ r f − r ∗ ∥ 2 2 ≥ 2 m δ > 0. R(q_f)-R(q^*)=\mathbb{E}[F_x(r_f(x))-F_x(r^*(x))]\geq2m\,\mathbb{E}\lVert r_f-r^*\rVert_2^2\geq2m\delta>0. R ( q f ) − R ( q ∗ ) = E [ F x ( r f ( x )) − F x ( r ∗ ( x ))] ≥ 2 m E ∥ r f − r ∗ ∥ 2 2 ≥ 2 m δ > 0.
Together with R ( q t ) → R ( q ∗ ) R(q_t)\to R(q^*) R ( q t ) → R ( q ∗ ) , this proves the claim. □
The fixed-reference specialization of Alg. 1 discretizes this flow. With β = 1 \beta=1 β = 1 and the reference at the prior, its inner step is logit r ← logit r − ( 1 − e − h ) ∇ F x ( r ) \operatorname{logit}r\leftarrow\operatorname{logit}r-(1-e^{-h})\nabla F_x(r) logit r ← logit r − ( 1 − e − h ) ∇ F x ( r ) , that is, mirror descent with mirror map ψ \psi ψ . Since ∇ 2 F x ⪯ ( 1 + λ max ( J ) / 4 ) ∇ 2 ψ \nabla^2F_x\preceq(1+\lambda_{\max}(J)/4)\nabla^2\psi ∇ 2 F x ⪯ ( 1 + λ m a x ( J ) /4 ) ∇ 2 ψ , the same conclusion holds after finitely many inner steps, at a geometric rate, whenever 1 − e − h ≤ 4 / ( 4 + λ max ( J ) ) 1-e^{-h}\leq4/(4+\lambda_{\max}(J)) 1 − e − h ≤ 4/ ( 4 + λ m a x ( J )) ([51 ] ). This discrete guarantee requires both β = 1 \beta=1 β = 1 and the stated step-size bound.
The condition λ min ( J ) > − 4 \lambda_{\min}(J) > -4 λ m i n ( J ) > − 4 is exactly the condition for the mean-field objective to be strongly convex, so it has a single optimum that BeFOND approaches. A width-independent sufficient condition follows for atoms of equal norm c c c under unit covariance: λ min ( J ) ≥ − c 2 \lambda_{\min}(J) \ge-c^2 λ m i n ( J ) ≥ − c 2 , with equality when K > M K > M K > M , so it reduces to c < 2 c < 2 c < 2 in units of the noise standard deviation. For stronger coupling the objective can have several local minima, one per competing explanation, and the proposition does not apply.
Rolling-reference inference (section B.1.1) allows the inference budget to be allocated across reference updates. It includes fixed-reference inference by assigning the entire budget to the first inner block and returning its output before refreshing the reference. With a general positive-definite Σ \Sigma Σ , whitening gives the same statement with W = Φ T Σ − 1 Φ W = \Phi^{\mathsf{T}}\Sigma^{-1}\Phi W = Φ T Σ − 1 Φ and J = W − diag ( W ) J = W - \operatorname{diag}(W) J = W − diag ( W ) . The strong-convexity condition and discrete step-size bound use this J J J , while the sufficient norm bound applies to whitened atoms Σ − 1 / 2 ϕ ( i ) \Sigma^{-1/2}\phi^{(i)} Σ − 1/2 ϕ ( i ) .
Rain–sprinkler example
Figure 2 illustrates the two-atom case with independent rain and sprinkler latents, each with prior probability 0.1. The coordinates of x x x are lawn and roof wetness, with:
Φ = ( 2 2 3 0 ) , Σ = ( 1.05 ) 2 I 2 . \Phi= \begin{pmatrix} 2 & 2 \\ 3 & 0 \end{pmatrix}, \qquad\Sigma= (1.05)^2 I_2. Φ = ( 2 3 2 0 ) , Σ = ( 1.05 ) 2 I 2 .
Rain contributes to both coordinates, while the sprinkler contributes only to lawn wetness. The atoms are neither orthogonal nor parallel, so theorem 4.1 applies after whitening. Moreover, λ min ( J ) = − 4 / 1.05 2 > − 4 \lambda_{\min}(J) = -4/1.05^2 > -4 λ m i n ( J ) = − 4/1.0 5 2 > − 4 , satisfying theorem C.2.
The exact posterior is computed by enumerating the four latent configurations.
Fixed-prior inference. The BeFOND panel shows the unique optimal factorized Bernoulli posterior. We solve the stationary equations from theorem C.2 by fixed-point iteration, initialized at r = ( 0.1 , 0.1 ) r = (0.1, 0.1) r = ( 0.1 , 0.1 ) , with β = 1 \beta= 1 β = 1 and the generating prior held fixed. The update map has contraction factor 1 / 1.05 2 < 1 1/1.05^2 < 1 1/1.0 5 2 < 1 . Iteration continues until the fixed-point residual divided by 1 − 1 / 1.05 2 1 - 1/1.05^2 1 − 1/1.0 5 2 is below 2 × 10 − 13 2 \times10^{-13} 2 × 1 0 − 13 . The panel shows the converged solution of eq. (10) with the decoder and reference fixed.
Single-projection encoder. We numerically fit r i ( x ) = f i ( w i T x ) r_i(x) = f_i(w_i^{\mathsf{T}}x) r i ( x ) = f i ( w i T x ) to minimize the same model-averaged reverse KL to the exact posterior. Each unit direction is parameterized by an angle. A 12 × 12 12 \times12 12 × 12 angular grid over [ 0 , π ) [0,\pi) [ 0 , π ) supplies five starting points for local refinement. For each direction pair, the scalar response functions are solved from the conditional stationarity equations of this KL objective and represented by piecewise-linear probabilities. Final fits use 2,001 grid points per function, extending eight noise standard deviations beyond the projected component means, with constant extrapolation. Conditional expectations during fitting use 160-point Gauss–Hermite quadrature. The fitted rain and sprinkler directions are 65.80 ∘ 65.80^\circ 65.8 0 ∘ and − 20.02 ∘ -20.02^\circ − 20.0 2 ∘ , respectively.
We evaluate both methods using 160-point Gauss–Hermite quadrature per input coordinate and mixture component. Averaging D K L ( q ( z ∣ x ) ∥ p ( z ∣ x ) ) D_{\mathrm{KL}}(q(z \mid x)\Vert p(z \mid x)) D KL ( q ( z ∣ x ) ∥ p ( z ∣ x )) over x ∼ p ( x ) x \sim p(x) x ∼ p ( x ) gives 0.008508 nats for converged fixed-prior BeFOND and 0.021554 nats for the fitted single-projection encoder.
The white point has roof wetness 1.5, halfway between the dry and wet conditional means, and therefore equal roof likelihoods with and without rain. Raising roof wetness to 3 while holding lawn wetness fixed strengthens rain and suppresses the sprinkler. Table 3 reports the exact and factorized probabilities at these points.
Table 3: Posterior activation probabilities at the marked observations in Figure 2 , rounded to six decimal places. Neutral and wet correspond to x = ( 2 , 1.5 ) T x = (2,1.5)^{\mathsf{T}} x = ( 2 , 1.5 ) T and x = ( 2 , 3 ) T x = (2,3)^{\mathsf{T}} x = ( 2 , 3 ) T , respectively.
Table 3. Posterior activation probabilities at the marked observations in Figure 2, rounded to six decimal places. Neutral and wet correspond to x = ( 2 , 1.5 ) T x = (2,1.5)^{\mathsf{T}} x = ( 2 , 1.5 ) T and x = ( 2 , 3 ) T x = (2,3)^{\mathsf{T}} x = ( 2 , 3 ) T , respectively.
Inference and learning ablations
Inference ablation: lateral interactions
Figure 3 and Figure 6 use K = 4,096 K = 4{,}096 K = 4 , 096 . The baseline comparison uses initialization seeds 0, 1, and 2, with individual results in Table 4 . The lateral ablations use seed 0. Metric definitions are in Section C.1.3. The lateral ablations use matched learning rates, β \beta β , and decoder norms. Their full BeFOND control differs from the selected BeFOND recipe in the baseline comparison at d = 512 , 384 , 256 d = 512, 384, 256 d = 512 , 384 , 256 : the ablations use ( L R , β ) = ( 0.001 , 1 ) , ( 0.001 , 1 ) , ( 0.001 , 2 ) (\mathrm{LR}, \beta) = (0.001, 1), (0.001, 1), (0.001, 2) ( LR , β ) = ( 0.001 , 1 ) , ( 0.001 , 1 ) , ( 0.001 , 2 ) , whereas the baseline comparison uses ( 0.0003 , 0.5 ) , ( 0.0003 , 1 ) , ( 0.0003 , 1.5 ) (0.0003, 0.5), (0.0003, 1), (0.0003, 1.5) ( 0.0003 , 0.5 ) , ( 0.0003 , 1 ) , ( 0.0003 , 1.5 ) . Excitatory-only runs at d = 1,024 d = 1{,}024 d = 1 , 024 and 1,536 1{,}536 1 , 536 stopped early. At d = 256 d = 256 d = 256 , suppressive interactions raise MCC from 0.2810 to 0.6862 within the matched ablation recipes. Excitatory-only inference activates almost all 4,096 latents but reaches MCC 0.2825. Suppressive-only inference has one dead latent at d = 1,536 d = 1{,}536 d = 1 , 536 and zero at the other dimensions. Both full and zero-off-diagonal inference have zero throughout.
Table 4: Individual-seed results for Figure 3 (K = 4,096 K = 4{,}096 K = 4 , 096 , K ⋆ = 16,384 K_\star= 16{,}384 K ⋆ = 16 , 384 ). MCC values retain the recorded precision. Dead latents are counted on 106 held-out examples using each model’s native activity rule (r i > 0.5 r_i > 0.5 r i > 0.5 for BeFOND and Mean-field + Adam).
Table 4.
Learning ablation: inference and learning geometry
The Euclidean ablations also reveal a substantial gain in training efficiency (Figure 7 ). Natural inference and learning (N/N) reach MCC 0.500 and Rare F1 0.280 after just 1,000 updates, exceeding both Euclidean variants after 100,000 updates on their respectively tuned runs.
The natural-inference/natural-learning recipe reaches stronger recovery in fewer decoder updates. Each geometry uses a separately tuned recipe, with settings given in Table 2 . Section C.4 derives equal contraction for frozen, matched second moments and extends the result to unequal moments.
Rolling prior
Figure 8 varies β \beta β and the cap on the mean initial prior in 72 completed fits: six values of each hyperparameter and seeds 0 and 1. Increasing β \beta β reduces final activity in this sweep, but also reduces recovery at the larger values. Several looser caps produce overlapping curves because the learned prior lies below those caps. The initial-prior cap constrains the starting activity, while the rolling-reference dynamics determine activity later in the rollout.
Figure 8. Sparsity and recovery versus β \beta β on SynthSAEBench (d = 768 d = 768 d = 768 , K = 4,096 K = 4{,}096 K = 4 , 096 , K ⋆ = 16,384 K_{\star} = 16{,}384 K ⋆ = 16 , 384 ). Colors indicate the mean initial-prior cap, lines show the mean over two seeds, and shading shows their range. Each fit uses 12,000 updates and is evaluated on 8,192 examples after 5,000 inference steps.
All fits use raw, unwhitened inputs, batch size 1,024, a learning rate decaying from 0.001 to 10 − 5 10^{-5} 1 0 − 5 , one inner ETD1 step with h = ∞ h = \infty h = ∞ , and an exponential training horizon with mean 5.5 capped at 50. The decoder dictionary starts at norm 2 and is clipped at norm 4. The decoder covariance is fixed, decoder bias is learned, and Fisher damping is 10 − 5 10^{-5} 1 0 − 5 . Initial-prior fits use 100 inference steps on 1,024 examples every 500 updates, with no positive prior floor. Total exposure is 12.3M main plus 24,576 prior examples per fit.
Exact and approximate rarity compensation
Fix a training minibatch and hold its inferred distributions, prior references, and covariance Σ ≻ 0 \mathbf{\Sigma} \succ0 Σ ≻ 0 fixed during the decoder update. Throughout this subsection, E ≻ 0 \mathbf{E} \succ0 E ≻ 0 and E p ≻ 0 \mathbf{E}_p \succ0 E p ≻ 0 denote the minibatch averages of the posterior and prior second moments in eq. (59) , and F \mathcal{F} F denotes the resulting minibatch-averaged free energy. In Fisher-preconditioned decoder updates, the matrix gradient is implicitly vectorized columnwise before multiplication by G Φ − 1 \mathbf{G}_{\Phi}^{-1} G Φ − 1 , and the result is reshaped to the decoder matrix.
Proof of Theorem 4.2. For the unit-covariance likelihood in the theorem, the decoder-dependent terms are
F ( Φ ) = 1 2 E b a t c h E q [ ∥ x − Φ z ∥ 2 2 ] + c o n s t . \mathcal{F}(\Phi) = \frac{1}{2}\mathbb{E}_{\mathrm{batch}}\mathbb{E}_{q}\left[\lVert x-\Phi z\rVert_{2}^{2}\right] + \mathrm{const}. F ( Φ ) = 2 1 E batch E q [ ∥ x − Φ z ∥ 2 2 ] + const .
The posterior and prior references are fixed, so the KL term is constant in Φ \Phi Φ . Expanding the quadratic gives
∇ Φ F = Φ E − E b a t c h [ x r T ] , \nabla_{\Phi}\mathcal{F} = \Phi\mathbf{E} - \mathbb{E}_{\mathrm{batch}}[x r^{\mathsf{T}}], ∇ Φ F = Φ E − E batch [ x r T ] ,
∇ vec ( Φ ) 2 F = E ⊗ I ≻ 0. (87) \nabla_{\operatorname{vec}(\Phi)}^{2}\mathcal{F} = \mathbf{E}\otimes\mathbf{I} \succ0. \tag*{(87)} ∇ vec ( Φ ) 2 F = E ⊗ I ≻ 0. (87)
Hence the minimizer is unique, Φ ∗ = E b a t c h [ x r T ] E − 1 \Phi^{*} = \mathbb{E}_{\mathrm{batch}}[x r^{\mathsf{T}}]\mathbf{E}^{-1} Φ ∗ = E batch [ x r T ] E − 1 , and ∇ Φ F = ( Φ − Φ ∗ ) E \nabla_{\Phi}\mathcal{F} = (\Phi-\Phi^{*})\mathbf{E} ∇ Φ F = ( Φ − Φ ∗ ) E .
For a model draw x ~ ∣ z ∼ N ( Φ z , I ) \tilde{x}\mid z\sim\mathcal{N}(\Phi z,\mathbf{I}) x ~ ∣ z ∼ N ( Φ z , I ) , the decoder score is
∇ Φ log p Φ ( x ~ ∣ z ) = ( x ~ − Φ z ) z T . \nabla_{\Phi}\log p_{\Phi}(\tilde{x}\mid z) = (\tilde{x}-\Phi z)z^{\mathsf{T}}. ∇ Φ log p Φ ( x ~ ∣ z ) = ( x ~ − Φ z ) z T .
The conditional residual has second moment I \mathbf{I} I . Averaging the vectorized score’s outer product over these model draws and the fixed prior references therefore gives G Φ = E p ⊗ I \mathbf{G}_{\Phi}=\mathbf{E}_{p}\otimes\mathbf{I} G Φ = E p ⊗ I . Its inverse acts on a matrix gradient by right multiplication with E p − 1 \mathbf{E}_{p}^{-1} E p − 1 . Thus, when E p = E \mathbf{E}_{p}=\mathbf{E} E p = E ,
Euclidean: d d τ ( Φ − Φ ∗ ) = − η Φ ( Φ − Φ ∗ ) E , \frac{d}{d\tau}(\Phi-\Phi^{*})=-\eta_{\Phi}(\Phi-\Phi^{*})\mathbf{E}, d τ d ( Φ − Φ ∗ ) = − η Φ ( Φ − Φ ∗ ) E ,
Natural: d d τ ( Φ − Φ ∗ ) = − η Φ ( Φ − Φ ∗ ) . \frac{d}{d\tau}(\Phi-\Phi^{*})=-\eta_{\Phi}(\Phi-\Phi^{*}). d τ d ( Φ − Φ ∗ ) = − η Φ ( Φ − Φ ∗ ) .
Integrating the natural flow yields
Φ ( Δ t ) − Φ ∗ = e − η Φ Δ t ( Φ ( 0 ) − Φ ∗ ) . (88) \Phi(\Delta t)-\Phi^{*}=e^{-\eta_{\Phi}\Delta t}(\Phi(0)-\Phi^{*}). \tag*{(88)} Φ ( Δ t ) − Φ ∗ = e − η Φ Δ t ( Φ ( 0 ) − Φ ∗ ) . (88)
The matching condition is E p = E \mathbf{E}_{p}=\mathbf{E} E p = E for the minibatch-averaged second moments.
To compare relaxation times, let E v j = λ j v j \mathbf{E}v_j=\lambda_jv_j E v j = λ j v j . Since E ≻ 0 \mathbf{E}\succ0 E ≻ 0 , its eigenvectors form an orthonormal basis and λ j > 0 \lambda_j>0 λ j > 0 . Along the Euclidean trajectory,
( Φ ( Δ t ) − Φ ∗ ) v j = e − η Φ λ j Δ t ( Φ ( 0 ) − Φ ∗ ) v j . (\Phi(\Delta t)-\Phi^{*})v_j=e^{-\eta_{\Phi}\lambda_j\Delta t}(\Phi(0)-\Phi^{*})v_j. ( Φ ( Δ t ) − Φ ∗ ) v j = e − η Φ λ j Δ t ( Φ ( 0 ) − Φ ∗ ) v j .
Its modal relaxation times are 1 / ( η Φ λ j ) 1/(\eta_{\Phi}\lambda_j) 1/ ( η Φ λ j ) , so the ratio of the slowest to the fastest is λ max ( E ) / λ min ( E ) = κ ( E ) \lambda_{\max}(\mathbf{E})/\lambda_{\min}(\mathbf{E})=\kappa(\mathbf{E}) λ m a x ( E ) / λ m i n ( E ) = κ ( E ) . Natural flow instead has relaxation time 1 / η Φ 1/\eta_{\Phi} 1/ η Φ in every direction. Since z i 2 = z i z_i^2=z_i z i 2 = z i for Bernoulli latents,
ρ i = E i i = E b a t c h E q [ z i ] = E b a t c h [ r i ] . \rho_i=\mathbf{E}_{ii}=\mathbb{E}_{\mathrm{batch}}\mathbb{E}_{q}[z_i]=\mathbb{E}_{\mathrm{batch}}[r_i]. ρ i = E ii = E batch E q [ z i ] = E batch [ r i ] .
The Rayleigh quotient bounds each diagonal entry between the smallest and largest eigenvalues, giving
λ max ( E ) ≥ ρ max , λ min ( E ) ≤ ρ min , κ ( E ) ≥ ρ max ρ min . \lambda_{\max}(\mathbf{E})\geq\rho_{\max},\qquad
\lambda_{\min}(\mathbf{E})\leq\rho_{\min},\qquad
\kappa(\mathbf{E})\geq\frac{\rho_{\max}}{\rho_{\min}}. λ m a x ( E ) ≥ ρ m a x , λ m i n ( E ) ≤ ρ m i n , κ ( E ) ≥ ρ m i n ρ m a x .
For one feature with known activity, E = p \mathbf{E}=p E = p , recovering the Euclidean rate η Φ p \eta_{\Phi}p η Φ p and natural rate η Φ \eta_{\Phi} η Φ used in the scalar example.
Corollary C.3 (Power-law feature frequencies ). Under theorem 4.2, suppose the averaged posterior activation probabilities satisfy ρ i = c i − α \rho_i = c i^{-\alpha} ρ i = c i − α for i = 1 , … , K i = 1,\ldots,K i = 1 , … , K , with c > 0 c > 0 c > 0 and α > 0 \alpha> 0 α > 0 . The ratio of the slowest to the fastest Euclidean relaxation time is at least K α K^\alpha K α ; whereas, for the matched natural-gradient flow it is one.
Proof. The largest and smallest frequencies are c c c and c K − α cK^{-\alpha} c K − α . Substituting their ratio into the theorem gives κ ( E ) ≥ K α \kappa(\mathbf{E}) \ge K^\alpha κ ( E ) ≥ K α . eq. (88) gives the common natural-gradient relaxation time.
With the inferred codes fixed and the averaged second moments matched, natural-gradient flow has the same local contraction rate in every decoder direction.
General observation covariance. For fixed Σ ≻ 0 \boldsymbol{\Sigma} \succ0 Σ ≻ 0 , the corresponding gradient, Hessian, and decoder Fisher are
∇ Φ F = Σ − 1 ( Φ − Φ ∗ ) E , \nabla_{\boldsymbol{\Phi}}\mathcal{F} = \boldsymbol{\Sigma}^{-1}(\boldsymbol{\Phi} - \boldsymbol{\Phi}^{*})\mathbf{E}, ∇ Φ F = Σ − 1 ( Φ − Φ ∗ ) E ,
∇ vec ( Φ ) 2 F = E ⊗ Σ − 1 , G Φ = E p ⊗ Σ − 1 . (89) \nabla^2_{\operatorname{vec}(\boldsymbol{\Phi})}\mathcal{F} = \mathbf{E} \otimes\boldsymbol{\Sigma}^{-1}, \qquad G_{\boldsymbol{\Phi}} = \mathbf{E}_{p} \otimes\boldsymbol{\Sigma}^{-1}. \tag*{(89)} ∇ vec ( Φ ) 2 F = E ⊗ Σ − 1 , G Φ = E p ⊗ Σ − 1 . (89)
The optimum is unchanged. Euclidean flow now obeys Φ ˙ = − η Φ Σ − 1 ( Φ − Φ ∗ ) E \dot{\boldsymbol{\Phi}} = -\eta_{\Phi}\boldsymbol{\Sigma}^{-1}(\boldsymbol{\Phi} - \boldsymbol{\Phi}^{*})\mathbf{E} Φ ˙ = − η Φ Σ − 1 ( Φ − Φ ∗ ) E ; its Hessian has condition number κ ( E ) κ ( Σ ) \kappa(\mathbf{E})\kappa(\boldsymbol{\Sigma}) κ ( E ) κ ( Σ ) because the Kronecker eigenvalues are products. Natural preconditioning cancels the observation precision and gives
d d τ ( Φ − Φ ∗ ) = − η Φ ( Φ − Φ ∗ ) E E p − 1 . \frac{d}{d\tau}(\boldsymbol{\Phi} - \boldsymbol{\Phi}^{*}) = -\eta_{\Phi}(\boldsymbol{\Phi} - \boldsymbol{\Phi}^{*})\mathbf{E}\mathbf{E}_{p}^{-1}. d τ d ( Φ − Φ ∗ ) = − η Φ ( Φ − Φ ∗ ) E E p − 1 .
The coefficients are fixed during the update, hence
Φ ( Δ t ) − Φ ∗ = ( Φ ( 0 ) − Φ ∗ ) exp [ − η Φ Δ t E E p − 1 ] . (90) \boldsymbol{\Phi}(\Delta t) - \boldsymbol{\Phi}^{*} = (\boldsymbol{\Phi}(0) - \boldsymbol{\Phi}^{*})\exp[-\eta_{\Phi}\Delta t\,\mathbf{E}\mathbf{E}_{p}^{-1}]. \tag*{(90)} Φ ( Δ t ) − Φ ∗ = ( Φ ( 0 ) − Φ ∗ ) exp [ − η Φ Δ t E E p − 1 ] . (90)
When E p = E \mathbf{E}_{p} = \mathbf{E} E p = E , this again reduces to eq. (88) , independently of the fixed observation covariance. The following extension treats unequal moments.
Proposition C.4 (Rarity compensation with unequal moments ). Under the same frozen-substep assumptions, let E ≻ 0 \mathbf{E} \succ0 E ≻ 0 , E p ≻ 0 \mathbf{E}_{p} \succ0 E p ≻ 0 , and η Φ > 0 \eta_{\Phi} > 0 η Φ > 0 , without requiring E = E p \mathbf{E} = \mathbf{E}_{p} E = E p . The decoder error obeys eq. (90) . Define
λ ∗ : = λ min ( E p − 1 / 2 E E p − 1 / 2 ) > 0. \lambda_{*} := \lambda_{\min}\left(\mathbf{E}_{p}^{-1/2}\mathbf{E}\mathbf{E}_{p}^{-1/2}\right) > 0. λ ∗ := λ m i n ( E p − 1/2 E E p − 1/2 ) > 0. Then, for Δ t ≥ 0 \Delta t \ge0 Δ t ≥ 0 ,
∥ ( Φ ( Δ t ) − Φ ∗ ) E p 1 / 2 ∥ F ≤ e − η Φ λ ∗ Δ t ∥ ( Φ ( 0 ) − Φ ∗ ) E p 1 / 2 ∥ F . (91) \left\|(\boldsymbol{\Phi}(\Delta t) - \boldsymbol{\Phi}^{*})\mathbf{E}_{p}^{1/2}\right\|_{F} \le e^{-\eta_{\Phi}\lambda_{*}\Delta t}\left\|(\boldsymbol{\Phi}(0) - \boldsymbol{\Phi}^{*})\mathbf{E}_{p}^{1/2}\right\|_{F}. \tag*{(91)} ( Φ ( Δ t ) − Φ ∗ ) E p 1/2 F ≤ e − η Φ λ ∗ Δ t ( Φ ( 0 ) − Φ ∗ ) E p 1/2 F . (91) In particular, if
( 1 − ϵ ) E p ⪯ E ⪯ ( 1 + ϵ ) E p , 0 ≤ ϵ < 1 , (1-\epsilon)\mathbf{E}_{p} \preceq\mathbf{E} \preceq(1+\epsilon)\mathbf{E}_{p}, \qquad0 \le\epsilon< 1, ( 1 − ϵ ) E p ⪯ E ⪯ ( 1 + ϵ ) E p , 0 ≤ ϵ < 1 , then
∥ ( Φ ( Δ t ) − Φ ∗ ) E p 1 / 2 ∥ F ≤ e − η Φ ( 1 − ϵ ) Δ t ∥ ( Φ ( 0 ) − Φ ∗ ) E p 1 / 2 ∥ F . (92) \left\|(\boldsymbol{\Phi}(\Delta t) - \boldsymbol{\Phi}^{*})\mathbf{E}_{p}^{1/2}\right\|_{F} \le e^{-\eta_{\Phi}(1-\epsilon)\Delta t}\left\|(\boldsymbol{\Phi}(0) - \boldsymbol{\Phi}^{*})\mathbf{E}_{p}^{1/2}\right\|_{F}. \tag*{(92)} ( Φ ( Δ t ) − Φ ∗ ) E p 1/2 F ≤ e − η Φ ( 1 − ϵ ) Δ t ( Φ ( 0 ) − Φ ∗ ) E p 1/2 F . (92) Proof. eq. (90) follows from the quadratic decoder gradient derived above. Multiplying its error dynamics on the right by E p 1 / 2 \mathbf{E}_{p}^{1/2} E p 1/2 gives:
d d τ [ ( Φ − Φ ∗ ) E p 1 / 2 ] = − η Φ [ ( Φ − Φ ∗ ) E p 1 / 2 ] ( E p − 1 / 2 E E p − 1 / 2 ) . \frac{d}{d\tau}\left[(\boldsymbol{\Phi} - \boldsymbol{\Phi}^{*})\mathbf{E}_{p}^{1/2}\right] = -\eta_{\Phi}\left[(\boldsymbol{\Phi} - \boldsymbol{\Phi}^{*})\mathbf{E}_{p}^{1/2}\right]\left(\mathbf{E}_{p}^{-1/2}\mathbf{E}\mathbf{E}_{p}^{-1/2}\right). d τ d [ ( Φ − Φ ∗ ) E p 1/2 ] = − η Φ [ ( Φ − Φ ∗ ) E p 1/2 ] ( E p − 1/2 E E p − 1/2 ) . The matrix in the final parentheses is symmetric positive definite, so its decay exponential has spectral norm e − η Φ λ ∗ Δ t e^{-\eta_{\Phi}\lambda_{*}\Delta t} e − η Φ λ ∗ Δ t . Applying ∥ A B ∥ F ≤ ∥ A ∥ F ∥ B ∥ 2 \lVert AB\rVert_F \le\lVert A\rVert_F\lVert B\rVert_2 ∥ A B ∥ F ≤ ∥ A ∥ F ∥ B ∥ 2 proves eq. (91) . Under the stated moment bounds, this matrix has eigenvalues in [ 1 − ϵ , 1 + ϵ ] [1-\epsilon,1+\epsilon] [ 1 − ϵ , 1 + ϵ ] , hence λ ∗ ≥ 1 − ϵ \lambda_{*} \ge1-\epsilon λ ∗ ≥ 1 − ϵ , which proves eq. (92) .
Activity-normalized inference
Theorem C.5 (Activity-normalized inference). Fix the observation, decoder, covariance, and current prior reference during inference. For the factorized Bernoulli posterior, let r i = σ ( u i ) ∈ ( 0 , 1 ) r_i = \sigma(u_i) \in(0,1) r i = σ ( u i ) ∈ ( 0 , 1 ) . At the same posterior state, the unit-rate Euclidean and natural-gradient flows in membrane-potential (logit) coordinates satisfy
u ˙ i N G D = − 1 r i ( 1 − r i ) ∂ F ∂ u i , u ˙ i G D = r i ( 1 − r i ) u ˙ i N G D . \dot{u}_i^{\mathrm{NGD}}=-\frac{1}{r_i(1-r_i)}\frac{\partial\mathcal{F}}{\partial u_i}, \qquad\dot{u}_i^{\mathrm{GD}}=r_i(1-r_i)\dot{u}_i^{\mathrm{NGD}}. u ˙ i NGD = − r i ( 1 − r i ) 1 ∂ u i ∂ F , u ˙ i GD = r i ( 1 − r i ) u ˙ i NGD . Thus natural-gradient inference removes the multiplicative Bernoulli variance factor from each membrane-potential update.
Proof of Theorem C.5. For factorized Bernoulli latents, r i = σ ( u i ) ∈ ( 0 , 1 ) r_i = \sigma(u_i) \in(0,1) r i = σ ( u i ) ∈ ( 0 , 1 ) , so
∂ r i ∂ u i = r i ( 1 − r i ) , C = diag [ r ⊙ ( 1 − r ) ] . \frac{\partial r_i}{\partial u_i}=r_i(1-r_i), \qquad\mathbf{C}=\operatorname{diag}[\mathbf{r}\odot(1-\mathbf{r})]. ∂ u i ∂ r i = r i ( 1 − r i ) , C = diag [ r ⊙ ( 1 − r )] .
The score is ∂ log q u ( z ∣ x ) / ∂ u i = z i − r i \partial\log q_u(z\mid x)/\partial u_i = z_i-r_i ∂ log q u ( z ∣ x ) / ∂ u i = z i − r i . Independence therefore gives the posterior Fisher G ( u ) = C \mathbf{G}(\mathbf{u})=\mathbf{C} G ( u ) = C . The chain rule yields ∇ u F = C ∇ r F \nabla_{\mathbf{u}}\mathcal{F}=\mathbf{C}\nabla_{\mathbf{r}}\mathcal{F} ∇ u F = C ∇ r F . Natural preconditioning cancels this factor:
u ˙ i N G D = − 1 r i ( 1 − r i ) ∂ F ∂ u i = − ∂ F ∂ r i , u ˙ i G D = r i ( 1 − r i ) u ˙ i N G D . \dot{u}_i^{\mathrm{NGD}}=-\frac{1}{r_i(1-r_i)}\frac{\partial\mathcal{F}}{\partial u_i}=-\frac{\partial\mathcal{F}}{\partial r_i}, \qquad\dot{u}_i^{\mathrm{GD}}=r_i(1-r_i)\dot{u}_i^{\mathrm{NGD}}. u ˙ i NGD = − r i ( 1 − r i ) 1 ∂ u i ∂ F = − ∂ r i ∂ F , u ˙ i GD = r i ( 1 − r i ) u ˙ i NGD .
When the inference drive favors activation, this cancellation removes an additional suppression of weakly active latents’ logit updates. When the inference drive favors activation, this cancellation removes the variance factor from weakly active latents’ logit updates. Activation probabilities evolve according to r ˙ i = r i ( 1 − r i ) u ˙ i \dot{r}_i=r_i(1-r_i)\dot{u}_i r ˙ i = r i ( 1 − r i ) u ˙ i .
Local conditioning under Adam normalization
Adam normalizes updates using coordinatewise estimates of gradient second moments [45 , 9 ] . The following calculation isolates the effect of this normalization on decoder conditioning.
Proposition C.6 (Local conditioning under frozen Adam normalization). Let x = Φ ∗ z + ξ x=\Phi_*z+\xi x = Φ ∗ z + ξ , where the known codes have independent coordinates z i ∼ Bernoulli ( ρ i ) z_i\sim\operatorname{Bernoulli}(\rho_i) z i ∼ Bernoulli ( ρ i ) with 0 < ρ i < 1 0<\rho_i<1 0 < ρ i < 1 , and ξ ∼ N ( 0 , I d ) \xi\sim\mathcal{N}(0,\mathbf{I}_d) ξ ∼ N ( 0 , I d ) is independent of z z z . For the unconstrained population loss
L ( Φ ) = 1 2 E ∥ x − Φ z ∥ 2 2 , E = E [ z z ⊤ ] , H = E ⊗ I d , L(\Phi)=\frac{1}{2}\mathbb{E}\lVert x-\Phi z\rVert_2^2,\qquad\mathbf{E}=\mathbb{E}[zz^\top],\qquad\mathbf{H}=\mathbf{E}\otimes\mathbf{I}_d, L ( Φ ) = 2 1 E ∥ x − Φ z ∥ 2 2 , E = E [ z z ⊤ ] , H = E ⊗ I d , consider gradients averaged over B B B independent samples. Freeze the Adam denominator at the square root of its expected second-moment target at Φ ∗ \Phi_* Φ ∗ , with stabilizer ϵ > 0 \epsilon>0 ϵ > 0 . The resulting diagonal preconditioner is
D ϵ = diag i = 1 K [ ( ϵ + ρ i / B ) − 1 ] ⊗ I d . \mathbf{D}_{\epsilon}=\operatorname{diag}_{i=1}^{K}\left[\left(\epsilon+\sqrt{\rho_i/B}\right)^{-1}\right]\otimes\mathbf{I}_d. D ϵ = diag i = 1 K [ ( ϵ + ρ i / B ) − 1 ] ⊗ I d . Writing A ϵ = D ϵ 1 / 2 H D ϵ 1 / 2 \mathbf{A}_{\epsilon}=\mathbf{D}_{\epsilon}^{1/2}\mathbf{H}\mathbf{D}_{\epsilon}^{1/2} A ϵ = D ϵ 1/2 H D ϵ 1/2 , its condition number satisfies
κ ( A ϵ ) ≥ ρ max / ( ϵ + ρ max / B ) ρ min / ( ϵ + ρ min / B ) ≥ ρ max ρ min . (93) \kappa(\mathbf{A}_{\epsilon})\geq\frac{\rho_{\max}/(\epsilon+\sqrt{\rho_{\max}/B})}{\rho_{\min}/(\epsilon+\sqrt{\rho_{\min}/B})}\geq\sqrt{\frac{\rho_{\max}}{\rho_{\min}}}. \tag*{(93)} κ ( A ϵ ) ≥ ρ m i n / ( ϵ + ρ m i n / B ) ρ m a x / ( ϵ + ρ m a x / B ) ≥ ρ m i n ρ m a x . (93) Thus ρ i = c i − α \rho_i=ci^{-\alpha} ρ i = c i − α , with 0 < c < 1 0<c<1 0 < c < 1 and α > 0 \alpha>0 α > 0 , gives κ ( A ϵ ) ≥ K α / 2 \kappa(\mathbf{A}_{\epsilon})\geq K^{\alpha/2} κ ( A ϵ ) ≥ K α /2 . Matched complete-data Fisher preconditioning instead gives H − 1 / 2 H H − 1 / 2 = I \mathbf{H}^{-1/2}\mathbf{H}\mathbf{H}^{-1/2}=\mathbf{I} H − 1/2 H H − 1/2 = I and condition number one.
Proof. The Hessian is H \mathbf{H} H , and E = diag ( ρ i ( 1 − ρ i ) ) + ρ ρ ⊤ ≻ 0 \mathbf{E}=\operatorname{diag}(\rho_i(1-\rho_i))+\boldsymbol{\rho}\boldsymbol{\rho}^{\top}\succ0 E = diag ( ρ i ( 1 − ρ i )) + ρ ρ ⊤ ≻ 0 . At the optimum, a single-sample gradient is − ξ z ⊤ -\xi z^\top − ξ z ⊤ , with mean zero and vectorized second moment H \mathbf{H} H . Independence gives second moment H / B \mathbf{H}/B H / B for the averaged gradient, yielding D ϵ \mathbf{D}_{\epsilon} D ϵ above. Each diagonal entry of A ϵ \mathbf{A}_{\epsilon} A ϵ is
a i = ρ i / ( ϵ + ρ i / B ) a_i = \rho_i/(\epsilon+ \sqrt{\rho_i/B}) a i = ρ i / ( ϵ + ρ i / B ) , repeated d d d times. Rayleigh quotients give κ ( A ϵ ) ≥ max i a i / min i a i \kappa(A_\epsilon) \ge\max_i a_i/\min_i a_i κ ( A ϵ ) ≥ max i a i / min i a i . Since a i a_i a i increases with ρ i \rho_i ρ i , the first bound follows. For s = ρ max / ρ min ≥ 1 s = \sqrt{\rho_{\max}/\rho_{\min}} \ge1 s = ρ m a x / ρ m i n ≥ 1 and t = ρ min / B t = \sqrt{\rho_{\min}/B} t = ρ m i n / B , the ratio is s 2 ( ϵ + t ) / ( ϵ + s t ) ≥ s s^2(\epsilon+ t)/(\epsilon+ st) \ge s s 2 ( ϵ + t ) / ( ϵ + s t ) ≥ s . Substitution gives the width bound. The complete-data Fisher equals H H H for this model, proving the final claim.
This local conditioning analysis uses known latent codes and fixes Adam’s gradient second-moment estimate at its expected value at the decoder optimum, before taking the square root to form the normalization. Adam’s normalization depends on gradient variance [9 ] , while the model Fisher measures distributional sensitivity [55 ] . Section B.8 discusses the computational cost of the implemented Fisher updates.
Learning and rare-feature recovery
Resampling and auxiliary-loss variants
Resampling and auxiliary losses aim to revive inactive features [15 , 39 ] . Figure 9 and Table 5 compare the original baselines with modified recipes using MinFire (BatchTopK), resampling (JumpReLU and Matryoshka), learning-rate decay, and retuned sparsity. These modifications substantially improve baseline recovery, but BeFOND retains the highest MCC, Macro F1, and Rare F1. The comparison evaluates complete recipes with different target sparsities. Measured L 0 L_0 L 0 is reported in the table.
Figure 9. BeFOND retains the highest MCC, Macro F1, and Rare F1 after baseline modifications aimed at preventing inactive features. Hatched bars denote modified recipes (d = 768 d = 768 d = 768 , K = K ∗ = 16,384 K = K_* = 16{,}384 K = K ∗ = 16 , 384 , seed 0); numerical results appear in Table 5 .
The modified recipes follow the released full-width sweep (chanind-goodfire, 2026), using seed 0, 200M samples, batch size 1,024, Adam with learning rate 3 × 10 − 4 3 \times10^{-4} 3 × 1 0 − 4 and moments (0.9, 0.999), BF16 autocast, gradient-norm clipping at 1, and learning-rate decay during the final 20% of training. Target L 0 L_0 L 0 is 45 for BatchTopK, 40 for JumpReLU, and 35 for Matryoshka.
MinFire (the sweep implementation’s MinFireGate in gates.py) reserves each latent’s strongest positive activation before filling the remaining batch-wide TopK budget. The selected BatchTopK recipe applies this gate every batch for the first 90% of training, then uses ordinary BatchTopK. JumpReLU uses an input straight-through estimator and a base L 0 L_0 L 0 coefficient of 0.1 with an adaptive multiplier. JumpReLU and Matryoshka resample every 2,500 updates during the first 80% of training, with inactivity windows of 1,000 and 100 updates, respectively. Resampled decoder atoms follow reconstruction-residual directions, and their optimizer moments are reset. BatchTopK and Matryoshka retain auxiliary-loss coefficient 1. Matryoshka uses prefixes 128, 512, 2,048, and 16,384 with per-level auxiliary losses.
Gemma Scope uses reconstruction and L 0 L_0 L 0 sparsity losses, without a separate dead-latent auxiliary loss, alongside straight-through estimators, tied initialization, learning-rate and sparsity warmup, and decoder normalization [50 Sections 2.2 and 3.2] .
Recovery across feature frequencies. Figure 10 resolves the comparison into frequency quintiles. The BeFOND checkpoint is the best run in Table 5 (MCC 0.8986), and the original and modified baseline checkpoints are those in Figure 9 . Improvements from the modified recipes extend into the rare tail, while BeFOND retains higher coverage and F1 in every quintile. Coverage measures dictionary alignment. F1 measures detection of the matched feature’s activity, so the two need not coincide.
Figure 10. Recovery across feature-frequency quintiles (d = 768 d = 768 d = 768 , K = K ⋆ = 16,384 K = K_{\star} = 16{,}384 K = K ⋆ = 16 , 384 , seed 0). Dashed lines show original baselines, and “+” denotes their modified recipes. Coverage is the fraction of features matched above cosine 0.8. Quintiles use each run’s 500K-example frequency reference. F1 uses 1M held-out examples. Random draws differ between some runs.
These fifths differ from Rare F1’s least-frequent quarter.
Dictionary capacity. Table 5 combines recovery, sparsity, and dead-latent counts. Main-text Figure 4 reports three-seed means: MCC 0.8980 and Rare F1 0.9519, with 0.33 dead latents on average. Its seed-0 run reaches MCC 0.8986 and Rare F1 0.9554, with one dead latent. The separate continuous run below reaches MCC 0.8974 and Rare F1 0.9482, with zero. MP has two dead latents but lower recovery, so keeping latents active is not sufficient for accurate feature recovery.
Training sample efficiency
Figure 11 reports MCC, Macro F1, and Rare F1 throughout training in the full-width setting. Its BeFOND curve follows one continuous run, whose endpoint is identified separately in Table 5 .
Figure 11. Feature recovery throughout training on unwhitened SynthSAEBench (d = 768 d = 768 d = 768 ; 16,384 learned and ground-truth features), using plain baseline recipes and seed 0. (a) Dictionary mean correlation coefficient (MCC). (b) Macro F1 over ground-truth features after positive-cosine one-to-one matching. (c) Rare F1 over the least frequent quartile, defined by a shared independent 500K-example frequency reference (seed 315031). Every checkpoint is evaluated on 1M held-out examples (seed 49100). BeFOND uses 200 inference steps with activity p > 0.5 p > 0.5 p > 0.5 ; baselines use positive native activations. The x-axis counts decoder-update examples and is piecewise linear: 1M examples at 0–10M, 5M at 10–50M, and 25M beyond 50M occupy equal horizontal distances. Cross-region slopes therefore do not have a common per-sample interpretation. Baseline points through 10M, after 10M through 50M, and beyond 50M come from separate matching-recipe runs with their original full-budget learning-rate schedules; they do not form a single continuous trajectory. Overlapping checkpoints are selected by these fixed windows, not by score. BeFOND uses one continuous run. Samples are rounded up to full batches. Baselines finish at approximately 200M decoder-update examples and BeFOND at 181.82M plus 18.18M separate prior-update examples, which are excluded from the x-axis. Baseline auxiliary exposure is not counted on this axis. Final measured L 0 L_0 L 0 values are BatchTopK: 34.83, JumpReLU: 45.15, Matryoshka: 19.98, Matching Pursuit: 29.65, ReLU-L1: 35.09, BeFOND: 35.70. One seed is shown; no uncertainty intervals are estimated.
Figure 12. Performance as a function of inference depth. Sparse probing top-1 accuracy (left), top-5 accuracy (middle), and RAVEL disentanglement (right) for BeFOND on Gemma-2-2B layer-12 activations, evaluated over T = 1 , … , 40 T = 1, \ldots, 40 T = 1 , … , 40 inference steps at dictionary widths of 16k, 65k, 131k, and 524k. All evaluations use checkpoint 12,207, corresponding to 49,999,872 training tokens. Lines show means and shaded regions indicate ± 1 \pm1 ± 1 sample standard deviation across three training seeds. Sparse probing peaks within the first few steps, whereas RAVEL generally benefits from longer inference.
Extended Gemma experiments
Experimental setup
Dataset. We extract layer-12 post-residual activations from Gemma-2-2B ([32 ] ) (d = 2,304 d = 2{,}304 d = 2 , 304 ). Documents from Pile Uncopyrighted (monology, 2023) are tokenized separately with BOS and truncated to 1,024 tokens. BOS and padding positions are excluded. Validation, calibration, and training use disjoint document ranges. Raw and whitened activations are evaluated separately. Validation and calibration each use 65,536 tokens, with up to 500M training tokens. Extraction uses BF16, batch 4, and no document packing. Whitening statistics were fitted on 500M training tokens.
Training. Table 7 summarizes the training and evaluation settings. The selected BeFOND results in Table 6 use seeds 0–2 and checkpoint 12,207, corresponding to 49,999,872 decoder-training tokens. Evaluation uses ten outer inference steps with one inner step per reference update. The readout retains posterior means above 0.5 and sets the remainder to zero, followed by decoder-norm rescaling.
Table 7. Gemma training and evaluation settings. Preprocessing, checkpoint, inference depth, and readout identify an evaluation configuration.
At widths 16K, 65K, and 131K, the recipes use β = 1 \beta= 1 β = 1 , ETD1 step h = 1.5 h = 1.5 h = 1.5 , reference retention 0.999, and decoder-norm targets 4, 1.5, and 0.75, respectively. At 524K they use β = 1.5 \beta= 1.5 β = 1.5 , h = ∞ h = \infty h = ∞ , full reference retention, and norm target 0.5. All use a global batch of 4,096 and a linear learning-rate schedule with peak 10 − 3 10^{-3} 1 0 − 3 and minimum 10 − 5 10^{-5} 1 0 − 5 . Warmup occupies 5% of training at 16K–131K and 1% at 524K.
Evaluation. Sparse probing reports mean test accuracy across 113 tasks, using the best 1 or 5 features selected on training data. RAVEL reports cause, isolation, and their mean (Huang et al., [38 ] ). Table 7 specifies the evaluation settings (Karvonen et al., [43 ] ).
Implementation. The Gemma reference environment uses Python 3.11.14, PyTorch 2.7.1+cu126, TransformerLens 2.16.1, Transformers 4.57.3, and SAE Lens 6.24.6.
Results
The whitened baseline comparison reports sparse probing and RAVEL in Table 8 , and Table 9 reports the Gemma Scope checkpoints.
Table 8. SAEBench results for SAEs trained on 50M tokens of whitened Gemma-2-2B layer-12 activations. Entries report mean ± sample standard deviation over five training seeds (1–5), evaluated at the final checkpoint (49,999,872 tokens). Sparse-probing metrics are macro-averaged over 113 tasks; RAVEL overall is the disentanglement score. All scores are fractions, and higher is better. L 0 L_0 L 0 denotes target training sparsity, fixed using a separate seed-0 pilot. Bold indicates the highest mean across L 0 L_0 L 0 values within each width–architecture group, selected before rounding. Sparse probing ([42 ] ) RAVEL ([38 ] ).
Wall-clock training times on H200 GPUs
Table 10 compares wall-clock training times on eight NVIDIA H200 GPUs, with one model measured at a time and seed 0 throughout. Each measurement covers the first 999,424 main-training tokens of the original 50M-token schedule. Global batch size is 4,096 for BeFOND, BatchTopK, and Matryoshka, and 2,048 for MF20+clip.
Table 10: Elapsed training time in seconds for 999,424 training tokens on eight NVIDIA H200 GPUs (lower is better). Each model is measured once at seed 0. Timings include BeFOND’s prior updates and exclude evaluation, initialization, warmup, data preparation, checkpointing, and logging. Matryoshka denotes Matryoshka BatchTopK. Mean-field + Adam uses 20 inference steps, gradient clipping, and batch skipping.
Table 10.
Inputs are loaded, shuffled, whitened, and placed in GPU memory before timing. Initialization and CUDA/JIT warmup are excluded, and the complete initial training state is restored after warmup. The timed interval includes inference, losses, parameter updates, normalization, required communication, and BeFOND’s prior updates with convergence checks. Evaluation, checkpoint writing, and logging are excluded. PyTorch timings use the maximum CUDA-synchronized elapsed time across ranks, while JAX waits for all output shards on all devices.
BeFOND retains its original stochastic training horizons, capped at 100 with one inner step, and warms the complete measured prefix to cover adaptive solver paths. MF uses 20 inference steps. Its clipping and loss-based skipping begin after 2,000 updates and are inactive during this prefix. Model tensors are FP32, with native FP64 intermediates retained in BeFOND’s moment reductions and Woodbury calculations. BeFOND and the amortized baselines use PyTorch, while MF uses JAX. The distributed baseline implementations preserve the global TopK budget and synchronize gradients, thresholds, and dead-feature histories.
BeFOND takes approximately 12–14× as long as BatchTopK across these widths.