Manuscript Offprint
arXiv:2610.10395Executing Causal Structure Learning with Linear-Attention Transformers
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Transformers can execute algorithms on data given in their input. We ask whether they can do the same for causal discovery. We study a standard continuous method that repeatedly updates a candidate causal graph while enforcing acyclicity. We explicitly construct a fixed-weight transformer whose forward pass exactly reproduces one update of this method, so repeated blocks reproduce its optimization trajectory. The transformer carries the current graph and the algorithm's multiplier between updates. We show that retaining the multiplier is essential for exact execution, since different multiplier values can lead to different next updates. We also give conditions under which, within a fixed stage, the number of updates needed to reach a target accuracy can be computed in advance and rounding errors stay bounded as depth grows. Experiments show that the constructed block agrees with a reference update to floating-point precision, while arithmetic replay on synthetic data and seven published benchmark network topologies inherits the reference solver's successes and failures. This separates accurate algorithm execution from accurate causal recovery. In contrast, the ordinary attention models tested under our training budgets do not reliably execute the update or transfer to larger graphs. Whether gradient training can learn an executor in the architecture class of the construction remains open.
Keywords Transformers · Causal discovery · Algorithm execution · Linear attention · Continuous DAG learning · Augmented Lagrangian.
1 Introduction
Can a transformer carry out causal discovery by executing a known solver, with weights fixed before seeing the data? The question grows out of a line of work on what transformers can compute from their prompt. Constructive studies of in-context learning show how a transformer can compute on examples it is shown (Garg et al., 2022) and even implement gradient descent in its forward pass (Akyürek et al., 2022; von Oswald et al., 2022; Ahn et al., 2023). Later constructions go further, building networks that carry out proximal updates, looped programs and graph algorithms (Bai et al., 2023; Giannou et al., 2023). What these results share is that the weights are specified rather than fitted, so the forward pass is a known computation and one can say exactly what it computes, how deep it must be and where it loses precision.
Causal discovery looks like a natural next test, and a harder one. A weighted directed graph over p variables is a causal graph only if it contains no directed cycle, and this global requirement couples every edge to every other. Continuous formulations turn the requirement into a smooth constraint: NOTEARS replaces the combinatorial search over acyclic graphs by an equality constraint on the weighted adjacency matrix (Zheng et al., 2018), and polynomial variants have the same acyclic zeros (Yu et al., 2019; Wei et al., 2020). The resulting solvers alternate between a gradient-and-threshold step on the edge weights and an update of a multiplier that tightens the acyclicity penalty. A transformer that is to execute such a solver must do more than evaluate a gradient. It must evaluate a matrix-power constraint, apply a sparse proximal step, respect an allowed-edge mask, and keep a second piece of state, the multiplier, available for the next update.
Roy and Karmakar
This is the problem we take on. We study the complete update of a continuous DAG solver, which combines a least-squares gradient, a polynomial acyclicity penalty, a sparse proximal step and a multiplier update. Each ingredient is established; the question is how to execute their composition in a transformer and retain the state the next update needs. The state is the crux. The next update depends on both the weighted adjacency matrix W and the multiplier , so we encode this complete state in the prompt and build a fixed-weight block that maps it to the next state, leaving the penalty schedule and stopping rule external. Figure 1 shows the resulting correspondence between the solver and transformer trajectories.
(a)

(b)

Figure 1: One update, run two ways. The solver carries the edge matrix and multiplier ; the fixed-weight transformer carries the same state in . With identical controls, the two transitions agree exactly (Theorem 4.1). The surfaces are schematic.
Our answer is an explicit construction. A single set of weights, shared by all graphs with up to variables, executes one update exactly with depth and width , and we prove a matching depth order for linear attention with bilinear/ReLU sublayers and affine encoding and readout (Section 4). Because the multiplier is carried from one block to the next rather than recomputed, it is the quantity most easily lost, and we show that losing it changes the next update; we also bound the error this causes and explain why constraint evaluations need care as the graph approaches acyclicity (Section 5). Within a fixed penalty stage we give conditions under which the number of updates needed for a target accuracy can be computed in advance (Section 6), and we relate the solver's output to the true graph (Section 7).
The experiments then ask whether this works in practice. The constructed block agrees with an independent reference implementation of the update to floating-point precision, and repeated blocks reproduce the solver's trajectory. Replaying the updates on synthetic data and on seven published benchmark network topologies gives the same graphs as the reference solver, including its mistakes: reproducing the solver's updates also reproduces its statistical and optimization errors, so accurate execution should not be confused with accurate causal recovery (Section 8). Ordinary attention models trained under our budgets, by contrast, do not reliably execute the update or transfer to larger graphs, and whether gradient training can find an executor in the architecture class of the construction remains open. We stress the scope of the claim. The block executes the Poly-prox update for supplied controls; it does not choose the schedule, run line searches or decide when to stop, and the reference solver serves as a well-defined target rather than a state-of-the-art estimator.
The rest of the paper follows this story. Section 2 reviews related work and Section 3 states the solver and its reference update. Section 4 builds the block, and Sections 5–7 study what is lost through the multiplier, the constraint and finite precision, and how exact execution relates to recovery. Section 8 reports the experiments and Section 9 concludes. Proofs and experimental details are in the appendices.
Roy and Karmakar
Continuous DAG learning. NOTEARS uses a matrix-exponential constraint (Zheng et al., 2018); polynomial constraints have the same acyclic zeros (Yu et al., 2019; Wei et al., 2020). TMPI exploits repeated squaring (Zhang et al., 2022); DAGMA, GOLEM and SDCD offer alternative formulations (Bello et al., 2022; Ng et al., 2020a; Nazaret et al., 2023). Exact execution still inherits the solver's statistical and optimization limitations, including those discussed in Appendix F.4.
3 The Causal-Discovery Algorithm
Let hold i.i.d. centered observations of a mean-zero generated by a linear SEM with acyclic and independent, mean-zero noise with finite positive variances. With equal noise variances uniquely minimizes the population least-squares loss over acyclic supports (Peters and Buhlmann, 2012; Loh and Bühlmann, 2013; Chen et al., 2018); Section 7 relates the solver's finite-sample output to it.
For , we study
(1)
where restricts to a binary zero-diagonal allowed-edge mask ( with no domain knowledge), is the weight of edge , and
With , exactly on matrices whose support graph is acyclic (Yu et al., 2019; Wei et al., 2020); we fix one for every . We solve (1) by a NOTEARS-style augmented Lagrangian with a proximal-gradient primal step (Daubechies et al., 2003; Beck and Teboulle, 2009):
Throughout, , and ; the schedule controls are externally supplied. Here , the step size is , and allows several primal steps per multiplier update. Algorithm 1 collects one iteration of (3)–(4), and we call this reference implementation Poly-prox. The solver itself is standard; our contribution is a transformer with analytically fixed weights that executes it (Section 4). We choose Poly-prox because its fixed step consists of matrix products, scalar products and ReLU soft-thresholding, allowing a finite exact construction. Line searches and alternative optimizers are not implemented by this fixed block.
Proposition A.1 (Appendix A.1) gives, with and , and , both built from the same matrix powers that compute itself; the Lasso proximal map is entrywise soft-thresholding restricted to the allowed edges, .
A well-known feature of this constraint, shared by the matrix-exponential version (Wei et al., 2020), is that its gradient vanishes on the entire feasible set: is a sum over weighted directed walks that would close a cycle through , so it is nonzero exactly on edges that lie on a cycle and as soon as is acyclic (Lemma A.2, Appendix A.2).
At every feasible point, then, the usual regularity condition for the equality constraint fails, and a feasible point is a KKT point exactly when it also minimizes the convex masked Lasso problem (Appendix A.2); Section 5 turns the same fact into a statement about what an executor must retain.
4 How the Transformer Executes an Update
We now construct a block that exactly executes one iteration of Algorithm 1. The prompt and the block are designed together: the prompt is a numerical encoding of the solver's current state, one row token per variable plus a single control token holding the scalar controls and . A register is a designated group of coordinates in the residual stream; a persistent one carries its value from one iteration to the next (here W and ), a scratch one is reset after each update.
The encoded state has width . Set and let contain the variable-token flag and zero scratch. The control row uses . For variable rows , with all
Roy and Karmakar
Algorithm 1 Poly-prox causal-discovery update
Require: Current state , covariance , mask , and
Ensure: Updated state
1:
2:
3:
4:
5:
6:
7: return
Algorithm 2 Fixed-weight transformer execution
Require: Encoded state from Eq. (5)
Ensure: Encoded state
1: Read and controls from .
2: Form in the scratch registers.
3: Use the repeated-squaring stages to obtain and .
4: Assemble the augmented gradient from and the acyclicity term.
5: Apply masked ReLU soft-thresholding to obtain .
6: Compute and update the multiplier .
7: Write to the persistent registers, reset scratch space, and return .
Figure 2: One update, two implementations. Left: one Poly-prox iteration. Right: the same iteration as the fixed-weight transformer carries it out on the encoded state of (5), line for line; blue is linear attention, orange bilinear/ReLU, green persistent state. Theorem 4.1 shows both return the same .
matrix rows padded to ,
The last block contains nine wide scratch registers and eighteen scalar coordinates for flags, controls and scratch. Appendix B.1 indexes these coordinates; Appendices B.2, B.3, B.4 and B.5 give the selector maps, schedule, invariants and cost. We use residual, unnormalized linear heads , without softmax or layer normalization, and feedforward sublayers
the second term bilinear, as in gated feedforward units (Shazeer, 2020). Soft-thresholding is exact with two ReLUs per coordinate,
and the update inherits the mask from its inputs, so the thresholded output is already supported on the allowed edges (Appendix B). Figure 2 sets the solver and transformer updates side by side.
Theorem 4.1 (Exact execution of one Poly-prox update)
Informal statement: there is a block of linear-attention and bilinear/ReLU layers, one weight set for every , such that, for every valid encoded state , the block executes Algorithm 2 exactly and therefore produces the same as one iteration of Algorithm 1, in exact real arithmetic, for every problem size up to at once.
Appendix A contains the proofs; Appendix A.3 states the construction theorem in full. The block has width , at most four heads per layer, and nonzero weight magnitudes in .
How the block evaluates the constraint. The block computes two matrix sequences together. Starting from and , set
After doublings, and exactly (Appendix A.3), so and, since , . The constraint and its gradient therefore share the same doubling stages. Each doubling is one attention layer: with one token per row, an unnormalized head whose query reads , whose key reads the identity register and whose value reads writes row by row, and a second head writes the same way. The rest of the update — the least-squares gradient , the soft-threshold, and a second squaring pass for — uses a fixed number of layers (Appendix B).
Corollary 4.2 (Exact execution over repeated updates). Let encode with the fixed data , and at each iteration let an outside schedule write only that iteration's controls into the control token. Stacking blocks then reproduces the first iterations of Algorithm 1 exactly in real arithmetic, at depth : each copy computes and the next one reads it, so the multiplier never leaves the network.
Roy and Karmakar
Why logarithmic depth is necessary. Any exact implementation using these operations and affine encoding and readout also needs logarithmic depth. Here one layer consists of an attention sublayer followed by a feedforward sublayer.
Theorem 4.3 (Minimum depth for exact execution)
Fix and . A -layer block of this type, with parameters fixed independently of its input, any finite width and head count, and a token count fixed at each problem size, that computes the Poly-prox primal update exactly for every valid state satisfies
if it computes the full state exactly, then
Appendix C gives the proof.
Together with Theorem 4.1, our results yield as the least depth order for uniform exact execution of the full fixed- update in this primitive class with affine encoding/readout. This bound concerns the specified exponent- recurrence; it is not a lower bound for every DAG solver.
5 Memory and Numerical Accuracy
The block retains and recomputes the constraint in scratch space. We now quantify the consequences of errors in this computation. Write , , and let denote the exact update. A decoded transition is the state returned by an implementation.
Theorem 5.1 (Accumulation of update errors)
Informal statement: if the decoded transition is -close to the exact update at every step, and is -Lipschitz, then, writing for the initial state error,
The proof is in Appendix A.4.
Remark 5.2 (Undamped multiplier error). By Lemma A.2, whenever is acyclic, so there and . Taking and keeps the exact trajectory at the origin, while a decoder that adds to at each step still meets the local-error bound yet ends at . What accumulates is state error, not graph error: near an acyclic state nothing pulls back, so an error made there is carried forward, and whether it reaches depends on the next stage.
Lemma A.3 (Appendix A.5) shows that if and, for one of two multiplier values , the pre-threshold entry lies outside the dead zone of the soft-threshold, then the augmented gradients differ and so do the updates; hence any deterministic executor that returns exactly must retain information distinguishing from .
Near a stationary point, a small constraint gradient may need a large multiplier to balance the loss gradient. The coefficient multiplying in the augmented gradient is the effective multiplier , which need not have the same magnitude as alone. All stationarity residuals are taken inside the linear subspace . Write for the stationarity residual of the convex masked Lasso problem, with acyclicity dropped, and call -stationary when the augmented residual with coefficient is at most . Appendix A.6 defines both residuals and proves the following result.
Roy and Karmakar
Proposition 5.3 (Growth of the effective multiplier)
Informal statement: suppose a trajectory is -stationary for the augmented objective at every step with , and is feasible but not a solution of the masked Lasso problem. Then its effective multiplier must diverge in magnitude, at rate
where is the Lasso stationarity gap at and is a local Lipschitz constant for on a neighbourhood of .
Under these assumptions, grows as the constraint gradient shrinks. It also multiplies any error in that gradient; error in affects through . The next result shows when relative accuracy keeps the resulting error bounded.
Corollary 5.4 (Relative cycle accuracy at stage-stationary states). Let as in the formal Proposition 5.3 of Appendix A.6, and assume the covariance is exact and that the computed effective multiplier and constraint gradient satisfy the relative bounds and for some . If is -stationary as above, then the assembled gradient error obeys , so these assumed relative errors in and stay controlled by even as . The relative bounds are a hypothesis about the implementation: Theorem 4.1 supplies in real arithmetic, and floating point is measured in Section 8.
Appendix A.7 proves the corollary and contrasts relative and absolute perturbations. The two-node family in Appendix A.6 has , showing that the general growth bound need not be tight. Figure 7 illustrates the relative-error bound and absolute-error amplification (Appendix F.7). Figure 8 shows finite-trajectory stationarity diagnostics; these do not establish the proposition's asymptotic premises (Appendix F.8).
Bounding rounding errors. We follow rounding errors through every operation in the block, including the second constraint evaluation and the replacement of stored values.
Theorem 5.5 (Rounding error in the constructed block)
Fix the selector weights and layer schedule of Appendix B, the matrix-product kernels, accumulation order and casts. Under the scalar arithmetic model (46), with exactly represented weights, flags and mask and finite intermediates, propagating the nonnegative rules (49)–(51) through every operation in both squaring passes yields
with the right sides in (52). Uniform input bounds give a uniform block bound, and for fixed input bounds both enclosures tend to zero with the arithmetic and conversion errors (Appendix E).
Appendix E.1 states the arithmetic assumptions, Appendix E.2 proves the enclosure, and Appendix E.3 bounds residual overwrites. The latter matter because subtracting an old scratch value can lose relative accuracy even with finite intermediates. These bounds are implementation-specific.
How accurately must the multiplier be stored? Lemma A.3 shows why the multiplier matters. We now bound the error from storing it imprecisely. Fix the data, and the controls, and vary only ; its encoding can use many coordinates.
Proposition 5.6 (Error from losing multiplier information)
Let and . Suppose a nonempty set of allowed entries stays on fixed active soft-threshold branches throughout , and , with equal to on and zero elsewhere. If a deterministic encoder merges , some decoded primal prediction errs by at least . If the encoding takes at most values on and the decoded primal error is uniformly at most , then ; a -bit encoding needs . For an -Lipschitz decoder, (Appendix D).
Discarding is the case . The bound concerns information, not a unique register layout. Appendix D proves the result and gives a matching midpoint-quantization bound.
6 How Many Updates Are Enough?
We now ask how many updates suffice to reach a target accuracy while the multiplier, penalty and step size stay fixed. The bound requires contraction, a region the updates cannot leave, and a rounding-error bound valid throughout that
Roy and Karmakar
region. Fix finite , set , and write for the primal map. This describes one penalty stage, before the controller changes its settings.
When each update reduces the error. Let denote the Hessian of restricted to the allowed-edge subspace. With and , its quadratic form is
(10)
Its last term is positive semidefinite. If uniformly on a convex region, , then for the primal map contracts with
The choice gives .
Checking the curvature bounds. For , put . Lemma A.5 gives finite- constants with and as . A global sufficient lower bound is
where is the least eigenvalue of the loss Hessian on nonempty allowed columns. Alternatively, compute the actual masked Hessian at , with extreme eigenvalues , and set
(13)
If , these are uniform Hessian bounds on (Theorem A.7). A two-node example in Appendix A.10 passes this local test even when the global bound fails. Proposition A.9 gives a third test using interval arithmetic. Appendix A.10 proves all three.
Theorem 6.1 (Convergence within a fixed stage)
Informal statement: suppose is -Lipschitz, , on , and every decoded transition stays in and differs from by at most uniformly on . If , where , then exact and decoded trajectories starting in stay there. The exact primal map has a unique fixed point in , and after updates,
where .
For , target , and , a sufficient number of updates is
Each update is one constructed block of layers. Thus the execution depth is , with any initial encoding cost separate.
Appendix A.8 proves the invariant-ball and residual bounds, including the and cases. Corollary E.2 in Appendix E.4 shows how to choose precision so the updates stay in the region and reach the target accuracy.
When the bound applies in practice. The bound controls distance to a fixed point, which may still contain cycles. None of the three tests passes on 270 balls around 90 saved states. After further optimizing each fixed objective, the interval test passes at 46/90 centres with the recorded step size; 25 saved stage endpoints lie in these balls. The update bound excludes the earlier iterations and this additional optimization. Appendix F.3 gives the coverage protocol (Table 1) and the subsequent tests with repeated transformer blocks.
7 When Accurate Updates Recover the Graph
So far, we have measured agreement with Algorithm 1. Recovering the true graph also requires the solver itself to be accurate. The next result separates error from computation, optimization and finite data.
Roy and Karmakar


Figure 3: Benchmark topologies (top: ASIA, CANCER, EARTHQUAKE, SURVEY; bottom: SACHS, CHILD, ALARM). Median-SHD draw at , SHD beside each name; red dots are true edges; the column labelled “transformer” shows the direct arithmetic replay of the block. Last column, thresholded at 0.3: green kept by both, red missed by both, gold added by both; the black disagreement category is empty on every row.
Proposition 7.1 (Graph recovery from an error bound)
Informal statement: if the total error — computation, optimization, and statistical — satisfies , where is the weakest edge weight of a nonempty true graph, then thresholding the transformer's output at any — keeping the entries with , so that the endpoint is admissible — recovers the true edge set exactly.
The computation error is what Theorem 5.1 controls; is optimization error against the chosen reference and is statistical error including regularization bias, which can persist even with infinite data. Exact execution sets the first term to zero, which is why Section 8 keeps the solver's own output apart from the true graph .
Appendix A.9 defines the three errors and proves the threshold claim, including its certified-stage specialization.
8 Experiments
We ask how well the solver recovers graphs, whether the transformer reproduces its updates, whether training learns those updates, and whether replaying them yields the same graphs. In the solver comparison, Poly-prox, Poly-LBFGS
Roy and Karmakar
(1) generalization
(2) prompt
(3) proximal updates

Figure 4: What the trained models produce. Red dots mark true edges. (1) A softmax model trained at and applied at after 12 updates. (2) At , a collapsed-input linear model withholds , while a softmax model receives them; this illustration changes both architecture and state access. Table 4 separately tests write-back with identical inputs and architectures. (3) Reference-solver updates 1, 5 and 40. The right column is the solver's returned estimate. Colour shows , scaled within each panel; the rows use two illustrative problem instances.
and NOTEARS use and read-off threshold 0.3; edge weights come from . Appendix F gives the protocols, metrics and failure counts.
How well does the reference solver recover graphs? On linear SEMs up to 20 variables, continuous solvers and sort-regress have lower structural Hamming distance (SHD) than PC and GES on raw data. Poly-prox reaches median cycle constraint , versus for L-BFGS, with slightly higher SHD but acyclic thresholded outputs throughout the raw grid (Figure 6). This establishes a useful reference, not a leading estimator (Appendix F.4).
Does the transformer reproduce the solver update? We instantiate weights from alone and compare literal attention/FF execution with an independent matrix-power implementation. Across 254 finite-reference cases with , all sizes , random masks and varied controls, the maximum relative discrepancy is in and in . One additional reference case overflows. These tests encode each input anew. To test repeated execution, we also pass the construction’s full output directly through three blocks: 150 comparisons on 50 inputs have maximum Frobenius error . Appendix F.1 distinguishes these tests and documents a scratch-reset defect in the earlier implementation. Agreement on one update does not ensure correct reuse of the state.
The rounding bounds stay within the representable range in 129/135 serial-arithmetic tests. In six float16 cases, the bounds exceed that range even though the sampled outputs remain finite (Appendix F.2). Six float64 runs with fixed controls pass the full state between blocks, stay inside the verified regions and reach the distance target within the predicted number of updates (Table 2). These runs test the bound within a stage; convergence of the outer controller remains a separate question.
Can training learn the same update? We train width-64 attention blocks with four tied repeats at , using five seeds: 2460 transitions over 12 epochs or 24600 over 30. The loss is mean squared error in plus 0.05 times that in . Appendix F.6 gives the data, optimizer and treatment of failed runs.
One-step error is , so copying scores approximately 1. The 12-step metric is an unnormalized Frobenius distance, for which copying scores 0.86. With the smaller corpus, state-input softmax and linear attention score and on one step. With the larger corpus, softmax reaches and a learned-threshold map (Gregor and LeCun, 2010) reaches ; their trajectory errors improve to 0.40.
Roy and Karmakar



Figure 5: How close small trained transformers get to the exact update. One-step error is normalized so copying scores 1 (dashed line). Circles: trained and tested at p = 5; squares: transfer to p = 10. Top: smaller- and larger-corpus one-step errors, then smaller-corpus rollout distances. Bottom: identical state inputs with residual write-back or prediction from scratch; the latter stays above copying. Five training runs are attempted per condition; means and standard errors use finite run summaries (failure counts in Tables 3 and 4).
and 0.41. Transfer to fails: one-step errors rise to and , respectively (Figure 5, Table 3). Figure 4(1) shows how a plausible edge pattern can still have inaccurate weights.
Holding state inputs fixed, predicting the next state from scratch instead of adding a residual update raises the smaller-corpus errors to (linear) and (softmax). Figure 5 (bottom) and Table 4 isolate write-back; Figure 4(2) separately illustrates a model whose state inputs are withheld. These models have fewer layers and lack the construction’s bilinear sublayers. Whether training can learn the update using the full architecture remains open.
Does the transformer recover the same graphs? Arithmetic replay uses the reference controls on ASIA, CANCER, EARTHQUAKE, SURVEY, SACHS, CHILD and ALARM (Spiegelhalter and Cowell, 1992; Beinlich et al., 1989). Ten Gaussian noise draws per sample size yield 220 datasets, with one fixed weighting per topology (Appendix F.5). Replay and Poly-prox agree exactly in float64 on final weights, multipliers and thresholded graphs across all datasets. Both recover EARTHQUAKE and SURVEY perfectly and make identical mistakes on SACHS, CHILD and ALARM (Figure 3). Mean SHD on CHILD and ALARM is about 6.3 and 32, versus 5 and 21 for NOTEARS. Replaying the updates also reproduces the solver's estimation errors.
9 Discussion and Conclusion
A fixed-weight transformer executes the complete Poly-prox transition in logarithmic depth, carrying the graph and multiplier between blocks. The depth, information and rounding bounds specify its requirements; experiments distinguish exact construction from partial learning by ordinary attention models.
The guarantees apply to the stated update rule. The bound on the number of updates requires contraction, a region the iterates cannot leave, and a verified error bound. It excludes the adaptive controller and does not by itself ensure acyclicity or graph recovery. A learned executor should therefore be tested against the reference transition on identical states and controls, then with its full output fed back across updates. Graph accuracy alone cannot establish execution: an exact executor also inherits the solver's mistakes. Learning within the full constructed architecture remains open; initialization at the constructed weights is one concrete direction.
Roy and Karmakar
References
Ahn, K., Cheng, X., Daneshmand, H., and Sra, S. (2023). Transformers learn to implement preconditioned gradient descent for in-context learning. ArXiv, abs/2306.00297.
Akyürek, E., Schuurmans, D., Andreas, J., Ma, T.-Y., and Zhou, D. (2022). What learning algorithm is in-context learning? investigations with linear models. ArXiv, abs/2211.15661.
Aragam, B., Amini, A. A., and Zhou, Q. (2019). Globally optimal score-based learning of directed acyclic graphs in high-dimensions. In Neural Information Processing Systems.
Bai, Y., Chen, F., Wang, H., Xiong, C.-M., and Mei, S. (2023). Transformers as statisticians: Provable in-context learning with in-context algorithm selection. ArXiv, abs/2306.04637.
Beck, A. and Teboulle, M. (2009). A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM J. Imaging Sci., 2:183–202.
Beinlich, I. A., Suermondt, H. J., Chavez, R. M., and Cooper, G. F. (1989). The alarm monitoring system: A case study with two probabilistic inference techniques for belief networks. In Conference on Artificial Intelligence in Medicine in Europe.
Bello, K., Aragam, B., and Ravikumar, P. K. (2022). Dagma: Learning dags via m-matrices and a log-determinant acyclicity characterization. ArXiv, abs/2209.08037.
Chen, T., Fu, D., Jia, R., and Sharan, V. (2023). Transformers learn to achieve second-order convergence rates for in-context linear regression. Advances in Neural Information Processing Systems 37.
Chen, W., Drton, M., and Wang, Y. S. (2018). On causal discovery with an equal-variance assumption. Biometrika.
Chickering, D. M. (2002). Optimal structure identification with greedy search. J. Mach. Learn. Res., 3:507–554.
Colombo, D. and Maathuis, M. H. (2012). Order-independent constraint-based causal structure learning. J. Mach. Learn. Res., 15:3741–3782.
Daneshmand, H. (2026). In-context learning for discrete optimal transport: Can transformers sort? In The 29th International Conference on Artificial Intelligence and Statistics.
Daubechies, I., Defrise, M., and Mol, C. D. (2003). An iterative thresholding algorithm for linear inverse problems with a sparsity constraint. Communications on Pure and Applied Mathematics, 57.
de Luca, A. B. and Fountoulakis, K. (2024). Simulation of graph algorithms with looped transformers. ArXiv, abs/2402.01107.
Deng, C., Bello, K., Aragam, B., and Ravikumar, P. K. (2023). Optimizing notears objectives via topological swaps. In International Conference on Machine Learning.
Garg, S., Tsipras, D., Liang, P., and Valiant, G. (2022). What can transformers learn in-context? a case study of simple function classes. ArXiv, abs/2208.01066.
Giannou, A., Rajput, S., yong Sohn, J., Lee, K., Lee, J. D., and Papailiopoulos, D. (2023). Looped transformers as programmable computers. ArXiv, abs/2301.13196.
Gregor, K. and LeCun, Y. (2010). Learning fast approximations of sparse coding. In International Conference on Machine Learning.
Jin, K., Ng, I., Zhang, K., and Huang, B. (2024). Revisiting differentiable structure learning: Inconsistency of penalty and beyond. ArXiv, abs/2410.18396.
Kaiser, M. and Sipos, M. (2021). Unsuitability of notears for causal graph discovery when dealing with dimensional quantities. Neural Processing Letters, 54:1587 – 1595.
Ke, N. R., Chiappa, S., Wang, J. X., Bornschein, J., Goyal, A., Rey, M., Weber, T., Botvinick, M. M., Mozer, M. C., and Rezende, D. J. (2022). Learning to induce causal structure. ArXiv, abs/2204.04875.
Loh, P.-L. and Bühlmann, P. (2013). High-dimensional learning of linear causal networks via inverse covariance estimation. J. Mach. Learn. Res., 15:3065–3105.
Lorch, L., Sussex, S., Rothfuss, J., Krause, A., and Schölkopf, B. (2022). Amortized inference for causal structure learning. ArXiv, abs/2205.12934.
Monga, V., Li, Y., and Eldar, Y. C. (2019). Algorithm unrolling: Interpretable, efficient deep learning for signal and image processing. IEEE Signal Processing Magazine, 38:18–44.
Nazaret, A., Hong, J., Azizi, E., and Blei, D. M. (2023). Stable differentiable causal discovery. ArXiv, abs/2311.10263.
Roy and Karmakar
Ng, I., Ghassami, A., and Zhang, K. (2020a). On the role of sparsity and dag constraints for learning linear dags. ArXiv, abs/2006.10201.
Ng, I., Huang, B., and Zhang, K. (2023). Structure learning with continuous optimization: A sober look and beyond. In CLEaR.
Ng, I., Lachapelle, S., Ke, N. R., Lacoste-Julien, S., and Zhang, K. (2020b). On the convergence of continuous constrained optimization for structure learning. In International Conference on Artificial Intelligence and Statistics.
Nichani, E., Damian, A., and Lee, J. D. (2024). How transformers learn causal structure with gradient descent. ArXiv, abs/2402.14735.
Peters, J. and Buhlmann, P. (2012). Identifiability of gaussian structural equation models with equal error variances. Biometrika, 101:219–228.
Peters, J. and Bühlmann, P. (2015). Structural intervention distance for evaluating causal graphs. Neural Computation, 27:771–799.
Reisach, A. G., Seiler, C., and Weichwald, S. (2021). Beware of the simulated dag! causal discovery benchmarks may be easy to game. In Neural Information Processing Systems.
Reisach, A. G., Tami, M., Seiler, C., Chambaz, A., and Weichwald, S. (2023). A scale-invariant sorting criterion to find a causal order in additive noise models. Advances in Neural Information Processing Systems 36.
Sachs, K., Perez, O. D., Pe'er, D., Lauffenburger, D. A., and Nolan, G. P. (2005). Causal protein-signaling networks derived from multiparameter single-cell data. Science, 308:523 – 529.
Seng, J., Zecevic, M., Dhami, D. S., and Kersting, K. (2024). Learning large dags is harder than you think: Many losses are minimal for the wrong dag. In International Conference on Learning Representations.
Shazeer, N. (2020). Glu variants improve transformer. ArXiv, abs/2002.05202.
Shimizu, S., Hoyer, P. O., Hyvärinen, A., and Kerminen, A. J. (2006). A linear non-gaussian acyclic model for causal discovery. J. Mach. Learn. Res., 7:2003–2030.
Spiegelhalter, D. J. and Cowell, R. G. (1992). Learning in probabilistic expert systems. In Bernardo, J. M., Berger, J. O., Dawid, P., Smith, A. F. M., Bernardo, J. M., Berger, J. O., Dawid, P., and Smith, A. F. M., editors, Bayesian Statistics 4: Proceedings of the Fourth Valencia International Meeting, Dedicated to the memory of Morris H. DeGroot, 1931–1989. Oxford University Press.
van de Geer, S. A. and Bühlmann, P. (2012). -penalized maximum likelihood for sparse directed acyclic graphs. arXiv: Statistics Theory.
von Oswald, J., Niklasson, E., Randazzo, E., Sacramento, J., Mordvintsev, A., Zhmoginov, A., and Vladymyrov, M. (2022). Transformers learn in-context by gradient descent. In International Conference on Machine Learning.
Wang, X.-Y., Wang, S., and Huang, B.-W. (2026). Transformer is inherently a causal learner. ArXiv, abs/2601.05647.
Wei, D., Gao, T., and Yu, Y. (2020). Dags with no fears: A closer look at continuous optimization for learning bayesian networks. ArXiv, abs/2010.09133.
Yu, Y., Chen, J., Gao, T., and Yu, M. (2019). Dag-gnn: Dag structure learning with graph neural networks. ArXiv, abs/1904.10098.
Zhang, Z., Ng, I., Gong, D., Liu, Y., Abbasnejad, E., Gong, M.-M., Zhang, K., and Shi, J. Q. (2022). Truncated matrix power iteration for differentiable dag learning. ArXiv, abs/2208.14571.
Zheng, X., Aragam, B., Ravikumar, P. K., and Xing, E. P. (2018). Dags with no tears: Continuous optimization for structure learning. In Neural Information Processing Systems.
Roy and Karmakar
Supplementary Materials
A Proofs and Derivative Bounds
This appendix proves the gradient, execution, state-error, conditioning, update-count and graph-recovery results used in the main paper.
A.1 Proof of Proposition A.1
Proposition A.1 (Update gradients). , and with , ,
(15)
The proximal map of , where is the convex indicator (0 on and off it, not the indicator 1 used for the mask), is .
Proof. since and is symmetric. For by cyclicity of the trace, and , so . The chain rule gives the third identity; the proximal claim separates over entries of .
A.2 Proof of Lemma A.2
Lemma A.2 (The constraint's gradient vanishes exactly on DAGs). For ,
Hence iff and the edge lies on a directed cycle of of length at most . Consequently iff , i.e. iff is acyclic.
Proof. Expand in (15); the term is , which vanishes off the diagonal, giving (16). Since entrywise, every is entrywise non-negative and every coefficient is positive, so the sum in (16) vanishes exactly when every one of its terms does; walks of different lengths cannot cancel. A nonzero is a weighted directed walk of length from to using edges of (since iff edge is present); together with the edge this closes a cycle of length through , and conversely every such cycle contributes such a walk. Since every simple cycle has length at most , this range of detects every cycle in .
Feasibility and KKT stationarity. At a feasible , Lemma A.2 removes the constraint term from the finite-multiplier KKT equation. On this leaves , which is equivalent to masked-Lasso optimality by convexity. For example, take , both off-diagonal entries allowed, with , and . Then and , but both allowed least-squares gradient entries are ; no subgradient in cancels them. This feasible point is nonregular and is not a KKT point. The stage-stationary family in Appendix A.6 approaches precisely such a non-Lasso-stationary feasible limit by letting the effective multiplier diverge.
A.3 Proof of Theorem 4.1
Theorem 4.1 (Exact execution of one Poly-prox update). Fix , , . There is a block of layers, at most four linear heads per layer of key dimension at most , embedding width , and at most ReLU units and bilinear units per feedforward sublayer, such that for every , every symmetric , binary zero-diagonal , , , , and , the block computes exactly as in (3)–(4). The weights are the same for every and every input, with nonzero magnitudes in ; they depend on , not the data.
Roy and Karmakar
Proof. Put and define
Induction gives and : the first recurrence squares , and the second multiplies by . Thus and , since has zero diagonal. The three-head doubling layer and the eight preparation, threshold, trace and write-back layers are specified coordinate by coordinate in Appendix B. They compute the least-squares gradient, assemble the masked pre-threshold state, apply the exact ReLU identity, then repeat the squaring pass on to update . Two s-layer passes and eight other layers give depth .
The selector formulas in that appendix realize every matrix product, transpose, sum and broadcast with at most four heads. Their feedforward maps use signed ReLU pairs for linear writes and one bilinear unit per coordinate product, giving the stated resource bounds. Forbidden primal entries and padded columns remain zero, while the final layer clears scratch exactly. Hence the same weights serve every , and the output encoding is a valid input to the next block. Induction on stacked blocks proves Corollary 4.2.
A.4 Proof of Theorem 5.1
Theorem 5.1 (Accumulation of update errors). If is -Lipschitz in on a set containing , , and the decoded transition satisfies , then with ,
Proof. Writing , the triangle inequality gives . Unrolling this scalar recurrence proves (18), with empty products equal to one and empty sums equal to zero.
A.5 Proof of Lemma A.3
Lemma A.3 (Multiplier information must be retained). Fix , , , , , and , let , and write . If for some , and at least one of , lies outside the dead zone of the soft-threshold, then the augmented gradients differ and so do the updates, . Hence any deterministic executor that returns exactly must retain information distinguishing from .
Proof. By (15) the least-squares term and do not depend on , so , which is nonzero at ; hence . By Lemma A.2, forces , so and with . The map is nondecreasing, strictly increasing outside , and zero on it; so for , only if both lie in , which the hypothesis excludes. Thus . A deterministic executor given identical encodings for the two multiplier values would return identical outputs, so its encodings of and must differ.
A.6 Proof of Proposition 5.3
Masked stationarity. The effective multiplier need not have the same magnitude as alone. All stationarity residuals are taken inside the linear subspace . Let and . Define by , with subspace subdifferential
(19)
Every is zero on forbidden entries and has norm at most . Set
the stationarity residual of the convex masked Lasso problem with acyclicity dropped, so exactly at its minimizers. For , is -stationary if some satisfies
We use the subspace subgradient rather than the unbounded full-space normal cone of an indicator of (Appendix A.6).
Roy and Karmakar
Throughout this proof, , and are the subspace quantities in (19)–(20). Their subgradients are bounded by ; no full-space normal-cone term is included. Since , is itself supported on . Proposition 5.3 (Growth of the effective multiplier). Let and , with no sign assumed, and suppose is -stationary for the augmented objective: there is with
Let . Then
If with , , and is not a masked-Lasso minimizer (so ), then for any Lipschitz bound of near ,
for all large ; in particular for large .
Proof. Since , the residual is at most . Inserting and splitting it off, then using (22) on what remains,
In the other direction, , because every element of has Frobenius norm at most . This is (23); only enters, so the sign of plays no role.
The minimum in (20) is attained on a nonempty compact subgradient set. To see lower semicontinuity, take any convergent sequence and a subsequence realizing the liminf of ; choose a minimizing subgradient at each point. Their common norm bound gives a further convergent subsequence, and the closed graph of places its limit in the subgradient set at the limit point. Continuity of then shows that the liminf is at least the limiting point's residual. Thus gives for large , and with eventually, the left half of (23) gives . In particular . Since (Lemma A.2) and is -Lipschitz near , for near , so
which is (24). The right side is finite only if , which the previous step already guarantees, and it is unbounded as , so .
A two-node example with faster multiplier growth. Take , , , , and . Then , both allowed entries of equal , and setting makes every allowed stationarity equation exact for small . We see that as , faster than the general 1/dist rate above, so that rate is a lower bound rather than the exact order everywhere. This example realizes the proposition's stationarity hypothesis exactly.
A.7 Proof of Corollary 5.4
Corollary 5.4 (Relative cycle accuracy). Under the hypotheses stated there, .
Proof. Write for the assembled gradient and for the computed one; the covariance is exact by hypothesis, so the least-squares term cancels and
The first term has norm at most . For the second, , so its norm is at most . Adding,
The right half of (23), which uses only -stationarity (22) and no sign of , bounds by , which is the claim.
Relative accuracy of alone does not imply relative accuracy of , because the sum may cancel for signed . For exact and absolute gradient error at most , the bound is instead , which permits amplification as grows. Neither model forces a particular realized error. The literal block's operation-level absolute enclosure is given in Appendix E.
Roy and Karmakar
A.8 Proof of Theorem 6.1
Theorem 6.1 (Convergence within a fixed stage). Let , suppose is -Lipschitz on with , let , and suppose every approximate transition stays in and is within of on . If , both exact and approximate iterations from stay in ; has a unique fixed point ; and, writing ,
For any , . If only a decoded next state is available, the bound is : the local error is added in the numerator.
Proof. For , ; setting proves exact invariance too. Banach's theorem gives a unique fixed point of in this closed ball, with , hence . The one-step error satisfies for . Summing the geometric series and using proves (25). Finally, gives the residual certificate. Replacing by its approximate value adds at most to the numerator.
If , zero updates suffice. If , one update has error at most , unless the initial bound already meets the target. The fixed point may be cyclic; the update bound assumes fixed controls.
A.9 Proof of Proposition 7.1
Proposition 7.1 (Graph recovery from an error bound). Let be any reference matrix (e.g. an empirical minimizer or the numerical limit) with and . Under Theorem 5.1, , where bounds . If the true graph is nonempty with and , every threshold recovers the exact support under the strict rule , and hence the acyclic graph . The rule must be strict at the left endpoint: a true zero can attain , so an inclusive test would keep it when .
Proof. By the triangle inequality and , every true zero is estimated within and every true edge within at least .
Corollary A.4 (Graph recovery within a verified stage). Suppose Theorem 6.1 holds with error , contraction and fixed point . Assume the true graph is nonempty and there is a reference with and . If , choose any and use the update bound (14), with the stated and conventions. Then thresholding at any , where , recovers the exact support under the strict rule .
Proof. The stage bound gives . Add the two reference errors and apply Proposition 7.1. For an empty true graph, any strict threshold removes all entries. The reference-error bounds remain assumptions.
A.10 Derivative Bounds and Convergence Within a Stage
All derivatives in this subsection act on , with its Frobenius inner product, and is binary and zero-diagonal. Let . Assume at least one edge is allowed, hence and ; if none is allowed,
Roy and Karmakar
the primal state space is and its dynamics are trivial. For , set and define
The powers are polynomial bounds, so at these formulas are interpreted directly. The quantities and below are the derivatives of along allowed directions, with the output projected to if needed.
Lemma A.5 (Zero-diagonal derivative bounds). For and ,
Consequently, for fixed and , the masked gradient of is Lipschitz on with
The constants are no larger than the simpler, N-independent bounds
In particular their orders at the origin are , , , , respectively, uniformly in on bounded ranges of .
Proof. Put and . Since and ,
All traces are nonnegative because is entrywise nonnegative. For , the Frobenius trace inequality and submultiplicativity give . Summing gives (26). The linear term disappears because the diagonal is zero; on unrestricted matrices a bound of this order can fail.
Write . Expansion and the induced matrix norm give . Because on , the exact gradient is , and hence , using . The identity cancellation is valid along every allowed direction.
For arbitrary matrix directions , differentiate the finite power without assuming commutativity. There are placements of its first derivative and ordered placements of its second derivative. With and , this gives
For the second derivative is zero. The directions of are and , so their norms are bounded by and , respectively. Thus
has norm at most . Differentiating again yields
Roy and Karmakar
The first two terms contribute to the bilinear operator bound, and the last contributes . This proves the bound . Projection to allowed coordinates is nonexpansive. Integration along the line segment between and in the convex ball proves the two Lipschitz inequalities.
For completeness, the full smooth Hessian, restricted after taking directions in , is
where and . Its norm is bounded by (35), proving the masked-gradient Lipschitz claim. Finally, the binomial bounds and give the exponential bounds, and their Taylor expansions give the stated orders. No finite-precision assumption is used in these derivative bounds.
Corollary A.6 (Stage contraction and global sufficient curvature). Fix , , and . If convex has masked strong-monotonicity constant and masked-gradient Lipschitz constant , then gives contraction with . If, more specifically, on , then every gives the sharper spectral factor . For , sufficient Hessian bounds are and
whenever . Empty allowed columns are omitted.
Proof. The allowed-edge proximal map is nonexpansive in the Frobenius norm. For and , strong monotonicity and Lipschitzness imply
Under uniform Hessian bounds, instead write , with . This symmetric operator has spectrum in , so . The argument holds on every branch of the soft-threshold map.
For (37), the loss quadratic form obeys . In (36), is explicitly dropped only from the lower bound, while . The upper bound retains the rank-one term through .
For this global sufficient test, positivity requires positive definiteness of each nonempty , and therefore . The local stage Hessian also carries penalty curvature, so this requirement belongs to the global test alone. For fixed finite , tends to as . The unsharpened bound imposes the radius-independent restriction ; the sharpened removes it. A suitable radius around a given nonzero stage centre still has to be checked.
Theorem A.7 (Uniform local Hessian certificate). Let , , and . Let and be the least and greatest eigenvalues of the actual masked Hessian , including its rank-one penalty term. Put and
Then for every ,
If , set and choose . The primal map contracts on with the spectral factor from Corollary A.6. If in addition a decoded block has uniform error at most on and , then all conclusions of Theorem 6.1 apply, with total depth .
Proof. The loss Hessian is constant. Write and . The Hessian difference in (36) is
Every segment from to is inside . The first term is bounded by . For the second, the mean value bound gives . The rank-one difference has norm at most , hence at most before multiplication by . Adding proves the operator norm bound. Applying it to unit allowed directions proves both spectral bounds. The contraction corollary and the separate invariance hypothesis then give the remaining conclusions.
Roy and Karmakar
Remark A.8 (Point curvature and numerically computed Hessians). The local test uses the centre eigenvalues and the variation radius . Invariance of the chosen ball is a separate condition from a positive eigenvalue at . If the computed symmetric masked Hessian has certified operator error at most , one may use and . Certified upper bounds for the other constants and for are also needed for a numerical certificate. Merely evaluating these quantities in floating point without error enclosures is an empirical diagnostic.
Proposition A.9 (Verified interval Hessian certificate). Fix finite stage controls , , and . Let , , and . Assume the number of allowed entries is positive and use one coordinate per allowed entry. Let be a finite entrywise enclosure of the actual masked Hessian for every in the coordinate box on allowed entries, with forbidden entries fixed at zero. Let be any recorded matrix with finite entries for which a verified bound gives , . Enclose every , , entrywise by a finite interval matrix , and set
If , the bounds
give uniformly on . Thus the contraction and update bounds of Theorem 6.1 apply whenever the recorded step size gives , a verified centre displacement and a uniform primal block error satisfy , and the implementation preserves the mask and valid persistent encoding. For the literal block, the latter error and encoding hypotheses are supplied under the kernel and range assumptions of Theorem 5.5 and Corollary E.2. An approximate eigenvector matrix may be used as ; no unverified eigenvalue is used in this conclusion.
Proof. The Frobenius ball is contained in the stated coordinate box. Each actual masked Hessian is symmetric, so is symmetric. Its entries lie in , and Gershgorin's theorem therefore gives . The Gram bound implies , hence is invertible. For , compare with . Positivity of gives the lower ratio and the upper ratio , proving the claimed Hessian bounds. Corollary A.6 and the separate displacement, error and invariance tests give the remaining conclusions.
Obtaining the interval matrix. For the finite polynomial constraint, put . For allowed entries and , the exact derivative formulas are
The trace derivative gives the first identity. Differentiating it with and the product rule for gives the second. The constant loss Hessian has entries . Evaluating these finite sums, products and powers with outward interval arithmetic, then using
gives the required entrywise enclosure. The value can be enclosed without subtracting nearly equal traces by starting , repeatedly setting , and taking for . The verification must record operation order, outward arithmetic and finite endpoints; evaluating these formulas in ordinary floating point alone is not an interval certificate.
For the spectral step, an outward maximum absolute row-sum bound on the symmetric matrix supplies e. The formulas for and must also be enclosed outward in a numerical implementation. For the centre
Roy and Karmakar
displacement, exact rational evaluation of the nominal binary inputs and the soft-threshold branch, followed by an outward square-root bound, supplies . These computations concern the recorded finite-sample covariance and fixed controls, not the population graph or the changing controller. If there are no allowed entries, the primal space is a singleton and the spectral test is unnecessary.
For example, with , , , , and , , the centre is a fixed point. Its masked Hessian eigenvalues are 0.599968 and 2.200224. At radius 0.01, , so , and give . The centre displacement is zero and the error allowance is 0.003. The global test is negative even with the sharper constants. This illustrates a certified neighborhood of a cyclic fixed point; it supplies no graph-recovery guarantee.
B Transformer Construction and Computational Cost
This appendix gives the weights and state layout used in Figure 2 and Theorem 4.1, including how temporary values are cleared before the next update.
B.1 Where the State Is Stored
Put and . Use zero-based coordinate indices. For , the wide register occupies , in the order
Scalar coordinate , has the following meaning:
| j | Register | j | Register |
|---|---|---|---|
| 0 | 9 | ||
| 1 | 10 | ||
| 2 | 11 | ||
| 3 | 12 | ||
| 4 | 13 | ||
| 5 | 14 | ||
| 6 | 15 | ||
| 7 | 16 | ||
| 8 | 17 |
The flags and five input controls occupy the first seven scalar coordinates. All eleven remaining scalar coordinates and all nine wide scratch registers start at zero. Variable row has , , identity , and padded rows of . The control row has the reverse flags, the five controls, and zero wide registers. The barred scalars are broadcasts on variable rows, separate from the corresponding control-row quantities; this prevents a reset from deleting an input control.
B.2 Attention and Feedforward Weights
For a wide register , let select its columns, and . For a scalar register , let be its -dimensional selector column, and . Use the following fixed heads, all read from the same pre-attention residual stream within a layer:
A value map may route to several target registers; for example copies into both and . The first pattern adds . Thus gives , and gives . Control-row identity is zero, and is the padded identity. The other two patterns sum a per-variable scalar into the control row and broadcast control scalars onto variable rows, respectively.
To add a fixed linear residual increment , use the ReLU branch
Roy and Karmakar
Zero target columns can be omitted, so this needs at most 2d ReLU units. For a product of source coordinates , use one bilinear unit with , . Its row in is the desired fixed output routing vector. In particular one square unit can write both and . Several products concatenate their selector columns. A residual overwrite includes the linear increment and the routed expression , evaluated from the same pre-FF stream. Soft-thresholding uses the two preactivations and , routed to with coefficients 1, -1. Here is still zero on entry to the threshold layer.
B.3 What Each Layer Computes
The following list specifies every head and every product. Linear resets and assignments use (44); unlisted registers are preserved. Attention precedes FF in each complete layer.
-
Initialize and the four scalar products. There is no attention. The FF products are ( units), routed to with coefficients , and (four units), routed to . Reset .
-
Repeat times, with no FF: heads , , and add , , to their specified targets. With the existing residuals this is exactly and . All three heads read the old , .
-
With no attention, overwrite by , using bilinear units. The control-row result is zero.
-
Use four heads: , , , and . Their initially zero targets receive , , and the two broadcasts. The following FF has products: into , into , and into , with the linear addition . Thus is formed in the control row only after the sum head has supplied .
-
Use , then the FF overwrite . It uses 2P products. The multiplier-weighted assembly follows the previous layer's computation of .
-
With no attention or bilinear units, write , using 2P ReLU units.
-
With no attention, overwrite , with the square products of , routed with coefficients , and reset . This uses bilinear units. Old , , are removed by their linear residual increments.
-
Repeat the same s three-head layers on these new S, Q.
-
Overwrite d by the new diagonal readout, again with P bilinear units. This reset removes the first pass's old d.
-
Use , followed by one product into . In the same FF sublayer add to the primal register and erase all nine wide and eleven scalar scratch registers. The product reads before they are erased, so the control row becomes .
There are eight single layers and two s-layer passes. This list proves that every input to an operation has already been formed; there is no sequential computation hidden within one FF branch.
B.4 State Preservation, Width and Depth
Only variable rows carry the wide matrices. Wide control-row scratch remains zero, and only the designated scalar broadcasts are nonzero on variable rows. Every padded matrix column remains zero: the identity, data, mask and initial primal state have this property, and row products, transposes and coordinate products preserve it. The allowed-edge mask is required only for the persistent primal register and the masked registers B, HS, X, V, . It is not imposed on S, Q, SW, ST; those scratch matrices may contain nonzero entries at forbidden primal positions.
At the threshold layer, X is masked by its explicit product with M, HS is masked by its product with W, and hence V is masked. Since on variable rows, soft-thresholding preserves those zeros, including all padding. The final layer clears scratch exactly in real arithmetic, keeps , M, id, flags and controls fixed, and writes , to persistent coordinates. It therefore establishes the clean-input invariant for the next block. In floating point, resets and overwrite errors are analyzed by Appendix E, rather than assumed absent.
The indexed schedule has at most four heads per layer, key dimension at most , ReLU units, and
bilinear units per FF sublayer. The first layer needs products; the gradient-preparation layer needs . The other counts are as listed above. Consequently the bound holds for , and the general literal schedule needs 5 and 6 products at , where would give 3 and 5. The count is an upper count
Roy and Karmakar
for this schedule; the single-variable primal problem itself is trivial. The depth, embedding width, head bound and asymptotic resource orders are unchanged.
Every selector entry, sign, reset coefficient and routing coefficient has magnitude 1 or 2, except the square-to-S coefficient 1/N. The ReLU linear realization copies these magnitudes and signs. Thus all nonzero parameters have magnitudes in and depend on P alone, including the unused padded selector coordinates.
B.5 Arithmetic Cost and Parameter Storage
For , there are active tokens and coordinates. Each complete layer has a constant number of -wide projections and at most four heads. Dense projection/product kernels use at most operations at the largest served size, giving per update for . Working activations can be streamed with storage; retaining every layer's activations would instead use .
Dense untied parameter matrices occupy numbers. The explicit selector representation has nonzero coefficients per layer, and hence in the full stored schedule. The identical doubling layers can also share one parameter template. An working-memory statement therefore does not include materializing separate dense parameters or saving all activations. These counts are arithmetic/number-storage bounds, not finite-bit precision bounds. For the counts are constant.
C Why Exact Execution Needs Logarithmic Depth
One counted layer is a residual linear-attention sublayer followed by a residual bilinear/ReLU sublayer as in (6). All heads within a sublayer read the same input. Width, head count and token count are finite and fixed along the scalar input family below; parameters are independent of that input. Fixed affine biases or output projections are allowed. Encoding and readout are affine, with no external writes inside the block. Softmax, normalization and division by a variable are outside this class.
How polynomial degree grows with depth. If the input coordinates are polynomials of degree at most , the queries, keys and values have degree at most , and each attention output has degree at most . On an interval where all ReLU signs are fixed, the ReLU branch does not raise this degree, while the bilinear branch raises it to at most . Residual sums and affine maps do not increase these bounds. Each nonzero polynomial preactivation has finitely many roots; identically zero ones add no boundaries. A finite network therefore has a finite partition into open intervals and boundary points, with polynomial output degree at most on each open interval for affine input. Increasing finite width or head count changes the partition, but not the degree bound.
Inputs that require high-degree outputs. Let , , , , , and , , with any fixed . The exponent is even for . With , the eigenvalues of are and . Thus
Their degrees are 2N and 2N - 1, with leading coefficients and . Hence has degree , positive leading coefficient and tends to infinity as . Choose an open interval with . The allowed loss-gradient entries are , so the pre-threshold entries are , on the negative active branch. Therefore
The primal degree is with nonzero leading coefficient . The multiplier degree is with leading coefficient . Lower-degree terms cannot cancel either coefficient.
Proof of Theorem 4.3. On a nonempty open subinterval of the active family, the network’s affine readout is polynomial of degree at most . Exactness on that interval implies polynomial identity with for the primal output, and with for the multiplier. Thus for primal execution and for full-state execution, proving the integer bounds. Since , the upper construction and lower bound both have order .
The hard family has two variables but uses the specified exponent ; this is not a lower bound for every two-variable DAG solver. Uncounted nonlinear preprocessing or readout can change the degree argument. Approximation, exactness on a finite test set, and normalized attention are not covered. For , , the outputs reduce to and , verifying both degrees directly.
Roy and Karmakar
D Error from Losing Multiplier Information
Fix the data, mask, primal state and controls, and let and . On every fixed active branch in , soft-thresholding subtracts a constant signed threshold. Thus its output difference on is . Nonexpansiveness of the mask and soft-threshold gives the complementary upper bound:
The lower bound needs the active-branch hypothesis; the upper bound holds for every pair of multipliers.
Proof of Proposition 5.6. If the encoder merges two multipliers, their common prediction cannot be within less than half their output separation of both targets. This proves the paired-state claim. If a decoder is -Lipschitz and each prediction has error at most , the triangle inequality through both predictions gives
For an encoder taking at most values, each nonempty fibre therefore has diameter at most . Its closed interval hull has that length, and at most such hulls cover of length . Consequently . This requires neither measurable nor contiguous fibres. Substituting gives the bit bound.
When the lower bound is attained. Partition into equal bins and decode each bin to the exact update at its midpoint. The upper separation bound gives uniform error at most . When all nonzero-gradient entries remain on fixed active branches, , so this attains the lower bound. For instance, at , , , , and , for . Both branches are active and . The bits count the whole multiplier-dependent code; the claim does not prescribe a register layout or an average-case learning rate.
E Rounding Bounds for the Constructed Block
We bound rounding errors through the operations in Appendix B, including both constraint evaluations and all changes to the stored state. The bound is computed from the weights and input bounds, so it applies beyond the sampled executions. It may be conservative and depends on the specified arithmetic implementation with fixed controls. Section 6 uses it to bound the number of updates needed for a target accuracy.
E.1 Arithmetic and inputs
Let be the unit roundoff. For each scalar addition, subtraction and multiplication assume
with finite intermediates, exact negation, and exact zero operations (zero products/results and addition of zero). Stored controls satisfy , and the stored threshold is nonnegative. The allowance covers a specified underflow mode; setting requires the relative model to hold for every nonzero intermediate. A flush-to-zero kernel needs its own valid . ReLU is exact on stored values. Matrix products are classical dot products in the recorded order, or kernels with the same proved bound. Unmodeled casts, reduced-precision products, or reassociation require a new graph or a replacement kernel bound. No softmax or normalization is part of this architecture. The dyadic weights , identity, flags, mask, and are exactly represented; otherwise their conversion errors must be included as inputs.
For a dot product of length k, define
Entrywise absolute values and inequalities are used below. A classical matrix product obeys
where is its inner dimension and has its output shape. Products on the right are exact nonnegative matrix products. The usual relative dot-product proof bounds the product of at most rounding factors by . There are at most additive rounding noises from products and sums, each amplified by at most ; this proves the stated, slightly loose, underflow allowance. Exactly zero or monomial selector products may instead be treated as exact when that fact follows from their operands and the kernel.
Roy and Karmakar
The nominal state is with the fixed covariance and controls of the intended real-arithmetic update. The encoded input has clean scratch. Input bounds include covariance/control conversion when the intended values differ from the stored ones. To compare one update at its current decoded floating-point , that is the nominal input, so its input error is zero; the difference from an earlier exact trajectory is handled by Theorem 5.1, not counted again as a new conversion error.
E.2 Bounding the Error in Each Layer
For a nominal graph node A and its computed value , carry two nonnegative arrays
Constants have , when exact. Given valid input bounds, the following rules propagate them. Write
For a matrix product of inner dimension , use
For , use
For an entrywise product , use
ReLU permits , , since it is 1-Lipschitz. Transpose, exact copy, and exact negation permute or retain these bounds. A cast with parameters , permits and . Use the actual signs and exact-zero structure to tighten these rules where justified, rather than replacing a literal operation by an algebraically different solver replay.
Expanding each layer into arithmetic operations. For each head expand
Bound the three projections, the score product and the value product in that order. Sum the heads and add the residual in the recorded order. From that attended state bound , its ReLU, and the product with ; separately bound , , their entrywise product and its product with . Sum the two feedforward branches and add the residual in the recorded order. These are precisely the linear-attention and bilinear/ReLU layers of Section 4. The same rules cover both squaring passes, the loss product , scalar assembly and broadcasts, the two threshold preactivations, the old-to-new scratch overwrites, and the final , writeback. Inner dimensions are read from these products; in particular, a dense projection's dimension must not be silently replaced by .
Proof of Theorem 5.5. For multiplication, . Taking entrywise absolute values gives . Equation (48) bounds the arithmetic error at the computed operands by . The scalar arithmetic model proves the sum and entrywise-product rules. ReLU's Lipschitz property proves its rule even at a threshold crossing. Induction over the finite directed computation graph proves every enclosure, including all residual additions. Extracting the output coordinates gives
Thus the decoded state error in the product norm of Section 5 is at most .
For a uniform certificate on a specified region, choose uniform input , and apply these monotone nonnegative rules once. For example, on one may use , or the looser , with fixed covariance and controls bounded explicitly. This bounds all representable decoded inputs in ; include input rounding if the implementation first converts arbitrary real inputs. Compute the bounds exactly or with outward rounding. A rounded estimate of an enclosure is not itself a certified upper bound.
With fixed finite input bounds, each tends to zero as and the input/weight error bounds tend to zero: this follows by induction from the formulas, , and . This continuity assertion presumes an admissible arithmetic family with sufficient range. To justify the finite-intermediate hypothesis, also check the range of products and partial sums inside each kernel, using absolute-sum majorants or the scalar-expanded graph. Bounded mathematical inputs alone do not exclude implementation overflow.
Roy and Karmakar
Passing the state to the next block. Immutable input columns, identity, flags and mask receive no writes and are preserved exactly by the selector construction. Forbidden entries of remain exactly zero: the loss term is multiplied by , the cycle term is multiplied by , their pre-threshold combination is zero there, and the two ReLU branches give for the stored . Zero padding is preserved for the same reason. Choose the final scratch clears as pure coordinate negations followed by the residual addition: for finite stored . They are exact, so the next block starts with clean scratch. At , the multiplier increment is exactly zero and stays fixed. All these statements require finite operands; in particular the second pass still runs when , and cannot be used as a zero increment. If a different implementation perturbs supposedly immutable columns or does not clear scratch exactly, enclose and carry those extra state coordinates between blocks instead of claiming the two-register state invariant.
E.3 Replacing Stored Values and Recomputing the Constraint
A new value in a residual stream is generally written by subtracting the old one and adding the residual. This is not an exact assignment in floating point and must appear in the graph enclosure.
Lemma E.1 (Residual writeback). For a finite stored vector , a target , and a computed target with , suppose the writeback is . For written coordinates under (46),
(53)
Proof. Let . Componentwise, . The next addition then gives . Use and , and take Frobenius norms. The coefficient of is .
For example, binary32 round-to-nearest with , gives and . Binary64 has the same example with . The intermediates are normal and finite. Thus a relative-error bound depending only on the new value cannot cover general residual writeback.
In the block, this applies to , to the second initialization , and to overwritten diagonal scratch. The old is the first-pass polynomial value and need not be small relative to the new . The first-pass relative model therefore cannot simply be restarted. Use its actual absolute initialization error and the full graph rules (49)–(51) through the second pass, trace, multiplier increment and final writeback. Clearing alone does not remove these other errors. These terms are why Theorem 5.5 analyzes the literal residual layers rather than replacing the reset and assignment by exact operations in an arithmetic replay.
E.4 Choosing Precision for a Target Accuracy
Corollary E.2 (Precision needed for a target accuracy). Fix the stage controls with and a ball with uniform curvature and contraction factor from Section 6. Obtain from Theorem 5.5 using uniform input bounds on , including any covariance and control conversion errors, and verify the range of all operations in both passes. Use the exact mask, padding and scratch invariants of Appendix E. With , a sufficient precision test for an invariant ball and target tol is
Then Theorem 6.1 and (14) apply with : the error floor is and each update uses transformer layers. If the invariance slack is strictly positive and conversion errors tend to zero, sufficiently accurate members of an arithmetic family with adequate range meet this test. No fixed dtype is asserted to work for every input or stage.
Proof of Corollary E.2. The uniform input enclosure on , with the stated kernel and range checks, supplies a bound for every implemented transition at a representable decoded input in that ball. The exact-zero properties above give the mask and clean-scratch invariants; preserves the fixed multiplier exactly. The radius argument of Theorem 6.1 is . It therefore applies at each decoded iterate. The error recurrence and sufficient update count follow from that theorem with .
If and the target tolerance is positive, there is a positive error allowance satisfying both inequalities in (54). The enclosure tends to zero with arithmetic and conversion errors for fixed finite bounds. An admissible family with sufficient range therefore has sufficiently accurate members meeting that allowance. The corollary is an existence statement together with a computable selection test, and each dtype and kernel still needs its own range audit. A small
Roy and Karmakar
u cannot compensate for an insufficient exponent range, and changes made by the outer controller lie outside the certificate.
F Experimental Details and Additional Results
This appendix gives the protocols and additional results for Section 8. Measurements from repeated blocks, snapshots and different radii are dependent. We count nonfinite results as failures and state when averages exclude them.
F.1 Single Updates and Repeated Execution
The 254 finite-reference checks use the legacy executor.run wrapper, which freshly encodes each input, executes attention/FF layers, and decodes . Capacities are 4, 8, 16, 32, with all , three mask densities, varied scalar controls and both values of . The independent reference uses matrix powers. Maximum relative errors are in and in . One additional reference case overflows in the second constraint evaluation: a large step sends a finite input to at .
The indexed construction in Appendix B is checked separately at capacities 1, 2, 4, 8, 16, ten input seeds each. Its 50 one-block comparisons have maximum Frobenius error and zero multiplier error. Three-block reuse of the full output encoding gives 150 comparisons, with maximum error and multiplier error ; the maximum discrepancy from a clean encoding is . These are sampled float64 checks, not uniform certificates.
Why repeated execution needs a separate test. Direct reuse of the legacy implementation’s full residual stream leaves scratch scalars that contaminate later blocks. A three-block audit has maximum errors in W and 0.101 in ; an explicit final-scratch reset reduces them to and . The indexed specification includes these clears. The historical 180-case bridge to arithmetic replay reports finite full states in 178 cases and two failures on re-audit. We therefore use indexed full-stream comparisons and the verified serial continuations below as persistence evidence. Fresh-encoding agreement and arithmetic replay alone do not establish that property.
F.2 Rounding Errors at Different Precisions
The grid uses , five input seeds, input scales 0.01, 0.1, 0.5, radius 0.01, and float16/32/64: 135 cases in total. Evaluation is serial, unfused and left-to-right; exact rational arithmetic at the nominal binary64 inputs supplies the reference. Point and uniform-ball enclosures include input conversion. All sampled executions are finite and below their point-error envelopes. Maximum errors are , and for float16/32/64, respectively; multiplier maxima are , and .
The uniform range test passes 129/135 cases. The six failures are float16 at scale 0.5: with seed 4, and with seeds 0–4. Their sampled intermediates remain finite, but uniform majorants exceed 65504. All reset/immutable-coordinate discrepancies are zero. Median point-bound/error ratios are approximately 6960, 6270 and 8270 by dtype, so these sufficient bounds are conservative. Neither sampled containment nor this serial arithmetic certificate supplies a uniform guarantee for an unspecified kernel.
F.3 Testing the Update Bound with Repeated Blocks
The captured corpus has 30 Gaussian linear-SEM instances: , ten seeds per dimension, , Erdős–Rényi graphs of expected degree two, and . Three snapshots per trajectory give 90 centres. Freezing recorded with , neither the sharp-global nor local-Hessian test certifies a ball at radii 0.001, 0.01, 0.1; the verified interval retest also gives 0/270. Six two-node control balls pass the analytic tests. Snapshots and radius attempts are dependent measurements, not independent instances.
For each snapshot, take the last saved state V with matching , , and polish that fixed objective by L-BFGS-B on split positive/negative variables for at most 1500 iterations. This proposes centre U; the update bound excludes these preliminary optimization steps. Test radii 0.1, 0.03, 0.01, 0.003, 0.001, 0.0003, 0.0001, 0.00003, 0.00001, 0.000003, 0.000001 in descending order. One policy retains recorded ; the other chooses a binary64 value near , which defines a new fixed map. Stop at the first passing radius and retain failed attempts in the denominator.
Outward binary64 interval products enclose the Hessian and basis Gram error; Gershgorin gives uniform curvature. Rational evaluation of the nominal proximal map bounds the centre displacement . The literal serial graph gives
Roy and Karmakar
and range bounds. Acceptance requires , finite enclosures, , and . The update counts are verified using outward-rounded bounds on . Table 1 reports coverage.
| Protocol | Radius attempts | Passing snapshots | Saved inside | |||
|---|---|---|---|---|---|---|
| Original centres, recorded | 270 | 0/90 | 0 | 0 | 0 | 0 |
| Polished centres, recorded | 725 | 46/90 | 21 | 12 | 13 | 25 |
| Polished centres, new | 636 | 67/90 | 30 | 20 | 17 | 27 |
Table 1: Verified interval fixed-stage tests. Each dimension has 30 snapshots from ten SEM instances; snapshots and radius attempts are not independent experimental units. The polished policies retain one passing ball per successful snapshot. The last column counts saved matching-control endpoints in that policy’s passing ball, not automatically successful continuations of the original adaptive controller. Only 2 and 4 original snapshot states, respectively, lie in the polished passing balls.
For starts at half the ball radius, the sufficient number of updates ranges from 43 to 379087 with the recorded step size, and from 24 to 269405 with the new one. The largest passing error floors are and , respectively. Passing the test can therefore still require many updates. Failing it does not establish that the map is noncontractive.
| Starting policy | Seed | Snapshot | Certified updates | Final verified distance bound | |
|---|---|---|---|---|---|
| Seeded half-radius perturbation | 3 | 5 | 0 | 134 | |
| Seeded half-radius perturbation | 5 | 0 | 0 | 43 | |
| Seeded half-radius perturbation | 10 | 3 | 0 | 978 | |
| Saved matching-control endpoint | 3 | 8 | 0 | 186 | |
| Saved matching-control endpoint | 5 | 9 | 0 | 426 | |
| Saved matching-control endpoint | 10 | 3 | 0 | 546 |
Table 2: Repeated execution of the constructed block in serial float64 arithmetic. All use the recorded step size and , with controls fixed throughout. Within each starting policy and dimension, the selector prefers the recorded-step policy and selects the smallest positive predicted update count, up to 5000. All six trajectories remain finite, stay inside their verified balls, retain exactly clean scratch/immutable coordinates, and meet the fixed-point distance target by the predicted update count. Final bounds use exact rational a posteriori residuals divided by , or the verified triangle bound through the centre, whichever is smaller.
Each continuation feeds back the full residual stream and checks ball membership and clean encoding at every transition. Perturbation starts use a seeded masked direction at half-radius; endpoint starts encode once. Both use . These six runs reach their targets within the predicted update counts. They test these specific fixed-control cases; they do not validate all passing balls or the adaptive controller. Their targets are stage fixed points, which need not be acyclic or statistically correct.
F.4 Additional diagnostics for the reference solver
We compare Poly-prox, the direct implementation of Algorithm 1, with Poly-LBFGS (same polynomial constraint, L-BFGS optimizer) and NOTEARS (L-BFGS, matrix-exponential constraint), which separate the effect of the constraint from that of the optimizer, and with sort-regress, PC and GES. The grid covers Erdős–Rényi and scale-free linear SEMs with expected degree 1, 2 and 4, Gaussian and Laplace noise, and , each on raw data and after rescaling columns to unit variance; is used only at expected degree 2, Gaussian noise and .
Each grid cell has three input seeds; raw and standardized versions share a data draw. Poly-prox starts at , , , uses at most 12 outer stages and 400 proximal steps per stage, with acyclicity tolerance and stationarity tolerance . The reference L-BFGS methods allow 40 outer stages and 200 inner iterations, with acyclicity tolerance . All three use and threshold 0.3. PC uses stable Fisher-z tests at level 0.05; GES uses the BIC score. Sort-regress regresses each variable on those with smaller marginal variance. The implementations are solver.py and baselines.py; the grid runner is run_reference.py. Greedy score search provides a classical alternative (Chickering, 2002). Continuous constraints can create optimization difficulties (Kaiser and Sipos, 2021; Seng et al., 2024); convergence of augmented-Lagrangian methods requires separate hypotheses (Ng et al., 2020b). Raw-scale performance can reflect variance ordering (Reisach et al., 2021, 2023), and comparisons depend on optimization and evaluation choices (Ng et al., 2023). Regularized DAG scores can fail to recover the target even at the population level (Jin et al., 2024). Published biological networks provide another evaluation setting (Sachs et al., 2005); our retained recovery experiment uses synthetic observations on fixed benchmark topologies.
Roy and Karmakar
Figure 6 gives the mean SHD at . On raw data varsortability averages 0.96 and the continuous solvers and sort-regress stay ahead of PC and GES; rescaling each column to unit variance drops it to 0.52 and makes sort-regress the worst method at , while PC and GES, unaffected by column scaling, do not move. Poly-prox pays a small price for its optimizer, reaching a median constraint value near against the tolerance both L-BFGS solvers meet, so its SHD sits a little above theirs, though its thresholded output is acyclic in every raw simulation.
raw

standardized

Figure 6: Accuracy of graph recovery. Lower structural Hamming distance (SHD) means fewer edge mistakes. Each bar averages 36 simulations with 1000 observations; error bars show standard errors. On raw data, the continuous solvers and sort-regress outperform PC and GES. Rescaling each variable to unit variance makes sort-regress the worst method at 20 variables. PC and GES are unchanged by this rescaling.
F.5 Benchmark topology protocol
The recovery experiment keeps each benchmark’s directed support and uses one fixed weighted linear Gaussian SEM per topology, with edge magnitudes in and random signs. Sample sizes are on every topology, plus on CHILD. Noise is Gaussian with variance one; columns are centered without standardization. The fixed topology order is ASIA, CANCER, EARTHQUAKE, SURVEY, SACHS, CHILD, ALARM. For zero-based topology index , weight and data seeds are SeedSequence([1000+i, 1]) and SeedSequence([2000+i, m, draw]). Ten draws per sample size produce repeated observations of each fixed graph, not independent graph weightings. The experiment uses direct arithmetic replay under the reference solver’s accepted controls and multiplier events; it does not run the attention/FF residual graph for all datasets.
Across 220 datasets, the final Frobenius and largest-entry weight gaps, multiplier gap and thresholded graph disagreement are exactly zero in float64. Figure 3 displays the median-SHD draw at . SHD is computed after
Roy and Karmakar
thresholding at 0.3. The agreement establishes inheritance of these reference computations; it does not certify recovery of the underlying graph or transfer to other weightings of the same topology.
F.6 Training Models with and without State Updates
We train ordinary tied-weight attention models on Poly-prox transition labels, with five independent training runs per reported condition, and compare their decoded outputs with the reference update. These models use four tied attention/ReLU repeats; they do not instantiate the full-depth bilinear architecture of Theorem 4.1. The experiments measure output agreement for these architectures and budgets, rather than learnability of the guaranteed construction. Table 3 includes a collapsed-input model that withholds , whereas Table 4 holds state access fixed and changes residual write-back.
How we summarize runs and report failures. For one-step error, each training run is summarized by its median test error, and tables report the mean and standard error of finite run summaries. The trajectory metric is the unnormalized 12-update Frobenius error and is aggregated separately. All conditions have five attempted training runs. A bracketed marks nonfinite run summaries excluded from that cell's mean; “non-finite (all)” means all five failed, and standard errors require at least two finite summaries. Finite-only means are conditional summaries, not a success rate or an unconditional expected error.
Objective and data. The independently drawn random-transition component uses a random DAG on nodes, Erdős–Rényi or scale-free with equal probability and expected degree from ; observations from the linear SEM of Section 3 with Gaussian or Laplace noise, each with probability , and column standardization applied with probability ; a state with i.i.d. off-diagonal entries; and controls , . The label is the exact Poly-prox update of that state. Each corpus also contains states the solver actually visits: twelve evenly spaced iterates from each of several short proximal runs, labelled the same way, which is 960 of the 2460 transitions and 9600 of the 24600. States from a shared solver run are dependent observations. Random-transition labels use , while solver-derived primal labels use . The ordinary models receive no explicit input, so their multiplier supervision mixes two update policies. This does not alter the primal target, but the shared training loss can still affect fitted parameters; these experiments do not isolate why primal learning fails. The loss is the mean squared error in the entries of plus 0.05 times the mean squared error in , minimized with AdamW at learning rate , batch size 64 and gradient-norm clipping at 1. Models are trained at with rows padded to and evaluated at without retraining. The five-seed runner is experiments/run_train_seeds.py, using models from run_train.py. Held-out tests are fixed across training seeds: 200 random transitions at (input seed 1), 120 at (seed 2), and 24 twelve-step trajectories at (seed 3). Training seeds vary initialization, training data and minibatch order; the test corpus is shared.
Figure 4 uses plot_heatmaps.py: a five-node instance with seed 22 and a ten-node instance with seed 83, both with 800 Gaussian observations, expected degree two and raw scale. The displayed model outputs follow 12 updates. The right column is the reference solver's returned estimate, while red dots mark true edges. These examples are illustrative, not averages.
| Model | trajectory error, 12 updates | ||
|---|---|---|---|
| paper-size corpus | |||
| softmax, with memory | |||
| linear, with memory | |||
| linear, no memory (collapsed input) | |||
| learned-threshold unroll | |||
| corpus, epochs | |||
| softmax, with memory | |||
| linear, with memory | |||
| linear, no memory (collapsed input) | |||
| learned-threshold unroll | |||
Table 3: Trained update executors, mean standard error over five attempted training runs. Step error is normalized so that copying the input scores 1; the median over test cases is taken within a seed. A bracketed count gives the seeds whose value was non-finite, which are excluded from that mean; trajectory means are dominated by a few divergent seeds.
Roy and Karmakar
Updating the current state or predicting it from scratch. The collapsed-input model in Table 3 withholds and predicts the next state from scratch. Its inputs do not determine the target update. Table 4 therefore holds state access, architecture, parameter count and training recipe fixed, changing only whether the model predicts a residual update or the whole next state. At the smaller corpus, removing write-back raises one-step errors from 0.98 to 10.44 for linear attention and from 0.94 to 10.98 for softmax. At the larger corpus, softmax closes part of this gap at (1.70 versus 0.67), but not at (14.82 versus 1.56). Because step error is normalized by a potentially small true update, imperfectly reconstructing the incoming can incur a large score. The comparison supports residual parameterization under this recipe; it does not establish necessity of a particular state encoding.
| Attention | Residual write-back | error | error | trajectory error |
|---|---|---|---|---|
| softmax (paper-size) | persistent () | |||
| softmax (paper-size) | absent (output from scratch) | |||
| linear (paper-size) | persistent () | |||
| linear (paper-size) | absent (output from scratch) | |||
| softmax (large corpus) | persistent () | |||
| softmax (large corpus) | absent (output from scratch) | |||
| linear (large corpus) | persistent () | [2] | ||
| linear (large corpus) | absent (output from scratch) | [3] |
Table 4: Residual write-back with identical inputs, five training runs. “Persistent” writes the update back into the state registers, ; “absent” gives the model the same inputs and the same parameter count but produces and from scratch. One-step errors are normalized so that copying scores 1; the trajectory column is the unnormalized after twelve unrolled updates. A bracketed count gives the seeds whose value was non-finite, excluded from that mean. These are the numbers quoted in Section 8.
F.7 Checking the Relative-Error Bound
Figure 7 connects the conditioning results to numerical examples. Panel (1) compares direct arithmetic replay with an independent matrix-power update on eight states per , at capacity and . This is a replay check, separate from the literal attention/FF tests in Appendix F.1. Panels (2)–(3) use the stationary two-node family in Appendix A.6, with , , and exact . Multiplying by , with , keeps the assembled gradient error below as in Corollary 5.4. Because , perturbing has no effect in this example: it tests relative gradient accuracy with an exact coefficient. Adding to each off-diagonal gradient entry instead amplifies the error from 0.0035 to 6.7 as grows from 25 to . Panel (4) adds to the multiplier after each update at the origin, realizing the undamped drift in Remark 5.2. The protocol and saved values are in experiments/run_exact.py and experiments/results/exact_execution.json.
Roy and Karmakar
(1) one update

(2) multiplier

(3) gradient error

(4) drift at the origin
Figure 7: Arithmetic replay and conditioning checks. (1) One-update replay error across eight states per dimension. (2) Effective-multiplier growth in the two-node stationary family. (3) Relative gradient perturbations remain below the bound of Corollary 5.4; fixed absolute perturbations are amplified as grows. (4) Undamped multiplier error accumulates as while .
Roy and Karmakar
F.8 How Stationarity Changes During Optimization
Figure 8 summarizes 30 saved Gaussian linear-SEM trajectories: ten input seeds for each , with , and polynomial exponents , respectively. There are 44508, 46590 and 47282 accepted primal outputs by dimension (138380 total). These are arithmetic-replay states, not literal-transformer activations. Each output uses its own recorded pre-controller ; later controller changes can alter and the augmented residual without changing .
The masked-Lasso residual and the smallest augmented residual use the definitions in Appendix A.6. For the relevant smooth gradient , each allowed nonzero entry has residual ; at an exactly zero entry it is . Forbidden entries are excluded, and the Frobenius norm gives the residual. No support threshold replaces exact zeros. At the last primal output, median is 0.00338, 0.00661 and 0.0136 by dimension. None of these endpoints has in absolute norm. The plots show finite compensation of the Lasso residual by the cycle term, while changing controls can increase the augmented residual. They do not demonstrate , convergence to an acyclic non-Lasso limit, or multiplier divergence, and do not certify the adaptive outer controller.

Figure 8: Stationarity along saved accepted primal outputs, using each update's pre-controller controls. At each of 101 normalized progress fractions , trajectory contributes its saved index . Lines are medians and bands are minima/maxima over ten input-seed trajectories per dimension, not confidence intervals. The horizontal axes do not align outer-stage boundaries. The plotted first point is the first primal output; at the separately recorded initial , and . Finite control changes can increase the augmented residual as the constraint and its gradient decrease.