From a6d88a18a4bfd46ab0dd487730b72dcbc3b8b5b8 Mon Sep 17 00:00:00 2001 From: Yuren Hao Date: Wed, 15 Jul 2026 10:32:26 -0500 Subject: assets/: organize into decks|figs|hw|refs|misc; scripts + gitignore repointed Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn --- .gitignore | 2 +- assets/decks/alexi_primer_deck.pptx | Bin 0 -> 999612 bytes assets/decks/zhai_update_0714.pptx | Bin 0 -> 205089 bytes assets/ept_method_intro.tex | 606 --------- assets/figs/fig_ep_phases.png | Bin 0 -> 159757 bytes assets/figs/fig_p3_schedule.png | Bin 0 -> 148284 bytes assets/figs/fig_p4_blowup.png | Bin 0 -> 171798 bytes assets/figs/fig_p5_loop.png | Bin 0 -> 130618 bytes assets/figs/fig_p6_window.png | Bin 0 -> 160498 bytes assets/figs/fig_primer_arch.emf | Bin 0 -> 539020 bytes assets/figs/fig_primer_arch.png | Bin 0 -> 389335 bytes assets/figs/fig_primer_arch.svg | 1327 ++++++++++++++++++++ assets/figs/fig_primer_block.emf | Bin 0 -> 826816 bytes assets/figs/fig_primer_block.png | Bin 0 -> 266630 bytes assets/figs/fig_primer_block.svg | 1956 ++++++++++++++++++++++++++++++ assets/figs/fig_primer_phases.emf | Bin 0 -> 358368 bytes assets/figs/fig_primer_phases.png | Bin 0 -> 204700 bytes assets/figs/fig_primer_phases.svg | 925 ++++++++++++++ assets/figs/frozen_vs_adaptive.png | Bin 0 -> 217748 bytes assets/frozen_vs_adaptive.png | Bin 217748 -> 0 bytes assets/hw/CLOCKLESS_ANALOG_MVP_PLAN.html | 509 ++++++++ assets/hw/COLLABORATOR_BRIEF.html | 98 ++ assets/hw/hw_mvp_explainer.html | 220 ++++ assets/hw/hw_outreach_pack.zip | Bin 0 -> 188976 bytes assets/misc/ept_method_intro.tex | 606 +++++++++ assets/misc/fw72m_api_proof.png | Bin 0 -> 146608 bytes ep_run/build_alexi_deck.py | 6 +- ep_run/fig_primer_arch.py | 6 +- ep_run/fig_primer_block.py | 6 +- ep_run/fig_primer_pack2.py | 2 +- ep_run/fig_primer_phases.py | 6 +- 31 files changed, 5655 insertions(+), 620 deletions(-) create mode 100644 assets/decks/alexi_primer_deck.pptx create mode 100644 assets/decks/zhai_update_0714.pptx delete mode 100644 assets/ept_method_intro.tex create mode 100644 assets/figs/fig_ep_phases.png create mode 100644 assets/figs/fig_p3_schedule.png create mode 100644 assets/figs/fig_p4_blowup.png create mode 100644 assets/figs/fig_p5_loop.png create mode 100644 assets/figs/fig_p6_window.png create mode 100644 assets/figs/fig_primer_arch.emf create mode 100644 assets/figs/fig_primer_arch.png create mode 100644 assets/figs/fig_primer_arch.svg create mode 100644 assets/figs/fig_primer_block.emf create mode 100644 assets/figs/fig_primer_block.png create mode 100644 assets/figs/fig_primer_block.svg create mode 100644 assets/figs/fig_primer_phases.emf create mode 100644 assets/figs/fig_primer_phases.png create mode 100644 assets/figs/fig_primer_phases.svg create mode 100644 assets/figs/frozen_vs_adaptive.png delete mode 100644 assets/frozen_vs_adaptive.png create mode 100644 assets/hw/CLOCKLESS_ANALOG_MVP_PLAN.html create mode 100644 assets/hw/COLLABORATOR_BRIEF.html create mode 100644 assets/hw/hw_mvp_explainer.html create mode 100644 assets/hw/hw_outreach_pack.zip create mode 100644 assets/misc/ept_method_intro.tex create mode 100644 assets/misc/fw72m_api_proof.png diff --git a/.gitignore b/.gitignore index ff95c94..2e0640c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ ep_run/data/ ep_run/runs/ runs/ archive/ -assets/*.pdf +assets/**/*.pdf *.pt *.state *.bin diff --git a/assets/decks/alexi_primer_deck.pptx b/assets/decks/alexi_primer_deck.pptx new file mode 100644 index 0000000..9dcea29 Binary files /dev/null and b/assets/decks/alexi_primer_deck.pptx differ diff --git a/assets/decks/zhai_update_0714.pptx b/assets/decks/zhai_update_0714.pptx new file mode 100644 index 0000000..7f284f7 Binary files /dev/null and b/assets/decks/zhai_update_0714.pptx differ diff --git a/assets/ept_method_intro.tex b/assets/ept_method_intro.tex deleted file mode 100644 index 31d458d..0000000 --- a/assets/ept_method_intro.tex +++ /dev/null @@ -1,606 +0,0 @@ -\documentclass[11pt]{article} - -\usepackage[margin=1in]{geometry} -\usepackage{amsmath,amssymb} -\usepackage{bm} -\usepackage[round]{natbib} -\usepackage{enumitem} -\usepackage{booktabs} -\usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref} - -% --- light-weight notation --------------------------------------------------- -\newcommand{\R}{\mathbb{R}} -\newcommand{\C}{\mathbb{C}} -\renewcommand{\Re}{\operatorname{Re}} -\newcommand{\xin}{x_{\mathrm{in}}} -\newcommand{\zstar}{z^{\ast}} -\newcommand{\zbar}{\bar{z}} -\newcommand{\Fnc}{F_{\mathrm{nc}}} -\newcommand{\Jnc}{J_{\mathrm{nc}}} -\newcommand{\half}{\tfrac12} -\newcommand{\grad}{\nabla} -\newcommand{\dd}{\,\mathrm{d}} -\newcommand{\inner}[2]{\langle #1,\, #2\rangle} -\DeclareMathOperator{\Attn}{Attn} -\DeclareMathOperator{\FFN}{FFN} -\DeclareMathOperator{\softmax}{softmax} -\DeclareMathOperator{\LSE}{LSE} -\DeclareMathOperator{\LN}{LN} -\DeclareMathOperator{\jvp}{jvp} -\DeclareMathOperator{\vjp}{vjp} -\DeclareMathOperator*{\argmin}{arg\,min} - -\title{\bf Training a Transformer Language Model with Equilibrium Propagation:\\ -from energy-based EP to non-conservative, holomorphic, tracking-AEP} -\author{Method introduction (internal)} -\date{2026-06-21} - -\begin{document} -\maketitle - -\begin{abstract} -We train a transformer-class language model in which \emph{both} attention and the -feed-forward network learn \emph{without backpropagation through the computation}, -using Equilibrium Propagation (EP). This note is written for a reader who knows -\emph{classic} energy-based EP \citep{scellier2017} --- the two-phase free/nudged -relaxation of a conservative, symmetric-Jacobian system --- but has not met the -non-conservative / asymmetric / holomorphic extensions. We first recall why classic -EP \emph{requires} a conservative system, then show that softmax self-attention -breaks that requirement (independent $Q,K,V$ give an asymmetric Jacobian). We then -introduce, from first principles, the pieces that repair this: the -\emph{asymmetric / adjoint} EP correction $J\!\to\!J^{\!\top}$ -\citep{scurria2026}; the \emph{holomorphic} EP estimator \citep{laborieux2022}; -the \emph{Convergent Energy Transformer} (CET) route \citep{hoier2026} that -sidesteps the problem by making attention conservative; and finally \emph{our} -recipe: a damped non-conservative equilibrium-transformer block, trained with -\emph{tracking-AEP} (re-linearizing the correction at the moving common-mode -midpoint) plus a residual-driven stabilization stack. We report what is solidly -validated --- component gradients match backprop at cosine $0.99$--$1.0$, and EP -trains the block stably and competitively with a backprop transformer at equal -parameters on a character-level LM --- and clearly mark the larger-scale work -(the $C{=}512$ ``residual-defense'' line) as \emph{ongoing}. -\end{abstract} - -\tableofcontents - -%============================================================================== -\section{Recap: classic energy-based EP and why it needs a conservative system} -\label{sec:classic} - -\paragraph{Setup.} -Classic EP \citep{scellier2017} trains a dynamical system whose state -$z\in\R^{d}$ relaxes, under a fixed input/clamp, to the minimum of a scalar -\emph{energy} $E(z,\theta)$. Two ideas make it a learning rule. - -\paragraph{Two phases.} -\begin{itemize}[leftmargin=1.4em,itemsep=2pt] - \item \emph{Free phase.} Run the gradient dynamics $\dot z=-\grad_z E(z,\theta)$ - to the free equilibrium $\zstar=\argmin_z E(z,\theta)$, - in practice an Euler relaxation to a fixed point. - \item \emph{Nudged phase.} Add the task loss to the energy with a small strength - $\beta$, $E_\beta = E + \beta\,\ell(z)$, and relax to the nudged - equilibrium $z_\beta$. -\end{itemize} - -\paragraph{The contrastive gradient.} -EP's central identity is that the loss gradient w.r.t.\ any parameter is the -\emph{contrastive difference of $\partial E/\partial\theta$ across the two phases}: -\begin{equation} - \frac{\partial \mathcal{L}}{\partial \theta} - \;\approx\; - \frac{1}{\beta}\!\left[ - \frac{\partial E}{\partial\theta}(z_\beta,\theta) - -\frac{\partial E}{\partial\theta}(\zstar,\theta) - \right] - \qquad(\text{one-sided, bias }O(\beta)). - \label{eq:ep-onesided} -\end{equation} -Centered / symmetric nudging \citep{laborieux2021} uses $\pm\beta$ and averages, -reducing the estimator bias to $O(\beta^2)$: -\begin{equation} - \frac{\partial \mathcal{L}}{\partial \theta} - \;\approx\; - \frac{1}{2\beta}\!\left[ - \frac{\partial E}{\partial\theta}(z_{+\beta}) - -\frac{\partial E}{\partial\theta}(z_{-\beta}) - \right]. - \label{eq:ep-centered} -\end{equation} -The update is \emph{local}: each parameter reads only the two equilibria of the -terms it touches; there is no backward pass and no weight transport. As -$\beta\!\to\!0$ with a converged free phase, the EP estimate equals the -implicit/equilibrium gradient, and (in an RNN with static input) it equals the -step-wise BPTT gradient \citep{ernoult2019}. - -\paragraph{Why this needs a conservative / symmetric-Jacobian system.} -Equations \eqref{eq:ep-onesided}--\eqref{eq:ep-centered} are only valid because -the dynamics are the \emph{gradient} of a scalar energy. Write the force as -$F(z) = -\grad_z E(z)$ and its Jacobian as $J=\partial F/\partial z$. If $F$ -descends an energy, then $J = -\,\partial^2 E/\partial z^2$ is a Hessian and is -therefore \emph{symmetric}, $J=J^{\!\top}$. This symmetry is exactly what makes the -nudged perturbation a faithful surrogate for the loss \emph{adjoint}: linearizing -the nudged relaxation around $\zstar$ produces a response governed by -$(I-J)^{-1}$, and because $J=J^{\!\top}$ this self-adjoint operator is the same one -the true gradient (which involves $(I-J^{\!\top})^{-1}$) requires. We therefore -record the four implicit premises of classic EP --- the transformer will break all -four, and each fix below targets exactly one of them: -\begin{description}[leftmargin=2.6em,itemsep=2pt] - \item[(A) Conservative / symmetric.] A scalar energy $E$ exists, so $J=J^{\!\top}$. - \item[(B) Free phase converged.] The readout sits at the true fixed point; - residual $\approx 0$. - \item[(C) Small-$\beta$ linear response, clean nudge.] $\beta\!\to\!0$ is a mere - perturbation, and no non-analytic ``clamp'' contaminates the estimate. - \item[(D) The fixed point stays stable throughout training.] After every weight - update the free phase still relaxes to a stable fixed point. -\end{description} - -%============================================================================== -\section{The gap: softmax attention is non-conservative} -\label{sec:gap} - -A pre-LN transformer block computes, for a state $z$, -\begin{equation} - \Attn(z) = \softmax\!\Big(\tfrac{Q(z)K(z)^{\!\top}}{\sqrt{d}},\ \text{causal}\Big)V(z)\,W_O, - \qquad - Q=zW_Q,\ K=zW_K,\ V=zW_V, - \label{eq:attn} -\end{equation} -with \emph{independent} projections $W_Q,W_K,W_V$. The query--key coupling -$i\!\to\!j$ is governed by $W_QW_K^{\!\top}$, while $j\!\to\!i$ is governed by -$W_KW_Q^{\!\top}$; these differ, and $V$ is a third independent map. Consequently -the attention Jacobian is \emph{asymmetric}, $J_{\Attn}\neq J_{\Attn}^{\!\top}$, and -\emph{no scalar energy has this gradient}. An untied $4\times$ FFN -($W_2\,\mathrm{GELU}(W_1\cdot)$ with $W_2\neq W_1^{\!\top}$) is non-conservative for -the same reason. Premise~(A) fails. - -Empirically this is not a cosmetic issue: with an asymmetric $J$ the nudged phase -relaxes under $J$ but the correct loss adjoint needs $J^{\!\top}$, so the raw EP -contrast is \emph{biased}. Measured against the true backprop gradient, uncorrected -EP gives an attention-parameter cosine of only $\approx 0.25$ (essentially the -wrong direction), even though the loss-adjacent output projection looks fine. (This -is the same pathology that limits feedback alignment, which only trains the layer -right before the loss and leaves $Q/K/V$ at cosine $\approx 0.25$ and the upstream -FFN at $\approx -0.01$.) - -There are two ways out, and we will use the second: -\begin{enumerate}[leftmargin=1.6em,itemsep=2pt] - \item \textbf{Energy route} (make attention conservative): fold attention into a - scalar energy with a \emph{tied} value, so $F=-\grad E$ and classic EP is - exactly valid. This is the CET route (\S\ref{sec:cet-energy}); it costs the - $Q\!\neq\!K$ asymmetry and the free value that make attention expressive. - \item \textbf{Force route} (keep real attention, repair the \emph{estimator}): - leave \eqref{eq:attn} as a non-conservative \emph{force} and add a - correction that turns $J$ into $J^{\!\top}$ in the nudged phase. This is the - AEP route (\S\ref{sec:aep}), and it is what our block uses. -\end{enumerate} - -%============================================================================== -\section{AEP, holomorphic EP, and the force-form readout} -\label{sec:aep} - -\subsection{Force-form (vector-field) EP} -\label{sec:vf} -The first step is to drop the energy and write the dynamics directly as a force -$F(z)$, relaxing $\dot z=F(z)$ to a fixed point $\zstar$. The parameter gradient is -then read off a \emph{vector-field} (VF) contrast \citep{scurria2026}: -\begin{equation} - \frac{\partial\mathcal{L}}{\partial\theta} - \;\approx\; - \frac{\partial}{\partial\theta}\,\big\langle a,\ F(\zstar;\theta)\big\rangle, - \qquad - a \;=\; \frac{z_{-\beta}-z_{+\beta}}{2\beta}\ \approx\ -\frac{\dd \zstar}{\dd\beta}, - \label{eq:vf} -\end{equation} -where $a$ is the centered contrast (the ``adjoint state'') read from the two nudged -equilibria, and the right-hand side is \emph{one} autograd call evaluated at the -fixed point only --- per-term local bookkeeping, \emph{not} backprop through the -relaxation steps. Every term of the block (attention, FFN, LayerNorm affines, and -the embeddings, which enter through the input clamp $-(z-\xin)$) is a term of the -same $F$, so \eqref{eq:vf} trains them jointly with no per-module schedule. - -\paragraph{Attribution / honest caveat.} -The force-form VF readout \eqref{eq:vf} is \emph{not ours}: it is the baseline of -\citet{scurria2026}. Crucially it \emph{collapses on its own} for a non-conservative -system (their CIFAR-10 VF reaches chance, $10\%$; MNIST $64\%$ vs.\ $92.7\%$), -exactly mirroring our measured cosine $\approx 0.25$ for uncorrected attention. VF -is therefore the ``starting point that fails''; what rescues it is the next step. - -\subsection{The AEP correction: \texorpdfstring{$J\!\to\!J^{\!\top}$}{J to J transpose}} -\label{sec:aep-corr} -For a non-conservative $F$, the nudged relaxation linearized at $\zstar$ runs under -$J=\partial F/\partial z$, but the true adjoint requires $J^{\!\top}$. \emph{Asymmetric -EP} (AsymEP) \citep{scurria2026} repairs this by adding to the nudged force a term -that subtracts twice the antisymmetric part of the Jacobian. With -$v=z-\zstar$ and $\Jnc$ the Jacobian of the \emph{non-conservative} part $\Fnc$, -\begin{equation} - \mathrm{corr}(z) \;=\; \Jnc\,v - \Jnc^{\!\top} v - \;=\; (\Jnc-\Jnc^{\!\top})\,v - \;=\; 2\,A_J\,v, - \qquad - A_J \equiv \tfrac12\big(\Jnc-\Jnc^{\!\top}\big), - \label{eq:aep} -\end{equation} -which is \emph{mathematically identical} to their $-2A_J(\zstar)(z-\zstar)$. The -nudged force becomes $f \;=\; F(z) \mp \beta\,\grad_z\ell(z) - \mathrm{corr}(z)$, -so the attention part of the nudged linearization is replaced as -\begin{equation} - J\,v \;-\; (J-J^{\!\top})\,v \;=\; J^{\!\top} v , -\end{equation} -i.e.\ \emph{$J$ is turned into $J^{\!\top}$}, restoring the correct adjoint and hence the -exact gradient for $Q\!\neq\!K$ attention. Two structural facts make this cheap and -local: -\begin{itemize}[leftmargin=1.4em,itemsep=2pt] - \item \emph{The symmetric (conservative) parts cancel.} The damping $-c\,z$ has - Jacobian $-cI$ (symmetric), the FFN-as-Hopfield-energy and the input clamp - are symmetric, so they contribute $0$ to $A_J$. Thus a \emph{single} - correction on the attention term repairs the \emph{whole} block; FFN/clamp - ride along in the conservative part and are already exact under VF. - \item \emph{It is matrix-free.} We never build $\Jnc$. Each nudged step uses one - Jacobian-vector product and one vector-Jacobian product, - $\Jnc v=\jvp(\Fnc,\zstar,v)$ and $\Jnc^{\!\top} v=\vjp(\Fnc,\zstar,v)$. -\end{itemize} - -\paragraph{Attribution.} -The correction \eqref{eq:aep} is \citet{scurria2026}'s, \emph{not} ours. Their scope -is feedforward / Hopfield nets on static MNIST/CIFAR with an \emph{explicitly -constructed} Jacobian, no attention, no sequence model, and no stability controller. -\emph{Ours on this line} is: (i) the matrix-free $\jvp/\vjp$ form (their explicit -Jacobian is infeasible at transformer state dimension $B\!\cdot\!T\!\cdot\!C$); -(ii) the application to data-dependent \emph{softmax attention}; (iii) the -combination with holomorphic estimation (\S\ref{sec:holo}); (iv) the common-mode -\emph{tracking} variant (\S\ref{sec:tracking}); and (v) the transformer-LM -application together with the stability stack (\S\ref{sec:stab}). - -\paragraph{Validity window.} -The correction is linearized \emph{at $\zstar$}, so the nudged trajectory must stay -inside the linear-response window. At $\varepsilon{=}0.1$ a nudge horizon -$T_2\!\approx\!20$ is comfortably inside; $T_2\gtrsim 60$ can leave it (\S\ref{sec:stab}). - -\subsection{Holomorphic EP: variance-reduced, higher-order estimates} -\label{sec:holo} -The $\pm\beta$ contrast trades bias against noise: small $\beta$ shrinks the -$O(\beta^2)$ bias but amplifies the $1/\beta$ noise on $(z_{-\beta}-z_{+\beta})/2\beta$. -Holomorphic EP \citep{laborieux2022} removes this trade-off by replacing the two -real points with $N$ points on a \emph{complex circle}, -$\beta_k = r\,e^{2\pi i k/N}$, relaxing the \emph{holomorphically extended} dynamics -and reading the contrast off a discrete Cauchy integral: -\begin{equation} - a \;=\; -\,\Re\!\left[\frac{1}{Nr}\sum_{k=0}^{N-1} e^{-i\phi_k}\,(z_k-\zstar)\right], - \qquad \phi_k=\tfrac{2\pi k}{N}, - \label{eq:holo} -\end{equation} -whose bias is $O(r^{N})$ instead of $O(r^{2})$ --- so $r$ may be $5$--$10\times$ -larger at equal bias, cutting the $1/\beta$ noise by the same factor. The -holomorphic extension is built by hand (complex LayerNorm with non-conjugate -variance, softmax as a ratio of exponentials, the $\tanh$-form GELU which is an -entire function); the AEP correction \eqref{eq:aep} is \emph{real-linear in $v$}, so -it preserves holomorphy and is applied to the real and imaginary parts separately. -No clamps appear inside the holomorphic nudge --- clamps are non-analytic and would -destroy the $O(r^N)$ bias order. This addresses premise~(C). \citep{laborieux2022} -is the source; we add only the combination with the AEP correction and with softmax -attention. - -%============================================================================== -\section{The equilibrium-transformer block (and the CET alternative)} -\label{sec:block} - -\subsection{Our damped, non-conservative block (\texttt{thick})} -\label{sec:thick} -The state is $z\in\R^{B\times T\times C}$, one vector per token position. Inference -is a relaxation to a fixed point under a \emph{single force} $F$, -$z\leftarrow z+\varepsilon F(z)$ for $T_1$ steps ($\varepsilon{=}0.1$, $T_1{\approx}150$), -after which logits $=\zstar W_h$. The force is a pre-LN transformer block written as -a force rather than a layer stack: -\begin{equation} - F(z) = - \underbrace{-(z-\xin)}_{\text{input clamp}} - +\underbrace{\Attn(\LN_1(z))}_{\text{causal MHSA},\ W_Q,W_K,W_V,W_O} - +\underbrace{W_2\mathrm{GELU}(W_1\LN_2(z)+b_1)+b_2}_{\text{untied }4\times\text{ FFN}} - -\underbrace{c\,z}_{\text{damping}}. - \label{eq:thick} -\end{equation} -Here $\xin=\mathrm{tok}[\mathrm{idx}]+\mathrm{pos}$ is the (trained) input -embedding, clamped as a boundary condition through the $-(z-\xin)$ term; this is the -same fixed-point map a Deep Equilibrium model \citep{bai2019} uses. The block is -strongly non-conservative ($Q\!\neq\!K$, untied FFN), and AEP makes EP exact for it. - -\paragraph{Why the $-c\,z$ damping is the key recipe move.} -Raw attention at high gain has \emph{no} fixed point: the residual floors at -$\sim\!3\times10^{-2}$ and the relaxation never settles, so the entire EP family -(corrected or not) cannot even start (there is no $\zstar$ to nudge around). Adding -$-c\,z$ ($c\!\geq\!1$) makes the map contractive enough to \emph{create a stable -fixed point at any attention strength}, while leaving the map non-conservative -(independent $Q/K/V$ are untouched). Critically, the damping's Jacobian $-cI$ is -symmetric, so it \emph{cancels in $A_J$} \eqref{eq:aep}: it buys a fixed point -without polluting the AEP correction, which still sees only attention's -non-reciprocal part. Together, ``damping $+$ AEP'' is the minimal recipe that makes -real attention EP-trainable, taking the attention-parameter cosine from -$\approx 0.25$ (uncorrected) to $0.99$--$1.0$ even at high gain. - -\paragraph{A subtlety for LN-inside blocks.} -Because LayerNorm sits \emph{inside} \eqref{eq:thick} and its Jacobian scales like -$1/\sigma(z)$, large damping shrinks $\|\zstar\|$ and thereby \emph{inflates} the -effective Jacobian (measured: plain-relax residual $8.8\times10^{-3}$ at $c{=}0$ -vs.\ $3.4\times10^{-2}$ at $c{=}2$). So for \texttt{thick} we keep $c$ small ($c{=}1$) -and the actual stabilizer is the Jacobian-norm penalty of \S\ref{sec:stab}, not the -damping. (For a simpler ``thin'' variant whose FFN is an energy-based modern-Hopfield -memory and whose attention is a raw damped force, the damping \emph{is} required.) - -\subsection{The CET / energy route (the conservative alternative)} -\label{sec:cet-energy} -\textbf{CET} here means the \emph{Convergent Energy Transformer} of -\citet{hoier2026} --- an energy-based transformer block, trained with EP, that we -reproduced (on masked image completion) as the prior SOTA for ``EP $+$ attention''. -Its trick is to make attention \emph{conservative} so classic EP applies with -\emph{no} correction: attention is folded into a scalar energy -\begin{equation} - E_{\mathrm{att}}(z) \;=\; - -\frac{1}{\gamma}\sum_{\text{heads},\,i} - \LSE_{j}\!\big(\gamma\, q_i\!\cdot\!k_j\big) - \quad(\text{causal-masked}), - \label{eq:cet} -\end{equation} -whose force \emph{ties the value to the key} ($v\!\equiv\!k$), plus a confinement -$\tfrac12 c\|z\|^2$ (because $E_{\mathrm{att}}$ is unbounded below) and a -modern-Hopfield memory energy $E_{\mathrm{mem}}(z)=-\sum\mathrm{relu}(zW_m)^2$ -playing the role of the FFN (its force is a \emph{tied}-weight squared-ReLU MLP). On -this energy $F=-\grad E$ exactly, so classic EP is valid with symmetric Jacobian and -no AEP. In our reproduction EP matched truncated-BPTT (``EP $\approx$ TBPTE'', -gradient cosine $0.99$). The trade-off is expressivity: the tied value and -reciprocal coupling are the least expressive form of attention. Under \emph{exact} -gradients on the LM, this conservative route (and a monotone-DEQ variant -\citep{winston2020}) costs $\approx 0.15$--$0.2$ CE relative to the non-conservative -\texttt{thick} block --- which is precisely why we pay for the AEP machinery and keep -real attention. - -%============================================================================== -\section{Our recipe: tracking-AEP and the stabilization stack} -\label{sec:recipe} - -\subsection{Tracking-AEP: re-linearize at the moving common mode} -\label{sec:tracking} -The AEP correction \eqref{eq:aep} is frozen at $\zstar$. Near a good solution this -becomes the binding error: as the model sharpens, the true gradient shrinks below -the \emph{bias floor} of the frozen linearization, and the highly non-normal block -Jacobian makes that floor large (we measure $\|\Jnc v-\Jnc^{\!\top} v\|/\|\Jnc v\|=1.37$ -at $\zstar$). The fix is to re-linearize the antisymmetric correction not at the -frozen $\zstar$ but at the \emph{instantaneous common mode} of the two nudged -trajectories, -\begin{equation} - \zbar \;=\; \half\big(z_{+}+z_{-}\big), - \qquad - \mathrm{corr}(z) \;=\; \Jnc(\zbar)\,v - \Jnc(\zbar)^{\!\top} v, - \quad v = z-\zbar, - \label{eq:track} -\end{equation} -evaluated step-by-step as $\zbar$ moves with the nudge (run the $+$ and $-$ phases in -lockstep, recompute $\jvp/\vjp$ about the running $\zbar$). This is exact transposed -differential dynamics with no compounding linearization error, and it is loose-tolerant -(it does not demand an ultra-tight free phase). At a plateau checkpoint where the -frozen estimator had collapsed (gradient cosine vs.\ BPTT $-0.045$, batch-to-batch -self-coherence $-0.27$, magnitude ratio $\sim\!4000\times$), tracking-AEP restores -cosine $0.997$, self-coherence $+0.95$, magnitude ratio $0.9$. Tracking-AEP and the -common-mode formulation \eqref{eq:track} are \emph{ours}. - -\subsection{The validity threshold and the residual as the health signal} -\label{sec:stab} -The governing empirical fact is that the EP estimator has a \emph{validity threshold} -in the free-phase relative residual -\begin{equation} - \mathrm{res} \;=\; \frac{\|z^{+}-\zstar\|}{\|\zstar\|} - \qquad(\text{one extra relaxation step}), -\end{equation} -which is the load-bearing health signal (premise~(B)). Gradient cosine vs.\ the exact -reference degrades sharply with res: $\approx 0.85$ at $\mathrm{res}\!\sim\!5\times10^{-5}$, -batch-dependent $0.2$--$0.9$ at $10^{-3}$, and noise at $10^{-2}$. BPTT has no such -threshold (it differentiates the actual finite unroll, converged or not); \emph{this -asymmetry, and nothing deeper, is the EP-specific difficulty}. Accordingly the free -phase is run adaptively: relax to $T_1{=}150$, then continue in chunks until -$\mathrm{res}\!\le\!10^{-4}$ before nudging. We emphasize there is \emph{no} structural -``EP ceiling'': an early ``EP caps at $\sim\!2.5$'' verdict was traced to two -undertrained/invalid-regime runs and retracted. - -\subsection{The stabilization stack} -Training pushes the dynamics off the contractive manifold (premise~(D)) --- and not -only for EP: even \emph{exact} BPTT on this architecture walks off the manifold on -long horizons (residual $\to 4.7\times10^{-2}$, val CE $\to 3.0$). The stack that -keeps the system valid: -\begin{itemize}[leftmargin=1.4em,itemsep=3pt] - \item \textbf{Frozen / controlled Jacobian-norm penalty (\texttt{jacreg}).} A soft - penalty $\lambda\,\|\Jnc(\zstar)\|_F^2$, estimated matrix-free by Hutchinson - (one $\jvp$ on a random probe, differentiated w.r.t.\ $\theta$). This is - \citet{bai2021}'s DEQ-stabilization penalty, \emph{not} ours. It keeps the - free phase contractive and hence the estimator inside its validity region. - A continuous controller drives it, - $\lambda \leftarrow \mathrm{clip}\big(\lambda\,(\mathrm{res}_{\mathrm{EMA}}/\mathrm{target})^{0.3}\big)$, - on an EMA-smoothed residual (the raw residual is noisy and a multiplicative - controller on it random-walks). A key hard lesson: the controller \emph{floor} - is load-bearing and must never anneal to zero --- two independent - $\lambda\!\to\!0$ runs died identically (val CE $60$--$77$, $\mathrm{res}\!\equiv\!0$), - which post-mortem is an \emph{explosion disguised as convergence by - floating-point absorption} ($\varepsilon F<\mathrm{ulp}(z)$ freezes the - relaxation), not a benign dead state. - \item \textbf{Residual, not spectral radius, as the control signal.} The block - Jacobian is highly non-normal, so transient growth is invisible to - eigenvalues (measured $\rho(J){=}0.94$ ``stable'' while the relaxation - diverged to $\mathrm{res}\,0.21$). The one-step residual \emph{is} the - transient; we control on it. - \item \textbf{Validity gate.} When the residual exceeds a gate, the EP update is - mathematically undefined, so we apply only the homeostat (jacreg) and skip the - nudge --- a fast recovery step. At larger scale this gate is load-bearing - (off-equilibrium EP updates poison the weights). - \item \textbf{Adaptive $T_2$ by hindsight snapshot selection.} On slow-mixing - batches a long nudge phase can diverge through non-normal transient growth, - and step-size early-stopping \emph{fails} (the transient triggers it - spuriously). Instead, run to $T_{2\max}$ in lockstep, snapshot the contrast - $a_t$ every few steps, and return the \emph{most settled} snapshot (smallest - increment of $a_t$); judging by increments of the \emph{quantity of interest} - rather than step sizes makes transient growth harmless. This is ours; it - lifts probe cosine from $0.871$ to $0.932$. -\end{itemize} - -\subsection{Ongoing: the residual-defense term (\texttt{resreg}) --- under validation} -\label{sec:resreg} -At larger width ($C{=}512$) we observe a distinct, \emph{still-open} failure that we -call the below-$2.10$ wall: frozen-jacreg, tracking-AEP EP descends to best -$\approx 2.09$ and then bifurcates within $\sim\!200$ steps (residual -$5\!\times\!10^{-3}\!\to\!0.15$, gradient cosine $0.98\!\to\!0$, CE $\to\!4{+}$), -while \emph{exact} BPTT with the identical recipe sails past to $1.72$. The diagnosed -root cause is an \emph{objective mismatch}: EP optimizes the (refined) fixed point and -never defends the finite-step residual that evaluation actually uses, whereas BPTT -differentiates the finite unroll and so implicitly rewards contraction. The diverged -state is a forward bifurcation to a \emph{limit cycle}, so more relaxation steps cannot -fix it; only a residual \emph{cost} can. The proposed fix is an explicit T1-residual -penalty on the \emph{evaluated} state $z_{150}=\mathrm{relax}(\xin,T_1)$ taken before -any refinement, -\begin{equation} - R_{\mathrm{res}} \;=\; \frac{\|\varepsilon F(z_{150})\|^2}{\|z_{150}\|^2+\varepsilon}, - \qquad - \text{gradient w.r.t.\ }\theta\text{ with }z_{150}\text{ detached}, - \label{eq:resreg} -\end{equation} -scaled task-relative and added to the EP gradient (run with the validity gate off, so -the penalty is not bypassed exactly when the residual is high). \textbf{Status: this is -ongoing.} The residual-defense term \eqref{eq:resreg} held the residual pinned at -$1$--$5\times10^{-4}$ and reached best $2.0573$ (past the wall) through only step -$\sim\!1000$ before a storage cleanup deleted the run; full re-validation toward the -$\approx 1.8$ BPTT ceiling is pending. We present it as a diagnosis $+$ proposed fix, -\emph{not} a finished result. (The objective-mismatch diagnosis, the common-mode -tracking estimator, the residual-driven controller and validity gate, and this -residual-defense term are ours.) - -%============================================================================== -\section{Established results (and what is still open)} -\label{sec:results} - -\paragraph{Solidly validated.} -\begin{itemize}[leftmargin=1.4em,itemsep=3pt] - \item \textbf{EP/AEP component gradients match backprop.} On the character LM, - AEP gives causal-attention parameters cosine $0.99$, the (Hopfield) FFN - $1.00$, and the full LM block $0.99$ vs.\ the true backprop gradient - --- versus feedback alignment at $Q/K/V\approx 0.25$, FFN $\approx -0.01$. - On the CET reproduction, global cosine $0.99$ and EP $\approx$ TBPTE on - masked-image completion. - \item \textbf{EP trains the equilibrium transformer stably, without backprop.} - With the stabilization stack, end-to-end EP runs $10\text{k}+$ steps with - zero non-finite steps. - \item \textbf{It matches/beats a BP transformer at equal parameters.} On - Shakespeare character-LM (single block, $C{=}128$), at a fully controlled - $14$k-step comparison (Table~\ref{tab:results}): EP reaches val CE - \textbf{1.676} (multi-seed $1.680\pm0.005$, $3$ seeds); the like-for-like - standard BP transformer (matched in parameter \emph{shape} to the thick - block) reaches $1.610$; EP \emph{beats} the thinner BP baseline ($1.689$). - The total gap of $0.066$ decomposes into an architecture tax $\approx 0.025$ - (BPTT on the identical block $1.635$) and an EP-rule tax $\approx 0.041\pm0.005$ - --- real, tightly reproducible, and consistent with the measured estimator - misalignment (cosine $0.85$--$0.93$). -\end{itemize} - -\begin{table}[t] - \centering - \small - \begin{tabular}{llc} - \toprule - \textbf{training rule} & \textbf{architecture / recipe} & \textbf{best val CE}\\ - \midrule - BP & standard transformer (like-for-like for \texttt{thick}) & \textbf{1.610}\\ - BPTT $+$ $\lambda$-controller $+$ param-EMA & \texttt{thick} (exact grad, same stabilizer) & 1.635\\ - \textbf{EP} & \texttt{thick}; tracking-AEP $+$ adaptive $T_1/T_2$ & \textbf{1.676}\\ - BP & standard transformer (thin-matched) & 1.689\\ - BPTT (exact grad) & \texttt{thick}, unregularized & 2.021 (destabilizes late)\\ - random & --- & 4.174\\ - \bottomrule - \end{tabular} - \caption{Fully-controlled $14$k-step comparison on Shakespeare char-LM - (random $=\ln 65$). EP matches the architecture-controlled exact-gradient - run to within $0.041$ and beats the thin-matched BP baseline. ``BPTT as - ablation'' separates the training-rule cost (EP$-$BPTT) from the - architecture cost (BPTT$-$BP).} - \label{tab:results} -\end{table} - -\paragraph{Honest framing of the controlled comparison.} -EP beats \emph{bare} BPTT, but the controlled table shows most of that win is EP's -\emph{mandatory} stabilization loop doubling as regularization: bare exact-gradient -training walks off the contractive manifold at $14$k, and the same controller that EP -cannot live without also lifts BPTT to $1.635$. The contraction controller is good for -the equilibrium architecture regardless of training rule; EP merely forced its -discovery. - -\paragraph{Ongoing / under validation.} -The $C{=}512$ work is \emph{not} a finished result. (i) The $2.40$ plateau there is -diagnosed as a late-training EP estimator bias-floor / batch-incoherence, which -tracking-AEP breaks in training ($2.40\!\to\!2.16$, still descending in a $2500$-step -warm-start test). (ii) The below-$2.10$ wall is diagnosed as the objective mismatch of -\S\ref{sec:resreg}; the residual-defense term \eqref{eq:resreg} validated res-tight and -past the wall (best $2.0573$) \emph{only through step $\sim\!1000$} before the run was -lost, and a full re-run toward the $\approx 1.8$ BPTT ceiling is pending. These should -be read as diagnoses with promising partial evidence, not as established numbers. - -%============================================================================== -\section*{Attribution summary} -\addcontentsline{toc}{section}{Attribution summary} - -\begin{description}[leftmargin=2.2em,itemsep=2pt] - \item[Theirs.] Classic energy-based EP and centered nudging - \citep{scellier2017,laborieux2021}; EP $\equiv$ BPTT in the converged, $\beta\!\to\!0$ - limit \citep{ernoult2019}; holomorphic EP \citep{laborieux2022}; the asymmetric/AEP - correction $J\!\to\!J^{\!\top}$ \emph{and} the force-form VF readout - \citep{scurria2026}; the Jacobian-norm penalty \citep{bai2021}; DEQ - \citep{bai2019} and monotone DEQ \citep{winston2020}; the Convergent Energy - Transformer / CET \citep{hoier2026}. - \item[Ours.] The transformer application of the force route and the damping recipe - (damping $+$ AEP making real attention EP-trainable at any gain); the matrix-free - $\jvp/\vjp$ form of the correction at transformer scale and its combination with - holomorphic estimation and softmax attention; \emph{tracking-AEP} (common-mode - re-linearization, Eq.~\ref{eq:track}); the residual-driven controller, the validity - gate, and adaptive-$T_2$ snapshot selection; and the (ongoing) residual-defense term - \texttt{resreg} (Eq.~\ref{eq:resreg}) with its objective-mismatch diagnosis. -\end{description} - -%============================================================================== -\begin{thebibliography}{9} -\bibitem[Bai et al., 2019]{bai2019} - S.~Bai, J.~Z.~Kolter, V.~Koltun. - \emph{Deep Equilibrium Models}. NeurIPS 2019. - -\bibitem[Bai et al., 2021]{bai2021} - S.~Bai, V.~Koltun, J.~Z.~Kolter. - \emph{Stabilizing Equilibrium Models by Jacobian Regularization}. ICML 2021. - -\bibitem[Ernoult et al., 2019]{ernoult2019} - M.~Ernoult, J.~Grollier, D.~Querlioz, Y.~Bengio, B.~Scellier. - \emph{Updates of Equilibrium Prop Match Gradients of Backprop Through Time in an - RNN with Static Input}. NeurIPS 2019. - -\bibitem[H{\o}ier et al., 2026]{hoier2026} - R.~H{\o}ier, K.~Kerjan, B.~Scellier. - \emph{Training a Convergent Energy Transformer with Equilibrium Propagation} (CET). - ICLR 2026 Associative Memory workshop; OpenReview \texttt{Qrfml76eWJ}. - -\bibitem[Laborieux et al., 2021]{laborieux2021} - A.~Laborieux, M.~Ernoult, B.~Scellier, Y.~Bengio, J.~Grollier, D.~Querlioz. - \emph{Scaling Equilibrium Propagation to Deep ConvNets by Drastically Reducing its - Gradient Estimator Bias} (centered/symmetric nudging). Frontiers in Neuroscience, 2021. - -\bibitem[Laborieux \& Zenke, 2022]{laborieux2022} - A.~Laborieux, F.~Zenke. - \emph{Holomorphic Equilibrium Propagation Computes Exact Gradients Through Finite Size - Oscillations}. NeurIPS 2022. - -\bibitem[Scellier \& Bengio, 2017]{scellier2017} - B.~Scellier, Y.~Bengio. - \emph{Equilibrium Propagation: Bridging the Gap between Energy-Based Models and - Backpropagation}. Frontiers in Computational Neuroscience, 2017. - -\bibitem[Scurria et al., 2026]{scurria2026} - A.~Scurria, P.~Vanden Abeele, B.~Mognetti, S.~Massar. - \emph{Equilibrium Propagation for Non-Conservative Systems} (AsymEP). - arXiv:2602.03670, 2026. - -\bibitem[Winston \& Kolter, 2020]{winston2020} - E.~Winston, J.~Z.~Kolter. - \emph{Monotone Operator Equilibrium Networks} (monotone DEQ). NeurIPS 2020. -\end{thebibliography} - -\end{document} diff --git a/assets/figs/fig_ep_phases.png b/assets/figs/fig_ep_phases.png new file mode 100644 index 0000000..e787f58 Binary files /dev/null and b/assets/figs/fig_ep_phases.png differ diff --git a/assets/figs/fig_p3_schedule.png b/assets/figs/fig_p3_schedule.png new file mode 100644 index 0000000..c4ad8b3 Binary files /dev/null and b/assets/figs/fig_p3_schedule.png differ diff --git a/assets/figs/fig_p4_blowup.png b/assets/figs/fig_p4_blowup.png new file mode 100644 index 0000000..53b9d3c Binary files /dev/null and b/assets/figs/fig_p4_blowup.png differ diff --git a/assets/figs/fig_p5_loop.png b/assets/figs/fig_p5_loop.png new file mode 100644 index 0000000..18964ad Binary files /dev/null and b/assets/figs/fig_p5_loop.png differ diff --git a/assets/figs/fig_p6_window.png b/assets/figs/fig_p6_window.png new file mode 100644 index 0000000..9519e39 Binary files /dev/null and b/assets/figs/fig_p6_window.png differ diff --git a/assets/figs/fig_primer_arch.emf b/assets/figs/fig_primer_arch.emf new file mode 100644 index 0000000..87ba265 Binary files /dev/null and b/assets/figs/fig_primer_arch.emf differ diff --git a/assets/figs/fig_primer_arch.png b/assets/figs/fig_primer_arch.png new file mode 100644 index 0000000..a7e7adf Binary files /dev/null and b/assets/figs/fig_primer_arch.png differ diff --git a/assets/figs/fig_primer_arch.svg b/assets/figs/fig_primer_arch.svg new file mode 100644 index 0000000..24e64f1 --- /dev/null +++ b/assets/figs/fig_primer_arch.svg @@ -0,0 +1,1327 @@ + + + + + + + + 2026-07-15T09:29:43.786622 + image/svg+xml + + + Matplotlib v3.10.8, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (A) The model — a stock OLMo2-style decoder + + + Inference is one ordinary forward pass. + + + logits + + + + + + + + + + l + i + n + e + a + r +   + r + e + a + d + o + u + t +   +   +   + ( + u + n + t + i + e + d + ) + W + o + u + t + + + + + + + + + final RMSNorm + + + + + + + + + + t + r + a + n + s + f + o + r + m + e + r +   + b + l + o + c + k +   +   + ( + ) +   +   +   + = + × + 1 + 2 + f + l + + + + + + + + h + z + z + = + + + R + M + S + N + o + r + m + ( + A + t + t + n + ( + ) + ) + + + + + + + + z + h + h + 0 + = + + + R + M + S + N + o + r + m + ( + S + w + i + G + L + U + ( + ) + ) + + + + + causal SDPA · QK-RMSNorm · RoPE + + + + + + + token embedding + + + 42.75M (TinyStories 4k BPE) / 72.11M (FineWeb-Edu 32k BPE) + + + Nothing in this graph is modified for training: the trained checkpoint + is indistinguishable in form from a conventionally trained model. + + + (B) Free phase (= inference) + + + + + + g + i + v + e +   + e + a + c + h +   + l + a + y + e + r +   + a +   + s + t + a + t + e +   +   + ( + 3 +   + o + f +   +   + d + r + a + w + n + ) + ; +   + s + e + t + t + l + e +   + t + h + e +   + d + i + s + a + g + r + e + e + m + e + n + t +   + e + n + e + r + g + y + z + L + l + + + + + + + + E + z + z + f + z + ( + ) + = + + + ( + ) + + + l + l + l + l + 1 + 2 + + 1 + 2 + + + + + + + + + z + f + z + 3 + 3 + 2 + = + ( + ) + + + + + term = 0 + + + + + + z + f + z + 2 + 2 + 1 + = + ( + ) + + + + + term = 0 + + + + + + z + f + 1 + 1 + = + ( + e + m + b + ) + + + + + term = 0 + + + + + + + + + + + + + + + + + + e + m + b + ( + ) + x + + + + + + + + T + h + e +   + m + i + n + i + m + u + m +   + i + s +   + e + x + a + c + t + : +   +   + = + 0 + , +   +   + s + t + a + t + e + s +   + +   + f + o + r + w + a + r + d +   + a + c + t + i + v + a + t + i + o + n + s + , + E + + + + + and one bottom-up pass reaches it. + + + The free phase adds nothing and changes nothing at inference. + + + (C) Nudged phase (training only) + + + + + + a + d + d +   + t + h + e +   + l + o + s + s +   + a + t +   + s + t + r + e + n + g + t + h +   + + 1 +   + a + n + d +   + s + e + t + t + l + e +   + a + g + a + i + n + : + β + + + + + + + + E + z + β + z + y + ( + ) + + + + C + E + ( + l + o + g + i + t + s + ( + ) + , + ) + 3 + + + + + + + + p + u + l + l +   + + + C + E + β + + + + + (the only place the label enters) + + + + + + + + + + z + z + d + β + 3 + 3 + 3 + = + + + + + + + + + + z + z + d + β + 2 + 2 + 2 + = + + + + + + + + + + z + z + d + β + 1 + 1 + 1 + = + + + + + + + + + + + + + + + + + + + + + + e + m + b + ( + ) + x + + + + + + + + + + + + d + J + d + 2 + 3 + + 3 + = + + + + + + + + + + + + d + J + d + 1 + 2 + + 2 + = + + + + + + + + T + h + e +   + t + o + p +   + s + t + a + t + e +   + i + s +   + p + u + l + l + e + d +   + t + o + w + a + r + d +   + l + o + w + e + r +   + l + o + s + s + ; +   + e + a + c + h +   + l + a + y + e + r + ' + s +   + m + i + s + m + a + t + c + h +   + d + l + + + + + transmits DOWN through the same weights, and the stack re-settles. + + + + + + ( +   + = +   + t + h + e +   + t + r + a + n + s + p + o + s + e +   + r + e + a + d +   + a +   + b + i + d + i + r + e + c + t + i + o + n + a + l +   + p + h + y + s + i + c + a + l +   + d + e + v + i + c + e +   + p + r + o + v + i + d + e + s + ) + J + + + + + + (D) The update — a difference measurement between the two settled states + + + + + + ̂ + = + + ( + ) + + + ( + ) + / + ( + + ( + ) + + 0 + h + e + r + e + , + s + i + n + c + e + = + 0 + ) + g + E + z + E + z + β + E + z + E + [ + ] + θ + β + θ + θ + 0 + 0 + + + + + + + + p + e + r +   + l + a + y + e + r + : +   +   + Δ + + + , + + ( + ) + / + + + / + θ + d + f + z + θ + β + l + l + l + l + l + + 1 + + + + + Each layer updates from its own boundary mismatch — no global backward graph, no global tape, no loss + + + + d + e + r + i + v + a + t + i + v + e + s +   + e + x + c + e + p + t +   + t + h + e +   + t + o + p +   + n + u + d + g + e + . +   +   + + 0 +   + g + i + v + e + s +   + t + h + e +   + e + x + a + c + t +   + g + r + a + d + i + e + n + t + ; +   + b + i + a + s +   + i + s +   + ( + ) + ; +   + a +   + ± +   + t + w + o + - + s + i + d + e + d +   + r + e + a + d +   + c + a + n + c + e + l + s +   + i + t +   + t + o +   + ( + ) + . + β + O + β + β + O + β + 2 + + + + + (E) This is not predictive coding — same energy family, different measurement + + + · PC (as typically run): ONE settled phase with the target clamped hard; the update uses the raw errors of that single state → finite-clamp + + + bias. Its "exact-BP" results require freezing predictions during error transport (fixed-prediction) — backprop re-expressed in local variables. + + + · EP (here): TWO phases and an infinitesimal nudge; the update is a difference quotient in β → bias is measured and controllable, and the + + + settle stays fully self-consistent — which is what physical hardware actually does. + + + · The free phase is the zero-reference of the measurement: on analog hardware the subtraction cancels state-independent device offsets. + + + + + + + + + diff --git a/assets/figs/fig_primer_block.emf b/assets/figs/fig_primer_block.emf new file mode 100644 index 0000000..7993cc9 Binary files /dev/null and b/assets/figs/fig_primer_block.emf differ diff --git a/assets/figs/fig_primer_block.png b/assets/figs/fig_primer_block.png new file mode 100644 index 0000000..b5eb58d Binary files /dev/null and b/assets/figs/fig_primer_block.png differ diff --git a/assets/figs/fig_primer_block.svg b/assets/figs/fig_primer_block.svg new file mode 100644 index 0000000..7a901a9 --- /dev/null +++ b/assets/figs/fig_primer_block.svg @@ -0,0 +1,1956 @@ + + + + + + + + 2026-07-15T09:29:45.734111 + image/svg+xml + + + Matplotlib v3.10.8, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + One transformer block, op by op + + + + + + O + L + M + o + 2 +   + o + r + d + e + r + i + n + g +   +   + R + M + S + N + o + r + m +   + a + f + t + e + r +   + e + a + c + h +   + s + u + b + l + a + y + e + r + , +   + i + n + s + i + d + e +   + t + h + e +   + r + e + s + i + d + u + a + l + . +   +   +   +   +   + = + 5 + 1 + 2 +   +   +   + = + 8 +   +   +   + = + 6 + 4 +   +   +   + = + 2 + 5 + 6 +   +   +   + = + 1 + 4 + 0 + 8 + + C + H + h + T + h + d + f + f + + + + + attention sublayer + + + + + + i + n + p + u + t +   +   +   +   + z + B + T + C + ( + , + , + ) + + + + + + + + + residual rail + + + + + + + + + + m + a + t + m + u + l +   +   + : + + 3 + W + C + C + q + k + v + + + + + + + + ( + , + , + 3 + ) +   +   + s + p + l + i + t +   + i + n + t + o +   + , + , + B + T + C + q + k + v + + + + + + + + + q + + + + + + + + k + + + + + + + + v + + + + + + + + + + + + + + + + + + + + R + M + S + N + o + r + m + q + + + + + + + + R + M + S + N + o + r + m + k + + + + + + + + s + p + l + i + t +   + h + e + a + d + s +   + ( + = + 8 + ) + H + + + + + + + + s + p + l + i + t +   + h + e + a + d + s +   + ( + = + 8 + ) + H + + + + + + + + s + p + l + i + t +   + h + e + a + d + s +   + ( + = + 8 + ) + H + + + + + RoPE + + + RoPE + + + + + + θ + = + 5 + + 1 + 0 + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + m + a + t + m + u + l +   +   + = + + 1 + / + S + q + k + h + + + d + + + + + + + + + ( + , + , + , + ) + B + H + T + T + + + + + + + + + causal mask + + + + + + + softmax over keys + + + + + + + + + + m + a + t + m + u + l +   +   + = + y + A + v + + + + + + + + ( + , + , + , + ) + B + H + T + h + d + + + + + + + + + merge heads + + + + + + ( + , + , + ) + B + T + C + + + + + + + + + + + + m + a + t + m + u + l +   +   + : + + W + C + C + p + r + o + j + + + + + + + + + + + + R + M + S + N + o + r + m + a + t + t + n + + + + + ◄ OLMo2: norm on the sublayer OUTPUT, + not on its input + + + + + + + + + + + + + + + + + + + + + z + 0 + + + + + SwiGLU sublayer + + + + + + + + + + + + + + + + + + m + a + t + m + u + l +   +   + : + + W + C + h + 1 + f + f + + + + + + + + m + a + t + m + u + l +   +   + : + + W + C + h + 3 + f + f + + + + + + + + h + f + f + = + 1 + 4 + 0 + 8 + + + + + + + + + SiLU + + + + + + + + + + + ⊙ elementwise gate + + + + + + + + + + m + a + t + m + u + l +   +   + : + + W + h + C + 2 + f + f + + + + + + + + + + + + R + M + S + N + o + r + m + f + f + + + + + ◄ norm after the sublayer, again + + + + + + + + + + + + + + + + + + + + + o + u + t + p + u + t +   +   +   +   +   + o + n + e +   + f + u + l + l +   +   + d + o + n + e + z + f + 0 + 0 + + l + + + + + + + + w + e + i + g + h + t +   + × +   + a + c + t + i + v + a + t + i + o + n +   + m + a + t + m + u + l +   +   + 7 +   + l + o + g + i + c + a + l +   + ( +   + f + u + s + e + s +   + , + , + ) + ; +   + c + r + o + s + s + b + a + r + - + m + a + p + p + a + b + l + e +   + o + n +   + a + n + a + l + o + g +   + h + a + r + d + w + a + r + e + + W + W + W + W + q + k + v + q + k + v + + + + + + + + a + c + t + i + v + a + t + i + o + n +   + × +   + a + c + t + i + v + a + t + i + o + n +   + m + a + t + m + u + l +   +   + 2 +   + ( +   + a + n + d +   + ) + ; +   + c + o + m + p + u + t + e + d +   + o + n +   + t + h + e +   + f + l + y + : +   + t + h + e +   + n + o + n + - + c + r + o + s + s + b + a + r +   + p + a + r + t +   + o + f +   + a + t + t + e + n + t + i + o + n + + q + k + A + v + + + + + + RMSNorm (learned gain) + + + elementwise / reshape + + + + + + N + o +   + b + i + a + s + e + s +   + a + n + y + w + h + e + r + e +   + i + n +   + t + h + e +   + n + e + t + w + o + r + k + . +   +   + T + h + e +   + 1 + / +   + s + c + a + l + e +   + i + s +   + f + o + l + d + e + d +   + i + n + t + o +   + ; +   + m + a + s + k +   + a + n + d +   + s + o + f + t + m + a + x +   + r + u + n +   + a + l + o + n + g +   + t + h + e +   + k + e + y +   + a + x + i + s + . + + h + S + d + + + + + + + + + h + C + C + f + f + = + 1 + 4 + 0 + 8 + + 8 + / + 3 + , +   + r + o + u + n + d + e + d +   + u + p +   + t + o +   + a +   + m + u + l + t + i + p + l + e +   + o + f +   + 6 + 4 + . +   +   + Q + K + - + n + o + r + m +   + a + c + t + s +   + o + n +   + t + h + e +   + f + u + l + l +   + w + i + d + t + h +   + , +   + b + e + f + o + r + e +   + t + h + e +   + h + e + a + d +   + s + p + l + i + t + . + + + + + + + + T + h + e +   + b + o + x + e + d +   + p + i + p + e + l + i + n + e + , +   + i + n + p + u + t +   +   + t + o +   + o + u + t + p + u + t +   + , +   + i + s +   + e + x + a + c + t + l + y +   +   + o + n +   + t + h + e +   + c + o + m + p + a + n + i + o + n +   + p + a + g + e + ; +   + t + h + e +   + s + t + a + t + e +   +   + l + i + v + e + s +   + o + n +   + t + h + e +   + r + e + s + i + d + u + a + l +   + r + a + i + l + . + z + z + f + z + 0 + 0 + l + l + + + + + + + + + + + diff --git a/assets/figs/fig_primer_phases.emf b/assets/figs/fig_primer_phases.emf new file mode 100644 index 0000000..c28c459 Binary files /dev/null and b/assets/figs/fig_primer_phases.emf differ diff --git a/assets/figs/fig_primer_phases.png b/assets/figs/fig_primer_phases.png new file mode 100644 index 0000000..a6db577 Binary files /dev/null and b/assets/figs/fig_primer_phases.png differ diff --git a/assets/figs/fig_primer_phases.svg b/assets/figs/fig_primer_phases.svg new file mode 100644 index 0000000..da9ed6a --- /dev/null +++ b/assets/figs/fig_primer_phases.svg @@ -0,0 +1,925 @@ + + + + + + + + 2026-07-15T09:44:53.517354 + image/svg+xml + + + Matplotlib v3.10.8, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Free phase (= inference) + + + + + + g + i + v + e +   + e + a + c + h +   + l + a + y + e + r +   + a +   + s + t + a + t + e +   +   + ( + 3 +   + o + f +   +   + d + r + a + w + n + ) + ; +   + s + e + t + t + l + e +   + t + h + e +   + d + i + s + a + g + r + e + e + m + e + n + t +   + e + n + e + r + g + y + z + L + l + + + + + + + + E + z + z + f + z + ( + ) + = + + + ( + ) + + + l + l + l + l + 1 + 2 + + 1 + 2 + + + + + + + + + z + f + z + 3 + 3 + 2 + = + ( + ) + + + + + term = 0 + + + + + + z + f + z + 2 + 2 + 1 + = + ( + ) + + + + + term = 0 + + + + + + z + f + 1 + 1 + = + ( + e + m + b + ) + + + + + term = 0 + + + + + + + + + + + + + + + + + + e + m + b + ( + ) + x + + + + + + + + T + h + e +   + m + i + n + i + m + u + m +   + i + s +   + e + x + a + c + t + : +   +   + = + 0 + , +   +   + s + t + a + t + e + s +   + +   + f + o + r + w + a + r + d +   + a + c + t + i + v + a + t + i + o + n + s + , + E + + + + + and one bottom-up pass reaches it. + + + The free phase adds nothing and changes nothing at inference. + + + Nudged phase (training only) + + + + + + a + d + d +   + t + h + e +   + l + o + s + s +   + a + t +   + s + t + r + e + n + g + t + h +   + + 1 +   + a + n + d +   + s + e + t + t + l + e +   + a + g + a + i + n + : + β + + + + + + + + E + z + β + z + y + ( + ) + + + + C + E + ( + l + o + g + i + t + s + ( + ) + , + ) + 3 + + + + + + + + p + u + l + l +   + + + C + E + β + + + + + (the only place the label enters) + + + + + + + + + + z + z + d + β + 3 + 3 + 3 + = + + + + + + + + + + z + z + d + β + 2 + 2 + 2 + = + + + + + + + + + + z + z + d + β + 1 + 1 + 1 + = + + + + + + + + + + + + + + + + + + + + + + e + m + b + ( + ) + x + + + + + + + + + + + + d + J + d + 2 + 3 + + 3 + = + + + + + + + + + + + + d + J + d + 1 + 2 + + 2 + = + + + + + + + + T + h + e +   + t + o + p +   + s + t + a + t + e +   + i + s +   + p + u + l + l + e + d +   + t + o + w + a + r + d +   + l + o + w + e + r +   + l + o + s + s + ; +   + e + a + c + h +   + l + a + y + e + r + ' + s +   + m + i + s + m + a + t + c + h +   + d + l + + + + + transmits DOWN through the same weights, and the stack re-settles. + + + + + + ( +   + = +   + t + h + e +   + t + r + a + n + s + p + o + s + e +   + r + e + a + d +   + a +   + b + i + d + i + r + e + c + t + i + o + n + a + l +   + p + h + y + s + i + c + a + l +   + d + e + v + i + c + e +   + p + r + o + v + i + d + e + s + ) + J + + + + + + The update — a difference measurement between the two settled states + + + + + + ̂ + = + + ( + ) + + + ( + ) + / + ( + + ( + ) + + 0 + h + e + r + e + , + s + i + n + c + e + = + 0 + ) + g + E + z + E + z + β + E + z + E + [ + ] + θ + β + θ + θ + 0 + 0 + + + + + + + + p + e + r +   + l + a + y + e + r + : +   +   + Δ + + + , + + ( + ) + / + + + / + θ + d + f + z + θ + β + l + l + l + l + l + + 1 + + + + + Each layer updates from its own boundary mismatch — no global backward graph, no global tape, no loss derivatives except the top nudge. + + + + + + + + + diff --git a/assets/figs/frozen_vs_adaptive.png b/assets/figs/frozen_vs_adaptive.png new file mode 100644 index 0000000..e45e77b Binary files /dev/null and b/assets/figs/frozen_vs_adaptive.png differ diff --git a/assets/frozen_vs_adaptive.png b/assets/frozen_vs_adaptive.png deleted file mode 100644 index e45e77b..0000000 Binary files a/assets/frozen_vs_adaptive.png and /dev/null differ diff --git a/assets/hw/CLOCKLESS_ANALOG_MVP_PLAN.html b/assets/hw/CLOCKLESS_ANALOG_MVP_PLAN.html new file mode 100644 index 0000000..a2e1e07 --- /dev/null +++ b/assets/hw/CLOCKLESS_ANALOG_MVP_PLAN.html @@ -0,0 +1,509 @@ +

Clockless analogue MVP for physical EP research

+

Prepared: 2026-07-11
+Starting point: COMPONENT_HW_MAP.md
+Scope: academic prototype, not a product demonstrator; analogue learning core; no processor, ADC, DAC, FPGA, sample-and-hold bank, phase clock, or digital optimizer in the learning loop.

+
+

1. Executive decision

+

The current $5k–$20k Demo-0 is not an MVP. It is an architecture demonstrator that tries to validate, at once, an SRAM-CIM module, bidirectional transpose reads, RoPE mixers, QK/RMS normalization, analogue softmax, SwiGLU multipliers, analogue state handling, ADC/DAC boundaries, a phase sequencer, write programming, and digital supervisory logic. A failure would be difficult to attribute to one mechanism.

+

The lower-risk research question is narrower and more publishable:

+
+

Can a reciprocal nonlinear analogue network continuously learn by a local equilibrium contrast, with the free and nudged states physically present at the same time, without a clock or processor in the learning loop?

+
+

Build that first. The recommended core is a twin-equilibrium analogue learning tile:

+ +

Recommended first populated board: 8 sign-update edges plus one exact multiplier reference channel, approximately $170–$300 excluding instruments, tax, and shipping. This is about 17×–118× below the current $5k–$20k board class. A one-edge calibration rig is approximately $70–$130.

+
+

2. What “completely analogue and clockless” can honestly mean

+

A defensible claim is:

+
+

The state evolution, nudge, local learning rule, and weight storage are continuous-time analogue processes. No periodic control signal, processor, converter, sampled state memory, or digitally computed parameter update participates in learning.

+
+

Allowed outside the claim:

+ +

A full language-model demonstration cannot honestly be entirely analogue and clockless at the token interface: symbol lookup, presentation of a sequence, cross-entropy labels, and token sampling are discrete operations. The academic MVP should therefore validate the physical learning primitive, then add a very small reciprocal attention cell as a second experiment.

+
+

3. Core topology

+
                      analogue input x          analogue target y*
+                             │                           │
+                ┌────────────┴────────────┐              │
+                │                         │              │
+                ▼                         ▼              │
+        FREE reciprocal network    NUDGED reciprocal network
+          natural RC settling        natural RC settling
+             output y0              output yβ + nudge current
+                │                         ▲              │
+                │                         │      OTA/error transconductor
+                │                         └──────────────┘
+                │
+       for every trainable edge e:
+
+          edge voltage Δv0,e               edge voltage Δvβ,e
+                    │                              │
+                    └──── local contrast cell ─────┘
+                                  │
+                         charge/discharge current
+                                  │
+                            shared weight Cw,e
+                                  │
+                     ┌────────────┴────────────┐
+                     ▼                         ▼
+             MOSFET edge in free net   MOSFET edge in nudged net
+
+

The two replicas must be laid out symmetrically and use matched transistor pairs where practical. The shared capacitor ensures both edge copies always use the same learned weight.

+

3.1 State dynamics

+

The node voltages are the states. Resistors/MOSFET conductances and node capacitances produce the relaxation automatically. Add small capacitors only where needed to set a reproducible pole and suppress oscillation; do not build a capacitor-plus-OTA integrator for every abstract model state.

+

Design target, not a theorem:

+
τ_{weight}/τ_state ≥ 10^2,     preferably 10^3.
+
+

The state should equilibrate much faster than the weight capacitors move. This time-scale separation replaces a settle detector and phase sequencer.

+

3.2 True EP nudge and the CL control

+

Populate both modes on the same board.

+

EP mode — current/force nudge. For voltage outputs, compute the output error and inject a proportional current at the nudged output. A practical small-nudge implementation is

+
I_β = -g_β (y_0-y^*)
+
+

with an LM13700-class OTA or a discrete transconductor. The polarity is chosen to push the nudged output toward the target. This crosses voltage error with current nudge and is the mode to use for the formal EP/gradient-flow claim.

+

CL mode — voltage constraint. Buffer a weighted voltage between the free output and the target and impose it on the second replica. This is easier and reproduces the demonstrated clockless Coupled Learning architecture, but it should not be called exact EP.

+

A two-position switch should select EP-current or CL-voltage nudge. That comparison is itself a useful experiment.

+

3.3 Exact local contrast

+

For a conductance-like parameter, the local energy derivative is proportional to the squared voltage drop. Use

+
C_{w,e} dV/dt_{w,e}
+ = s_e k≤ft[(\Delta v_{β,e})^2-(\Delta v_{0,e})^2],
+
+

where s_e = ±1 accounts for whether increasing capacitor voltage increases or decreases effective conductance.

+

Do not square twice. Use

+
a^2-b^2=(a-b)(a+b),
+
+

so one four-quadrant multiplier can implement an exact reference channel. The established laboratory circuit used an AD633 with op-amp conditioning and a local capacitor.

+

3.4 Low-cost sign contrast

+

The exact multiplier dominates cost. A much cheaper local rule is

+
C_{w,e} dV/dt_{w,e}
+ = s_e I_0 sgn≤ft(|\Delta v_{β,e}|-|\Delta v_{0,e}|)
+
+

outside a deadband δ, with zero current inside the deadband. Implement it with absolute-value/rectifier stages, a comparator with hysteresis, and two matched charge/discharge current sources.

+

This rule has precedent in simulated memristor EP hardware because it removes the analogue multiplier. The continuous capacitor implementation proposed here is an engineering adaptation, not an already demonstrated result. That is a legitimate research contribution, but it must be labeled correctly.

+

3.5 Freeze and retention

+

Use a mechanical toggle or relay to disconnect update current from every weight capacitor. Avoid a clocked switch matrix. Use film capacitors initially; characterize leakage and dielectric absorption. Volatile analogue weights are acceptable for an academic demonstrator, but not for a storage product.

+
+

4. Recommended hardware ladder

+

Rung A — one-edge metrology tile

+

Purpose: validate the physics before assembling a network.

+

Populate:

+ +

Estimated cost: $70–$130.

+

Required measurements:

+
    +
  1. transfer surface I_update(Δv0, Δvβ);
  2. +
  3. exact-channel gain and offset;
  4. +
  5. sign-channel boundary, hysteresis, and deadband;
  6. +
  7. zero-contrast drift at Δv0 = Δvβ;
  8. +
  9. weight retention with learning frozen;
  10. +
  11. temperature drift;
  12. +
  13. nudge linearity versus β;
  14. +
  15. time-scale ratio between node settling and weight motion.
  16. +
+

Do not build the multi-edge board until this tile gives a stable null at zero contrast.

+

Rung B — two modular four-edge cards

+

Build a four-edge card and populate two cards for eight trainable edges. Each card contains:

+ +

Recommended population: eight sign channels plus one parallel exact AD633 channel on a selected edge. This gives a continuously measured exact-versus-sign comparison without buying eight multipliers.

+

Estimated cost: $170–$300.

+

Initial task:

+ +

Do not promise XOR at eight edges. The published nonlinear clockless network used 32 twin edges for XOR. Design the card so eight identical four-edge modules can be stacked later.

+

Rung C — 32-edge replication-class network

+

Use eight four-edge cards and the sign-update rule. This approaches the scale of the published nonlinear demonstration while avoiding 32 AD633 multipliers.

+

Estimated cost: $450–$900.

+

This is still below the low end of the original plan by approximately 5.5×–44× and is large enough for a serious robustness and nonlinear-learning study.

+

Rung D — reciprocal attention microcell

+

Only after Rungs A–C work, add a transformer-adjacent cell:

+ +

For two alternatives, softmax reduces to a logistic function of a score difference, so a differential pair can replace a general N-way entropic-resistor array. This is an attention-shaped energy cell, not an OLMo2 block.

+

Estimated total including the learning core: $300–$700.

+
+

5. Costed options

+

Budgetary single-quantity catalogue prices checked on 2026-07-11; prices exclude tax, shipping, instruments, assembly labor, and rework.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ItemPlanning roleUnit price usedPlanning quantity, 8-edge boardExtended
ALD1106PBLmatched N-MOS array; two twin edges/package$9.294$37.16
AD633ANZexact four-quadrant contrast multiplier$21.480, 1, or 8$0 / $21.48 / $171.84
TLV274IPWRquad rail-to-rail op amp$1.436–8$8.58–$11.44
LM13700dual OTA; output nudge/current sources$1.701–2$1.70–$3.40
LM339-class comparatorsign/deadband channelsabout $0.672–4about $1.34–$2.68
CD4066-class switchoptional static freeze/routingabout $0.73–$0.972–4about $1.46–$3.88
Film capacitorsweight storageabout $0.63 at 1 µF8–12about $5–$8
Diodes, resistors, trimsrectifiers, limits, biasinglot$15–$40
PCB/protoboard, headers, test pointsphysical implementationlot$35–$120
Power rails, protection, spare partslaboratory overheadlot$30–$90
+

Resulting envelopes:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariantEstimated build costRecommendation
One-edge exact/sign calibration tile$70–$130Build first
8-edge sign-only$140–$250Cheapest useful network
8-edge sign + one exact reference channel$170–$300Recommended MVP
8-edge all-exact AD633$300–$500Only after reference channel works
32-edge sign-update network$450–$900Replication-class nonlinear demo
Reciprocal two-token attention add-on+$100–$250Phase 2 only
+

Aggressive transistor substitution

+

A CD4007UBE costs about $0.89 and contains a CMOS dual complementary pair plus inverter. It can be explored on the one-edge tile, but it is not the main-board recommendation: matching, body connections, and device operating region become the dominant uncertainty. Saving roughly $30 of matched-transistor cost on an eight-edge board is not worth sacrificing the experiment’s interpretability.

+
+

6. Delete list for the original plan

+

For the academic MVP, delete these entirely:

+ +

Keep or replace as follows:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Original functionMVP replacement
MVM/crossbarpatchable reciprocal nonlinear resistor network
state integratorsnatural RC/KCL state dynamics
sequential free/nudged phasestwo continuously operating physical replicas
DAC nudgeOTA current injection
digital phase memorysimultaneous physical state comparison
outer-product update/programminglocal capacitor charge/discharge
FPGA controlmanual boundary selection and learn/freeze
ADC telemetrybuffered scope/DMM observation outside loop
+
+

7. Experimental matrix

+

The cleanest paper is not merely “it learned.” It should isolate the choices that make the clockless implementation possible.

+

Factor 1 — nudge type

+ +

Factor 2 — local update

+ +

Factor 3 — device quality

+ +

Factor 4 — nudge magnitude

+ +

Factor 5 — operating conditions

+ +

Proposed acceptance criteria, to be declared before network training:

+
    +
  1. no periodic control signal in the learning loop;
  2. +
  3. no processor, ADC, DAC, or stored free-phase sample used for an update;
  4. +
  5. exact reference channel has a stable zero-contrast null;
  6. +
  7. sign channel agrees with the exact channel on update direction in at least 95% of the specified operating grid;
  8. +
  9. frozen weights remain within the chosen tolerance over the measurement interval;
  10. +
  11. loss decreases consistently across multiple resets, with all failures reported;
  12. +
  13. EP-current and CL-voltage modes are labeled separately.
  14. +
+
+

8. Six-week execution plan

+

Week 1 — SPICE and one-edge schematic

+ +

Week 2 — one-edge breadboard

+ +

Week 3 — one-edge characterization

+ +

Week 4 — first four-edge card

+ +

Week 5 — eight-edge network

+ +

Week 6 — robustness and paper figures

+ +
+

9. Claims this MVP can and cannot support

+

It can support

+ +

It cannot support

+ +

A passive reciprocal network avoids the adjoint/transposed-Jacobian problem by construction, but it also excludes normal non-reciprocal attention. The transformer connection must therefore use tied, energy-based attention or be deferred to an active-adjoint phase.

+
+

10. Why this is the better academic MVP

+

It tests one scientific claim at a time. Every expensive item in the original plan exists to preserve a nearly complete transformer block. That is appropriate after the physical learning primitive is established, not before it.

+

The proposed sequence produces publishable intermediate results even if the final nonlinear task fails:

+ +

The main recommendation is therefore:

+
+

Build the $70–$130 one-edge tile, then the $170–$300 eight-edge hybrid board. Do not purchase a CIM evaluation module, FPGA, DAC/ADC bank, or softmax hardware for the MVP.

+
+
+

11. Primary references used

+
    +
  1. Sam Dillavou et al., “Machine Learning Without a Processor: Emergent Learning in a Nonlinear Electronic Metamaterial,” arXiv:2311.00537v2 / PNAS (2024). Demonstrated a fully analogue, clockless nonlinear twin-resistor network; 32 twin edges; local capacitive learning; XOR and nonlinear regression. Its implemented rule is Coupled Learning.
  2. +
  3. Sam Dillavou et al., “Understanding and Embracing Imperfection in Physical Learning Networks,” arXiv:2505.22887v2 (2026 revision). Characterizes bias, limit cycles, and system-agnostic suppression of analogue learning imperfections.
  4. +
  5. Joshua A. McGinnis, Xinbo Li, and Yoichiro Mori, “Coercivity and Local Convergence of Physical Learning in Linear Circuits,” arXiv:2606.15443 (2026). Distinguishes EP’s force/current nudge from CL’s voltage constraint and analyzes their gradient-flow structure.
  6. +
  7. Seung-Hyun Oh et al., “Memristor Crossbar Circuits Implementing Equilibrium Propagation for On-Device Learning,” Micromachines 14(7):1367 (2023). Proposes simultaneous free/nudged networks and a sign-only fixed-step update to remove analogue multipliers; results are simulation-oriented for memristor programming.
  8. +
  9. I. M. Elfadel and J. L. Wyatt, “The ‘Softmax’ Nonlinearity: Derivation Using Statistical Mechanics and Useful Properties as a Multiterminal Analog Circuit Element,” NeurIPS 1993. Establishes reciprocal/passive circuit properties of an entropic softmax element.
  10. +
  11. “How to Train Your Resistive Network: Generalized Equilibrium Propagation and Analytical Learning,” arXiv:2602.03546 (2026). Gives a single-network projector-based route for linear resistive networks; useful as a future replica-reduction direction, not the first nonlinear build.
  12. +
\ No newline at end of file diff --git a/assets/hw/COLLABORATOR_BRIEF.html b/assets/hw/COLLABORATOR_BRIEF.html new file mode 100644 index 0000000..48df78c --- /dev/null +++ b/assets/hw/COLLABORATOR_BRIEF.html @@ -0,0 +1,98 @@ +

Backprop-free training of transformers — results and a staged hardware program

+

One-page brief for hardware-side collaborators · rev. 2026-07-12 · Yuren Hao (UIUC)

+

The idea in three sentences

+

We train standard multi-layer transformers with Equilibrium Propagation on a layered energy: +training consists of two relaxation phases and a local contrast update per weight — no +backpropagation anywhere — and inference is an ordinary forward pass. On GPU this now works at +language-model scale with essentially no quality gap to backprop. The hardware program starts with +the cheapest object that can validate the physical learning rule — a clockless twin-network +analog tile (~$300) — and climbs rung by rung to an in-memory-compute transformer block.

+

GPU-scale results (2026-07, measured)

+ +

Measured fault tolerances (fault injection at the trained model)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
faultfreemarginaldead
weight precision8-bit (ΔCE +0.004)6-bit (+0.05)4-bit
forward state noise1%
error-channel (nudge) noise10% relative30%
divider mismatch / gate gain / phase error3% / 10% / 0.03 rad10% / — / 0.1 rad
+

Under every non-fatal fault the learning signal tracks the faulted network (gradient cosine ≈ 0.97 +invariant): the rule co-adapts to the device. The only hard spec is ~7-bit effective weights.

+

The hardware ladder (each rung publishable alone)

+
    +
  1. One-edge metrology tile ($70–130): twin MOSFET edge, shared weight capacitor, exact + (difference-of-squares) and sign-only local update channels, OTA current nudge — no processor, + converter, clock, or sampled memory in the learning loop.
  2. +
  3. 8-edge twin network ($170–300): nonlinear regression; EP current-nudge vs Coupled-Learning + voltage-clamp on one board; exact-vs-sign update comparison; measured bias-vs-nudge-magnitude + curve (the same β-SNR law we measured in simulation).
  4. +
  5. 32-edge network ($450–900): replication-class nonlinear tasks, robustness study.
  6. +
  7. Reciprocal attention microcell (+$100–250): two tokens, one head, energy-based attention.
  8. +
  9. CIM transformer block (partner phase): analog MVM + in-situ two-phase EP weight update — + the piece no shipping analog-AI chip has (all are inference-only or on-chip-backprop).
  10. +
  11. North star: a few-M-parameter TinyStories LM trained on analog hardware.
  12. +
+

What we bring / what we ask

+

Bring: the trained models and recipe, the estimator theory (β-SNR law, stability walls), the +measured tolerance ledger, SPICE-first costed build plan, and parts funding (rungs 1–3 are <$1k). +Ask (rungs 1–3): bench access, analog-design mentorship, and/or a student who enjoys discrete +analog — six-week plan, instruments = a scope and a DMM. Ask (rung 5): a CIM/mixed-signal +partnership where the substrate expertise is yours and the learning rule is ours.

+

(Detail: CLOCKLESS_ANALOG_MVP_PLAN.md — full BOM, schedule, acceptance criteria, claim limits; +COMPONENT_HW_MAP.md — per-operation analog mapping + tolerance status.)

\ No newline at end of file diff --git a/assets/hw/hw_mvp_explainer.html b/assets/hw/hw_mvp_explainer.html new file mode 100644 index 0000000..4114648 --- /dev/null +++ b/assets/hw/hw_mvp_explainer.html @@ -0,0 +1,220 @@ + + + + +无时钟模拟学习板 — 结构图解(给不懂硬件的人) + + + +
+ +

无时钟模拟学习板:它长什么样、为什么能学习

+

+一句话:这块板子上同时活着两份一模一样的电路——一份自由地"回答问题"(FREE),一份的输出被轻轻拉向正确答案(NUDGED)。 +每个"权重"是一颗电容,它不停地比较自己在两份电路里的受力差异、朝着缩小差异的方向缓慢充放电。 +没有处理器、没有时钟、没有数模转换——物理本身在做训练。 +把鼠标悬停在图里任何东西上看它是什么。 +

+ + + + + + + + + + FREE 网络(自由态) + 自然弛豫,输出 = 网络自己的回答 ŷ + + + + + + + x₁ + + x₂ + + + + h + + + + ŷ + + + + + + + + + + + + + + + NUDGED 网络(微推态) + 同样的电路 + 输出被轻拉向目标 y* + + + + + + x₁ + + x₂ + + h + + + + ŷβ + + + + + + + + + + + + + + + y* + + + + + 电流微推 (β) + + + + 共享权重 + 学习单元(每条边一套) + + + + + + + + learn / freeze + + + + + + 示波器 + + +

悬停任何元素查看解释 · 紫框 = 学习单元(对比 + 电容)· 绿 = 权重/目标相关 · 蓝 = FREE · 橙 = NUDGED

+ +

ML ↔ 电路 词典

+ + + + + + + + + + +
机器学习里的板子上的备注
激活值 z节点电压没人"计算"它——电流平衡自己找到它
权重 w一颗电容的电压(控制 MOSFET 导电性)非易失升级版 = FeFET(Zhu 组的方向)
前向传播RC 自然弛豫(~微秒)免费,且天然并行
损失的输出梯度OTA 电流 = g·(ŷ − y*)只在输出端,任何学习规则都需要这个
反向传播不存在被"双生网络 + 局部对比"替代
每个权重的梯度该边两侧压降的平方差 Δvβ² − Δv²纯局部量——只需要摸自己这条边
optimizer.step()电容充/放电(~毫秒-秒)学习率 = 充电电流大小
训练循环 / 时钟不存在两态同时物理存在 + 快慢时间尺度分离
+ +

一次"学习"是怎么发生的(其实是连续的,这里人为分步)

+
    +
  1. 摆题:手动开关把输入 x 设到两份网络上,把目标 y* 设到 OTA 上。
  2. +
  3. 瞬间稳定(微秒级):两份网络各自弛豫。FREE 的输出是网络自己的回答;NUDGED 的输出被 OTA 拉向正确答案一点点。
  4. +
  5. 形变传播:输出端被拉动后,NUDGED 网络全身的电压分布都微微变形——离输出越远变形越小,但每条边都感受得到。这就是"credit assignment 由物理完成"。
  6. +
  7. 逐边对比(连续进行):每条边的学习单元比较自己在两侧的压降,差异越大充电越快。方向恰好是能量下降的方向——数学上等价于梯度下降。
  8. +
  9. 慢速累积(毫秒-秒级):权重电容比节点慢 100–1000 倍,所以在权重看来网络永远是"稳定的"——这个时间尺度差就是时钟的替代品
  10. +
  11. 换题:手动换下一组输入/目标。重复。loss 就这样降下去(Penn 的 32 边版本已经在物理上学会了 XOR 和非线性回归)。
  12. +
+ +

造价阶梯

+

+① 单边标定件 $70–130(先证明物理) +② 8 边网络 $170–300 ← 推荐 MVP +③ 32 边 $450–900(复现 Penn 规模) +④ 注意力微单元 +$100–250 +⑤ CIM transformer block(合作方阶段) +

+ +
+诚实边界(也是给合作者的说法):这块板子验证的是物理学习原语——无时钟双生 EP、局部模拟更新、真电流 nudge vs 电压钳制的对比—— +不是 transformer 本身。它和我们 GPU 侧共享同一条定律:nudge 幅度 vs 噪声的信噪比曲线(我们在 fp32 里测过的 β 定律,这块板会在物理里再测一遍)。 +
+ +
+
+ + + diff --git a/assets/hw/hw_outreach_pack.zip b/assets/hw/hw_outreach_pack.zip new file mode 100644 index 0000000..4737d6c Binary files /dev/null and b/assets/hw/hw_outreach_pack.zip differ diff --git a/assets/misc/ept_method_intro.tex b/assets/misc/ept_method_intro.tex new file mode 100644 index 0000000..31d458d --- /dev/null +++ b/assets/misc/ept_method_intro.tex @@ -0,0 +1,606 @@ +\documentclass[11pt]{article} + +\usepackage[margin=1in]{geometry} +\usepackage{amsmath,amssymb} +\usepackage{bm} +\usepackage[round]{natbib} +\usepackage{enumitem} +\usepackage{booktabs} +\usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref} + +% --- light-weight notation --------------------------------------------------- +\newcommand{\R}{\mathbb{R}} +\newcommand{\C}{\mathbb{C}} +\renewcommand{\Re}{\operatorname{Re}} +\newcommand{\xin}{x_{\mathrm{in}}} +\newcommand{\zstar}{z^{\ast}} +\newcommand{\zbar}{\bar{z}} +\newcommand{\Fnc}{F_{\mathrm{nc}}} +\newcommand{\Jnc}{J_{\mathrm{nc}}} +\newcommand{\half}{\tfrac12} +\newcommand{\grad}{\nabla} +\newcommand{\dd}{\,\mathrm{d}} +\newcommand{\inner}[2]{\langle #1,\, #2\rangle} +\DeclareMathOperator{\Attn}{Attn} +\DeclareMathOperator{\FFN}{FFN} +\DeclareMathOperator{\softmax}{softmax} +\DeclareMathOperator{\LSE}{LSE} +\DeclareMathOperator{\LN}{LN} +\DeclareMathOperator{\jvp}{jvp} +\DeclareMathOperator{\vjp}{vjp} +\DeclareMathOperator*{\argmin}{arg\,min} + +\title{\bf Training a Transformer Language Model with Equilibrium Propagation:\\ +from energy-based EP to non-conservative, holomorphic, tracking-AEP} +\author{Method introduction (internal)} +\date{2026-06-21} + +\begin{document} +\maketitle + +\begin{abstract} +We train a transformer-class language model in which \emph{both} attention and the +feed-forward network learn \emph{without backpropagation through the computation}, +using Equilibrium Propagation (EP). This note is written for a reader who knows +\emph{classic} energy-based EP \citep{scellier2017} --- the two-phase free/nudged +relaxation of a conservative, symmetric-Jacobian system --- but has not met the +non-conservative / asymmetric / holomorphic extensions. We first recall why classic +EP \emph{requires} a conservative system, then show that softmax self-attention +breaks that requirement (independent $Q,K,V$ give an asymmetric Jacobian). We then +introduce, from first principles, the pieces that repair this: the +\emph{asymmetric / adjoint} EP correction $J\!\to\!J^{\!\top}$ +\citep{scurria2026}; the \emph{holomorphic} EP estimator \citep{laborieux2022}; +the \emph{Convergent Energy Transformer} (CET) route \citep{hoier2026} that +sidesteps the problem by making attention conservative; and finally \emph{our} +recipe: a damped non-conservative equilibrium-transformer block, trained with +\emph{tracking-AEP} (re-linearizing the correction at the moving common-mode +midpoint) plus a residual-driven stabilization stack. We report what is solidly +validated --- component gradients match backprop at cosine $0.99$--$1.0$, and EP +trains the block stably and competitively with a backprop transformer at equal +parameters on a character-level LM --- and clearly mark the larger-scale work +(the $C{=}512$ ``residual-defense'' line) as \emph{ongoing}. +\end{abstract} + +\tableofcontents + +%============================================================================== +\section{Recap: classic energy-based EP and why it needs a conservative system} +\label{sec:classic} + +\paragraph{Setup.} +Classic EP \citep{scellier2017} trains a dynamical system whose state +$z\in\R^{d}$ relaxes, under a fixed input/clamp, to the minimum of a scalar +\emph{energy} $E(z,\theta)$. Two ideas make it a learning rule. + +\paragraph{Two phases.} +\begin{itemize}[leftmargin=1.4em,itemsep=2pt] + \item \emph{Free phase.} Run the gradient dynamics $\dot z=-\grad_z E(z,\theta)$ + to the free equilibrium $\zstar=\argmin_z E(z,\theta)$, + in practice an Euler relaxation to a fixed point. + \item \emph{Nudged phase.} Add the task loss to the energy with a small strength + $\beta$, $E_\beta = E + \beta\,\ell(z)$, and relax to the nudged + equilibrium $z_\beta$. +\end{itemize} + +\paragraph{The contrastive gradient.} +EP's central identity is that the loss gradient w.r.t.\ any parameter is the +\emph{contrastive difference of $\partial E/\partial\theta$ across the two phases}: +\begin{equation} + \frac{\partial \mathcal{L}}{\partial \theta} + \;\approx\; + \frac{1}{\beta}\!\left[ + \frac{\partial E}{\partial\theta}(z_\beta,\theta) + -\frac{\partial E}{\partial\theta}(\zstar,\theta) + \right] + \qquad(\text{one-sided, bias }O(\beta)). + \label{eq:ep-onesided} +\end{equation} +Centered / symmetric nudging \citep{laborieux2021} uses $\pm\beta$ and averages, +reducing the estimator bias to $O(\beta^2)$: +\begin{equation} + \frac{\partial \mathcal{L}}{\partial \theta} + \;\approx\; + \frac{1}{2\beta}\!\left[ + \frac{\partial E}{\partial\theta}(z_{+\beta}) + -\frac{\partial E}{\partial\theta}(z_{-\beta}) + \right]. + \label{eq:ep-centered} +\end{equation} +The update is \emph{local}: each parameter reads only the two equilibria of the +terms it touches; there is no backward pass and no weight transport. As +$\beta\!\to\!0$ with a converged free phase, the EP estimate equals the +implicit/equilibrium gradient, and (in an RNN with static input) it equals the +step-wise BPTT gradient \citep{ernoult2019}. + +\paragraph{Why this needs a conservative / symmetric-Jacobian system.} +Equations \eqref{eq:ep-onesided}--\eqref{eq:ep-centered} are only valid because +the dynamics are the \emph{gradient} of a scalar energy. Write the force as +$F(z) = -\grad_z E(z)$ and its Jacobian as $J=\partial F/\partial z$. If $F$ +descends an energy, then $J = -\,\partial^2 E/\partial z^2$ is a Hessian and is +therefore \emph{symmetric}, $J=J^{\!\top}$. This symmetry is exactly what makes the +nudged perturbation a faithful surrogate for the loss \emph{adjoint}: linearizing +the nudged relaxation around $\zstar$ produces a response governed by +$(I-J)^{-1}$, and because $J=J^{\!\top}$ this self-adjoint operator is the same one +the true gradient (which involves $(I-J^{\!\top})^{-1}$) requires. We therefore +record the four implicit premises of classic EP --- the transformer will break all +four, and each fix below targets exactly one of them: +\begin{description}[leftmargin=2.6em,itemsep=2pt] + \item[(A) Conservative / symmetric.] A scalar energy $E$ exists, so $J=J^{\!\top}$. + \item[(B) Free phase converged.] The readout sits at the true fixed point; + residual $\approx 0$. + \item[(C) Small-$\beta$ linear response, clean nudge.] $\beta\!\to\!0$ is a mere + perturbation, and no non-analytic ``clamp'' contaminates the estimate. + \item[(D) The fixed point stays stable throughout training.] After every weight + update the free phase still relaxes to a stable fixed point. +\end{description} + +%============================================================================== +\section{The gap: softmax attention is non-conservative} +\label{sec:gap} + +A pre-LN transformer block computes, for a state $z$, +\begin{equation} + \Attn(z) = \softmax\!\Big(\tfrac{Q(z)K(z)^{\!\top}}{\sqrt{d}},\ \text{causal}\Big)V(z)\,W_O, + \qquad + Q=zW_Q,\ K=zW_K,\ V=zW_V, + \label{eq:attn} +\end{equation} +with \emph{independent} projections $W_Q,W_K,W_V$. The query--key coupling +$i\!\to\!j$ is governed by $W_QW_K^{\!\top}$, while $j\!\to\!i$ is governed by +$W_KW_Q^{\!\top}$; these differ, and $V$ is a third independent map. Consequently +the attention Jacobian is \emph{asymmetric}, $J_{\Attn}\neq J_{\Attn}^{\!\top}$, and +\emph{no scalar energy has this gradient}. An untied $4\times$ FFN +($W_2\,\mathrm{GELU}(W_1\cdot)$ with $W_2\neq W_1^{\!\top}$) is non-conservative for +the same reason. Premise~(A) fails. + +Empirically this is not a cosmetic issue: with an asymmetric $J$ the nudged phase +relaxes under $J$ but the correct loss adjoint needs $J^{\!\top}$, so the raw EP +contrast is \emph{biased}. Measured against the true backprop gradient, uncorrected +EP gives an attention-parameter cosine of only $\approx 0.25$ (essentially the +wrong direction), even though the loss-adjacent output projection looks fine. (This +is the same pathology that limits feedback alignment, which only trains the layer +right before the loss and leaves $Q/K/V$ at cosine $\approx 0.25$ and the upstream +FFN at $\approx -0.01$.) + +There are two ways out, and we will use the second: +\begin{enumerate}[leftmargin=1.6em,itemsep=2pt] + \item \textbf{Energy route} (make attention conservative): fold attention into a + scalar energy with a \emph{tied} value, so $F=-\grad E$ and classic EP is + exactly valid. This is the CET route (\S\ref{sec:cet-energy}); it costs the + $Q\!\neq\!K$ asymmetry and the free value that make attention expressive. + \item \textbf{Force route} (keep real attention, repair the \emph{estimator}): + leave \eqref{eq:attn} as a non-conservative \emph{force} and add a + correction that turns $J$ into $J^{\!\top}$ in the nudged phase. This is the + AEP route (\S\ref{sec:aep}), and it is what our block uses. +\end{enumerate} + +%============================================================================== +\section{AEP, holomorphic EP, and the force-form readout} +\label{sec:aep} + +\subsection{Force-form (vector-field) EP} +\label{sec:vf} +The first step is to drop the energy and write the dynamics directly as a force +$F(z)$, relaxing $\dot z=F(z)$ to a fixed point $\zstar$. The parameter gradient is +then read off a \emph{vector-field} (VF) contrast \citep{scurria2026}: +\begin{equation} + \frac{\partial\mathcal{L}}{\partial\theta} + \;\approx\; + \frac{\partial}{\partial\theta}\,\big\langle a,\ F(\zstar;\theta)\big\rangle, + \qquad + a \;=\; \frac{z_{-\beta}-z_{+\beta}}{2\beta}\ \approx\ -\frac{\dd \zstar}{\dd\beta}, + \label{eq:vf} +\end{equation} +where $a$ is the centered contrast (the ``adjoint state'') read from the two nudged +equilibria, and the right-hand side is \emph{one} autograd call evaluated at the +fixed point only --- per-term local bookkeeping, \emph{not} backprop through the +relaxation steps. Every term of the block (attention, FFN, LayerNorm affines, and +the embeddings, which enter through the input clamp $-(z-\xin)$) is a term of the +same $F$, so \eqref{eq:vf} trains them jointly with no per-module schedule. + +\paragraph{Attribution / honest caveat.} +The force-form VF readout \eqref{eq:vf} is \emph{not ours}: it is the baseline of +\citet{scurria2026}. Crucially it \emph{collapses on its own} for a non-conservative +system (their CIFAR-10 VF reaches chance, $10\%$; MNIST $64\%$ vs.\ $92.7\%$), +exactly mirroring our measured cosine $\approx 0.25$ for uncorrected attention. VF +is therefore the ``starting point that fails''; what rescues it is the next step. + +\subsection{The AEP correction: \texorpdfstring{$J\!\to\!J^{\!\top}$}{J to J transpose}} +\label{sec:aep-corr} +For a non-conservative $F$, the nudged relaxation linearized at $\zstar$ runs under +$J=\partial F/\partial z$, but the true adjoint requires $J^{\!\top}$. \emph{Asymmetric +EP} (AsymEP) \citep{scurria2026} repairs this by adding to the nudged force a term +that subtracts twice the antisymmetric part of the Jacobian. With +$v=z-\zstar$ and $\Jnc$ the Jacobian of the \emph{non-conservative} part $\Fnc$, +\begin{equation} + \mathrm{corr}(z) \;=\; \Jnc\,v - \Jnc^{\!\top} v + \;=\; (\Jnc-\Jnc^{\!\top})\,v + \;=\; 2\,A_J\,v, + \qquad + A_J \equiv \tfrac12\big(\Jnc-\Jnc^{\!\top}\big), + \label{eq:aep} +\end{equation} +which is \emph{mathematically identical} to their $-2A_J(\zstar)(z-\zstar)$. The +nudged force becomes $f \;=\; F(z) \mp \beta\,\grad_z\ell(z) - \mathrm{corr}(z)$, +so the attention part of the nudged linearization is replaced as +\begin{equation} + J\,v \;-\; (J-J^{\!\top})\,v \;=\; J^{\!\top} v , +\end{equation} +i.e.\ \emph{$J$ is turned into $J^{\!\top}$}, restoring the correct adjoint and hence the +exact gradient for $Q\!\neq\!K$ attention. Two structural facts make this cheap and +local: +\begin{itemize}[leftmargin=1.4em,itemsep=2pt] + \item \emph{The symmetric (conservative) parts cancel.} The damping $-c\,z$ has + Jacobian $-cI$ (symmetric), the FFN-as-Hopfield-energy and the input clamp + are symmetric, so they contribute $0$ to $A_J$. Thus a \emph{single} + correction on the attention term repairs the \emph{whole} block; FFN/clamp + ride along in the conservative part and are already exact under VF. + \item \emph{It is matrix-free.} We never build $\Jnc$. Each nudged step uses one + Jacobian-vector product and one vector-Jacobian product, + $\Jnc v=\jvp(\Fnc,\zstar,v)$ and $\Jnc^{\!\top} v=\vjp(\Fnc,\zstar,v)$. +\end{itemize} + +\paragraph{Attribution.} +The correction \eqref{eq:aep} is \citet{scurria2026}'s, \emph{not} ours. Their scope +is feedforward / Hopfield nets on static MNIST/CIFAR with an \emph{explicitly +constructed} Jacobian, no attention, no sequence model, and no stability controller. +\emph{Ours on this line} is: (i) the matrix-free $\jvp/\vjp$ form (their explicit +Jacobian is infeasible at transformer state dimension $B\!\cdot\!T\!\cdot\!C$); +(ii) the application to data-dependent \emph{softmax attention}; (iii) the +combination with holomorphic estimation (\S\ref{sec:holo}); (iv) the common-mode +\emph{tracking} variant (\S\ref{sec:tracking}); and (v) the transformer-LM +application together with the stability stack (\S\ref{sec:stab}). + +\paragraph{Validity window.} +The correction is linearized \emph{at $\zstar$}, so the nudged trajectory must stay +inside the linear-response window. At $\varepsilon{=}0.1$ a nudge horizon +$T_2\!\approx\!20$ is comfortably inside; $T_2\gtrsim 60$ can leave it (\S\ref{sec:stab}). + +\subsection{Holomorphic EP: variance-reduced, higher-order estimates} +\label{sec:holo} +The $\pm\beta$ contrast trades bias against noise: small $\beta$ shrinks the +$O(\beta^2)$ bias but amplifies the $1/\beta$ noise on $(z_{-\beta}-z_{+\beta})/2\beta$. +Holomorphic EP \citep{laborieux2022} removes this trade-off by replacing the two +real points with $N$ points on a \emph{complex circle}, +$\beta_k = r\,e^{2\pi i k/N}$, relaxing the \emph{holomorphically extended} dynamics +and reading the contrast off a discrete Cauchy integral: +\begin{equation} + a \;=\; -\,\Re\!\left[\frac{1}{Nr}\sum_{k=0}^{N-1} e^{-i\phi_k}\,(z_k-\zstar)\right], + \qquad \phi_k=\tfrac{2\pi k}{N}, + \label{eq:holo} +\end{equation} +whose bias is $O(r^{N})$ instead of $O(r^{2})$ --- so $r$ may be $5$--$10\times$ +larger at equal bias, cutting the $1/\beta$ noise by the same factor. The +holomorphic extension is built by hand (complex LayerNorm with non-conjugate +variance, softmax as a ratio of exponentials, the $\tanh$-form GELU which is an +entire function); the AEP correction \eqref{eq:aep} is \emph{real-linear in $v$}, so +it preserves holomorphy and is applied to the real and imaginary parts separately. +No clamps appear inside the holomorphic nudge --- clamps are non-analytic and would +destroy the $O(r^N)$ bias order. This addresses premise~(C). \citep{laborieux2022} +is the source; we add only the combination with the AEP correction and with softmax +attention. + +%============================================================================== +\section{The equilibrium-transformer block (and the CET alternative)} +\label{sec:block} + +\subsection{Our damped, non-conservative block (\texttt{thick})} +\label{sec:thick} +The state is $z\in\R^{B\times T\times C}$, one vector per token position. Inference +is a relaxation to a fixed point under a \emph{single force} $F$, +$z\leftarrow z+\varepsilon F(z)$ for $T_1$ steps ($\varepsilon{=}0.1$, $T_1{\approx}150$), +after which logits $=\zstar W_h$. The force is a pre-LN transformer block written as +a force rather than a layer stack: +\begin{equation} + F(z) = + \underbrace{-(z-\xin)}_{\text{input clamp}} + +\underbrace{\Attn(\LN_1(z))}_{\text{causal MHSA},\ W_Q,W_K,W_V,W_O} + +\underbrace{W_2\mathrm{GELU}(W_1\LN_2(z)+b_1)+b_2}_{\text{untied }4\times\text{ FFN}} + -\underbrace{c\,z}_{\text{damping}}. + \label{eq:thick} +\end{equation} +Here $\xin=\mathrm{tok}[\mathrm{idx}]+\mathrm{pos}$ is the (trained) input +embedding, clamped as a boundary condition through the $-(z-\xin)$ term; this is the +same fixed-point map a Deep Equilibrium model \citep{bai2019} uses. The block is +strongly non-conservative ($Q\!\neq\!K$, untied FFN), and AEP makes EP exact for it. + +\paragraph{Why the $-c\,z$ damping is the key recipe move.} +Raw attention at high gain has \emph{no} fixed point: the residual floors at +$\sim\!3\times10^{-2}$ and the relaxation never settles, so the entire EP family +(corrected or not) cannot even start (there is no $\zstar$ to nudge around). Adding +$-c\,z$ ($c\!\geq\!1$) makes the map contractive enough to \emph{create a stable +fixed point at any attention strength}, while leaving the map non-conservative +(independent $Q/K/V$ are untouched). Critically, the damping's Jacobian $-cI$ is +symmetric, so it \emph{cancels in $A_J$} \eqref{eq:aep}: it buys a fixed point +without polluting the AEP correction, which still sees only attention's +non-reciprocal part. Together, ``damping $+$ AEP'' is the minimal recipe that makes +real attention EP-trainable, taking the attention-parameter cosine from +$\approx 0.25$ (uncorrected) to $0.99$--$1.0$ even at high gain. + +\paragraph{A subtlety for LN-inside blocks.} +Because LayerNorm sits \emph{inside} \eqref{eq:thick} and its Jacobian scales like +$1/\sigma(z)$, large damping shrinks $\|\zstar\|$ and thereby \emph{inflates} the +effective Jacobian (measured: plain-relax residual $8.8\times10^{-3}$ at $c{=}0$ +vs.\ $3.4\times10^{-2}$ at $c{=}2$). So for \texttt{thick} we keep $c$ small ($c{=}1$) +and the actual stabilizer is the Jacobian-norm penalty of \S\ref{sec:stab}, not the +damping. (For a simpler ``thin'' variant whose FFN is an energy-based modern-Hopfield +memory and whose attention is a raw damped force, the damping \emph{is} required.) + +\subsection{The CET / energy route (the conservative alternative)} +\label{sec:cet-energy} +\textbf{CET} here means the \emph{Convergent Energy Transformer} of +\citet{hoier2026} --- an energy-based transformer block, trained with EP, that we +reproduced (on masked image completion) as the prior SOTA for ``EP $+$ attention''. +Its trick is to make attention \emph{conservative} so classic EP applies with +\emph{no} correction: attention is folded into a scalar energy +\begin{equation} + E_{\mathrm{att}}(z) \;=\; + -\frac{1}{\gamma}\sum_{\text{heads},\,i} + \LSE_{j}\!\big(\gamma\, q_i\!\cdot\!k_j\big) + \quad(\text{causal-masked}), + \label{eq:cet} +\end{equation} +whose force \emph{ties the value to the key} ($v\!\equiv\!k$), plus a confinement +$\tfrac12 c\|z\|^2$ (because $E_{\mathrm{att}}$ is unbounded below) and a +modern-Hopfield memory energy $E_{\mathrm{mem}}(z)=-\sum\mathrm{relu}(zW_m)^2$ +playing the role of the FFN (its force is a \emph{tied}-weight squared-ReLU MLP). On +this energy $F=-\grad E$ exactly, so classic EP is valid with symmetric Jacobian and +no AEP. In our reproduction EP matched truncated-BPTT (``EP $\approx$ TBPTE'', +gradient cosine $0.99$). The trade-off is expressivity: the tied value and +reciprocal coupling are the least expressive form of attention. Under \emph{exact} +gradients on the LM, this conservative route (and a monotone-DEQ variant +\citep{winston2020}) costs $\approx 0.15$--$0.2$ CE relative to the non-conservative +\texttt{thick} block --- which is precisely why we pay for the AEP machinery and keep +real attention. + +%============================================================================== +\section{Our recipe: tracking-AEP and the stabilization stack} +\label{sec:recipe} + +\subsection{Tracking-AEP: re-linearize at the moving common mode} +\label{sec:tracking} +The AEP correction \eqref{eq:aep} is frozen at $\zstar$. Near a good solution this +becomes the binding error: as the model sharpens, the true gradient shrinks below +the \emph{bias floor} of the frozen linearization, and the highly non-normal block +Jacobian makes that floor large (we measure $\|\Jnc v-\Jnc^{\!\top} v\|/\|\Jnc v\|=1.37$ +at $\zstar$). The fix is to re-linearize the antisymmetric correction not at the +frozen $\zstar$ but at the \emph{instantaneous common mode} of the two nudged +trajectories, +\begin{equation} + \zbar \;=\; \half\big(z_{+}+z_{-}\big), + \qquad + \mathrm{corr}(z) \;=\; \Jnc(\zbar)\,v - \Jnc(\zbar)^{\!\top} v, + \quad v = z-\zbar, + \label{eq:track} +\end{equation} +evaluated step-by-step as $\zbar$ moves with the nudge (run the $+$ and $-$ phases in +lockstep, recompute $\jvp/\vjp$ about the running $\zbar$). This is exact transposed +differential dynamics with no compounding linearization error, and it is loose-tolerant +(it does not demand an ultra-tight free phase). At a plateau checkpoint where the +frozen estimator had collapsed (gradient cosine vs.\ BPTT $-0.045$, batch-to-batch +self-coherence $-0.27$, magnitude ratio $\sim\!4000\times$), tracking-AEP restores +cosine $0.997$, self-coherence $+0.95$, magnitude ratio $0.9$. Tracking-AEP and the +common-mode formulation \eqref{eq:track} are \emph{ours}. + +\subsection{The validity threshold and the residual as the health signal} +\label{sec:stab} +The governing empirical fact is that the EP estimator has a \emph{validity threshold} +in the free-phase relative residual +\begin{equation} + \mathrm{res} \;=\; \frac{\|z^{+}-\zstar\|}{\|\zstar\|} + \qquad(\text{one extra relaxation step}), +\end{equation} +which is the load-bearing health signal (premise~(B)). Gradient cosine vs.\ the exact +reference degrades sharply with res: $\approx 0.85$ at $\mathrm{res}\!\sim\!5\times10^{-5}$, +batch-dependent $0.2$--$0.9$ at $10^{-3}$, and noise at $10^{-2}$. BPTT has no such +threshold (it differentiates the actual finite unroll, converged or not); \emph{this +asymmetry, and nothing deeper, is the EP-specific difficulty}. Accordingly the free +phase is run adaptively: relax to $T_1{=}150$, then continue in chunks until +$\mathrm{res}\!\le\!10^{-4}$ before nudging. We emphasize there is \emph{no} structural +``EP ceiling'': an early ``EP caps at $\sim\!2.5$'' verdict was traced to two +undertrained/invalid-regime runs and retracted. + +\subsection{The stabilization stack} +Training pushes the dynamics off the contractive manifold (premise~(D)) --- and not +only for EP: even \emph{exact} BPTT on this architecture walks off the manifold on +long horizons (residual $\to 4.7\times10^{-2}$, val CE $\to 3.0$). The stack that +keeps the system valid: +\begin{itemize}[leftmargin=1.4em,itemsep=3pt] + \item \textbf{Frozen / controlled Jacobian-norm penalty (\texttt{jacreg}).} A soft + penalty $\lambda\,\|\Jnc(\zstar)\|_F^2$, estimated matrix-free by Hutchinson + (one $\jvp$ on a random probe, differentiated w.r.t.\ $\theta$). This is + \citet{bai2021}'s DEQ-stabilization penalty, \emph{not} ours. It keeps the + free phase contractive and hence the estimator inside its validity region. + A continuous controller drives it, + $\lambda \leftarrow \mathrm{clip}\big(\lambda\,(\mathrm{res}_{\mathrm{EMA}}/\mathrm{target})^{0.3}\big)$, + on an EMA-smoothed residual (the raw residual is noisy and a multiplicative + controller on it random-walks). A key hard lesson: the controller \emph{floor} + is load-bearing and must never anneal to zero --- two independent + $\lambda\!\to\!0$ runs died identically (val CE $60$--$77$, $\mathrm{res}\!\equiv\!0$), + which post-mortem is an \emph{explosion disguised as convergence by + floating-point absorption} ($\varepsilon F<\mathrm{ulp}(z)$ freezes the + relaxation), not a benign dead state. + \item \textbf{Residual, not spectral radius, as the control signal.} The block + Jacobian is highly non-normal, so transient growth is invisible to + eigenvalues (measured $\rho(J){=}0.94$ ``stable'' while the relaxation + diverged to $\mathrm{res}\,0.21$). The one-step residual \emph{is} the + transient; we control on it. + \item \textbf{Validity gate.} When the residual exceeds a gate, the EP update is + mathematically undefined, so we apply only the homeostat (jacreg) and skip the + nudge --- a fast recovery step. At larger scale this gate is load-bearing + (off-equilibrium EP updates poison the weights). + \item \textbf{Adaptive $T_2$ by hindsight snapshot selection.} On slow-mixing + batches a long nudge phase can diverge through non-normal transient growth, + and step-size early-stopping \emph{fails} (the transient triggers it + spuriously). Instead, run to $T_{2\max}$ in lockstep, snapshot the contrast + $a_t$ every few steps, and return the \emph{most settled} snapshot (smallest + increment of $a_t$); judging by increments of the \emph{quantity of interest} + rather than step sizes makes transient growth harmless. This is ours; it + lifts probe cosine from $0.871$ to $0.932$. +\end{itemize} + +\subsection{Ongoing: the residual-defense term (\texttt{resreg}) --- under validation} +\label{sec:resreg} +At larger width ($C{=}512$) we observe a distinct, \emph{still-open} failure that we +call the below-$2.10$ wall: frozen-jacreg, tracking-AEP EP descends to best +$\approx 2.09$ and then bifurcates within $\sim\!200$ steps (residual +$5\!\times\!10^{-3}\!\to\!0.15$, gradient cosine $0.98\!\to\!0$, CE $\to\!4{+}$), +while \emph{exact} BPTT with the identical recipe sails past to $1.72$. The diagnosed +root cause is an \emph{objective mismatch}: EP optimizes the (refined) fixed point and +never defends the finite-step residual that evaluation actually uses, whereas BPTT +differentiates the finite unroll and so implicitly rewards contraction. The diverged +state is a forward bifurcation to a \emph{limit cycle}, so more relaxation steps cannot +fix it; only a residual \emph{cost} can. The proposed fix is an explicit T1-residual +penalty on the \emph{evaluated} state $z_{150}=\mathrm{relax}(\xin,T_1)$ taken before +any refinement, +\begin{equation} + R_{\mathrm{res}} \;=\; \frac{\|\varepsilon F(z_{150})\|^2}{\|z_{150}\|^2+\varepsilon}, + \qquad + \text{gradient w.r.t.\ }\theta\text{ with }z_{150}\text{ detached}, + \label{eq:resreg} +\end{equation} +scaled task-relative and added to the EP gradient (run with the validity gate off, so +the penalty is not bypassed exactly when the residual is high). \textbf{Status: this is +ongoing.} The residual-defense term \eqref{eq:resreg} held the residual pinned at +$1$--$5\times10^{-4}$ and reached best $2.0573$ (past the wall) through only step +$\sim\!1000$ before a storage cleanup deleted the run; full re-validation toward the +$\approx 1.8$ BPTT ceiling is pending. We present it as a diagnosis $+$ proposed fix, +\emph{not} a finished result. (The objective-mismatch diagnosis, the common-mode +tracking estimator, the residual-driven controller and validity gate, and this +residual-defense term are ours.) + +%============================================================================== +\section{Established results (and what is still open)} +\label{sec:results} + +\paragraph{Solidly validated.} +\begin{itemize}[leftmargin=1.4em,itemsep=3pt] + \item \textbf{EP/AEP component gradients match backprop.} On the character LM, + AEP gives causal-attention parameters cosine $0.99$, the (Hopfield) FFN + $1.00$, and the full LM block $0.99$ vs.\ the true backprop gradient + --- versus feedback alignment at $Q/K/V\approx 0.25$, FFN $\approx -0.01$. + On the CET reproduction, global cosine $0.99$ and EP $\approx$ TBPTE on + masked-image completion. + \item \textbf{EP trains the equilibrium transformer stably, without backprop.} + With the stabilization stack, end-to-end EP runs $10\text{k}+$ steps with + zero non-finite steps. + \item \textbf{It matches/beats a BP transformer at equal parameters.} On + Shakespeare character-LM (single block, $C{=}128$), at a fully controlled + $14$k-step comparison (Table~\ref{tab:results}): EP reaches val CE + \textbf{1.676} (multi-seed $1.680\pm0.005$, $3$ seeds); the like-for-like + standard BP transformer (matched in parameter \emph{shape} to the thick + block) reaches $1.610$; EP \emph{beats} the thinner BP baseline ($1.689$). + The total gap of $0.066$ decomposes into an architecture tax $\approx 0.025$ + (BPTT on the identical block $1.635$) and an EP-rule tax $\approx 0.041\pm0.005$ + --- real, tightly reproducible, and consistent with the measured estimator + misalignment (cosine $0.85$--$0.93$). +\end{itemize} + +\begin{table}[t] + \centering + \small + \begin{tabular}{llc} + \toprule + \textbf{training rule} & \textbf{architecture / recipe} & \textbf{best val CE}\\ + \midrule + BP & standard transformer (like-for-like for \texttt{thick}) & \textbf{1.610}\\ + BPTT $+$ $\lambda$-controller $+$ param-EMA & \texttt{thick} (exact grad, same stabilizer) & 1.635\\ + \textbf{EP} & \texttt{thick}; tracking-AEP $+$ adaptive $T_1/T_2$ & \textbf{1.676}\\ + BP & standard transformer (thin-matched) & 1.689\\ + BPTT (exact grad) & \texttt{thick}, unregularized & 2.021 (destabilizes late)\\ + random & --- & 4.174\\ + \bottomrule + \end{tabular} + \caption{Fully-controlled $14$k-step comparison on Shakespeare char-LM + (random $=\ln 65$). EP matches the architecture-controlled exact-gradient + run to within $0.041$ and beats the thin-matched BP baseline. ``BPTT as + ablation'' separates the training-rule cost (EP$-$BPTT) from the + architecture cost (BPTT$-$BP).} + \label{tab:results} +\end{table} + +\paragraph{Honest framing of the controlled comparison.} +EP beats \emph{bare} BPTT, but the controlled table shows most of that win is EP's +\emph{mandatory} stabilization loop doubling as regularization: bare exact-gradient +training walks off the contractive manifold at $14$k, and the same controller that EP +cannot live without also lifts BPTT to $1.635$. The contraction controller is good for +the equilibrium architecture regardless of training rule; EP merely forced its +discovery. + +\paragraph{Ongoing / under validation.} +The $C{=}512$ work is \emph{not} a finished result. (i) The $2.40$ plateau there is +diagnosed as a late-training EP estimator bias-floor / batch-incoherence, which +tracking-AEP breaks in training ($2.40\!\to\!2.16$, still descending in a $2500$-step +warm-start test). (ii) The below-$2.10$ wall is diagnosed as the objective mismatch of +\S\ref{sec:resreg}; the residual-defense term \eqref{eq:resreg} validated res-tight and +past the wall (best $2.0573$) \emph{only through step $\sim\!1000$} before the run was +lost, and a full re-run toward the $\approx 1.8$ BPTT ceiling is pending. These should +be read as diagnoses with promising partial evidence, not as established numbers. + +%============================================================================== +\section*{Attribution summary} +\addcontentsline{toc}{section}{Attribution summary} + +\begin{description}[leftmargin=2.2em,itemsep=2pt] + \item[Theirs.] Classic energy-based EP and centered nudging + \citep{scellier2017,laborieux2021}; EP $\equiv$ BPTT in the converged, $\beta\!\to\!0$ + limit \citep{ernoult2019}; holomorphic EP \citep{laborieux2022}; the asymmetric/AEP + correction $J\!\to\!J^{\!\top}$ \emph{and} the force-form VF readout + \citep{scurria2026}; the Jacobian-norm penalty \citep{bai2021}; DEQ + \citep{bai2019} and monotone DEQ \citep{winston2020}; the Convergent Energy + Transformer / CET \citep{hoier2026}. + \item[Ours.] The transformer application of the force route and the damping recipe + (damping $+$ AEP making real attention EP-trainable at any gain); the matrix-free + $\jvp/\vjp$ form of the correction at transformer scale and its combination with + holomorphic estimation and softmax attention; \emph{tracking-AEP} (common-mode + re-linearization, Eq.~\ref{eq:track}); the residual-driven controller, the validity + gate, and adaptive-$T_2$ snapshot selection; and the (ongoing) residual-defense term + \texttt{resreg} (Eq.~\ref{eq:resreg}) with its objective-mismatch diagnosis. +\end{description} + +%============================================================================== +\begin{thebibliography}{9} +\bibitem[Bai et al., 2019]{bai2019} + S.~Bai, J.~Z.~Kolter, V.~Koltun. + \emph{Deep Equilibrium Models}. NeurIPS 2019. + +\bibitem[Bai et al., 2021]{bai2021} + S.~Bai, V.~Koltun, J.~Z.~Kolter. + \emph{Stabilizing Equilibrium Models by Jacobian Regularization}. ICML 2021. + +\bibitem[Ernoult et al., 2019]{ernoult2019} + M.~Ernoult, J.~Grollier, D.~Querlioz, Y.~Bengio, B.~Scellier. + \emph{Updates of Equilibrium Prop Match Gradients of Backprop Through Time in an + RNN with Static Input}. NeurIPS 2019. + +\bibitem[H{\o}ier et al., 2026]{hoier2026} + R.~H{\o}ier, K.~Kerjan, B.~Scellier. + \emph{Training a Convergent Energy Transformer with Equilibrium Propagation} (CET). + ICLR 2026 Associative Memory workshop; OpenReview \texttt{Qrfml76eWJ}. + +\bibitem[Laborieux et al., 2021]{laborieux2021} + A.~Laborieux, M.~Ernoult, B.~Scellier, Y.~Bengio, J.~Grollier, D.~Querlioz. + \emph{Scaling Equilibrium Propagation to Deep ConvNets by Drastically Reducing its + Gradient Estimator Bias} (centered/symmetric nudging). Frontiers in Neuroscience, 2021. + +\bibitem[Laborieux \& Zenke, 2022]{laborieux2022} + A.~Laborieux, F.~Zenke. + \emph{Holomorphic Equilibrium Propagation Computes Exact Gradients Through Finite Size + Oscillations}. NeurIPS 2022. + +\bibitem[Scellier \& Bengio, 2017]{scellier2017} + B.~Scellier, Y.~Bengio. + \emph{Equilibrium Propagation: Bridging the Gap between Energy-Based Models and + Backpropagation}. Frontiers in Computational Neuroscience, 2017. + +\bibitem[Scurria et al., 2026]{scurria2026} + A.~Scurria, P.~Vanden Abeele, B.~Mognetti, S.~Massar. + \emph{Equilibrium Propagation for Non-Conservative Systems} (AsymEP). + arXiv:2602.03670, 2026. + +\bibitem[Winston \& Kolter, 2020]{winston2020} + E.~Winston, J.~Z.~Kolter. + \emph{Monotone Operator Equilibrium Networks} (monotone DEQ). NeurIPS 2020. +\end{thebibliography} + +\end{document} diff --git a/assets/misc/fw72m_api_proof.png b/assets/misc/fw72m_api_proof.png new file mode 100644 index 0000000..e3f594b Binary files /dev/null and b/assets/misc/fw72m_api_proof.png differ diff --git a/ep_run/build_alexi_deck.py b/ep_run/build_alexi_deck.py index 461b8fb..d206e8d 100644 --- a/ep_run/build_alexi_deck.py +++ b/ep_run/build_alexi_deck.py @@ -8,7 +8,7 @@ from pptx.enum.text import PP_ALIGN INK = RGBColor(0x3a, 0x3a, 0x3a); GRAY = RGBColor(0x8a, 0x8a, 0x8a) BLUE = RGBColor(0x2c, 0x6f, 0xbb); ORAN = RGBColor(0xd9, 0x5f, 0x02) RED = RGBColor(0xb0, 0x3a, 0x2e); GREEN = RGBColor(0x2e, 0x7d, 0x32) -A = '/home/yurenh2/ept/assets/' +A = '/home/yurenh2/ept/assets/figs/' prs = Presentation() prs.slide_width = Inches(13.333); prs.slide_height = Inches(7.5) @@ -155,5 +155,5 @@ tf = tbox(s, 0.55, 5.9, 12.4, 1.3) para(tf, 'Prices (sourced, July 2026): market H100 $1.87–2.99/GPU·h; AWS p5e $4.97/GPU·h. All estimates include bf16 (1.56×) and EP ≈ 3.2× BP wall-clock; tail-only centered adds ~1.13×.', 12, GRAY, first=True, bullet=False) para(tf, 'Alternative one-shot: 3B-Chinchilla ≈ $40k fits the envelope alone — but the ladder buys three publishable points and de-risks the flagship.', 12, GRAY, bullet=False) -prs.save(A + 'alexi_primer_deck.pptx') -print('deck saved:', A + 'alexi_primer_deck.pptx') +prs.save('/home/yurenh2/ept/assets/decks/alexi_primer_deck.pptx') +print('deck saved: /home/yurenh2/ept/assets/decks/alexi_primer_deck.pptx') diff --git a/ep_run/fig_primer_arch.py b/ep_run/fig_primer_arch.py index 1090f45..3b3d7f4 100644 --- a/ep_run/fig_primer_arch.py +++ b/ep_run/fig_primer_arch.py @@ -129,7 +129,7 @@ txt(4.5, 7.5, '· EP (here): TWO phases and an infinitesimal nudge; the update i txt(4.5, 5.2, ' settle stays fully self-consistent — which is what physical hardware actually does.', 8.2, ha='left') txt(4.5, 3.0, '· The free phase is the zero-reference of the measurement: on analog hardware the subtraction cancels state-independent device offsets.', 8.2, ha='left') -fig.savefig('/home/yurenh2/ept/assets/fig_primer_arch.pdf') -fig.savefig('/home/yurenh2/ept/assets/fig_primer_arch.png', dpi=190) -fig.savefig('/home/yurenh2/ept/assets/fig_primer_arch.svg') +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_arch.pdf') +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_arch.png', dpi=190) +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_arch.svg') print('saved fig_primer_arch.{pdf,png,svg}') diff --git a/ep_run/fig_primer_block.py b/ep_run/fig_primer_block.py index ba3b5d0..74437e1 100644 --- a/ep_run/fig_primer_block.py +++ b/ep_run/fig_primer_block.py @@ -142,7 +142,7 @@ txt(5, 14.6, 'No biases anywhere in the network. The $1/\\sqrt{h_d}$ scale is f txt(5, 11.9, r'$h_{ff} = 1408 \approx 8C/3$, rounded up to a multiple of 64. QK-norm acts on the full width $C$, before the head split.', 8.2, ha='left') txt(5, 9.2, r'The boxed pipeline, input $z$ to output $z^{\prime\prime}$, is exactly $f_l$ on the companion page; the state $z_l$ lives on the residual rail.', 8.2, ha='left') -fig.savefig('/home/yurenh2/ept/assets/fig_primer_block.pdf') -fig.savefig('/home/yurenh2/ept/assets/fig_primer_block.png', dpi=185) -fig.savefig('/home/yurenh2/ept/assets/fig_primer_block.svg') +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_block.pdf') +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_block.png', dpi=185) +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_block.svg') print('saved fig_primer_block.{pdf,png,svg}') diff --git a/ep_run/fig_primer_pack2.py b/ep_run/fig_primer_pack2.py index ff28476..d23f9ca 100644 --- a/ep_run/fig_primer_pack2.py +++ b/ep_run/fig_primer_pack2.py @@ -14,7 +14,7 @@ ORAN, ORANF = '#d95f02', '#fdeee2' RED = '#b03a2e' CREAM, CREME = '#faf6ee', '#c9b895' GREEN = '#2e7d32' -A = '/home/yurenh2/ept/assets/' +A = '/home/yurenh2/ept/assets/figs/' def newfig(w, h, xmax=100, ymax=62): fig = plt.figure(figsize=(w, h)) diff --git a/ep_run/fig_primer_phases.py b/ep_run/fig_primer_phases.py index b04ed5f..91c873a 100644 --- a/ep_run/fig_primer_phases.py +++ b/ep_run/fig_primer_phases.py @@ -93,7 +93,7 @@ txt(50, 23.4, r'per layer: $\Delta\theta_l\ \propto\ \langle\ d_l\ ,\ \partial txt(50, 20.4, r'Each layer updates from its own boundary mismatch — no global backward graph, no global tape, no loss' r' derivatives except the top nudge.', 8.6) -fig.savefig('/home/yurenh2/ept/assets/fig_primer_phases.pdf') -fig.savefig('/home/yurenh2/ept/assets/fig_primer_phases.png', dpi=185) -fig.savefig('/home/yurenh2/ept/assets/fig_primer_phases.svg') +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_phases.pdf') +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_phases.png', dpi=185) +fig.savefig('/home/yurenh2/ept/assets/figs/fig_primer_phases.svg') print('saved fig_primer_phases.{pdf,png,svg}') -- cgit v1.2.3