Manuscript Offprint
arXiv:2610.36139SpatialPC: Deep Computation with Sublinear Local Credit Propagation
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Local learning rules are parallel only up to the speed at which information about the loss can travel. On a chain of states, any rule with bounded communication range needs rounds before the loss can influence the earliest parameters, and this latency is usually attributed to depth. We show that it is a property of the communication geometry rather than of depth. For states placed at constant density in dimensions, a light-cone argument gives an lower bound on the number of bounded-range rounds that any local algorithm needs before its gradient estimates can be sign-correct at every parameter. We construct a unit-range, degree-2d directed acyclic graph that contains a Hamiltonian computation of length and in which every state lies within directed distance of the output, matching the lower bound. In the realizable-circuit model, depth and credit depth are therefore independent parameters: represented depth and causal credit latency coexist, with a separation of order . SpatialPC realizes this separation within predictive coding. Credit is propagated by adjoint prediction dynamics (APD), a local update whose -round state on a settled acyclic graph is the truncated reverse-path sum , with error exactly . Graph geometry fixes when credit can first arrive at a state; the Jacobian-weighted path tail fixes how many further rounds accurate credit requires. A sparse two-dimensional Moore compiler retains the backbone with unit-range edges and has measured worst-node reachability up to , where a 65,535-edge backbone is reached in 258 local hops. With rounds, SpatialPC keeps finite-round task gradients aligned with settled gradients (cosine 0.93 on MNIST and 0.97 on Fashion-MNIST at ) and reaches 97.6% and 88.1% test accuracy after 20 epochs.
1 Introduction
Backpropagation assigns credit with a global reverse pass [1]: the error at the output is carried back through every layer in sequence, using the transposed forward weights and a separate backward phase. On a general-purpose processor this is efficient. On a system whose computation is distributed over physically local units, whether cortical circuits [2] or neuromorphic and in-memory hardware, it is not. Such a system is an embodied learner in the sense of embodied cognition [3, 4]: its computation occupies physical space, so the time for any signal, including a learning signal, to cross it is set by the geometry of the substrate rather than by an operation count, and a learning rule for such a
Equal contribution.
Preprint.
system must respect that constraint. This has motivated local learning rules whose updates depend only on quantities available at a unit and its neighbors. Predictive coding (PC) [5, 6], equilibrium propagation [7], forward-forward [8], local representation alignment or target propagation [9, 10], and random-feedback rules [2] are the main families. PC is the most developed among them: its dynamics are defined on arbitrary computation graphs [11, 12], they recover the backpropagation gradient at equilibrium [13], and they have been trained at the scale of 1000-layer residual networks [14], convolutional networks on CIFAR and TinyImageNet [15], and a VGG network on ImageNet [16].
The obstacle that recurs in this work is depth. On an L-layer chain the loss is generated at the last layer and the first layer is L - 1 local interactions away. In a synchronous model, at least L - 1 communication rounds pass before the earliest parameters can receive any information about the loss; in continuous-time inference the same distance appears as slow, attenuated, or unstable error propagation [17–19]. The remedies proposed so far act on the dynamics: depth-aware parameterization [18, 20], corrected error balance and timing [19], direct error pathways to selected layers [21], primal–dual updates [14], incremental schedules [22], and error-based formulations without signal decay [17]. All of them take the chain as given, and so all of them inherit its communication distance.
The chain conflates two quantities. The represented depth of a computation graph is the length of its longest directed path, the number of sequential operations it can express. The reachability depth is the largest number of edges separating any state from the output, the number of bounded-range rounds before every state can have heard from the loss. On a chain both equal . The communication graph of a physical substrate, however, is not a chain: a two-dimensional fabric of units with bounded range and bounded degree has diameter of order , and a three-dimensional one of order . Whether a long computation can be laid out on such a fabric so that its reachability depth matches the diameter while its represented depth stays linear has not been asked, and no bound has been established on the latency that locality itself permits.
This paper answers both questions. We fix a locality model in which units sit at constant density in dimensions, communicate within bounded range, and receive the target only at the output. A light-cone argument shows that no existing local learning algorithm, irrespective of how it computes, can deliver sign-correct gradient estimates to every parameter in fewer than rounds after the target is revealed (Theorem 4.9). A snake-ordered orientation (Boustrophedon) of the unit grid contains a Hamiltonian computation of length , uses only unit-length edges of degree at most , and places every state within directed distance of the output (Theorem 4.6). Together,
so the ratio is unbounded, and the exponent 1/d is the best that any local algorithm can achieve. In the language of realizable circuit complexity [23], circuits embedded in d-dimensional space under causality and bounded fan-in, depth and credit depth (reachability depth) are independent parameters (Theorem 4.11).
Reachability says when credit can arrive, not whether it is accurate. SpatialPC, the predictive-coding model that realizes the separation, compiles a computation onto a bounded-degree spatial fabric and propagates credit with adjoint prediction dynamics (APD), a local update in which each state predicts its own adjoint from the adjoints of its children and cancels the prediction error. On a settled graph the K-round APD state is the sum of all reverse paths of length less than K, and its error is exactly the settled adjoint pushed back through K more edges, . The first term to reach a state is fixed by graph distance; the rounds needed after that are fixed by the decay of the Jacobian powers, which depends on the learned weights and the task. We call the latter the effective credit radius ; in the experiments, the feasibility weight and the round budget act on while stays fixed.
The implementation uses a sparse two-dimensional compiler built on a Moore traversal [24]. It keeps the backbone with unit-range edges and has measured worst-node output distance for every power of two from to . With synchronous rounds on MNIST and Fashion-MNIST, finite-round task gradients at have cosine 0.93 and 0.97 with the settled gradients of the same network, and twenty epochs of training reach 97.64% and 88.10% test accuracy, matching a depth-128 backpropagation reference.
(a) Chain

(b) Spatial compilation

(c) Finite-time APD

reachability: graph geometry
fidelity: weighted path tail
Figure 1: Represented depth and local credit latency are different resources. (a) On a chain, represented depth and loss reachability are both . (b) The snake-ordered grid of Theorem 4.6 ( ) keeps an Hamiltonian computation (dark arrows) while every state lies within unit-range hops of the output; the blue route is a shortest credit path. (c) APD accumulates reverse paths by length . Geometry fixes the first round at which a state can receive credit; the Jacobian-weighted tail fixes how many further rounds accurate credit requires.
-
An exact, edge-local gradient for the finite-round SpatialPC objective (Theorem 5.2), together with a path-length decomposition of settled credit whose K-round error is (Theorem 6.1); this separates reachability from fidelity, controls the angle of each local update (Theorem 6.4), and has a forward counterpart in which the feasibility residual certifies the distance to the settled state (Theorem 6.5).
-
A sparse compiler with a proved edge count of for any Hamiltonian cycle of the grid (Theorem 4.12) and measured reachability up to .
-
Experiments showing that settled-gradient alignment is maintained under as the backbone grows from 15 to 255 edges, that the feasibility weight raises gradient cosine from 0.35 to 0.93 at constant accuracy, and that fidelity keeps improving for round budgets well beyond .
Section 2 places the work among local learning rules, realizable circuit complexity, parallel differentiation, and spatial layout. Section 3 provides notation: predictive coding as a constrained problem, the adjoint equation and APD, and the two depths. Section 4 defines realizable circuits, proves the separation and its optimality, and describes the Moore compiler. Section 5 specifies the finite-round forward dynamics of SpatialPC and its exact local gradient, and Section 6 analyzes the accuracy of finite-round credit. Section 7 reports structural measurements to N = 65,536 and task experiments to N = 256. Section 8 discusses the scope of the bounds, their reading in circuit-complexity terms, physical implementation, and the open problems they raise, and Section 9 concludes. Proofs omitted from the main text, the numerical verification of the implementation, secondary experiments, and pseudocode are in the appendix.
2 Related Work
Local learning rules. Rules that avoid the global reverse pass differ in what they transmit but share the constraint that each update uses information available at a unit and its neighbors [25]. Equilibrium propagation obtains gradients from the response of an energy-based network to a nudged output [7]; forward-forward trains each layer on a local goodness objective with no backward signal [8]; random-feedback rules replace transposed weights by fixed random matrices but still propagate layer by layer [2]. In all of these the output signal crosses the layers one at a time, so the number of local rounds before the first layer can be influenced grows with depth. Synthetic gradients [26] remove the dependence by predicting the gradient locally, at the cost of a learned approximation and of locality itself. The locality model of Section 4.1 covers all of these rules, and Theorem 4.9 applies to each of them.
Predictive coding on graphs and at scale. Predictive-coding dynamics were defined on chains and extended to arbitrary graph topologies [11, 12], including bidirectional and recurrent architectures for vision [27]; at equilibrium they reproduce reverse-mode differentiation on the computation graph [13]. Work on scaling has acted on the dynamics: incremental schedules [22], depth-aware parameterization [18, 20], corrected error balance and timing [19], direct output-error pathways [21], augmented-Lagrangian primal–dual updates [14], error-based formulations [17], stabilized convolutional models [15], and equilibrium-propagation training on ImageNet [16]. These methods change how credit moves over a given graph. The present work changes the graph, and uses the same local stationarity condition as augmented-Lagrangian PC (Appendix D), so it can be combined with any of them.
Realizable circuit complexity. Prada and Mali [23] define the classes of circuits realizable in -dimensional space under causality, bounded information flux, finite gate volume with constant fan-in, and local uniformity: a circuit that runs for time lies within a causal ball of radius , so its size is and its width . The classes form a strict hierarchy in with , and the volume constraint alone forces time for an -gate circuit. The classical antecedents are the bounded-wire-length models of VLSI complexity theory [28] and Vitányi's result that low-diameter networks cannot be realized with short wires [29]. Theorem 4.2 is the single-circuit form of this model, keeping the causality and gate-quantization constraints and singling out depth and credit depth as the parameters of interest, and the geometric budget of Section 7 is the regime in which an -gate planar circuit saturates the volume bound. The proof of Theorem 4.9 combines the causal-ball argument with an indistinguishability argument of the kind used in the LOCAL model of distributed computing [30, 31]; what is specific to learning is the quantity bounded, the sign of a gradient estimate, and the matching upper bound, which shows that the causal radius can be attained by a circuit that still contains a Hamiltonian computation.
Parallel differentiation and implicit models. Reverse-mode differentiation can be organized as triangular solves, parallel scans, or parallel recurrences [32–34], which reduce span when long-range reductions or operator composition are available; a bounded-range substrate provides neither. Deep equilibrium models define their states as fixed points and differentiate through the fixed point implicitly [35]; SpatialPC also targets a fixed point of local dynamics but differentiates through a finite unrolling and penalizes the terminal residual (Section 5.4).
Space-filling curves. The Hilbert curve and Moore’s closed variant of it [24] are used for locality-preserving traversals in spatial indexing [36]; the Moore curve is generated here by an L-system [37]. The orders of Sections 4.2 and 4.4 serve a different purpose: not to keep consecutive items close, which any Hamiltonian path of the grid does, but to make the oriented unit-grid shortcuts give every point a short directed route to the output.
3 Preliminaries
We write predictive coding as a constrained problem, derive the adjoint equation that APD solves, and define the two depths that the rest of the paper separates.
3.1 Predictive coding as constrained optimization
Let be a directed acyclic computation graph with a state at each node , and write and for the parents and children of . Every non-input state is predicted from its parents, and the prediction error is the local residual
Stacking the node-wise predictions into a map that also injects the input x at the input node gives the global residual
A feedforward evaluation of the graph is a state with , so supervised learning on G is the constrained problem
where is the set of output nodes and is the task loss. Predictive coding relaxes the constraints to a quadratic penalty,
and alternates local state inference with local parameter updates [11, 12].
3.2 Adjoint prediction dynamics
Attach a multiplier to each local constraint in Eq. (4) and form the Lagrangian
Let be the state Jacobian and the loss forcing, which is supported on . Stationarity of in is the adjoint equation
which at node v involves only its children:
Adjoint prediction dynamics (APD) treats the right-hand side as a local prediction of the adjoint and cancels the prediction error,
Applied synchronously to all nodes, Eq. (9) is the Jacobi iteration for Eq. (7). The parameter gradient is assembled from the same local quantities,
so that for a linear edge the block is the outer product of the postsynaptic adjoint and the presynaptic activity , scaled by the edge gain. Eq. (7) is also the state-stationarity condition of augmented-Lagrangian predictive coding [14], with equal to minus the augmented multiplier (Appendix D).
3.3 Represented depth and reachability depth
For a DAG G let be the number of edges of a directed path p. The represented depth is the length of the longest directed computation, and for an output set O the reachability depth is the largest shortest-path distance from a node to the output:
is a communication quantity: a message that originates at O and moves one edge per round cannot have reached every node before rounds have elapsed. A chain on N nodes has . The next section shows that on a d-dimensional substrate the two can differ by a factor of order , and that no local algorithm can do better.
4 Spatial Compilation: Linear Depth with Sublinear Reachability
On a chain the two depths of Section 3.3 coincide. We now place the computation on a -dimensional substrate and show that they need not. Section 4.1 defines realizable circuits and the locality model; Section 4.2 constructs a realizable circuit with and ; Section 4.3 proves that credit depth is unavoidable for realizable circuits and that rounds are necessary for every local algorithm; and Section 4.4 describes the sparser compiler used in the experiments.
4.1 Realizable circuits and the compilation problem
Definition 4.1 (Substrate). A substrate is a finite set of sites together with an embedding ; distances are . The substrate has density at most if every -ball of radius contains at most sites. The unit grid with one site per lattice point has density at most .
Definition 4.2 (Realizable circuit). A realizable circuit of range and degree on a substrate is a DAG on the sites with for every edge and for every vertex. Its depth is and, for an output set reachable from every vertex, its credit depth is the reachability depth of Section 3.3. A family is realizable in dimension if its substrates have density at most a common constant and , , and are bounded in .
This is the single-circuit form of the realizable circuit model of Prada and Mali [23], restricted to its causality and gate-quantization constraints (bounded wire length, bounded degree, constant density), with the depth of the circuit and the reverse eccentricity of its outputs singled out as the two parameters of interest; the bounded-wire-length models of VLSI theory [28, 29] are its classical antecedents. The compilation problem fixes the depth and asks for the credit depth.
Definition 4.3 (Admissible graphs). Let be a directed computational backbone with topological order , and let be a communication range and a degree bound. The admissible graphs are the realizable circuits that contain the backbone and respect its order,
(12)
Every admissible graph has depth , the largest possible on vertices. The spatial compilation problem is to choose the embedding and the shortcut edges so as to minimize the credit depth,
subject to a prescribed output set O. The objective is the number of bounded-range rounds after which every state can have received information generated at the output.
Definition 4.4 (Local learning algorithm). A learning algorithm on a substrate is -local if it proceeds in synchronous rounds in which the memory of each site is updated as a function of the memories of the sites within distance of it, itself included. The input x and the parameters reside at their sites throughout, and the target y is written into the memories of the output sites O at round 0 and nowhere else.
Forward computation, credit propagation, and any auxiliary signaling are charged to the same rounds, and nothing is assumed about what the sites compute; the only restriction is on where their inputs come from. Both the compiler below and APD in Section 5 are -local with .
4.2 Upper bound: the snake-ordered grid
For and let be the reflected snake order on : for , ; for , writing a point as with its first coordinate,
The order visits the slabs in turn, traversing the -dimensional snake forward in even slabs and backward in odd ones. Consecutive points are unit neighbors. Let and be the first and last points of the order; both are corners of the grid.
Lemma 4.5 (Monotone edges). In the order , every has a unit neighbor with and , and every has a unit neighbor with and .
The two statements must be carried together through the induction on , because an odd slab is traversed backward and its last point is the first point of the lower-dimensional snake; the proof is in Appendix A.
Theorem 4.6 (Snake-ordered grid compiler). Let , , , and let be the DAG on obtained by orienting every unit-grid adjacency from its earlier to its later endpoint in , with input and output . Then:
(i)
(ii) for every v, the directed distance from v to equals , and the directed distance from to v equals ; consequently
and the forward eccentricity of is the same number;
(iii) , every edge has unit length, and every vertex has degree at most 2d.
Proof. (i) Consecutive points of are unit neighbors, so the order is a Hamiltonian path of length in ; no directed path in a DAG on vertices is longer.
(ii) Every edge changes the distance to by exactly one, so any directed path from to has at least edges. By Theorem 4.5, from every there is an out-edge of whose head is one unit closer to ; following such edges reaches in exactly steps. The maximum of over the grid is attained at the corner opposite and equals . The forward statement follows from the second half of Theorem 4.5 by the same argument with the roles of and exchanged.
(iii) The grid has unit adjacencies along each of the axes, each vertex has at most unit neighbors, and every edge joins unit neighbors.
The construction therefore separates the two depths by
Part (ii) also gives the forward computation a sublinear first-arrival time: input information reaches every state within rounds, although the longest input-to-state path has length up to . The next subsection shows that the exponent in Eq. (16) cannot be improved.
4.3 Lower bound: a light cone for loss information
Lemma 4.7 (Light cone). After K rounds of a -local algorithm, the memory of site v is a function of the round-0 memories of the sites within distance of v. In particular, if , the memory of v after K rounds does not depend on the target y.
Proof. Induction on . The claim is trivial for . If it holds for , the round- memory of is a function of the round- memories of sites with , each of which is a function of round-0 memories within distance of , hence within distance of . The second statement follows because enters only the round-0 memories of .
The geometric half of the lower bound is a statement about realizable circuits alone.
Lemma 4.8 (Credit depth of realizable circuits). Let be a realizable circuit of range on a substrate of density at most with outputs, and let . Then
and the same bound holds for the forward eccentricity of any set of input vertices.
Proof. Fix any with . The sites within distance of number at most , so some vertex has . Every edge of has length at most , so every directed path from to has more than edges. Taking gives Eq. (17); the forward statement is identical with the roles of sources and targets exchanged.
Theorem 4.8 bounds the credit depth of the graph. The theorem below bounds the rounds used by any algorithm on the substrate, whether or not it follows the edges of a fixed graph.
Theorem 4.9 (Light-cone lower bound for local credit assignment). Let a substrate have density at most and output sites, and let be a -local learning algorithm. Suppose that for a site there are two instances and with gradients and , respectively, at the parameter block held at . If after rounds holds at an estimate with on both instances, then
Moreover, if then some site satisfies . Hence an algorithm that guarantees sign-correct estimates at every loss-sensitive site needs
rounds after the target is revealed, for fixed d, , , and .
Proof. If , Theorem 4.7 gives identical memories at on the two instances, hence the same estimate ; a single vector cannot have positive inner product with both and . This proves Eq. (18). The second claim is the density argument in the proof of Theorem 4.8, and Eq. (19) follows from Eq. (18).
Remark 4.10 (Sign-flipped twins exist). The hypothesis of Theorem 4.9 is satisfied at every loss-sensitive site for squared loss. With and a function of the settled state, the forcing is linear in , and by Eqs. (7) and (10) every parameter gradient is linear in once is fixed. Replacing by negates and therefore negates every gradient. The same holds for any loss whose output gradient can be negated by a change of target.
Corollary 4.11 (Depth and credit depth of realizable circuits). For every family of circuits realizable in dimension d, the credit depth is , and no -local learning algorithm on the family's substrates delivers sign-correct credit to every loss-sensitive parameter in rounds. The family of Theorem 4.6 is realizable in dimension d with range 1, degree 2d, depth N - 1, and credit depth . Depth and credit depth are therefore independent parameters of realizable circuits: for every N there is a realizable circuit of maximal depth N - 1 whose credit depth is , and no realizable circuit of any depth has credit depth .
Both bounds concern causal availability only: a state that has become reachable may still hold inaccurate credit. Section 6 quantifies the additional rounds in terms of the Jacobian-weighted path tail.
4.4 The sparse Moore compiler
The full grid of Theorem 4.6 uses every unit adjacency. The experiments use a sparser two-dimensional compiler that keeps the exponent with fewer edges. Let and . A closed Moore curve [24], generated here by an L-system [37], visits every point of the grid exactly once and returns to its start, so it is a Hamiltonian cycle of the unit grid. Cutting at one edge induces a topological order and the backbone . The cut edge is retained and oriented from input to output, and every unit-grid edge that separates two cells enclosed by is added and oriented from lower to higher index (Alg. 1). Figure 2 shows the and cases.
Proposition 4.12 (Edge count of cycle-based compilers). Let m be even and let C be any Hamiltonian cycle of the unit grid. The graph consisting of the N - 1 backbone edges, the cut edge, and the unit-grid edges separating two cells enclosed by C has exactly
edges, maximum undirected degree four, and unit-length edges only.

(a) grid ( )

(b) grid ( )
Figure 2: Sparse Moore compiler for two grids. Solid arrows form the Hamiltonian backbone; dashed arrows are the cut edge and the enclosed-cell shortcuts. Every edge is unit length and respects the common topological order. The state(s) farthest from the output is state 1 at distance 6 for the case and states 3, 5, 9 at distance 10 for the case. Both cases satisfy .
Proof. C is a simple closed lattice polygon with all N lattice points of the grid on its boundary and none in its interior. By Pick's theorem its area is , so it encloses unit cells. Each of the N edges of C is a side of exactly one enclosed cell, and every other side of an enclosed cell is shared with another enclosed cell, since a side separating an enclosed cell from a non-enclosed cell or from the exterior of the grid would lie on the boundary of the enclosed region, which is C. Counting sides of enclosed cells, with s the number of shared sides, so , and . Degree and length are inherited from the grid.
The shortcut edges are the sides of a tree in the dual graph of the enclosed cells, which is why the compiler is sparse: it uses about three quarters of the unit adjacencies of the grid.
For the implemented sizes , the reverse eccentricity of the output, computed exactly by breadth-first search, is
Eq. (21) is not proved for all ; the formal guarantee is Theorem 4.6, which the Moore compiler matches in exponent with a smaller constant and fewer edges. The graphs of this section fix where credit can travel; the next section specifies the dynamics that run on them.
5 SpatialPC: Local Dynamics on the Compiled Graph
A compiled graph bounds how far information can travel per round; it does not say how the states are computed or how the gradient is obtained. SpatialPC runs synchronous local dynamics on the graph for a fixed number of rounds T, trains the resulting finite-round predictor, and obtains the exact gradient of that objective by APD on the unrolled computation, using the same edges in reverse. The separation of Section 4 is what allows T to be of order rather than N.
5.1 Synchronous forward dynamics
For a directed edge the message sent from u to v is
(22) with degree-normalized skip gain and residual gain
where is a fixed constant, is the grid side, and is the state width. Each state aggregates the messages of its parents, and the input is injected at the root ,
Writing one simultaneous update of all states as ,
and the settled state is the unique solution of
which a single sweep in topological order computes exactly. The prediction is (Alg. 2).
Proposition 5.1 (Synchronous forward sweep). Let be the length of the longest directed path from to . For every :
(i) depends on x only through directed paths from to v of length at most T - 1;
(ii) whenever ; in particular for all .
Proof. (i) depends on only at , and each application of moves dependence across one edge. (ii) Induction on : , and if for all with , then for every with all parents satisfy , so . Since every state lies on the backbone, .
Theorem 5.1 is the forward counterpart of Theorem 4.7: the synchronous iteration is a Jacobi sweep of the triangular system Eq. (26), exact only after rounds and truncated at path length before that. With the finite-round state is not the settled state. Rather than wait for it to settle, SpatialPC trains the parameters so that the -round state is nearly a fixed point.
5.2 Finite-round objective
The finite-round predictor is trained with the terminal feasibility residual
and the objective
The residual term is the predictive-coding energy Eq. (5) evaluated at the finite-round state; it is zero exactly when is a fixed point of , that is, when the T-round computation is already settled. The gradient of is obtained next, by the same local mechanism that Section 3.2 introduced for the settled problem.
5.3 Exact gradients by APD on the space-time graph
Unrolling Eq. (25) gives the time-indexed constraints
whose constraint graph is copies of the spatial graph stacked in time. Let . APD on this space–time graph has the terminal adjoint
and the reverse recursion
Each product decomposes into child-to-parent messages along the edges used in the forward pass (Alg. 3).
Proposition 5.2 (Exactness and locality of finite-round APD). The recursion Eqs. (30) and (31) yields the exact gradient of Eq. (28),
and every operation in it is local to an edge of the spatial graph: a forward message, a reverse message, or an outer product of a postsynaptic adjoint with a presynaptic activity.
Proof. Apply the Lagrangian Eq. (6) to the constraints Eq. (29). Stationarity in gives Eq. (30), stationarity in for gives Eq. (31), and differentiating in gives Eq. (32); Appendix B carries out the computation. Locality holds because is a sum of edge messages, so and are sums of edge-local blocks.
Theorem 5.2 is the adjoint method applied to the unrolled computation; the adjoint pass needs no communication beyond the edges already present. With one parameter update uses forward message phases, one residual evaluation, one pullback for , and reverse phases, for local message phases in a strictly serial accounting. The implementation is verified against automatic differentiation to double precision in Appendix E.
5.4 Relation to predictive coding
SpatialPC is predictive coding in the constrained sense of Eq. (4). The objective contains the PC energy evaluated at the finite-round state, every operation is local to an edge, each weight update has the form of a postsynaptic credit signal times a presynaptic activity, and the settled adjoint equation Eq. (7) is the state-stationarity condition of augmented-Lagrangian PC, with a equal to minus the augmented multiplier (Appendix D).
It is not a relaxation-based PC network. There is no inference phase: states are produced by T synchronous rounds from with nothing clamped, the target never acts on the states, and credit is carried by a separate adjoint variable rather than by prediction errors relaxing under a clamped output. The reverse recursion Eq. (31) is reverse-mode differentiation of the unrolled computation, so APD computes the gradient of Eq. (28) exactly rather than approximating it at an inference equilibrium, and the feasibility term uses the PC energy as a penalty that pulls the finite-round state toward a fixed point of , not as the dynamics. What SpatialPC changes is the graph on which exact local credit is propagated, not the local rule. The separation of Section 4 and the analysis of Section 6 apply equally to relaxation-based PC dynamics run on the same compiled graph, since the light-cone bound constrains every local algorithm and the settled adjoint is the fixed point those dynamics approach.
The gradient of Theorem 5.2 is exact for the finite-round objective. How close the finite-round credit is to the credit of the fully settled computation is a separate question, and it is the subject of the next section.
6 Credit Fidelity Beyond Reachability
Section 4 determines when loss information can reach a state; Section 5 gives an exact gradient for a fixed round budget. What remains is the relation between the two: how many rounds the finite-round credit needs before it agrees with the credit of the fully settled computation. The accuracy of arriving credit depends on every reverse path, not only on the shortest one. On a settled graph APD makes this dependence explicit, and the identities below separate a geometric quantity, reachability, from a dynamical one, the decay of Jacobian powers.
6.1 Finite reverse-path expansion
Fix a settled state and set
The settled adjoint solves , and synchronous APD from is
In a topological order is strictly block lower triangular, and requires a directed path of length from to . Hence with .
Proposition 6.1 (Reverse-path expansion and tail identity). For every ,
and the truncation error is
In particular for all .
Proof. The first identity follows from Eq. (34) by induction. Since is nilpotent, is invertible with inverse , which gives the second. Subtracting, , using for .
The kth term sums the Jacobian products along all reverse paths of length exactly k from the output, so APD accumulates credit shell by shell, and what it has not yet delivered after K rounds is the settled adjoint pushed back through K further edges. Two consequences follow: a causal one, which depends only on the graph, and a quantitative one, which depends on J.
6.2 Causal arrival and the effective credit radius
Let be the length of the shortest directed path from to an output node on which is nonzero.
Proposition 6.2 (Credit causal cone). whenever . Output-dependent credit therefore cannot appear at before the st APD iterate, and iterates are necessary before every state can carry nonzero credit.
Proof. Every term of in Eq. (35) corresponds to a reverse path of length at most from a node in the support of to , and no such path exists when .
Theorem 6.2 is the APD form of Theorem 4.7, with graph distance in place of physical distance. The rounds required beyond causal arrival are governed by the tail. Define the normalized omitted credit mass and the effective credit radius
depends on the graph and the output placement only; depends in addition on the learned Jacobian and on the loss forcing. The two can be bounded independently.
Proposition 6.3 (Tail bounds). For every , . Consequently
and if then .
Proof. Immediate from Eq. (36), submultiplicativity, and .
Contraction is sufficient for a fast tail but not necessary: because is nilpotent, vanishes at whatever the value of , and it can become small well before that even when . What governs the tail is the decay of the Jacobian powers along the settled adjoint, which Section 7 measures through the alignment of finite-round and settled gradients.
6.3 From adjoint error to update fidelity
For a local linear parameter block at a settled state, the exact and K-round gradients share the presynaptic factor,
Corollary 6.4 (Local gradient-angle control). If with , then
that is, the angle between the local updates is at most .
The proof is in Appendix C; the bound is attained when is tangent to the ball of radius about . With Eq. (37), rounds give every local update whose adjoint error is at most the global tolerance an angle of at most from the settled update.
6.4 Forward–reverse duality and the residual as a certificate
The reverse expansion has a forward counterpart, which connects the feasibility residual penalized in Eq. (28) to the distance between the finite-round and settled states.
Proposition 6.5 (Forward truncation and residual identity). Let the local dynamics be affine, , with . For every ,
the terminal residual is the first omitted forward shell,
and the distance to the settled state is determined by the residual,
Proof. The expansions follow from by induction and from nilpotency as in Theorem 6.1. Then , and .
Forward inference accumulates forward paths by length and APD accumulates reverse paths by length; the truncation errors and are governed by the same Jacobian powers. The feasibility penalty acts on , which by Eq. (43) is a computable certificate for the distance between the finite-round state and the settled state; for the nonlinear dynamics used in practice the identities hold to first order about , which is the regime in which the residual is small. This is the mechanism by which the feasibility weight should control credit accuracy, and the next section tests it, together with the structural separation and the dependence of fidelity on the round budget.
7 Experiments
This section now empirically validates three testable claims: that the implemented compiler realizes the structural separation at scale (Theorems 4.6 and 4.12); that a round budget of order delivers gradients aligned with the settled gradients; and that beyond causal arrival, credit accuracy is governed by the feasibility residual and the round budget (Theorems 6.3 and 6.5) rather than by reachability. Section 7.2 tests the first with structural measurements to ; Sections 7.3 to 7.5 test the second and third with task experiments at ; Section 7.6 reports training over twenty epochs.
7.1 Setup
Data and optimization. MNIST [38] and Fashion-MNIST [39] are used with their standard 60,000/10,000 splits, flattened to and normalized, without augmentation. All results are mean ± standard deviation over three seeds. SpatialPC is trained with Adam [40] at learning rate from i.i.d. base weights.

Figure 3: Represented depth and reachability depth versus state count. A chain has ; the snake-ordered grid of Theorem 4.6 has ; the Moore compiler follows over the measured sizes, with in all cases.
Reference configuration. The reference model is a Moore graph (, 382 learned state-to-state matrices), width , ReLU activations, rounds, and feasibility weight . Two readout protocols are reported: SpatialPC-v1 uses cross-entropy with readout scale , and SpatialPC-v2 uses one-hot mean-squared error with .
Measured quantities. Finite-round accuracy is computed from . Settled accuracy uses the same parameters after an exact topological sweep. Gradient cosine is the cosine between the finite-round APD task gradient (the -dependent part of Eq. (32), excluding the direct feasibility term) and the settled task gradient of the same network, so it measures how closely the -round credit matches the credit of the fully settled computation. Residual RMS is the root-mean-square entry of the terminal residual , the quantity penalized in Eq. (28).
7.2 Structural scaling to 65,536 states
Moore graphs were constructed for , and , , and were computed exactly. The separation grows from at to at (Figure 3 and Table 1), following the exponent of Theorem 4.11. At a 4,095-edge backbone has worst-node output distance 66; at a 65,535-edge backbone has worst-node output distance 258. The edge counts match Theorem 4.12 at every size. The remaining experiments ask whether a round budget on this scale yields usable gradients.
Table 1: Structural scaling of the Moore compiler. (Theorem 4.12), is the backbone length, is the exact worst-node distance to the output, and the last column is .
| separation | |||||
|---|---|---|---|---|---|
| 4 | 16 | 22 | 15 | 6 | |
| 8 | 64 | 94 | 63 | 10 | |
| 16 | 256 | 382 | 255 | 18 | |
| 32 | 1,024 | 1,534 | 1,023 | 34 | |
| 64 | 4,096 | 6,142 | 4,095 | 66 | |
| 128 | 16,384 | 24,574 | 16,383 | 130 | |
| 256 | 65,536 | 98,302 | 65,535 | 258 |
7.3 Gradient fidelity under a geometric round budget
The number of states is increased with the round budget tied to the reachability scale,
Settled-gradient alignment of SpatialPC-v1 does not degrade as the backbone grows while the budget stays at (Table 2). On MNIST the gradient cosine is 0.804, 0.927, and 0.928 at , 64, and 256, and test accuracy rises from to ; on Fashion-MNIST the cosine is 0.860, 0.937, and 0.974, with accuracy above throughout. At the forward computation receives 32 synchronous rounds although the backbone has 255 edges. SpatialPC-v2 also improves in accuracy with but its MNIST gradient cosine drops to 0.647 at ; v1 is therefore the principal configuration below, and v2 is retained to show the sensitivity of credit fidelity to the loss and readout scaling.
Table 2: Gradient fidelity under the geometric budget as the number of states grows (, , one epoch). Gradient cosine compares the finite-round APD task gradient with the settled task gradient of the same network.
| Dataset | Method | # of States | T | Test Acc. (%) ↑ | Task-grad cos. to settled ↑ |
|---|---|---|---|---|---|
| MNIST | SpatialPC-v1 | 16 | 8 | 91.71 ± 0.14 | 0.8040 ± 0.0122 |
| 64 | 16 | 92.27 ± 0.08 | 0.9271 ± 0.0139 | ||
| 256 | 32 | 92.75 ± 0.23 | 0.9283 ± 0.0086 | ||
| SpatialPC-v2 | 16 | 8 | 84.44 ± 0.97 | 0.8379 ± 0.0116 | |
| 64 | 16 | 89.90 ± 0.23 | 0.9419 ± 0.0082 | ||
| 256 | 32 | 91.22 ± 0.27 | 0.6467 ± 0.0279 | ||
| Fashion-MNIST | SpatialPC-v1 | 16 | 8 | 82.24 ± 0.12 | 0.8597 ± 0.0230 |
| 64 | 16 | 82.73 ± 0.12 | 0.9372 ± 0.0038 | ||
| 256 | 32 | 82.85 ± 0.18 | 0.9745 ± 0.0008 | ||
| SpatialPC-v2 | 16 | 8 | 75.36 ± 0.21 | 0.8596 ± 0.0045 | |
| 64 | 16 | 79.55 ± 0.40 | 0.9607 ± 0.0051 | ||
| 256 | 32 | 80.66 ± 0.18 | 0.8795 ± 0.0231 |
7.4 Feasibility controls credit accuracy
At and the feasibility weight is varied over . For MNIST v1, raising from 0 to 100 lowers residual RMS from 0.0245 to 0.0079 and raises the gradient cosine from 0.353 to 0.928, while accuracy moves only from to (Table 3). Fashion-MNIST behaves the same way: residual RMS falls from 0.0180 to 0.0059, the cosine rises from 0.628 to 0.974, and accuracy is unchanged within noise. Prediction quality thus saturates before the finite-round state yields accurate settled credit, and the feasibility term closes the gap, as Theorem 6.5 predicts: the penalty acts on , the first omitted forward shell, and a small residual certifies a small distance to the settled state. The round budget is the second quantity identified in Section 6.
7.5 Fidelity continues to improve past causal arrival
At the round budget is varied over . Residual RMS decreases monotonically with (Table 4). On Fashion-MNIST v1 the gradient cosine rises from 0.795 at to 0.990 at ; on MNIST v1 it reaches 0.945 at and 0.955 at , with a small non-monotonicity at . The Moore graph has at , so every state is reachable from onward, yet fidelity keeps improving through . This is the gap between and in Eq. (37): reachability fixes when credit can arrive, and the Jacobian-weighted tail fixes when it becomes accurate. The one-epoch results above leave open whether the gap stays controlled during training.
7.6 Twenty epochs of training
The , , models are trained for 20 epochs and evaluated at epochs 1, 5, 10, and 20, alongside a depth-128, width-128 chain trained by backpropagation as an external reference.
Table 3: Effect of the feasibility weight at , , (one epoch). Accuracy is nearly constant while residual RMS falls and gradient cosine rises.
| Dataset | Method | Test Acc. (%) | Task-grad cos. to settled | Residual RMS | |
|---|---|---|---|---|---|
| MNIST | SpatialPC-v1 | 0 | |||
| 1 | |||||
| 10 | |||||
| 30 | |||||
| 100 | |||||
| SpatialPC-v2 | 0 | ||||
| 1 | |||||
| 10 | |||||
| 30 | |||||
| 100 | |||||
| Fashion-MNIST | SpatialPC-v1 | 0 | |||
| 1 | |||||
| 10 | |||||
| 30 | |||||
| 100 | |||||
| SpatialPC-v2 | 0 | ||||
| 1 | |||||
| 10 | |||||
| 30 | |||||
| 100 |
Table 4: Effect of the round budget at , , (one epoch). Every state is reachable once , yet gradient fidelity keeps improving to .
| Dataset | Method | Test Acc. (%) | Task-grad cos. to settled | Residual RMS | |
|---|---|---|---|---|---|
| MNIST | SpatialPC-v1 | 8 | |||
| 16 | |||||
| 32 | |||||
| 64 | |||||
| SpatialPC-v2 | 8 | ||||
| 16 | |||||
| 32 | |||||
| 64 | |||||
| Fashion-MNIST | SpatialPC-v1 | 8 | |||
| 16 | |||||
| 32 | |||||
| 64 | |||||
| SpatialPC-v2 | 8 | ||||
| 16 | |||||
| 32 | |||||
| 64 |
After 20 epochs SpatialPC-v1 reaches 97.64% on MNIST and 88.10% on Fashion-MNIST, against 97.55% and 88.03% for the backpropagation reference (Figure 4 and Table 5). The task-gradient cosines at epoch 20 are 0.883 and 0.920. Finite-round and settled accuracies stay within one point of each other throughout, while the gradient cosine drifts downward during training even though the residual stays flat or decreases: learning reshapes the weighted reverse-path distribution, and hence , independently of the forward residual.
mnist: training to 20 epochs

(a) MNIST accuracy
mnist: gradient fidelity over training
(b) Fashion-MNIST accuracy

(c) MNIST gradient cosine
fashionmnist: gradient fidelity over training
(d) Fashion-MNIST gradient cosine
Figure 4: Finite-round SpatialPC over 20 epochs at N = 256, T = 32. Gradient cosine compares the finite-round APD task gradient with the settled gradient of the same Moore network. The dashed accuracy curve is the depth-128 backpropagation reference.
7.7 Chain control and external baselines
Two further comparisons are in Appendix F. A 256-state chain trained with the same , width, objective, and optimizer stays at chance (Table 7): by Theorem 5.1, no input information reaches the output of a chain in fewer than 256 rounds, so the output state and the task gradient are identically zero, and the accuracies of 9.80% and 10.00% are the class-0 frequencies of the two test sets. The control is thus an instance of the forward light cone of Theorem 5.1; it also changes the depth-dependent residual scaling of the implementation, so it is not an isolated topology intervention. A one-epoch width sweep against backpropagation, standard PC, PC, and PC-ALM on depth-128 chains at matched width (Table 9) shows SpatialPC-v1 ahead at and within one point of backpropagation at .
8 Discussion
Scope of the bounds. Theorems 4.6 and 4.9 concern causal availability under bounded range, bounded degree, and constant density. Within that model, the latency of a chain is a consequence of embedding a long computation along a line, a d-dimensional embedding reduces it to without shortening the computation, and no local algorithm does better. Outside the model the bounds do not apply: a reduction tree, a global broadcast, or any interaction whose range grows with N breaks the light cone, and synthetic gradients [26] sidestep it by predicting credit rather
Table 5: Twenty-epoch training at , , (mean std over three seeds). “Test” is finite-round accuracy from and “Settled” uses the same parameters after an exact sweep; RMS is the residual RMS. The BP row is a depth-128 chain reference, for which the SpatialPC diagnostics do not apply.
| Dataset | Method | Epoch | Accuracy (%) | Gradient Alignment | ||
|---|---|---|---|---|---|---|
| Test | Settled | Task-grad cos. | RMS | |||
| MNIST | BP | 1 | - | - | - | |
| 5 | - | - | - | |||
| 10 | - | - | - | |||
| 20 | - | - | - | |||
| SPCv1 | 1 | |||||
| 5 | ||||||
| 10 | ||||||
| 20 | ||||||
| SPCv2 | 1 | |||||
| 5 | ||||||
| 10 | ||||||
| 20 | ||||||
| FMNIST | BP | 1 | - | - | - | |
| 5 | - | - | - | |||
| 10 | - | - | - | |||
| 20 | - | - | - | |||
| SPCv1 | 1 | |||||
| 5 | ||||||
| 10 | ||||||
| 20 | ||||||
| SPCv2 | 1 | |||||
| 5 | ||||||
| 10 | ||||||
| 20 | ||||||
than transporting it. Within the model, the bounds say nothing about accuracy after arrival. By Theorem 6.1 that is governed by , which depends on the learned weights and the task, and the experiments show the two scales to be far apart: at every state is reachable after 18 rounds, and gradient fidelity continues to improve to .
Circuit view. The -round SpatialPC is itself a realizable circuit in the sense of Theorem 4.2: the spatial graph unrolled times in time, of width and depth , with the same unit-length wiring at every layer. With it has gates per layer inside a causal ball of radius , which is the volume constraint defining [23]; the geometric budget is thus, up to constants, the smallest round count at which a planar circuit of this size is realizable, and Theorem 4.11 shows that the same budget suffices for credit to reach every gate. By Theorem 5.1 the function it computes depends on the input only through paths of length at most , so with it is a depth- circuit with unit-length wires, and the represented depth is a property of the wiring, the longest directed path available to the circuit, rather than of the -round function. The light cone applies to the forward direction as well: an exact evaluation of the full backbone takes rounds on any local substrate, while the compiled graph delivers input information to every state within rounds (Theorem 4.6(ii)). Theorem 4.11 therefore yields a circuit family in which the wiring supports arbitrarily long directed computations, both input and loss information reach every unit in rounds, and the function realized at budget is the -round truncation, which the feasibility penalty trains to be self-consistent. Which paths a trained circuit uses is a question about the learned weights, taken up below.
Geometry and dynamics. The scaling methods of Section 2 act on the dynamics that carry credit over a given graph and, in the terms of Section 6, shorten the gap between and . Spatial compilation reduces . The two interventions are independent and compose: the compiler places no constraint on the local rule, and any of those dynamics can be run on a compiled graph. For relaxation-based models the path-tail analysis also supplies a diagnostic, since is then the number of inference iterations after which credit reaches a given relative accuracy, and comparing it with separates latency caused by distance from latency caused by the Jacobian tail.
Physical implementation. SpatialPC is formulated for substrates in which range and degree are physical constraints, such as mesh-connected neuromorphic and in-memory accelerators. Every forward and reverse operation is local to an edge; the wiring is bounded-degree, unit-length, and fixed at compile time; and neither the compiler nor APD uses all-to-all communication, reduction trees, or a nonlocal feedback matrix. A computation can be laid out on such a fabric by ordering it along a space-filling traversal and retaining the unit-range shortcuts; a planar device cannot reduce worst-case credit latency below order rounds, and a three-dimensional stack cannot reduce it below order ; and one parameter update costs local message phases with T on the order of . The saving is in synchronization depth, not arithmetic: each round costs operations, so a T-round update performs T times the work of one topological sweep, spread over rounds instead of .
Open problems. Four questions follow directly from the results. First, the Moore identity holds at every implemented size but is not proved for all ; more generally, the minimum of over cycle-based compilers with edges is not known, and Theorem 4.6 shows only that is attainable with edges. Second, the tail identity reduces to the decay of , which suggests that the depth-aware parameterizations of [18, 20] could be used to bound on the compiled graph in terms of ; the present experiments measure through gradient alignment at and leave its growth with open. Third, represented depth is a property of the wiring; a path-sensitive ablation that cuts long backbone segments after training would measure how much of it a trained circuit uses. Fourth, the composition of geometry with relaxation-based dynamics, which the analysis predicts, is a direct experiment: run PC-ALM or PC on the Moore graph and on the chain at matched and compare their inference-iteration counts. Three-dimensional substrates, convolutional and sequence computations, and measurements on physically local hardware extend the same program.
9 Conclusion
The communication latency of local credit assignment is a property of the graph on which credit travels, not of the depth of the computation. For states on a constant-density, bounded-range substrate, rounds are necessary for loss information to reach every loss-sensitive parameter, and a unit-range, degree-2d compiler reaches every state in rounds while retaining an Hamiltonian computation; the separation is tight for every local learning algorithm. SpatialPC realizes it in predictive coding with an exact, edge-local gradient, and its path-length expansion identifies the second quantity on which finite-round learning depends: the effective credit radius, set by the decay of Jacobian powers along the settled adjoint rather than by the graph. The sparse Moore compiler keeps the two-dimensional exponent with edges to 65,536 states, and under round budgets the trained models keep finite-round gradients aligned with settled gradients and match a depth-128 backpropagation reference on MNIST and Fashion-MNIST. The compiler is defined for every dimension, the analysis applies to any local rule, and together they make the communication cost of credit assignment a quantity that can be chosen by design rather than inherited from depth.
References
[1] David E. Rumelhart, Geoffrey E. Hinton, and Ronald J. Williams. Learning representations by back-propagating errors. Nature, 323(6088):533–536, 1986. doi: 10.1038/323533a0.
[2] Timothy P. Lillicrap, Adam Santoro, Luke Marris, Colin J. Akerman, and Geoffrey Hinton. Backpropagation and the brain. Nature Reviews Neuroscience, 21(6):335–346, 2020. doi:10.1038/s41583-020-0277-3.
[3] Francisco J. Varela, Evan Thompson, and Eleanor Rosch. The Embodied Mind: Cognitive Science and Human Experience. MIT Press, Cambridge, MA, 1991.
[4] Rolf Pfeifer and Josh Bongard. How the Body Shapes the Way We Think: A New View of Intelligence. MIT Press, Cambridge, MA, 2006.
[5] Beren Millidge, Anil Seth, and Christopher L. Buckley. Predictive coding: A theoretical and experimental review, 2021. URL https://arxiv.org/abs/2107.12979.
[6] Tommaso Salvatori, Ankur Mali, Christopher L. Buckley, Thomas Lukasiewicz, Rajesh P. N. Rao, Karl Friston, and Alexander Ororbia. A survey on neuro-mimetic deep learning via predictive coding. Neural Networks, 195:108161, March 2026. doi: 10.1016/j.neunet.2025.108161.
[7] Benjamin Scellier and Yoshua Bengio. Equilibrium propagation: Bridging the gap between energy-based models and backpropagation. Frontiers in Computational Neuroscience, 11:24, 2017. doi: 10.3389/fncom.2017.00024.
[8] Geoffrey Hinton. The forward-forward algorithm: Some preliminary investigations, 2022. URL https://arxiv.org/abs/2212.13345.
[9] Dong-Hyun Lee, Saizheng Zhang, Asja Fischer, and Yoshua Bengio. Difference target propagation. In Machine Learning and Knowledge Discovery in Databases, pages 498–515. Springer, 2015.
[10] Alexander G. Ororbia and Ankur Mali. Biologically motivated algorithms for propagating local target representations. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4651–4658, 2019. doi: 10.1609/aaai.v33i01.33014651.
[11] Beren Millidge, Alexander Tschantz, and Christopher L. Buckley. Predictive coding approximates backprop along arbitrary computation graphs. Neural Computation, 34(6):1329–1368, 2022. doi: 10.1162/neco_a_01497.
[12] Tommaso Salvatori, Luca Pinchetti, Beren Millidge, Yuhang Song, Tianyi Bao, Rafal Bogacz, and Thomas Lukasiewicz. Learning on arbitrary graph topologies via predictive coding. In Advances in Neural Information Processing Systems, volume 35. Curran Associates, Inc., 2022. doi: 10.52202/068431-2770.
[13] Tommaso Salvatori, Yuhang Song, Zhenghua Xu, Thomas Lukasiewicz, and Rafal Bogacz. Reverse differentiation via predictive coding. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 8150–8158, 2022. doi: 10.1609/aaai.v36i7.20788.
[14] Jeffrey Seely and Julian Gould. Augmented lagrangian predictive coding, 2026. URL https://arxiv.org/abs/2605.31022.
[15] Myoung Hoon Ha, Hyunjun Kim, Yoondo Sung, Youngha Jo, Min S. Kang, and Sang Wan Lee. Stable and scalable deep predictive coding networks with meta-prediction errors. In International Conference on Learning Representations, 2026. URL https://openreview.net/forum?id=kE5jJUH19i.
[16] Tugdual Kerjan, Rasmus Høier, and Benjamin Scellier. Training a predictive coding network on ImageNet using equilibrium propagation, 2026. URL https://arxiv.org/abs/2606.03584.
[17] Cédric Goemaere, Gaspard Oliviers, Rafal Bogacz, and Thomas Demeester. ePC: Fast and deep predictive coding in digital simulation. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 35407–35442. PMLR, 2026. URL https://proceedings.mlr.press/v306/goemaere26a.html.
[18] Francesco Innocenti, El Mehdi Achour, and Christopher L. Buckley. PC: Scaling predictive coding to 100+ layer networks. In Advances in Neural Information Processing Systems, volume 38. Curran Associates, Inc., 2025. doi: 10.52202/085713-2923.
[19] Chang Qi, Matteo Forasassi, Thomas Lukasiewicz, and Tommaso Salvatori. Towards the training of deeper predictive coding neural networks. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 100334–100362. PMLR, 2026. URL https://proceedings.mlr.press/v306/qi26f.html.
[20] Francesco Innocenti, El Mehdi Achour, and Rafal Bogacz. On the infinite width and depth limits of predictive coding networks. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 49761–49799. PMLR, 2026. URL https://proceedings.mlr.press/v306/innocenti26a.html.
[21] Amirhossein Mohammadi and Alexander G. Ororbia. Error highways: Scaling predictive coding to very deep networks, 2026. URL https://arxiv.org/abs/2606.22744.
[22] Tommaso Salvatori, Yuhang Song, Yordan Yordanov, Beren Millidge, Lei Sha, Cornelius Emde, Zhenghua Xu, Rafal Bogacz, and Thomas Lukasiewicz. A stable, fast, and fully automatic learning algorithm for predictive coding networks. In International Conference on Learning Representations, 2024.
[23] Benjamin Prada and Ankur Mali. Realizable circuit complexity: Embedding computation in space-time, 2025. URL https://arxiv.org/abs/2509.19161.
[24] Eliakim Hastings Moore. On certain crinkly curves. Transactions of the American Mathematical Society, 1(1):72–90, 1900. doi: 10.2307/1986405.
[25] Alexander Ororbia, Ankur Mali, Adam Kohan, Beren Millidge, and Tommaso Salvatori. A review of neuroscience-inspired machine learning, 2024. URL https://arxiv.org/abs/2403.18929.
[26] Max Jaderberg, Wojciech Marian Czarnecki, Simon Osindero, Oriol Vinyals, Alex Graves, David Silver, and Koray Kavukcuoglu. Decoupled neural interfaces using synthetic gradients. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1627–1635. PMLR, 2017. URL https://proceedings.mlr.press/v70/jaderberg17a.html.
[27] Haiguang Wen, Kuan Han, Junxing Shi, Yizhen Zhang, Eugenio Culurciello, and Zhongming Liu. Deep predictive coding network for object recognition. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 5266–5275. PMLR, 2018. URL https://proceedings.mlr.press/v80/wen18a.html.
[28] Clark D. Thompson. A Complexity Theory for VLSI. PhD thesis, Carnegie Mellon University, 1980. Technical Report CMU-CS-80-140.
[29] Paul M. B. Vitányi. Locality, communication, and interconnect length in multicomputers. SIAM Journal on Computing, 17(4):659–672, 1988. doi: 10.1137/0217042.
[30] Nathan Linial. Locality in distributed graph algorithms. SIAM Journal on Computing, 21(1): 193–201, 1992. doi: 10.1137/0221015.
[31] David Peleg. Distributed Computing: A Locality-Sensitive Approach. SIAM Monographs on Discrete Mathematics and Applications. SIAM, 2000.
[32] Maxim Naumov. Parallel complexity of forward and backward propagation, 2017. URL https://arxiv.org/abs/1712.06577.
[33] Shang Wang, Yifan Bai, and Gennady Pekhimenko. BPPSA: Scaling back-propagation by parallel scan algorithm. In Proceedings of Machine Learning and Systems, volume 2. MLSys, 2020.
[34] Yang Song, Chenlin Meng, Renjie Liao, and Stefano Ermon. Nonlinear equation solving: A faster alternative to feedforward computation, 2020. URL https://arxiv.org/abs/2002.03629.
[35] Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. Deep equilibrium models. In Advances in Neural Information Processing Systems, volume 32, 2019.
[36] Google. S2 Geometry. https://s2geometry.io/. URL https://s2geometry.io/. Software documentation.
[37] Przemysław Prusinkiewicz and Aristid Lindenmayer. The Algorithmic Beauty of Plants. Springer-Verlag, 1990. ISBN 978-0-387-97297-8.
[38] Yann LeCun, Corinna Cortes, and Christopher J. C. Burges. The MNIST database of handwritten digits. http://yann.lecun.com/exdb/mnist/. URL http://yann.lecun.com/exdb/mnist/.
[39] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. CoRR, abs/1708.07747, 2017. URL https://arxiv.org/abs/1708.07747.
[40] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. URL https://arxiv.org/abs/1412.6980.
[41] Magnus R. Hestenes. Multiplier and gradient methods. Journal of Optimization Theory and Applications, 4(5):303–320, 1969. doi: 10.1007/BF00927673.
[42] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, volume 32, 2019.
Appendix
The appendix provides detailed proofs and protocols for materials referenced in the main text. Appendix A proves the monotone-edge lemma behind Theorem 4.6 and records how the Moore reachability of Eq. (21) was measured; Appendix B derives the finite-round APD recursion of Theorem 5.2; Appendix C proves Theorem 6.4; Appendix D relates the adjoint equation to augmented-Lagrangian predictive coding; Appendix E verifies the implementation against automatic differentiation; Appendix F reports the chain control, the activation ablation, and the external width sweep; and Appendix G gives pseudocode for the compiler, the forward pass, and training.
A Proofs for the Spatial Compilation Results
A.1 Proof of Theorem 4.5
Theorem 4.5 is the step of Theorem 4.6 that supplies, from every point of the snake-ordered grid, a forward edge that moves one unit closer to the output. Write and for the first and last points of , and call the two statements of the lemma ( ) and ( ):
(A_d) every has a unit neighbor u with
(B_d) every has a unit neighbor u with
We prove and together by induction on d.
Base case . Here and . For take ; for take .
Inductive step. Assume and . By Eq. (14), , and if is even and if is odd. Points in distinct slabs are ordered by slab index, and within slab i the order is if i is even and its reversal if i is odd.
(A_d): let . If , take . It lies in a later slab, so , and since the first coordinate of is , the move reduces the distance to by one. If and is even, the last slab is traversed by , whose last point is ; by there is a unit neighbor of with one unit closer to , and satisfies the claim. If and is odd, the last slab is traversed by the reversal of , whose last point is ; by there is a unit neighbor with , hence later in the reversed order, one unit closer to , and satisfies the claim.
(B_d): let . If , take , which lies in an earlier slab and is one unit closer to , whose first coordinate is 0. If , slab 0 is traversed by with first point , and supplies ; take .
A.2 Reverse eccentricity of the Moore output
Eq. (21) was obtained by breadth-first search on the reversed graph from the output node for , ; at the farthest state is state 1 (Figure 2), and at every implemented size the maximum distance is exactly . A proof for all would need to track the position of the cut (backbone index 0 is placed one quarter of the way around the Moore cycle, Alg. 1) relative to the recursive structure of the curve.
B Derivation of Finite-Round APD
This appendix carries out the stationarity computation stated in the proof of Theorem 5.2. For one example, define
subject to the time-indexed constraints
With the sign convention of Eq. (6),
Stationarity in gives . The feasibility contribution is
SO
which is Eq. (30). For , stationarity in gives , which is Eq. (31). Differentiating in at a stationary point,
where the direct derivative of the feasibility term, holding fixed, is
This is the gradient evaluated by Alg. 3.
C Proof of the Gradient-Angle Bound
We prove Theorem 6.4. Let and with and . Normalize and decompose
Then
which is decreasing in , so for fixed the minimum is attained at :
Since and , is minimized at , where . Hence , with equality when is tangent to the ball of radius about . For the edge gradients and with a common , the Frobenius inner products factor as , so .
D Connection to Augmented-Lagrangian Predictive Coding
Section 3.2 states that the adjoint equation Eq. (7) is the state-stationarity condition of augmented-Lagrangian predictive coding [14]. For the augmented Lagrangian [41]
define the augmented multiplier and set . Since ,
State stationarity is therefore , the settled APD equation Eq. (7), at every value of the residual. At feasibility , so the APD adjoint coincides with minus the Lagrange multiplier of the constrained problem Eq. (4). SpatialPC shares this fixed-point condition with augmented-Lagrangian PC but not its dynamics: PC-ALM approaches the condition by primal–dual relaxation of states and multipliers, whereas APD on the unrolled graph (Section 5.3) computes the exact gradient of the finite-round objective in reverse rounds with no relaxation and no feasibility requirement. The geometric results of Section 4 apply to both.
E Numerical Verification of the Implementation
Theorem 5.2 states that APD on the unrolled graph computes the exact gradient of Eq. (28); this appendix checks the implementation of that computation. The hand-written finite-round APD implementation was compared against PyTorch autograd [42] in double precision for both task losses, both readout scalings, and ReLU and tanh activations. Across the eight combinations the gradient cosine is 1.0 to displayed precision and the relative error is below (Table 6). Stationary APD at convergence reproduces the settled backpropagation gradient for both the cross-entropy/ and MSE/ protocols with relative error below .
Table 6: Double-precision verification of the finite-round SpatialPC/APD gradient against automatic differentiation.
| Loss | Readout | Activation | Gradient cosine | Relative error |
|---|---|---|---|---|
| CE | ReLU | |||
| CE | tanh | |||
| CE | ReLU | |||
| CE | tanh | |||
| MSE | ReLU | |||
| MSE | tanh | |||
| MSE | ReLU | |||
| MSE | tanh |
F Secondary Experiments
The three comparisons below are referenced from Section 7.7. The chain baselines share the width, optimizer, and epoch budget of SpatialPC and differ in topology.
F.1 Chain control
The finite-round Moore model is compared with a 256-state chain at the same state count, width, round budget, objective, and optimizer (Table 7). With no input information reaches the output of the chain (Theorem 5.1), so its prediction is the constant readout of a zero state and its task gradient vanishes; the reported accuracies are the frequencies of class 0 in the two test sets. The chain also changes the depth-dependent residual scaling of the implementation, so the comparison is a qualitative reference rather than an isolated topology intervention.
Table 7: Chain control at matched , , . With the chain output never receives input information, so accuracy equals the class-0 frequency and the task gradient is zero.
| Dataset | Method | Graph | Test Acc. (%) | Task-grad cos. to settled |
|---|---|---|---|---|
| MNIST | SpatialPC-v1 | Chain | ||
| Moore | ||||
| SpatialPC-v2 | Chain | |||
| Moore | ||||
| Fashion-MNIST | SpatialPC-v1 | Chain | ||
| Moore | ||||
| SpatialPC-v2 | Chain | |||
| Moore |
F.2 Activation ablation
Table 8 compares ReLU and tanh at the reference configuration. Tanh gives slightly lower accuracy and consistently higher gradient cosine for both protocols, consistent with a smaller Jacobian norm and hence a faster path tail.
Table 8: Activation ablation at the reference configuration (, , , , one epoch).
| Dataset | Method | Activation | Test Acc. (%) | Task-grad cos. to settled |
|---|---|---|---|---|
| MNIST | SpatialPC-v1 | ReLU | ||
| Tanh | ||||
| SpatialPC-v2 | ReLU | |||
| Tanh | ||||
| Fashion-MNIST | SpatialPC-v1 | ReLU | ||
| Tanh | ||||
| SpatialPC-v2 | ReLU | |||
| Tanh |
F.3 External width sweep
Depth-128 chain implementations of backpropagation, standard PC, PC, and PC-ALM are compared with SpatialPC after one epoch over (Table 9). The Moore graph has edges against for the chain, so the two differ in edge count as well as topology.
Table 9: One-epoch test accuracy (%) at matched hidden width . SpatialPC uses the Moore graph; the chain baselines use depth 128. Batch sizes are 32 for SpatialPC and 64 for the baselines. Bold marks the best entry in each row.
| Dataset | Width | BP | PC | PC | PC-ALM | SPC-v1 | SPC-v2 |
|---|---|---|---|---|---|---|---|
| MNIST | 8 | 38.80 | 18.67 | 9.53 | 37.90 | 83.00 | 65.70 |
| 16 | 75.85 | 35.65 | 9.51 | 71.47 | 87.60 | 77.94 | |
| 32 | 87.78 | 61.02 | 8.98 | 85.79 | 89.78 | 84.91 | |
| 64 | 91.51 | 74.98 | 9.75 | 89.78 | 91.42 | 89.18 | |
| 128 | 93.40 | 84.06 | 9.87 | 92.25 | 92.74 | 91.23 | |
| Fashion-MNIST | 8 | 47.56 | 24.48 | 11.41 | 43.44 | 74.88 | 64.77 |
| 16 | 73.22 | 45.45 | 8.15 | 72.02 | 78.08 | 71.48 | |
| 32 | 78.63 | 64.72 | 8.58 | 77.43 | 79.86 | 75.98 | |
| 64 | 81.23 | 72.29 | 11.09 | 80.08 | 81.60 | 78.95 | |
| 128 | 83.39 | 76.24 | 9.25 | 82.32 | 82.85 | 80.66 |
G Algorithms
Algorithm 1 constructs the Moore DAG of Section 4.4, Alg. 2 gives the settled and finite-round forward computations of Section 5.1, and Alg. 3 gives one APD gradient evaluation on the T-round space–time graph (Theorem 5.2).
Algorithm 1: Moore-grid DAG construction used by SpatialPC. The Moore cycle is cut to define a topological order. Backbone edges follow that order; the cut seam and eligible interior unit-grid edges are retained as forward-oriented shortcuts.
Input: grid side , Output: DAG with ; input/root ; output ; skip gains
1 ; 2 for to do 3 rewrite : , ; 4 points visited by a turtle reading ; 5 for ; // choose cut and topological order 6 foreach unit cell do 7 number of Moore-cycle edges to the left of in its row; 8 interior() ; 9 ; // Hamiltonian backbone 10 ; // directed cut seam used by the implementation 11 foreach unit-grid edge separating two interior cells do 12 ; 13 for ; 14 return ;
Algorithm 2: SpatialPC forward computation. Partial performs T synchronous local rounds. Settled evaluates the same DAG exactly in topological order.
Input: DAG in topological order; input ; input node ; outputs ; parameters ; gains ; nonlinearity ; rounds ; readout scale ; mode
Output: prediction and states
1 if then 2 | ; 3 else 4 | ; 5 return ;
6 Function Settled() 7 | ; 8 | ; 9 | for in topological order after do 10 | ; 11 | return Readout(), ;
12 Function Partial() 13 | ; 14 | for to do 15 | ; 16 | return Readout(), ;
17 Function LocalRound() 18 | for do in parallel 19 | ; 20 | ; 21 | ; 22 | for ; 23 | return ;
24 Function Readout() 25 | ;
Algorithm 3: SpatialPC training by Adjoint Prediction Dynamics (APD) on the T-round space-time graph.
Input: sample ; as in Alg. 2; feasibility weight Output:
1 ; 2 for to do 3 ; 4 ; 5 ; // terminal APD forcing on the unrolled graph 6 ; 7 ; 8 for ; 9 ; // APD: each node predicts its adjoint from local downstream credit 10 for down to 0 do 11 for do in parallel 12 ; 13 ; 14 ; 15 return ; 16 Function LocalPullback() 17 for do in parallel 18 ; 19 for ; 20 return ;