Differentiable Exact Learning
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
Differentiable Exact Learning
Hristo Papazov∗
Francesco D’Angelo
Nicolas Flammarion
arXiv:2611.21486v1 [cs.LG] 16 Nov 2026
Department of Computer Science, EPFL
Abstract We introduce a framework for differentiable exact learning that couples an unbounded external environment to a state-tracking neural controller, which we train on policy-trajectory observations (PTOs): expert behavior traces that expose observations and actions while hiding internal states. In addition to the learning framework, we introduce Differentiable Finite-State Transducers (DFSTs) which use multilinear updates, support log-parallel training, and emulate arbitrary finite-state controllers, yielding computational universality through environmental interaction. From tiny training datasets, compact DFSTs achieve extreme length generalization on arithmetic and universal-simulation tasks. We replicate the success of DFSTs on RNNs and GRUs, thereby supporting a broader learning recipe: State-Tracking Controller + Unbounded External Environment + PTOs = Extreme Length Generalization. Beyond length generalization, our metric-extraction protocol recovers interpretable discrete controllers from trained DFSTs, which we prove equivalent to the target arithmetic and universal-simulation algorithms. Furthermore, for our Softmax DFST models, simply taking argmax over the transition probabilities yields discrete controllers which provably exactly perform universal Turing-machine simulation and binary arithmetic. Proving exact learning for the neural controllers requires assumptions, which we empirically support. We make our code, training recipes, model weights, and proof checkers publicly available.
162,108 Parameters
Seen Tasks
Copy
Unseen Tasks
≥ 1,000
mult10 10,000 PTOs
≥ 500
Reverse
≥ 500
Bit-Delete
≥ 500
Cum-Sum
≥ 500
Flip
≥ 500
Parity
≥ 500
5,280 Parameters ≥ 1,000
mult2 100 PTOs
8,227 Parameters ≥ 5,000
add10 250 PTOs
Shift-Right
891 Parameters ≥ 5,000
add2 25 PTOs
3
5
10
100
1,000
10,000
≥ 500
75 PTOs
Scaling-B
≥ 500
universal
Scaling-A 1
≥ 500
4,335 Parameters
Shift-Left
1
Input Length (Log Scale)
≥ 500
5
10
100
1,000
Input Length (Log Scale)
Figure 1: Extreme Length Generalization from Small PTO Datasets and Compact Controllers. Length generalization by DFST models trained from scratch on arithmetic and universal-simulation tasks. Shading marks the length of inputs seen during training. Our models see computation traces of inputs with ≤ 3 digits for addition and ≤ 5 digits for multiplication. On the universal task, DFSTs see simulation traces of 5 Turing machines on inputs of up-to 5 symbols and generalize to 5 unseen Turing machines. Endpoints mark successful length-generalization reaching a pre-defined testing cap. ∗ Corresponding author: hristo.papazov@epfl.ch
40th Conference on Neural Information Processing Systems (NeurIPS 2026).
1
Introduction
For decades, researchers have sought to make neural networks learn algorithmic procedures from data, arguing that genuine machine intelligence requires exact recovery of underlying rules rather than matching surface-level statistics (Solomonoff et al., 2006; György et al., 2025). Yet arithmetic, the canonical testbed for algorithmic learning, continues to expose a persistent gap. Transformers and RNNs trained on input-output data generalize only marginally to longer inputs (Delétang et al., 2022). Even an extensive arsenal of scratchpad protocols, positional-encoding schemes, and input-formatting tricks brings Transformer length generalization2 to 2–7× the training operand length, with exact-match accuracy swiftly decaying as inputs lengthen (Hou et al., 2025; Y. Zhou et al., 2024; Cho et al., 2024a). The Neural GPU (Kaiser and Sutskever, 2015) stands out by reaching 100× length generalization on random binary arithmetic instances, although later diagnostics expose long-carry and symmetric-input failures (Price et al., 2016) (see Table 1). Such finite-test success leaves exactness on arbitrarily long inputs unresolved. A relevant exception comes from the recursive Neural Programmer-Interpreter (NPI) (Reed and De Freitas, 2015; Cai et al., 2017), which provably recovers decimal addition and several sorting algorithms. However, the training uses a stronger form of supervision through recursive call/return annotations that goes beyond merely observing expert actions in an external environment. In contrast, real learners routinely succeed under exactly this restriction. Indeed, children acquire complex procedural skills by observing adults perform goal-directed actions, with no access to the adults’ internal neural processes. From such behavior traces alone, infants infer the underlying procedural structure and reproduce the target behavior through practice (Meltzoff and Moore, 1995). Motivated by the success of natural learners, this paper entertains the idea of gradient-based exact algorithmic learning from behavior observations and provides a simple recipe for achieving extreme length generalization with compact controllers trained from scratch on small datasets (see Figure 1). To our knowledge, this work provides the first differentiable exact recovery of a fixed universal interpreter with correctness proofs covering arbitrary simulations of Turing machines with unbounded input lengths and unbounded execution horizons. We similarly achieve exact differentiable recovery on addition and multiplication tasks. Our training withholds expert control states and the learned interpreter requires no retraining when exchanging input programs. We just need two ingredients: sufficiently informative observations and a sufficiently expressive learner. Sufficiently Informative Observations. The choice of training data determines the possibility of exact learning. Gold (1967) proved that no algorithm can identify the class of recursive functions in the limit from input–output examples alone (Gold, 1967, Theorem I.5). Moreover, the impossibility persists in the active-learning setting (Gold, 1967, Theorem I.3). Hence, supervised learning from (z, f (z)) pairs and reinforcement learning rewarded only for correct output without a helpful curriculum cannot identify every recursive function in general. To navigate between this general identification barrier and the additional (strong and unrealistic) program-structure supervision of NPIs, we adopt policy-trajectory observations (PTOs) as our training signal. PTOs record how the environment evolves under the expert’s policy without exposing the expert’s internal state transitions.3 This middle ground carries two advantages: (i) PTOs avoid Gold’s impossibility barrier (Papazov and Flammarion, 2025, Theorem 16); (ii) PTOs admit a natural interpretation as behavior observations – the learner only observes how the world changes under the expert’s actions. Sufficiently Expressive Learner. Since we target exact learning of arbitrary algorithms, the learner must belong to a Turing-complete model class. Prior work establishes Turing-completeness for Transformers and RNNs through assumptions that preclude effective optimization: unbounded arithmetic precision (Siegelmann and Sontag, 1992; Pérez et al., 2019), unbounded context windows (Dehghani et al., 2018; Bhattamishra et al., 2020; Merrill and Sabharwal, 2023a), or non-differentiable environmental interaction (Chung and Siegelmann, 2021; Schuurmans et al., 2024). We propose a simpler workaround that preserves finite precision and fixed-size contexts, allowing for effective gradient-based optimization. The key idea couples a state-tracking4 controller – such as an RNN, LSTM, or GRU – to a dynamically resizing external environment in which the controller can move, read, and write. Because the environment grows as needed, computation no longer bottlenecks on the 2 Defined in the referenced papers as achieving above 95% exact-match accuracy (EMA). 3 Recovering an algorithm with PTOs mirrors more realistic learning-from-demonstration settings (Argall et al., 2009). 4We define state-tracking as capable of simulating arbitrary finite-state automata given sufficient model capacity.
2
controller’s fixed internal memory. Zaremba and Sutskever (2015) explored a related architecture pairing an LSTM controller with external tapes, but trained via reinforcement learning on input–output rewards alone, which Gold’s theorem renders insufficient for exact learning in general. We hope to revive and strengthen this architectural idea through the richer PTO supervision. Thus, our learning recipe distills into a simple equation: State-Tracking Controller + Unbounded External Environment + PTOs = Extreme Length Generalization.
In fact, we go a step further and introduce a simple extraction procedure, which recovers discrete controllers from our trained neural models. We prove that the extracted controllers exactly follow the target behavior and hence certify the following method for differentiable exact learning of algorithms: Learn Differentiably
Observe PTOs 1
0
1
+
Extract
Read
1
Read, Write, Move
1 State-Tracking Neural Controller Discrete Controller Predict Write and Move
Expert States Hidden
Extreme Length Generalization
Provably Equivalent to Expert
Main Contributions. 1. A Conceptual Framework for Differentiable Exact Learning. We revive the idea of achieving Turing-complete differentiable computation through a state-tracking neural controller coupled to an unbounded external environment. Training on a small number of PTOs yields extreme length generalization. Subsequent extraction establishes exact learning for the recovered discrete controllers across the studied tasks and for the neural controllers subject to stability assumptions. 2. Differentiable Finite-State Transducers (DFSTs). We introduce a (i) minimalist, (ii) multilinear, (iii) differentiable, (iv) state-tracking, and (v) parallelizable model family whose members serve as controllers in our experiments. DFSTs use no nonlinear activations, admit log-parallel training via prefix scans (Blelloch, 1990), and offer a transparent structure for studying the loss landscape of algorithmic learning and the useful implicit bias of gradient descent. 3. Extreme Generalization from Small PTO Datasets. We train on small PTO datasets (25 traces for add2, 100 for mult2, 250 for add10, and 10000 for mult10) and reach robust testing caps of 5000 digits for addition and 1000 digits for multiplication. The training operands contain at most 3 and 5 digits, respectively. We replicate the extreme length generalization on binary arithmetic using RNN and GRU controllers thereby supporting our generalization recipe. 4. Exact Learning of a Universal Controller. A 4335-parameter DFST trained from scratch on just 75 PTOs from 5 program simulations over inputs of at most 5 symbols reaches the 500-symbol evaluation cap across 10 tasks, including 5 held-out programs. From trained DFST models, our extraction procedures recover controllers provably equivalent to the expert universal interpreter and capable of simulating arbitrary programs on any input lengths and execution horizons. 5. Extraction and Verification of Exact Learning. A lightweight extraction procedure applied to trained DFSTs recovers compact FSTs. Eight proofs establish exact expert-policy equivalence across binary and decimal arithmetic and universal simulation. Additional empirically verified assumptions prove the equivalence of the trained neural controllers to the experts. Remark. An earlier workshop version introduced DFSTs and reported considerable arithmetic length generalization (Papazov et al., 2025). The present work simplifies training; pushes length generalization to the extreme; and adds learned universal simulation, Softmax DFSTs, recurrentcontroller comparisons, and exact-equivalence certificates for extracted controllers. Paper Organization. Section 2 formalizes PTO-learning, DFSTs, and the studied algorithmic tasks. Section 3 expands on our arithmetic and universal experiments, with a short passage on the implicit bias of gradient descent. Section 4 explains FST extraction and verification of correctness. We refer the reader to Section A for a thorough discussion of related work. 3
wt−1
wt
pt−1
DFSTθ
pt
state update A[xt ] ht−1 1
1
1
0
1
1
0
observation xt
ht−1
write σt
ht
1 σt
1
0
1
1
0
move µt B[xt ] ht−1
argmax
C[xt ] ht−1
argmax
σt ∈ Σ write µt ∈ M move
Figure 2: One Step of the DFST Agent. Left: the grid wt−1 before the action; the agent at position pt−1 reads the symbol in the red cell as observation xt . Center: the DFSTθ controller updates the hidden state via ht = A[xt ] ht−1 and produces the discrete outputs σt = arg max(B[xt ] ht−1 ) ∈ Σ (write) and µt = arg max(C[xt ] ht−1 ) ∈ M (move). Right: the resulting grid wt ; the orange cell shows the symbol σt written at pt−1 , and the agent has shifted to pt in the teal cell. We provide an interactive viewer that animates expert and trained neural controllers.
2
Preliminaries
As discussed in the introduction, our recipe for exact learning couples a state-tracking controller to an unbounded external environment. 2.1
Policy-Trajectory Observations
We model the external environment as a symbolic grid. Definition 2.1 (Symbolic Grid). Given a finite alphabet Σ containing the empty symbol λ, a grid configuration w : Z2 → Σ assigns a symbol w(p) ∈ Σ to each cell p ∈ Z2 such that only finitely many cells differ from λ. The symbolic grid G = G(Z2 , Σ) denotes the set of all such configurations. The finiteness requirement captures the idea that the environment grows as needed but never stores an infinite amount of information at any point in time. We now formalize the agents that inhabit the grid. Definition 2.2 (Grid Agent). A grid agent over the symbolic grid G(Z2 , Σ) stands for a finite-state transducer T = (Q, Σ, Γ, δ, γ, q0 , qf ), where Q denotes a finite set of states, Σ serves as both the read alphabet and the write alphabet, Γ = Σ × M with M = {L, R, U, D, S} forms the output alphabet pairing a grid symbol with a motion direction, δ : Q × Σ → Q specifies the state-transition function, γ : Q × Σ → Γ specifies the output function, q0 ∈ Q denotes the initial state, and qf ∈ Q denotes the halting state. The agent always starts at p0 = (0, 0). The agent occupies a single cell pt ∈ Z2 at each time step t, reads the symbol xt+1 = wt (pt ), produces an output γ(qt , xt+1 ) = (st+1 , mt+1 ) that writes st+1 at position pt and shifts the agent’s position by mt+1 , and transitions to state δ(qt , xt+1 ). We adopt the convention that every transition containing the stop motion S leads to the halting state qf , and all transitions from qf satisfy δ(qf , x) = qf and γ(qf , x) = (x, S) for every x ∈ Σ, rendering qf a dead state that leaves the grid unchanged. Note that a grid agent perceives only one cell at a time. Future work could explore richer perception mechanisms encoding the contents of multiple cells and agents interacting with a larger motion vocabulary. Since standard Turing machines arise as a special case of grid agents restricted to a single row, the class A of all grid agents achieves computational universality when interacting with G. PTOs. At each time step t, an external learner observing agent T perceives only the written symbol st ∈ Σ, the motion mt ∈ M, and the observation xt that triggered the action. Importantly, the internal state qt remains hidden. The resulting sequence (xt , st , mt )Tt=1 constitutes a policy-trajectory observation (PTO), matching the formalism of Papazov and Flammarion (2025). Crucially, Papazov and Flammarion (2025, Theorem 16) proved that PTOs enable exact identification of any computable function in the limit – a guarantee unachievable through input–output supervision alone (Gold, 1967). 4
Hardness. Each algorithmic task P comes with a set of valid inputs SP ⊆ Σ⋆ . Because the motion token outputted at each step constrains the next observation, SP may never cover all reachable transducer transitions, thereby making the learning problem fundamentally hard. Papazov and Flammarion (2025, Theorem 17) proved that no polynomial-mass characteristic set exists for this restricted-input regime, ruling out any algorithm that learns the policy of every grid agent from polynomially many polynomially long PTOs (see Section C.3 for details). 2.2
State-Tracking Differentiable Controllers
While Papazov and Flammarion (2025, Theorem 16) showed that a learning-by-enumeration strategy provably identifies any grid agent from PTOs, such an approach takes time and memory exponential in the size of the target expert agent. We instead pursue gradient-based learning by introducing a simple differentiable model that can serve as a grid-agent controller. Definition 2.3 (DFST). A Differentiable Finite-State Transducer (DFST) of dimension d over the symbolic grid G(Z2 , Σ) with motion vocabulary M comprises three trainable weight tensors A ∈ R|Σ|×d×d ,
B ∈ R|Σ|×|Σ|×d ,
C ∈ R|Σ|×|M|×d ,
and a trainable initial hidden state h0 ∈ Rd . At each time step t ≥ 1, the controller reads the one-hot encoding xt ∈ R|Σ| of the symbol at the current grid cell wt−1 (pt−1 ) and computes ht = A[xt ] ht−1 ,
ŝt = B[xt ] ht−1 ,
m̂t = C[xt ] ht−1 .
A drives the hidden-state recurrence, B produces scores over symbol tokens, and C produces scores over motion tokens. At inference time, the controller emits σt = argmax(ŝt ) ∈ Σ and µt = argmax(m̂t ) ∈ M, writing σt at position pt−1 and moving µt to pt (see Figure 2). The DFST recurrence and readouts use only input-indexed matrix-vector products, without nonlinear activations. This multilinear structure enables log-parallel training via prefix scans (Blelloch, 1990) and yields a compact parametrization. A d-dimensional DFST over an alphabet of size k = |Σ| with r = |M| motion tokens carries kd(k + d + r) + d trainable parameters, scaling as O(d2 ). Definition 2.4 (Softmax DFST). A Softmax DFST has the same recurrence and readout mechanism as a DFST, with trainable logits ΘA , ΘB , ΘC , θh parametrizing P [x]:j = softmax(ΘP [x]:j ),
P ∈ {A, B, C},
h0 = softmax(θh ).
Each column sums to one. Thus, the hidden state remains in the probability simplex and the readouts give distributions over writes and motions. Execution uses the same argmax decoding as a DFST. This parametrization makes extraction transparent: each column assigns probabilities to successors or actions, and concentration near a simplex vertex suggests a deterministic transition. The recurrence retains the associative matrix scan. Section 4 develops differentiable sharpening and the conditions for faithful extraction. Despite the simplicity of these architectures, both families support state tracking: Theorem 2.5 (DFST-Grid Universality). Any d-state grid agent admits exact emulation by a ddimensional DFST at any finite arithmetic precision, and by a (d + 1)-dimensional Softmax DFST with finite logits in exact real arithmetic. A d-dimensional Softmax DFST also suffices under rounded arithmetic whose softmax attains simplex vertices and whose recurrence preserves vertex operations. Consequently, both the DFST and Softmax DFST families achieve Turing-completeness on the symbolic grid under the respective arithmetic conditions. Section B gives the constructive proof and discusses non-uniqueness of DFST parametrizations and the relationship between hidden dimension and expert state count. More broadly, any sequential model capable of emulating a finite-state transducer can represent the policy of a grid agent and thereby compute any computable function on the grid. This class includes RNNs, LSTMs, and GRUs (Alon et al., 1991; Indyk, 1995; Siegelmann, 1996; Weiss et al., 2018; Merrill, 2019; Svete and Cotterell, 2023) whereas standard Transformers and diagonal SSMs face state-tracking limitations as demonstrated by Merrill and Sabharwal (2023b); Merrill et al. (2024). We focus on DFSTs due to the multilinear structure and simplicity of the model class, which we hope will inspire theoretical analysis of the implicit bias of gradient descent toward generalizing solutions. The DFST, RNN, and GRU experiments in Section 3 support this broader state-tracking perspective. 5
2.3
Experimental Setup
We study grid agents for binary and decimal arithmetic (add2, add10, mult2, mult10) and a universal grid agent U that simulates Turing machines over the {λ, 0, 1} alphabet. Table 2 summarizes expert state counts, alphabets, and runtimes for all implemented grid agents and Turing machines. Arithmetic Tasks. Each arithmetic agent receives z = a ◦ b, with ◦ ∈ {+, ×}, written horizontally on an otherwise empty grid. The agents execute the schoolbook algorithms for addition and multiplication, halting when only the result remains on the grid. Data Generation. Each arithmetic PTO dataset includes all R2 pairs of single-digit operands, then samples distinct pairs with independent uniform operand lengths in 1, . . . , q and digits in 0, . . . , R−1. Leading zeros remain part of the representation. Ordinary DFST datasets always use: add2: q = 3, N = 25; add10: q = 3, N = 250; mult2: q = 5, N = 100; mult10: q = 5, N = 10k. Length-Generalization Metrics. Uniform Length Generalization (ULG) records the operand length returned by a capped search requiring perfect next-action exact-match accuracy on ten random pairs of exactly that length. Robust Length Generalization (RLG) additionally requires perfect accuracy on structured repdigit probes and cannot exceed ULG. Every RLG evaluation tests all R2 repdigit pairs (am , bm ) with a, b ∈ {0, . . . , R − 1}. Every timestep must match both the expert write and motion. The Neural GPU motivates this distinction: strong generalization on random binary inputs (Kaiser and Sutskever, 2015) can coexist with failure on repdigit instances (Price et al., 2016). Section D.6 specifies the search, numerical execution modes, and limits of finite testing. Learning a Universal Interpreter. The universal grid agent U uses 15 states and alphabet + {0, 1, λ, X, Y, Z, L, R, S}. Given an encoding ⟨M, z⟩ of a Turing machine M and input z ∈ {0, 1} , U simulates M on z, halting with M (z) in a designated grid region whenever M halts. U uses 3 teleportation runes {X, Y, Z} to mark and jump directly between grid locations, shortening simulation trajectories. The grid stores an encoding of the currently simulated Turing machine M together with the input. From PTOs of the universal expert, a differentiable controller learns how to read and execute this program, without access to the internal states or transition map of U . The public repository provides model weights and animated executions. Data Generation and Evaluation. Universal datasets contain N ∈ {75, 150, 225} PTOs covering 5 programs, with binary input lengths at most 5. After sampling a random string for each program, the rest of the dataset comes from random program–input pairs. Evaluation covers 10 tasks, including 5 held-out programs and scaling tasks that increase both input length and program size. Section F details the rune mechanics, program/input encoding, and training and evaluation tasks. Controller Training. For each task, a manually designed expert supplies PTOs. We train controllers via next-action prediction with the MSE loss T 1 X ∥ŝt − 1st ∥22 + ∥m̂t − 1mt ∥22 , 2T t=1
where 1st and 1mt denote the one-hot encodings of the expert write and motion at time t. We train DFST controllers on all tasks, study Softmax DFSTs on binary arithmetic and universal simulation, and compare RNN and GRU controllers on binary arithmetic. Training always uses Adam (Kingma, 2014), batch size 32, and float32 precision. DFST Training. Unless otherwise specified, DFST hidden dimensions match the expert state counts. We always use a simple deterministic initialization. Transition matrices start at the identity, output matrices at zero, and the trainable initial state at 1d . All ordinary DFSTs runs use an exponential warm-up and cool-down learning-rate scheduler(Sections D.1 and D.2). Section B.3 examines successful learning with smaller and larger hidden dimensions. Softmax DFST Training. Softmax DFSTs apply the same initialization recipe to the logits before softmax normalization. The sweeps use one, two, or three times the expert state count and vary dataset size. Training uses 100k updates at constant learning rate 0.1 (and optional annealing towards approximately one-hot transition probabilities). Section D.4 gives the full training settings. 6
≥ 5000 ≥ 5000
500k
55
≥ 5000 ≥ 5000
250k
4582
≥ 5000
91
25k
50k
100k
500k
250k
8
41
51
≥ 1000 ≥ 1000
44
849
≥ 1000
45
25k
50k
100k
75
0
≥ 5000 ≥ 5000
50
0
≥ 5000 ≥ 5000
25
0
2
≥ 5000
11
22
33
Hidden Dimension
DFST: add10
DFST: mult10
Softmax DFST: mult2
≥ 5000 ≥ 5000 ≥ 5000
2M
≥ 5000 ≥ 5000 3216 85
130
276
0
50k
100k
Warm-Up Updates
4M
≥ 1000 ≥ 1000
107
2M
51
300
108
1M
34
107
70
0
50k
100k
Warm-Up Updates
Training PTOs
Warm-Up Updates
Total Updates
Warm-Up Updates
4M
1M
1M
Softmax DFST: add2 Training PTOs
36
Total Updates
DFST: mult2
1M
Total Updates
Total Updates
DFST: add2
300
1
≥ 1000 ≥ 1000
200
2
≥ 1000 ≥ 1000
100
1
≥ 1000
5
32
64
96
Hidden Dimension
Figure 3: Robust Generalization on Arithmetic from Differentiable Training. The first two columns show ordinary DFST learning-rate schedule sweeps. The last column shows Softmax DFST dimension/data sweeps after 100k updates of constant learning-rate training. Cells report RLG in operand digits. Section E provides the paired ULG/RLG plots.
3
Experimental Results and Discussion
In this section, we discuss length-generalization results solely due to differentiable training. 3.1
Length Generalization on Arithmetic
Figure 3 compares arithmetic generalization before extraction. All DFST and Softmax DFST models train from scratch with the same simple deterministic initialization recipe. Several DFST runs reach both the ULG and RLG testing caps: 5000 digits per operand for addition and 1000 for multiplication, in binary and decimal radix, after training on operands of at most 3 and 5 digits, respectively. Success varies across training schedules, and additional updates need not improve generalization. After 100k constant learning-rate updates, many Softmax DFST configurations reach the robust binary-addition and multiplication caps. The Softmax DFST runs hold the advantage of providing interpretable transition probabilities while also supporting extreme generalization. However, Softmax DFST optimization proves more challenging, and we could not fit even small training sets on the decimal tasks. Section D.7 discusses these limitations. Tens of Millions of Consecutive Correct Actions. Operand length understates the scale of this extrapolation. Adding two 5000-digit all-9 numbers requires 50 070 010 PTO steps; multiplying two 1000-digit all-9 numbers requires 15 012 991. Each step requires the correct write and motion, including the final stopping action. The corresponding binary all-1 probes require exactly the same numbers of steps (Section F.5). Successful decimal DFSTs reproduce the all-9 trajectories, while multiple binary DFST and Softmax DFST configurations reproduce the equally long all-1 trajectories. The binary controllers learn from only 25–75 addition PTOs or 100–300 multiplication PTOs on operands of at most 3 or 5 digits, respectively. Such training supports faithful execution over tens of millions of steps on these structured probes, far beyond the short training traces. Small-Data Learning and Implicit Bias. These long executions raise a question beyond representational capacity: why does gradient-based training favor rules that continue working so far beyond the training lengths? Matching the training PTOs alone does not force such behavior. We construct spurious binary addition and multiplication controllers that reproduce every expert PTO within the 7
Training Program Families
Held-Out Programs
DFST ≥ 500 ≥ 500 ≥ 500 ≥ 500 ≥ 500 75 PTOs
≥ 500 ≥ 500 ≥ 500 ≥ 500 ≥ 500
Softmax DFST ≥ 500 ≥ 500 ≥ 500 ≥ 500 ≥ 500 150 PTOs
≥ 500 ≥ 500 ≥ 500 ≥ 500 ≥ 500
Parity Shift Left
Shift Scale Scale Right A* B*
Bit Flip
Prefix Bit Reverse Copy Parity Delete
Training inputs: ≤ 5 symbols. *Scaling parameter: 5 → 500.
Figure 4: Generalization on Universal Simulations from Differentiable Training. Cells report successful tested input lengths under teacher-forced exact action matching. Both controllers reach the 500-symbol cap after training on inputs of at most 5 symbols. Figure 13 gives the full sweeps. training-length bounds, yet stop prematurely on longer inputs. Thus, even exhaustive supervision over the entire 3 or 5-digit input domains cannot distinguish the expert algorithms from these degenerate alternatives. Furthermore, the spurious controllers need only 14 and 38 states (Sections I.1 and I.2), compared to the 11 and 32 states for the binary arithmetic experts. The larger Softmax DFSTs in Figure 3 have enough capacity to express these spurious solutions: addition uses dimensions 22 and 33, and multiplication uses 64 and 96 (Section I.3). Nevertheless, five of six configurations in each larger sweep reach the robust testing cap. These successful configurations therefore avoid the constructed spurious rules despite sufficient capacity to represent those rules. Gradient-based optimization with the chosen parametrization and initialization repeatedly favors behavior that survives long execution horizons despite the training set failing to distinguish other spurious targets. These results support the existence of a useful implicit bias towards generalizing rules. Characterizing the source and reliability of this bias remains an open direction. 3.2
Length Generalization on the Universal Task
A 15-dimensional DFST with 4,335 parameters, trained on 75 PTOs from 5 programs on inputs of at most 5 symbols, reaches the 500-symbol cap on all 10 universal-simulation tasks (Figure 4). A 30-dimensional Softmax DFST with 12,720 parameters, trained on 150 PTOs, also reaches every task cap. The longest sampled trajectory requires 15,316,822 consecutive expert-action matches (Table 8). These evaluations test 3 distinct forms of generalization: longer inputs, transfer to 5 unseen programs, and larger encoded Turing machines. Each controller keeps the same learned weights across all evaluations. Thus, a fixed model can execute novel computations without retraining, simply by changing the input Turing machine. 3.3
Controller Families and Training Dynamics
All six DFST, RNN, and GRU runs reach both binary-task caps (Figure 5). Each controller learns from 25 addition PTOs or 100 multiplication PTOs. These results support the same learning recipe across three distinct controller families: state tracking, unbounded external memory, and PTO supervision. In Figure 5, the loss curves track fitting of the short training PTOs, while the RLG curves measure generalization to long structured inputs. All later recorded checkpoints retain the caps. Intermediate generalization need not improve monotonically, and low training loss does not certify algorithmic correctness. Section E.3 and Table 5 provide the full comparison and complete training settings.
4
Verification of Exact Learning
Beyond the finite length-generalization tests in Section 3, we extract and verify discrete controllers, then identify conditions for transferring correctness to neural execution (Section 1). Even with discrete controllers, the unbounded grid prevents a general sufficient testing horizon: Lemma 4.1 (Undecidability of Finite-Horizon Verification). No algorithm can take descriptions of two grid agents T, M and return a finite input-length bound L such that agreement of the PTOs T [z] = M [z] for every z ∈ Σ≤L implies agreement on all inputs. 8
add2
mult2
Training MSE
100
10−4 10−8
10−4 10−8
10−12
10−12
5000
1000
RLG
RLG
Training MSE
100
2500
0
500 DFST RNN GRU
0 0.0
0.2
0.4
0.6
0.8
1.0
0.0
Training Updates (Millions)
0.2
0.4
0.6
0.8
1.0
Training Updates (Millions)
Figure 5: Learning Dynamics across Controller Families. All six runs reach the 5000/1000-digit caps within one million updates. Runs use different dimensions, seeds, and schedules.
Section H.1 proves the claim by reduction from the halting problem. Thus, in general, no algorithm can guarantee that length-generalizing up to a certain cap proves exact learning. To certify exact learning, we will have to consider the specific controller structure. And since finite-precision neural controllers represent prohibitively large FSTs, we first need to extract something manageable. 4.1
Recovering Explicit Controllers
Metric Extraction. We feed random inputs to a trained DFST controller and unroll the hidden-state trajectories from the executions. We connect hidden states within ε Euclidean distance and cluster the hidden states into connected components which become the initial discrete states. Each discrete state points to other discrete states through symbol transitions inherited from the hidden states inside the connected component. Thus, we have obtained a non-deterministic FST. We begin to merge the discrete states until either we get a deterministic FST and return, or until we get some inconsistency. In case of inconsistency, we halve ε and start anew. For some small enough ε, we will obtain a consistent deterministic transition graph. The resulting graph reproduces the collected trajectories, leaving unobserved transitions undefined. Interestingly, we empirically verify that after enough sampled hidden-state trajectories, the extracted graph stabilizes. Note that this type of extraction uses no expert hidden-state labels. See Section G.1 for more details. Softmax Annealing and Direct Readout. A trained Softmax DFST assigns probabilities to successor states and actions. We continue training with a G(p) = 1 − ∥p∥22 penalty which sharpens the distributions. Progressively increasing (annealing) the penalty weight concentrates the probabilities into approximately one-hot vectors. Column-wise argmax then selects deterministic discrete transitions, thereby extracting an FST. Section G.2 gives the full objective and schedule. Both extraction routes produce candidate discrete controllers. Figure 6 shows empirical graph stability and approximate one-hot probability concentration. 4.2
Proving Target Equivalence for the Recovered Algorithms
We relate extracted states and grid configurations to phases of the expert algorithm. The relation holds initially, and we prove that each permitted transition produces matching actions and preserves the relation. Algorithm-specific invariants show that the phases cover every valid execution. Induction then establishes agreement for arbitrary execution lengths, including simultaneous stopping. Different internal representations and state counts can therefore implement the same algorithm (Section H.3). 9
Max. Second-Best Entry
Raw Graph Size
Metric Extraction (Universal Controller) 80 Unchanged Labeled Graph
60 40 20
States
Edges
0 20
40 60 Extraction Inputs
80
Differentiable Concentration
100 10
Binary Addition Binary Multiplication Universal
−2
10−4 10−6
100
0
1000
2000 3000 4000 Annealing Updates
5000
Figure 6: From Trained Controllers to Interpretable Graphs. Left: the extracted graph stabilizes after 23 sampled trajectories, providing finite evidence for graph stability. Right: runner-up probabilities approach 10−7 during annealing; longer annealing with larger regularization coefficients reaches the smallest positive subnormal probabilities, which remain distinct from exact zeros. Eight Certificates. We provide five metric-extraction and three annealing certificates. Theorems H.3, H.7, H.14 and H.18 cover binary and decimal arithmetic on arbitrary nonempty operands, including unequal lengths and leading zeros. The universal certificates extend far beyond the five training programs. Theorem H.24 proves that the recovered discrete controllers implement the interpreter’s rules for arbitrary correctly encoded machines and input lengths, yielding the following consequence. Corollary 4.2 (Exact Learning of a Universal Controller). The universal controllers obtained by metric extraction and softmax annealing from differentiably trained DFSTs and Softmax DFSTs correctly simulate every binary Turing machine on every nonempty binary input. GPT-6 Astra generated the proofs. We verified the arguments. The repository checkers mechanically verify finite transition obligations, while the induction arguments establish unbounded correctness. 4.3
Transferring Guarantees to Neural Controllers
Both routes transfer the recovered FST certificates to neural execution under explicit assumptions. Graph Stability for Metric Extraction. Graph stability requires every further neural hidden-state trajectory to preserve the graph extracted from trajectories S at threshold ε, up to state renaming. Uniformly Bounded Leakage for Softmax DFSTs. We assume ∥ht − eqt ∥1 ≤ ε uniformly over valid inputs and execution lengths, where qt tracks the unminimized argmax controller driven by the same observations. This bounds off-target leakage and drift from the intended one-hot state. At a one-hot hidden state, let µ denote the smallest score advantage of the prescribed write or motion over any competing choice, across all valid executions. Hidden-state leakage can reduce this advantage by at most ε. Rounding can reduce the advantage by another 2ρ, since each of the two compared scores can change by up to ρ. Thus, µ > ε + 2ρ ensures that both readouts still select the prescribed actions. Theorem 4.3 (Behavioral Faithfulness). Under Assumption H.1, a deterministic trace-consistent metric extraction reproduces every PTO of the neural controller on every valid input. Under Assumption G.1, the Softmax DFST and the argmax controller likewise produce identical PTOs. In either case, trace-preserving quotient reduction retains this equivalence, so an expert-equivalence certificate for the extracted controller transfers to the neural controller on the same domain. Section H.2 proves both cases. For Softmax DFSTs, the readout margin exceeds the combined leakage and rounding perturbations, so induction preserves every action and environment update.
5
Conclusion
Our framework places differentiable parameter search inside a discrete algorithmic shell: train a neural controller, extract a discrete model through a fixed rule, and verify exact agreement with the target algorithm. Since extraction follows a fixed simple procedure (especially with argmax readout for Softmax DFSTs), we view this combination of differentiable search and discrete readout as differentiable exact learning. The certificates concern the recovered discrete models, while the graph-stability or bounded-leakage assumptions additionally transfer correctness to neural execution. 10
Acknowledgments and Disclosure of Funding This work was partially funded by an unrestricted gift from Coefficient Giving, and the grant number 212111 from the Swiss National Science Foundation. Francesco D’Angelo was supported by the Google PhD Fellowship.
References N. Alon, A. K. Dewdney, and T. J. Ott. Efficient simulation of finite automata by neural nets. Journal of the ACM (JACM), 38(2):495–514, 1991. M. Andrychowicz and K. Kurach. Learning efficient algorithms with hierarchical attentive memory. arXiv preprint arXiv:1602.03218, 2016. D. Angluin. Learning regular sets from queries and counterexamples. Information and computation, 75(2):87–106, 1987. C. Anil, Y. Wu, A. Andreassen, A. Lewkowycz, V. Misra, V. Ramasesh, A. Slone, G. Gur-Ari, E. Dyer, and B. Neyshabur. Exploring length generalization in large language models. Advances in Neural Information Processing Systems, 35:38546–38556, 2022. B. D. Argall, S. Chernova, M. Veloso, and B. Browning. A survey of robot learning from demonstration. Robotics and autonomous systems, 57(5):469–483, 2009. A. Back de Luca, G. Giapitzakis, and K. Fountoulakis. Learning to add, multiply, and execute algorithmic instructions exactly with neural networks. In Advances in Neural Information Processing Systems, volume 38, 2025. URL https://doi.org/10.52202/085713-2636. S. Bhattamishra, A. Patel, and N. Goyal. On the computational power of transformers and its implications in sequence modeling. arXiv preprint arXiv:2006.09286, 2020. G. E. Blelloch. Prefix sums and their applications. 1990. M. Bošnjak, T. Rocktäschel, J. Naradowsky, and S. Riedel. Programming with a differentiable forth interpreter. In International conference on machine learning, pages 547–556. PMLR, 2017. J. Cai, R. Shin, and D. Song. Making neural programming architectures generalize via recursion. arXiv preprint arXiv:1704.06611, 2017. X. Chen, C. Liang, A. W. Yu, D. Song, and D. Zhou. Compositional generalization via neuralsymbolic stack machines. Advances in Neural Information Processing Systems, 33:1690–1701, 2020. H. Cho, J. Cha, P. Awasthi, S. Bhojanapalli, A. Gupta, and C. Yun. Position coupling: Improving length generalization of arithmetic transformers using task structure. Advances in Neural Information Processing Systems, 37:22233–22315, 2024a. H. Cho, J. Cha, S. Bhojanapalli, and C. Yun. Arithmetic transformers can length-generalize in both operand length and count. arXiv preprint arXiv:2410.15787, 2024b. S. Chung and H. Siegelmann. Turing completeness of bounded-precision recurrent neural networks. Advances in neural information processing systems, 34:28431–28441, 2021. C. De La Higuera. Characteristic sets for polynomial grammatical inference. Machine Learning, 27 (2):125–138, 1997. M. Dehghani, S. Gouws, O. Vinyals, J. Uszkoreit, and L. Kaiser. Universal transformers. arXiv preprint arXiv:1807.03819, 2018. G. Delétang, A. Ruoss, J. Grau-Moya, T. Genewein, L. K. Wenliang, E. Catt, C. Cundy, M. Hutter, S. Legg, J. Veness, et al. Neural networks and the chomsky hierarchy. arXiv preprint arXiv:2207.02098, 2022. 11
A. L. Gaunt, M. Brockschmidt, R. Singh, N. Kushman, P. Kohli, J. Taylor, and D. Tarlow. Terpret: A probabilistic programming language for program induction. arXiv preprint arXiv:1608.04428, 2016. C. Giles, G.-Z. Sun, H.-H. Chen, Y.-C. Lee, and D. Chen. Higher order recurrent networks and grammatical inference. Advances in neural information processing systems, 2, 1989. E. M. Gold. Language identification in the limit. Information and control, 10(5):447–474, 1967. E. M. Gold. Complexity of automaton identification from given data. Information and control, 37(3): 302–320, 1978. A. Graves, G. Wayne, and I. Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014. A. Graves, G. Wayne, M. Reynolds, T. Harley, I. Danihelka, A. Grabska-Barwińska, S. G. Colmenarejo, E. Grefenstette, T. Ramalho, J. Agapiou, et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471–476, 2016. E. Grefenstette, K. M. Hermann, M. Suleyman, and P. Blunsom. Learning to transduce with unbounded memory. Advances in neural information processing systems, 28, 2015. A. György, T. Lattimore, N. Lazić, and C. Szepesvári. Beyond statistical learning: Exact learning is essential for general intelligence. arXiv preprint arXiv:2506.23908, 2025. H. Zhou, A. Bradley, E. Littwin, N. Razin, O. Saremi, J. Susskind, S. Bengio, and P. Nakkiran. What algorithms can transformers learn? a study in length generalization. arXiv preprint arXiv:2310.16028, 2023. K. Hou, D. Brandfonbrener, S. M. Kakade, S. Jelassi, and E. Malach. Universal length generalization with Turing programs. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 23873–23893. PMLR, 2025. URL https://proceedings.mlr.press/v267/hou25a.html. P. Indyk. Optimal simulation of automata by neural nets. In Annual Symposium on Theoretical Aspects of Computer Science, pages 337–348. Springer, 1995. S. Jelassi, S. d’Ascoli, C. Domingo-Enrich, Y. Wu, Y. Li, and F. Charton. Length generalization in arithmetic transformers. arXiv preprint arXiv:2306.15400, 2023. A. Joulin and T. Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. Advances in neural information processing systems, 28, 2015. L. Kaiser and I. Sutskever. Neural gpus learn algorithms. arXiv preprint arXiv:1511.08228, 2015. A. Kazemnejad, I. Padhi, K. Natesan Ramamurthy, P. Das, and S. Reddy. The impact of positional encoding on length generalization in transformers. Advances in Neural Information Processing Systems, 36:24892–24928, 2023. D. P. Kingma. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. K. Kurach, M. Andrychowicz, and I. Sutskever. Neural random-access machines. arXiv preprint arXiv:1511.06392, 2015. N. Lee, K. Sreenivasan, J. D. Lee, K. Lee, and D. Papailiopoulos. Teaching arithmetic to small transformers. arXiv preprint arXiv:2307.03381, 2023. B. Liu, J. T. Ash, S. Goel, A. Krishnamurthy, and C. Zhang. Transformers learn shortcuts to automata. arXiv preprint arXiv:2210.10749, 2022. A. N. Meltzoff and M. K. Moore. Infants’ understanding of people and things: From body imitation to folk psychology. The body and the self, pages 43–69, 1995. W. Merrill. Sequential neural networks as automata. arXiv preprint arXiv:1906.01615, 2019. 12
W. Merrill and A. Sabharwal. The expresssive power of transformers with chain of thought. CoRR, 2023a. W. Merrill and A. Sabharwal. The parallelism tradeoff: Limitations of log-precision transformers. Transactions of the Association for Computational Linguistics, 11:531–545, 2023b. W. Merrill, J. Petty, and A. Sabharwal. The illusion of state in state-space models. In Proceedings of the 41st International Conference on Machine Learning, ICML’24. JMLR.org, 2024. A. Neelakantan, Q. V. Le, and I. Sutskever. Neural programmer: Inducing latent programs with gradient descent. arXiv preprint arXiv:1511.04834, 2015. J. Oncina and P. Garcia. Identifying regular languages in polynomial time. In Advances in structural and syntactic pattern recognition, pages 99–108. World Scientific, 1992. H. Papazov and N. Flammarion. Learning algorithms in the limit. In N. Haghtalab and A. Moitra, editors, Proceedings of Thirty Eighth Conference on Learning Theory, volume 291 of Proceedings of Machine Learning Research, pages 4486–4510. PMLR, 2025. H. Papazov, F. D’Angelo, and N. Flammarion. Exact learning of arithmetic with differentiable agents. arXiv preprint arXiv:2511.22751, 2025. R. Parekh and V. Honavar. Learning dfa from simple examples. Machine Learning, 44:9–35, 2001. E. Parisotto, A.-r. Mohamed, R. Singh, L. Li, D. Zhou, and P. Kohli. Neuro-symbolic program synthesis. arXiv preprint arXiv:1611.01855, 2016. A. Payani and F. Fekri. Inductive logic programming via differentiable deep neural logic networks. arXiv preprint arXiv:1906.03523, 2019. URL https://arxiv.org/abs/1906.03523. T. Pierrot, G. Ligner, S. E. Reed, O. Sigaud, N. Perrin, A. Laterre, D. Kas, K. Beguir, and N. de Freitas. Learning compositional neural programs with recursive tree search and planning. Advances in Neural Information Processing Systems, 32, 2019. E. Price, W. Zaremba, and I. Sutskever. Extensions and limitations of the neural gpu. arXiv preprint arXiv:1611.00736, 2016. J. Pérez, J. Marinković, and P. Barceló. On the turing completeness of modern neural network architectures. In International Conference on Learning Representations, 2019. S. Reed and N. De Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015. D. Schuurmans, H. Dai, and F. Zanini. Autoregressive large language models are computationally universal. arXiv preprint arXiv:2410.03170, 2024. R. Shen, S. Bubeck, R. Eldan, Y. T. Lee, Y. Li, and Y. Zhang. Positional description matters for transformers arithmetic. arXiv preprint arXiv:2311.14737, 2023. H. T. Siegelmann. Recurrent neural networks and finite automata. Computational intelligence, 12(4): 567–574, 1996. H. T. Siegelmann and E. D. Sontag. On the computational power of neural nets. In Proceedings of the fifth annual workshop on Computational learning theory, pages 440–449, 1992. R. J. Solomonoff et al. Machine learning-past and future. Dartmouth, NH, July, 2006. A. Svete and R. Cotterell. Recurrent neural language models as probabilistic finite-state automata. arXiv preprint arXiv:2310.05161, 2023. F. Vaandrager, B. Garhewal, J. Rot, and T. Wißmann. A new approach for active automata learning based on apartness. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pages 223–243. Springer, 2022. O. Vinyals, M. Fortunato, and N. Jaitly. Pointer networks. Advances in neural information processing systems, 28, 2015. 13
C. Wei, Y. Chen, and T. Ma. Statistically meaningful approximation: a case study on approximating turing machines with transformers. Advances in Neural Information Processing Systems, 35: 12071–12083, 2022. G. Weiss, Y. Goldberg, and E. Yahav. On the practical computational power of finite precision rnns for language recognition. arXiv preprint arXiv:1805.04908, 2018. J. Weston, S. Chopra, and A. Bordes. Memory networks. arXiv preprint arXiv:1410.3916, 2014. Y. Zhou, U. Alon, X. Chen, X. Wang, R. Agarwal, and D. Zhou. Transformers can achieve length generalization but not robustly. arXiv preprint arXiv:2402.09371, 2024. W. Zaremba and I. Sutskever. Reinforcement learning neural turing machines-revised. arXiv preprint arXiv:1505.00521, 2015. W. Zaremba, T. Mikolov, A. Joulin, and R. Fergus. Learning simple algorithms from examples. In International conference on machine learning, pages 421–429. PMLR, 2016. H. Zhang, L. H. Li, T. Meng, K.-W. Chang, and G. V. d. Broeck. On the paradox of learning to reason from data. arXiv preprint arXiv:2205.11502, 2022.
14
Organization of the Appendix • Section A positions our work within the broader literature on neural program induction, arithmetic length generalization, and learning-theoretic supervision hierarchies. • Section B proves the universality theorem for DFSTs (Theorem 2.5) and discusses non-uniqueness of DFST parametrizations. • Section C collects the extended notation for grid-agent execution, the hardness results motivating our learning paradigm, the pedagogical interpretation of PTOs, and the full catalog of expert agents. • Section D details optimizer settings, the learning-rate schedule, per-task DFST recipes, the recurrent-controller comparisons, and the capped evaluation protocol. • Section E presents additional uniform and robust generalization results, Softmax DFST sweeps, and training dynamics for DFST, RNN, and GRU controllers on binary arithmetic. • Section F describes the teleportation rune mechanics, the Turing-machine encoding, and the 10 simulated tasks used in the universal-agent experiment. • Section G develops metric extraction and softmax annealing, and separates empirical evidence from the assumptions needed for neural-model equivalence. • Section H proves the verification obstruction and conditional faithfulness theorem, then presents eight mathematical equivalence certificates grouped by task, including the required transition maps. • Section I constructs small arithmetic controllers that match every short-input PTO yet fail beyond the training lengths, and relates these counterexamples to the Softmax DFST capacity sweeps.
A
Related Work
Our work builds on a long line of research on neural program induction, which studies the problem of learning algorithmic procedures using neural architectures. Within this paradigm, prior work has explored a wide variety of learning signals and model classes. Our framework combines the following three desiderata: (1) Learning from expert behavior observations; (2) Computational universality of the learning framework; (3) Continuous optimization in a fully differentiable setting. This work investigates exact learning at the intersection of these three principles, with equivalence proofs for extracted controllers over all valid inputs. Specifically, we focus on learning scenarios where intelligent systems infer algorithmic processes solely from externally observable behavior, as in learning-from-demonstration settings (Argall et al., 2009). Crucially, behavior observations circumvent the general identification barrier for input–output supervision (Gold, 1967; Papazov and Flammarion, 2025), without access to the expert’s internal state. Furthermore, we require computational universality and differentiability from our framework in order to study learning as a general-purpose mechanism, avoiding task-specific instruction templates and hand-crafted search procedures during training. Prior universality results differ in the computational resources and learning guarantees provided: • Precision and Context Requirements: RNNs and Neural GPUs with unbounded-precision internal arithmetic (Siegelmann and Sontag, 1992; Pérez et al., 2019); Transformers with growing context windows or unbounded-precision internal arithmetic (Pérez et al., 2019; Dehghani et al., 2018; Bhattamishra et al., 2020; Merrill and Sabharwal, 2023a). • External-Memory Constructions: Bounded-precision recurrent controllers coupled to growing memory (Chung and Siegelmann, 2021); language models prompted with a complete productionrule system (Schuurmans et al., 2024). • Horizon-Dependent Architectures: Statistical approximation guarantees for bounded-time computation with model sizes depending on the execution horizon (Wei et al., 2022). These results establish computational expressivity or statistical approximation rather than recovery of a persistent controller from behavior observations. Finite-precision universality alone therefore does not distinguish our framework. Our universal controller instead learns from 75 PTOs without 15
supplied control states or a transition table, transfers to five programs absent from training, and yields extracted-controller certificates covering arbitrary valid machine encodings (Sections F and H). The certified controllers retain the same parameters across unbounded input lengths and execution horizons. We now compare the supervision and verification guarantees of related learning frameworks. External-Memory Frameworks. The work of Zaremba et al. (2016) comes, perhaps, closest to our setting. The authors consider an RNN-based controller which operates over a read-only input grid and a write-only unidirectional output tape by issuing action tokens containing move and write commands. Zaremba et al. (2016) investigate whether the neural controller can learn to execute simple algorithms (e.g., copying, reversing, addition) when trained via reinforcement learning for correct outputs or with supervision from expert policies. Unlike in our experiments, training uses nontrivial curricula, and off-the-shelf Q-learning fails on most tasks without additional modifications. The task suite includes single-digit multiplication and demonstrates substantial extrapolation on selected tasks. Our experiments additionally cover unrestricted two-operand multiplication and universal simulation using an unbounded read–write workspace. Related neurosymbolic frameworks include Higher-Order RNNs (Giles et al., 1989), Memory Networks (Weston et al., 2014), Neural Turing Machines (Graves et al., 2014), Neural GPUs (Kaiser and Sutskever, 2015), Neural Random-Access Machines (Kurach et al., 2015), Neural Programmers (Neelakantan et al., 2015), Pointer Networks (Vinyals et al., 2015), Stack-Augmented RNNs (Joulin and Mikolov, 2015), Differentiable Neural Computers (Graves et al., 2016), Hierarchical Attentive Memories (Andrychowicz and Kurach, 2016), TerpreT (Gaunt et al., 2016), R3NNs (Parisotto et al., 2016), Differentiable Forth Interpreters (Bošnjak et al., 2017), and Neural-Symbolic Stack Machines (Chen et al., 2020). External storage and even unbounded differentiable memory already appear in this literature (Grefenstette et al., 2015). Our distinction concerns learning latent controller state from PTOs and certifying the extracted computation, rather than external memory alone. Input-Output Observations. Another closely related approach appears in Zaremba and Sutskever (2015), which considers an LSTM controller operating over a read-only input tape, a read–write memory tape, and a write-only unidirectional output tape. The addition of a read–write memory renders the resulting model computationally universal. Nevertheless, learning proceeds solely via RL with rewards for correct output. Gold (1967, Theorems I.3 and I.5) rule out identification of the full class of recursive functions from input–output observations; these results do not prohibit learning a particular arithmetic algorithm. PTOs avoid this general identification barrier (Papazov and Flammarion, 2025), while the present experiments investigate finite-data optimization and verification. Program-Structure Observations. A particularly relevant line of work stems from Neural Programmer-Interpreters (NPIs) (Reed and De Freitas, 2015). NPIs use an LSTM controller as a program executor: At each step, the controller consumes a local environment snapshot together with the active subprogram embedding and current arguments, then outputs (i) a distribution over the next subprogram in a fixed library, (ii) the corresponding arguments, and (iii) a halt/return decision. Training traces explicitly supervise this call–return structure. Each program invocation starts a fresh recurrent state; return resumes the caller’s state. These annotations expose program structure, without supplying the numerical recurrent hidden vectors. This additional program supervision supports data-efficient learning5 and in special cases permits formal guarantees of exactness. Cai et al. (2017) observe that when the expert program follows a recursive template in which each subprogram admits only finitely many base configurations and reductions, one can formally certify that the trained LSTM controller recovers the ground-truth algorithm. The experiments already reach 5000-digit addition, with all-input proofs for addition and several sorting tasks. Our distinction concerns recovering persistent controller state without prescribed subprogram identities or recursive boundaries, and extending the certificates to full binary and decimal multiplication and universal simulation. Pierrot et al. (2019) further demonstrate reinforcement learning through hierarchical program specifications, pre/postcondition checks, and recursive tree search; an induction argument certifies unbounded Tower of Hanoi execution for agents satisfying specified base-case and recursive-trace conditions. Our training instead uses PTO next-action losses without a supplied recursive decomposition or program library. 5 The addition experiments train on 200 execution traces with operands of at most three digits.
16
Exact Instruction Learning and Logic Induction. Back de Luca et al. (2025) prove high-probability exact instruction execution in the infinite-width neural tangent kernel regime using explicit instruction templates, but require retraining whenever the memory budget increases; neural training experiments cover permutations, while arithmetic training remains untested because of ensemble cost. Our controllers retain fixed parameters across input lengths; the extracted-controller proofs impose no memory or execution-horizon bound. Payani and Fekri (2019) recover explicit recursive programs from positive/negative facts and supplied background predicates, including addition for multiplication, without NPI-style program-structure supervision; the empirical studies use finite domains and provide neither length-generalization measurements nor equivalence proofs over all valid inputs. Our multiplication controllers learn digit-level actions and carry propagation without a supplied addition subroutine, and admit all-input proofs after extraction. Arithmetic Length Generalization. Finally, we situate our contribution in the arithmetic generalization literature. Recent empirical studies (Joulin and Mikolov, 2015; Delétang et al., 2022; Liu et al., 2022; Zhang et al., 2022; Shen et al., 2023; Kazemnejad et al., 2023; Jelassi et al., 2023) demonstrate that Transformers, modified RNNs, and LSTMs length-generalize poorly on a variety of simple algorithmic tasks when trained on input-output data. With additional data-formatting strategies (such as task-specific index hints, optimized positional encodings, input reversing, position coupling, and scratchpad guidance) multiple works on arithmetic generalization in Transformers (Anil et al., 2022; Jelassi et al., 2023; H. Zhou et al., 2023; Lee et al., 2023; Y. Zhou et al., 2024; Hou et al., 2025; Cho et al., 2024a,b) achieve substantial finite-length extrapolation. Most notably, for decimal addition, Y. Zhou et al. (2024) report above 98% exact-match accuracy (EMA) on 100-digit summands after training on decimal addition with up to 40-digit numbers (2.5× LG); and Cho et al. (2024a) report above 95% EMA on roughly 6–7× longer operands, with a separate scale-up experiment reaching 500 digits after training on operands of up to 160 digits. The clearest quantitative distinction concerns both operands in decimal multiplication: Cho et al. (2024b) train on operands of at most 10 × 10 digits and attain at least 78.55% median EMA through 20 × 15 digits, counting the entire response including the scratchpad, whereas Hou et al. (2025) extrapolate from 50 × 1 or 50 × 3 digits to 100 × 1 or 100 × 3 digits with 97% accuracy. Our selected decimal-multiplication controller trains on operands of at most 5 × 5 digits and passes every action-level probe at 1000 × 1000 digits before extraction; the extracted controller additionally admits a proof over all valid inputs. Interestingly, similar to us, Hou et al. (2025) train on scratchpad data consisting of the computational traces of a Turing machine (TM) designed to solve the specific algorithmic task. However, whereas our agent only observes the evolution of the environment, Hou et al. (2025) supervise explicit machine states, head positions, and tape contents. The random-machine experiments evaluate onestep prediction on longer tapes, without establishing correct execution over unbounded trajectories. The accompanying RASP construction guarantees exp(n) simulated steps with a program of size O(n) under distinct-n-gram and in-memory execution assumptions; this construction does not certify experimentally trained weights. Our PTOs withhold expert control states, and the extracted-controller proofs impose no input-length or execution-horizon bound. We conclude by comparing our results in Table 1 against the Neural GPU (Kaiser and Sutskever, 2015; Price et al., 2016), which achieves strong arithmetic generalization from input-output observations. Kaiser and Sutskever (2015) introduce a Neural Cellular Automaton, called the Neural GPU, which achieves remarkable random-test generalization when trained solely on input-output examples (and an upper bound on the computation length) of binary addition and multiplication. Error-free sampled binary multiplication already reaches 2000 bits, exceeding our 1000-digit testing cap. However, Price et al. (2016) report sensitivity to the random seed and document long-carry and symmetric-input failures, despite greater than 99% whole-answer accuracy for decimal multiplication at 100 digits. Our selected models pass all repdigit cross-pairs at the testing caps in both bases, including decimal multiplication, and the extracted controllers admit proofs of exact learning. The single-seed DFST schedule sweeps do not establish superior robustness across random seeds. Furthermore, our DFST agents train on small PTO datasets using Adam, gradient clipping, and a learning-rate schedule, while Neural GPU training combines curricula, parameter-sharing relaxation, dropout, and gradient noise. As shown in Table 1, observable intermediate steps support extreme generalization with far fewer training examples, although PTOs provide richer supervision than input-output pairs. RNN and GRU
17
runs also reach both binary-task caps, supporting the broader state-tracking recipe beyond DFSTs (Section E.3). Table 1: Neural GPU vs. DFST on Arithmetic Tasks. DFST entries report the selected runs before extraction; lengths count bits in binary and digits in decimal. Framework Neural GPU with Input–Output Data
DFST (ours) with PTOs
Metric
add2
add10
mult2
mult10
# Samples # Parameters Training Digits RLG ULG
∼ 200k 10368 20 ≤ 20 2000
– – – – –
∼ 200k 10368 20 ≤8 2000
– – – – –
# Samples # Parameters Training Digits RLG ULG
25 891 3 ≥ 5000 ≥ 5000
250 8227 3 ≥ 5000 ≥ 5000
100 5280 5 ≥ 1000 ≥ 1000
10000 162108 5 ≥ 1000 ≥ 1000
Summary. Our contribution combines latent-state discovery from behavior, extreme extrapolation in both arithmetic operands, and exact verification within one universal framework. Eight certificates cover extracted controllers across all five trained tasks. Graph stability or a suitable invariant of the annealed dynamics additionally transfers these guarantees to the neural controllers (Sections G and H).
B
Differentiable Finite-State Transducers
This appendix collects the formal details of DFST expressivity deferred from Section 2. We prove Theorem 2.5, discuss the non-uniqueness of emulating parametrizations, and relate the required hidden-state dimension to the number of states of the target agent. B.1
Proof of Universality
We restate the theorem for convenience. Theorem 2.5 (DFST-Grid Universality). Any d-state grid agent admits exact emulation by a ddimensional DFST at any finite arithmetic precision, and by a (d + 1)-dimensional Softmax DFST with finite logits in exact real arithmetic. A d-dimensional Softmax DFST also suffices under rounded arithmetic whose softmax attains simplex vertices and whose recurrence preserves vertex operations. Proof. Let T = (Q, Σ, Γ, δ, γ, q0 , qf ) ∈ A denote a grid agent with d states q0 , . . . , qd−1 = qf . Write k = |Σ| for the alphabet size with symbols s0 , . . . , sk−1 , and r = |M| for the number of motion tokens m0 , . . . , mr−1 . We encode states, symbols, and motions as standard basis vectors: qi ↔ ei+1 ∈ Rd , sj ↔ ej+1 ∈ Rk , and mℓ ↔ eℓ+1 ∈ Rr . Define the DFST weights (A, B, C, h0 ) as follows. Set h0 = e1 = (1, 0, . . . , 0)⊤ ∈ Rd . For each transition δ(qi , sj ) = qi′ with γ(qi , sj ) = (sj ′ , mℓ ), assign A[j, i′ , i] = 1,
B[j, j ′ , i] = 1,
C[j, ℓ, i] = 1,
and set all remaining tensor entries to 0. Under this assignment, if ht−1 = ei+1 encodes state qi and the input xt = ej+1 encodes symbol sj , then A[xt ] ht−1 = ei′ +1 , B[xt ] ht−1 = ej ′ +1 , and C[xt ] ht−1 = eℓ+1 . Since h0 = e1 encodes the initial state q0 , induction on t shows that the DFST(A, B, C, h0 ) exactly reproduces the output sequence of T on every input. This construction uses only {0, 1}-valued weights and hence works at any finite arithmetic precision p ≥ 1. Softmax DFSTs in Exact Real Arithmetic. Let Dx ∈ {0, 1}d×d denote the deterministic transition matrix for read symbol x, and let Oxs ∈ {0, 1}k×d and Oxm ∈ {0, 1}r×d denote the corresponding 18
one-hot output matrices. Set n = d + 1 and u = 1n /n. Define Id V = , W = (Id 0) − 1d u⊤ . −1⊤ d Then W V = Id , W u = 0, and 1⊤ n V = 0. Choose 0 < α < 1 and η > 0 sufficiently small that every entry of A[x] = u1⊤ h0 = u + ηV eq0 n + αV Dx W, remains strictly positive. Such choices exist because the alphabet and state set contain finitely many elements. The columns of A[x] and the vector h0 sum to one. Induction gives ht = u + ηαt V eqt ,
qt = δ(qt−1 , xt ).
For either output alphabet of size a ∈ {k, r}, write ua = 1a /a, Va = Ia − ua 1⊤ a , and Ox ∈ {Oxs , Oxm }. Choose β > 0 sufficiently small that the column-stochastic matrix P [x] = ua 1⊤ n + βVa Ox W has strictly positive entries, and use P = B or P = C accordingly. If yt denotes the expert output on (qt−1 , xt ), the readout satisfies P [xt ]ht−1 = ua + βηαt−1 (eyt − ua ). The coordinate yt therefore attains the unique maximum whenever a > 1; a singleton output alphabet needs no comparison. Every strictly positive probability vector admits finite logits given by the coordinatewise logarithm. Thus these tensors and initialization define a Softmax DFST reproducing every expert action at every finite time. The margins shrink with t, so this exact-real construction alone supplies no finite-precision robustness guarantee. Softmax DFSTs under Rounded Arithmetic. For the d-dimensional one-hot construction above, assign logit 0 to each selected coordinate and −L to every other coordinate. A stable softmax whose exponential rounds exp(−L) to zero produces exactly the required one-hot column; apply the same construction to the initial state. For example, correctly rounded binary32 exponentiation with round-to-nearest underflows exp(−128) to zero. Once the implementation produces these vertices and preserves the corresponding matrix–vector operations, the original induction applies unchanged for every execution length. The saturation condition concerns the effective probabilities, rather than large finite logits alone. For Turing-completeness, observe that standard Turing machines arise as grid agents restricted to a single row of the grid. Each construction emulates every such agent under the stated arithmetic conditions, so both controller families can simulate any Turing machine. B.2
Non-Uniqueness of Emulating Parametrizations
The one-hot construction in the proof above produces one particular DFST that emulates a given grid agent T , but many other parametrizations achieve the same behavior. In exact arithmetic, any invertible matrix R ∈ Qd×d defines an equivalent controller through A′ [x] = RA[x]R−1 ,
B ′ [x] = B[x]R−1 ,
C ′ [x] = C[x]R−1 ,
h′0 = Rh0 .
Induction gives h′t = Rht for every read sequence, while B ′ [xt ]h′t−1 = B[xt ]ht−1 and C ′ [xt ]h′t−1 = C[xt ]ht−1 preserve both readouts. Thus the transformed controller reproduces every action and PTO. Choosing R = cId for distinct nonzero rational values c already yields infinitely many distinct exact-arithmetic parametrizations, since h0 ̸= 0. These transformations preserve the PTO loss and therefore generate infinitely many zero-loss realizations of the expert’s one-hot targets. A fixed finite arithmetic format admits only finitely many parameter configurations. Arbitrary rational changes of basis need not preserve representability or execution under rounding, so the infinitude claim does not extend to fixed finite precision. Permutations of the one-hot construction nevertheless preserve the binary weights and vertex operations, yielding equivalent finite-precision realizations whenever those operations remain exact. Separately, adding unreachable states yields infinitely many discrete grid agents with the same observable policy. 19
B.3
Hidden-State Dimension and State Complexity
Theorem 2.5 guarantees that an n-dimensional ordinary DFST suffices to emulate any n-state grid agent. Most ordinary-DFST experiments therefore match the hidden dimension to the expert state count, but successful learning does not require an exact match. For the 11-state add2 expert, a sweep over hidden dimensions d ∈ {5, 8, 11, 14, 17} reaches the 5000-digit RLG cap at every tested dimension except d = 5. Thus both a smaller controller and controllers with excess capacity achieve extreme tested generalization. These finite probes do not establish exact simulation on arbitrary inputs or identify the minimum sufficient dimension. The Softmax DFST sweeps provide complementary evidence for the benefits of additional capacity (Figures 9 and 13). Binary addition reaches both caps with dimensions 22 and 33, compared with 11 expert states; binary multiplication reaches both caps with dimensions 64 and 96, compared with 32 expert states. Universal simulation reaches every task cap with dimensions 30 and 45, compared with 15 expert states. Across these tasks, successful configurations therefore accommodate two or three times the expert state count. Larger dimensions do not improve every configuration, but these results support choosing excess capacity when the expert state count remains unknown: precise knowledge of that count need not precede successful training. Precisely characterizing the minimum hidden dimension required for a DFST to simulate a given n-state FST remains an open direction. The one-hot construction supplies an upper bound of n for ordinary DFSTs, while smaller representations may exploit the structure of the target transitions and outputs. Such a characterization should distinguish agreement on all input strings from agreement only on realizable environment traces, and account for arithmetic precision and readout margins. A separate question concerns whether gradient-based training can reliably discover representations near the minimum dimension.
C
Grid Agents, PTOs, and Task Catalog
This appendix collects the pedagogical interpretation of PTOs, the formal notation for grid-agent execution, the hardness results that motivate our learning paradigm, and the full catalog of expert agents used in our experiments. C.1
Pedagogical Interpretation of PTOs
Intelligent agents rarely acquire novel algorithmic skills from input–output pairs alone. Rather, learning typically proceeds from observing the evolution of an underlying computational process and inferring the target function from intermediate steps. The PTO formalism admits a concrete pedagogical interpretation: A grid agent models a teacher navigating a blackboard, with qt corresponding to the teacher’s mental state, pt marking the chalk’s position, and xt+1 denoting the symbol written at that position. Students observe the chalk’s movements mt+1 and the evolving blackboard contents st+1 but lack access to the teacher’s neuronal activity qt → qt+1 . PTOs thus capture a rich but reasonable chain of thought – not unlike the algorithmic scratchpad data employed to boost length generalization in Transformers (Lee et al., 2023), yet grounded in the natural structure of agentic computation rather than requiring internal-state annotations (Hou et al., 2025; Cai et al., 2017). C.2
Extended Notation for Grid-Agent Execution
We extend δ and γ recursively to Q × Σ⋆ in the standard way and denote by T (x) = T (x1 . . . xn ) the output sequence γ(q0 , x1 ), γ(δ(q0 , x1 ), x2 ), . . . , γ(δ(q0 , x1 . . . xn−1 ), xn ). Each algorithmic task P comes with a set of well-specified inputs SP ⊆ Σ⋆ . For arithmetic tasks, each input x ∈ SP occupies cells (0, 0), . . . , (|x| − 1, 0) on an otherwise empty grid. Universal inputs use the program-and-tape encoding in Section F.2. We also denote the initial world-state by x (overloading notation). Running the expert grid agent T on x produces a PTO T [x]. We write T {x} for the input trace – the sequence of symbols observed by T during execution on x – so that T (T {x}) gives the corresponding output trace. For a training set S ⊆ SP , we write T [S] for the PTOs induced by S and T {S} for the input traces due to S. Let I = T {SP } denote the set of all realizable input traces. 20
C.3
Hardness of Learning from Restricted Input Traces
Since I constitutes a restricted subset of Σ⋆ , a training set S – no matter how large – may leave some transitions of T unexplored. This incompleteness makes the learning problem fundamentally hard: Many irreducible FSTs can exhibit identical behavior on I. Learning FSTs from complete data constitutes a classical problem in grammatical inference, enjoying polynomial-size characteristic sets (Gold, 1978; Oncina and Garcia, 1992; De La Higuera, 1997; Parekh and Honavar, 2001) and efficient active-learning algorithms (Angluin, 1987; Vaandrager et al., 2022). However, restricting all observable inputs to the unknown set I dramatically increases difficulty. In particular, Papazov and Flammarion (2025, Theorem 17) proved that no polynomial-size characteristic set exists for this restricted problem, implying that no algorithm can learn the policy of every grid agent from polynomially many PTOs with lengths polynomial in the number of states of the expert agent. C.4
Expert Agent Catalog
Table 2 summarizes the state counts, alphabets, and runtimes of all grid agents and Turing machines used in our experiments. For arithmetic tasks, m and n denote the lengths in digits of the two operands; for all other tasks, n denotes the input length. For universal simulation, QM denotes the state set of the simulated Turing machine M , including the halting state, and |M [z]| counts the simulated machine’s actions on input z, including the stopping action. The runtime bound counts each teleportation as one action. The public controller walkthrough provides animated expert executions and instructions for inspecting individual computation steps. Table 2: Grid Agents and Turing Machines Used in Experiments. Task
# States |Q|
Alphabet Σ
Runtime
11 19 32 108
{0, 1, λ, +} {0, . . . , 9, λ, +} {0, 1, λ, ×} {0, . . . , 9, λ, ×}
O((m + n)2 ) O((m + n)2 ) O((m + n)2 ) O((m + n)2 )
Grid Agents add2 add10 mult2 mult10
Turing Machines (simulated by U ) parity flip cum-sum shift-left shift-right scaling-A(s) scaling-B(s) bit-delete reverse copy
{0, 1, λ} {0, 1, λ} {0, 1, λ} {0, 1, λ} {0, 1, λ} {0, 1, λ} {0, 1, λ} {0, 1, λ} {0, 1, λ} {0, 1, λ}
3 2 3 5 7 s+2 4s + 1 5 16 10
Θ(n) Θ(n) Θ(n) Θ(n) Θ(n) Θ(s) Θ(s) Θ(n) Θ(n2 ) Θ(n2 )
Universal Agent U (⟨M, z⟩)
D
15
{0, 1, λ, X, Y, Z, L, R, S} O(|QM | |M [z]|)
Implementation and Experimental Details
We specify the data, optimization, execution semantics, and evaluation protocol for the experiments. Section A compares these results with prior work. 21
Table 3: Generalization before Extraction. Selected ordinary DFST runs; N counts training PTOs and q bounds training operand length. Caps indicate successful finite probes, without asserting a failure beyond the cap. Task
d
N
q
Updates
Warm-up
ULG / RLG
add2 add10 mult2 mult10
11 19 32 108
25 250 100 10 000
3 3 5 5
500k 4M 500k 4M
50k 50k 25k 0
≥ 5000/ ≥ 5000 ≥ 5000/ ≥ 5000 ≥ 1000/ ≥ 1000 ≥ 1000/ ≥ 1000
The public repository provides training recipes, saved model weights and run configurations, and commands for reproducing the figures and analyses. D.1
Data and Controller Initialization
Arithmetic training uses small PTO datasets from distinct operand-string pairs, retaining leading zeros. Each set includes all single-digit pairs. Remaining pairs follow independent uniform sampling of each operand length from 1, . . . , q and of each digit from 0, . . . , R − 1, with duplicate pairs rejected. The ordinary-DFST datasets contain 25, 250, 100, and 10 000 PTOs for add2, add10, mult2, and mult10, respectively. Addition uses q = 3 and multiplication uses q = 5. These experiments use the ordinary sampler without an additional teaching-set coverage core. The plotted DFST and Softmax DFST sweeps use data seed 42. Separately, we replicated strong length generalization across three data-generation seeds using the same deterministic initialization recipe. Minibatch sampling chooses uniformly among occupied operand-length buckets, then uniformly among PTOs within the chosen bucket. Universal training first chooses a represented training task uniformly once per minibatch, then samples length buckets within that task. Consequently, training does not sample uniformly over all stored PTOs. Ordinary DFSTs start from A[x] = Id , B[x] = 0, C[x] = 0, and a trainable h0 = 1d . In the ordinary-DFST schedule sweeps, hidden dimensions match the experts: 11, 19, 32, and 108 for the four arithmetic tasks, and 15 for universal simulation. Inputs use frozen one-hot embeddings. The resulting arithmetic controllers contain 891, 8227, 5280, and 162 108 trainable parameters, respectively. Training uses float32 arithmetic and logarithmic-depth prefix scans. All DFST and Softmax DFST models begin PTO training from scratch without a pretrained checkpoint. Softmax DFSTs initialize the transition logits to Id , output logits to zero, and initial-state logits to 1d , then apply softmax normalization. Consequently, the effective initial state and output columns start uniformly, while transition columns favor the identity successor. Ordinary and softmax universal controllers contain 4335 and 12 720 trainable parameters at dimensions 15 and 30, respectively. D.2
Optimizer and Learning-Rate Schedule
Ordinary DFST training uses Adam (Kingma, 2014) with (β1 , β2 ) = (0.9, 0.999), ϵ = 10−8 , zero weight decay, batch size 32, and global gradient-norm clipping at 1. Let T denote the update budget, ω the warm-up duration, c the constant-rate duration, γ the peak rate, and γf the floor, with ω +c < T . The schedule follows 1−t/ω t/ω γ , 0 ≤ t < ω, γf ω ≤ t < ω + c, γ(t) = γ, 1−(t−ω−c)/(T −ω−c) (t−ω−c)/(T −ω−c) γ γf , ω + c ≤ t ≤ T.
(1)
A zero-duration phase contributes no updates. The DFST sweeps use c = 0; GRU dynamics include the plateaus in Table 5. Updates use t = 0, . . . , T − 1; the endpoint at T equals the floor. Within the DFST sweeps, binary arithmetic uses γ = 10−2 ; decimal arithmetic and universal simulation use γ = 10−3 . The DFST sweeps use γf = 10−7 ; the separate multiplication dynamics run uses 10−9 . 22
Table 4: Ordinary-DFST Schedule Sweeps. Every Cartesian-product combination contributes one cell in the arithmetic plots. Universal simulation varies the training-set size and update budget. Task
Hidden dimension
Total updates T
Warm-up ω
11 32 19 108 15
{250k, 500k, 1M} {250k, 500k, 1M} {1M, 2M, 4M} {1M, 2M, 4M} {250k, 500k}
{25k, 50k, 100k} {25k, 50k, 100k} {0, 50k, 100k} {0, 50k, 100k} 0
add2 mult2 add10 mult10 Universal
D.3
Loss and Training Loop
For a minibatch, let Mt mask valid timesteps and let 1st and 1mt encode the expert write and motion actions. The masked two-head MSE reads P Mt ∥ŝt − 1st ∥22 + ∥m̂t − 1mt ∥22 P L= t . (2) 2 t Mt The sum extends over the batch and time axes. Padding contributes neither recurrent updates nor loss. Training feeds expert observations into the controller and supervises the next write and motion. The ordinary-DFST runs use no curriculum, inverse-frequency weighting, or extraction during optimization. Logged losses average the action objective over updates in each logging window. The training-dynamics figure averages loss over 1000 updates and evaluates saved checkpoints every 100 000 updates. D.4
Softmax DFST Training
The probability parametrization in Section G replaces each transition and output column by a softmax distribution and normalizes the initial state. The initial training sweep uses 100 000 Adam updates at constant learning rate 0.1, MSE, batch size 32, gradient clipping at 1, and zero regularization weight. For add2, dimensions {11, 22, 33} combine with dataset sizes {25, 50, 75}; for mult2, dimensions {32, 64, 96} combine with sizes {100, 200, 300}. Universal simulation uses dimensions {15, 30, 45} and sizes {75, 150, 225}. The later annealing stage follows the separate procedure in Section G. Neither the softmax sweep nor annealing shares the ordinary-DFST learning-rate schedule by default. D.5
Additional State-Tracking Controllers
All controller families receive the currently observed symbol and emit separate write and motion scores. RNN and GRU heads act on the post-update hidden vector; DFST heads act on the previous vector together with the current observation. An Elman RNN uses ht = tanh(Wx xt + Wh ht−1 + b),
ŝt = Ws ht + bs ,
m̂t = Wm ht + bm .
GRU controllers replace the recurrence by gated reset, update, and candidate-state operations while retaining the same action heads. All recurrent baselines use one layer and frozen one-hot input embeddings. The RNN addition run initializes recurrent weights orthogonally, input weights with Xavier initialization, and recurrent biases to zero, with a fixed zero initial state. The RNN multiplication run and both GRU runs use zero input weights, zero recurrent biases, and a trainable all-ones initial state. For RNN multiplication, the recurrent matrix starts at the identity. For GRUs, only the candidate-state recurrent block starts at the identity; reset- and update-gate recurrent blocks start at zero. All RNN and GRU action heads use the linear layers’ default random initialization. Addition controllers contain 891, 1513, and 3977 trainable parameters for DFST, RNN, and GRU, respectively; multiplication controllers contain 5280, 5129, and 14089. Each addition dataset contains 25 PTOs with operands of at most three digits; each multiplication dataset contains 100 PTOs with operands of at most five digits. The different seeds produce different datasets within the same sampling recipe. Consequently, the training histories demonstrate successful learning across controller families without isolating architecture from initialization, data, and optimization choices. 23
Task / controller add2 / DFST add2 / RNN add2 / GRU mult2 / DFST mult2 / RNN mult2 / GRU
d
γ
γf
−2
−7
11 10 32 10−2 32 3 · 10−3 32 10−2 64 3 · 10−3 64 3 · 10−3
ω
c Clip Seed
10 50k 0 10−7 0 0 10−7 100k 800k 10−9 25k 0 10−7 0 0 10−7 100k 200k
1 0.1 0.1 1 0.1 0.1
42 123 17 42 1 11
Table 5: Controller-Comparison Training Configurations. Every run uses T = 106 Adam updates, MSE, batch size 32, zero weight decay, and no curriculum or inverse-frequency weighting. Warm-up and plateau durations count updates; cooldown lasts T − ω − c. Clip denotes the global gradientnorm threshold. The seed controls dataset generation, model initialization, and training sampling; evaluation uses seed 42 for every run.
D.6
Length-Generalization Evaluation
Every probe streams an expert PTO and requires the predicted write and motion to match at every real timestep, including the single final stopping action. ULG tests ten uniformly sampled pairs with both operands of exactly L digits. RLG additionally tests all R2 repdigit pairs (aL , bL ) with a, b ∈ {0, . . . , R − 1}: four pairs for binary arithmetic and 100 for decimal arithmetic. A deterministic generator indexed by the evaluation seed, task, and candidate length fixes random probes independently of the search history. The search first tests the cap: 5000 digits for addition, 1000 for multiplication, and 500 input symbols for universal simulation. A successful cap probe terminates the search. Otherwise, binary search probes smaller lengths; RLG cannot exceed the measured ULG. Binary search assumes monotone pass/fail behavior with length and does not exhaustively test every shorter length. Consequently, reported values describe the implemented search, and the notation ≥ Lmax records a successful capped test, not an exact maximal horizon or a mathematical guarantee for all shorter inputs. Evaluation uses batches of at most ten expert streams, chunks of 8192 transitions, and continuation state across chunks. Ordinary DFST evaluations, including the training-dynamics runs, use parallel matrix scans; the initial softmax evaluations use sequential recurrence. RNN and GRU evaluations retain the native recurrent implementation with continuation states across chunks, even when the shared evaluation configuration records the parallel scan option. These choices matter under finite precision: parallel and sequential products can differ through rounding, and ordinary-DFST sequential stabilization rescales hidden states while the parallel path uses unscaled products. All statements about agreement concern the recorded execution mode. Extraction and the conditional transfer arguments require the corresponding execution semantics rather than an unqualified interchange of numerical implementations. Teacher Forcing and Closed-Loop Agreement. For a deterministic recurrent execution rule and environment, exact next-action agreement along the complete expert PTO implies identical closedloop execution on that input: induction gives the same environment, next observation, and controller history after every matching action. Floating-point parallel scans require additional care because the arithmetic association can differ from a stepwise rollout. We report the actual teacher-forced exact-match protocol and treat the autonomous extracted-FST equivalence proofs separately. Compute Reporting. The released configurations specify CUDA execution on single NVIDIA A100-SXM4- 40GB and Tesla V100-SXM2-32GB GPUs. D.7
Optimization Limitations and Dataset Coverage
The ordinary-DFST sweep reaches the RLG cap in five of nine add2, three of nine mult2, five of nine add10, and two of nine mult10 configurations. Additional updates need not improve RLG, and low training loss alone does not certify algorithmic correctness. The results demonstrate successful configurations across tasks and parametrizations, without asserting success for every schedule or seed. 24
Task
Controller
add2
DFST RNN GRU DFST RNN GRU
mult2
First ULG cap
First RLG cap
Final ULG / RLG
200k 100k 500k 400k 300k 400k
400k 100k 900k 400k 300k 400k
≥ 5000/ ≥ 5000 ≥ 5000/ ≥ 5000 ≥ 5000/ ≥ 5000 ≥ 1000/ ≥ 1000 ≥ 1000/ ≥ 1000 ≥ 1000/ ≥ 1000
Table 6: First Recorded Cap-Reaching Checkpoints and Final Results. Checkpoints occur every 100k updates; first recorded success does not identify the exact crossing time. Final results refer to one million updates. Caps bound the tests rather than the algorithms.
Our Softmax DFST training attempts on decimal addition and multiplication failed to fit even very small training datasets. The softmax distributions quickly saturate, gradients vanish, and learning stalls, consistent with convergence to a poor local minimum. These failures concern fitting the training examples, before length generalization or extraction. Developing a robust training procedure for larger Softmax DFST controllers remains an open direction for future experiments. Dataset coverage also affects generalization. Without guaranteed transition coverage, finite random sampling can omit a reachable expert transition with nonzero probability, leaving the corresponding behavior unrepresented in the training PTOs. An important research direction concerns identifying minimal teaching sets that cover all reachable expert transitions and provide sufficient information for exact learning and extreme length generalization. Transition coverage alone need not distinguish the expert from every alternative controller, so this objective also requires understanding which execution contexts resolve behavioral ambiguities. Our repository implements preliminary teaching sets that exercise all reachable transitions of the task experts, but we have not yet evaluated these sets for neural-controller training.
E
Additional Generalization Results
E.1
Uniform and Robust Generalization
Figures 7 and 8 present the complete ULG and RLG sweeps for ordinary DFSTs. Uniform success can coexist with failures on structured repdigit inputs: for example, every add2 run reaches ULG 5000, while only five of nine runs reach RLG 5000. The two measurements therefore reveal distinct failure modes. E.2
Softmax Parametrization
Figure 9 reports the initial differentiable-training sweep, before annealing or argmax extraction. Five of nine binary-addition configurations reach both caps. Five of nine binary-multiplication configurations also reach both caps, providing starting points for the interpretable extraction procedure in Section G. Every recorded cell gives identical ULG and RLG, although ordinary DFST sweeps exhibit gaps between the two metrics. Increased state dimension and additional data can help optimization, but the sweep does not support monotone improvement with either quantity. The cap-reaching checkpoints use unregularized training; sharpening follows as a separate continuation stage. E.3
Training Dynamics across Controller Families
The released training histories include loss logs, run configurations, and checkpoint evaluations for all six runs below. Figure 10 compares million-update DFST, RNN, and GRU runs on both binary tasks. Each addition run uses 25 training PTOs with operands of at most three digits; each multiplication run uses 100 PTOs with operands of at most five digits. All six final checkpoints reach ULG and RLG caps of 5000 for addition and 1000 for multiplication. RLG tests all four binary repdigit cross-pairs. 25
≥5000
500k
≥5000
≥5000
≥5000
250k
≥5000
≥5000
≥5000
25k
50k
100k
Warmup Steps
1000
100
10
4M
≥5000
≥5000
≥5000
2M
≥5000
≥5000
4002
1M
≥5000
1541
1205
0
50k
100k
1
Warmup Steps
(a) Binary Addition.
41
51 100
500k
≥1000
≥1000
44 10
250k
849
≥1000
45
25k
50k
100k
Warmup Steps
Training Steps
8
mult10
ULG Length
Training Steps
1M
100
10
1
(b) Decimal Addition. 1000
mult2
1000
ULG Length
≥5000
5000
4M
≥1000
493 100
2M
71
300
167 10
1M
1
≥1000
1000
34
234
70
0
50k
100k
Warmup Steps
(c) Binary Multiplication.
ULG Length
≥5000
Training Steps
1M
ULG Length
Training Steps
add10
5000
add2
1
(d) Decimal Multiplication.
Figure 7: DFST Uniform Length Generalization. Each panel varies the update budget and warm-up duration. ULG requires exact action agreement along ten sampled expert trajectories; cap values denote successful finite probes. Figure 8 evaluates the same runs on structured inputs. The addition curves separate random-input and structured-input generalization. The RNN already passes both caps at the first evaluated checkpoint. At 200k updates, DFST reaches ULG 5000 but RLG 2630; both measurements fall at 300k, to 1258 and 1062, before reaching both caps at 400k. GRU reaches ULG 5000 at 500k updates while RLG reaches only 526; RLG subsequently reaches 5000 at 900k. These trajectories show that additional optimization can improve behavior on structured inputs after random-input tests saturate, and that intermediate generalization need not improve monotonically. Figure 11 supplies the corresponding ULG curves. All multiplication runs reach both caps by 400k updates. After first reaching an RLG cap, every later recorded checkpoint retains the cap. Across both tasks, the shared outcome supports state tracking with PTO supervision across multilinear, ungated recurrent, and gated recurrent controllers. Different hidden dimensions, initializations, seeds, and learning-rate schedules prevent a causal ranking of controller architectures; the histories establish successful learning for the selected configurations without quantifying success probabilities over random seeds. The DFST multiplication trajectory uses a learning-rate floor of 10−9 , distinct from the 10−7 floor in the schedule sweep. Both GRU runs include a constant-rate phase between exponential warm-up and cooldown. The complete settings appear in Table 5.
26
≥5000
500k
55
≥5000
≥5000
250k
4582
≥5000
91
25k
50k
100k
Warmup Steps
1000
100
10
4M
≥5000
≥5000
≥5000
2M
≥5000
≥5000
3216
1M
85
130
276
0
50k
100k
1
Warmup Steps
(a) Binary Addition.
41
51 100
500k
≥1000
≥1000
44 10
250k
849
≥1000
45
25k
50k
100k
Warmup Steps
Training Steps
8
mult10
RLG Length
Training Steps
1M
100
10
1
(b) Decimal Addition. 1000
mult2
1000
RLG Length
≥5000
5000
4M
≥1000
107 100
2M
51
300
108 10
1M
1
≥1000
1000
34
107
70
0
50k
100k
Warmup Steps
(c) Binary Multiplication.
RLG Length
36
Training Steps
1M
RLG Length
Training Steps
add10
5000
add2
1
(d) Decimal Multiplication.
Figure 8: DFST Robust Length Generalization. The training schedules match Figure 7. RLG supplements random-input testing with every repdigit cross-pair, four in binary and 100 in decimal. Cap values denote successful finite probes.
27
RLG
0
≥5000
≥5000
50
0
≥5000
≥5000
25
0
2
≥5000
11
22
33
5000
75
0
≥5000
≥5000
50
0
≥5000
≥5000
25
0
2
≥5000
11
22
33
Hidden Dimensions
1000
100
10
Generalization Length
75
Dataset Size
Dataset Size
ULG
1
Hidden Dimensions (a) Binary Addition.
200
100
1
2
≥1000
≥1000
≥1000
≥1000
1
≥1000
5
32
64
96
300
Dataset Size
Dataset Size
300
RLG
1
≥1000
1000
≥1000 100
200
2
≥1000
≥1000 10
100
Hidden Dimensions
1
≥1000
5
32
64
96
Hidden Dimensions
Generalization Length
ULG
1
(b) Binary Multiplication.
Figure 9: Initial Softmax DFST Generalization. Each panel compares ULG and RLG across hidden dimensions and training-set sizes after 100k updates. The displayed results precede the annealing stage.
28
add2 · Averaged Training Loss
add2 · RLG Every 100k Iterations Evaluation Cap: 5000
DFST
5000
RNN GRU
10 −2
4000
10 −4
RLG Length
Training Loss (MSE)
10 0
10 −6 10 −8
3000
2000
10 −10 1000
DFST
10 −12
RNN GRU
0 0
200k
400k
600k
800k
1M
0
200k
Training Iteration
400k
600k
800k
1M
Training Iteration
(a) Binary Addition: 5000-Digit Cap. mult2 · Averaged Training Loss 10 0
mult2 · RLG Every 100k Iterations Evaluation Cap: 1000
DFST
1000
RNN
10 −2
10
800
RLG Length
Training Loss (MSE)
GRU
−4
10 −6
600
400
10 −8 200 10
DFST RNN
−10
GRU
0 0
200k
400k
600k
800k
1M
0
200k
Training Iteration
400k
600k
800k
1M
Training Iteration
(b) Binary Multiplication: 1000-Digit Cap.
Figure 10: Training Dynamics for Three State-Tracking Controllers. Left panels show training MSE averaged over 1000 updates; right panels show RLG measured every 100k updates using all four binary repdigit pairs. Every final checkpoint reaches the task cap. Curves describe selected runs with different dimensions, seeds, initializations, and schedules (Table 5), rather than an isolated comparison of architectures.
29
add2 · Averaged Training Loss
add2 · ULG Every 100k Iterations Evaluation Cap: 5000
DFST
5000
RNN GRU
10 −2
4000
10 −4
ULG Length
Training Loss (MSE)
10 0
10 −6 10 −8
3000
2000
10 −10 1000
DFST
10 −12
RNN GRU
0 0
200k
400k
600k
800k
1M
0
200k
Training Iteration
400k
600k
800k
1M
Training Iteration
(a) Binary Addition: 5000-Digit Cap. mult2 · Averaged Training Loss 10 0
mult2 · ULG Every 100k Iterations Evaluation Cap: 1000
DFST
1000
RNN
10 −2
10
−4
10
−6
800
ULG Length
Training Loss (MSE)
GRU
600
400
10 −8 200
DFST RNN
10 −10
GRU
0 0
200k
400k
600k
800k
1M
0
200k
Training Iteration
400k
600k
800k
1M
Training Iteration
(b) Binary Multiplication: 1000-Digit Cap.
Figure 11: Uniform Generalization during Training. The loss curves and checkpoints match Figure 10; the right panels show ULG. Comparing ULG and RLG distinguishes random-input success from robustness to repdigit inputs.
30
F
Universal-Agent Experiments
The universal expert uses 15 states, a nine-symbol alphabet, and eight motion tokens. A single learned controller receives the encoded program through the environment; no controller weights change between simulated tasks. F.1
Teleportation Runes
The controller observes only the symbol under the grid head and emits a symbol to write and a motion token. The environment applies the write before the motion. The alphabet contains {λ, 0, 1, L, R, S, X, Y, Z}; motions comprise {L, R, U, D, S, X, Y, Z}, with S stopping execution. The three symbols X, Y, Z provide relocatable bookmarks. Writing a rune stores the symbol underneath the rune at the current cell. Rewriting the same rune restores the hidden symbol at the previous location and relocates the bookmark. A motion token X, Y , or Z jumps directly to the corresponding bookmark; writing a rune alone does not trigger a jump. Jumping to an unplaced rune leaves the head in place; valid simulations place each bookmark before use. Ordinary writes overwrite the current cell and remove any rune occupying that cell. The simulation relation must therefore track both visible grid contents and hidden symbols beneath runes. During simulation, Z marks the simulated tape head, X identifies the program-table block for the current simulated state, and Y bookmarks the instruction currently undergoing decoding. These operations shorten transport between the program and tape while preserving a finite controller and an unbounded environment. F.2
Program Encoding
For a binary Turing machine with s states, including the halting state, choose ternary width κ = max{1, ⌈log3 s⌉}. Encode state indices using L, R, S for ternary digits 0, 1, 2. Order program-table rows lexicographically by state index and read symbol, with blank preceding 0 and 1. Each row contains [ x, λ, code(q), 0, code(q ′ ), 0, w, m ], where (q ′ , w, m) denotes the Turing-machine transition on (q, x). The two delimiter zeros separate state fields. State codes use most-significant trits first. Thus the table contains 3s rows and 2κ + 6 columns, with three consecutive rows per state. Unoccupied grid cells contain blanks. For example, with s = 3, a transition (q, x) = (0, 1) 7→ (2, 0, R) contributes the row [1, λ, L, 0, S, 0, 0, R]. Initially, X covers the blank in column 1 of the first program row. The input word occupies columns starting at 1 of the row below the program table, and the universal head starts at the first input symbol. The controller starts in state 0. Each simulated step first records the tape-head position with Z and jumps to X. A vertical search within the current-state block selects the row matching the read symbol. The controller then crosses the current-state code and decodes the next-state code one trit at a time: Y bookmarks the instruction field, while X advances through matching state-code columns using vertical searches. After locating the successor-state block, the controller returns X to column 1, reads the write symbol and motion through Y , and jumps to Z to execute the tape action. A simulated S action performs the specified write and stops the universal controller. Rune relocation restores covered program symbols, allowing repeated interpretation of the same table without changing controller weights. The metric-extraction equivalence result in Section H covers correctly encoded programs and nonempty binary input words. The annealed controller also admits the empty word; the two theorem domains remain distinct. The simulation requires O(|QM | |M [z]|) actions, where QM denotes the state set of M , including the halting state, and |M [z]| counts the actions of M on z, including the stopping action. Each teleportation counts as one action. F.3
Training and Evaluation Programs
Training samples 75, 150, or 225 PTOs with input lengths at most five from five programs: parity, shift-left, shift-right, scaling-A(5), and scaling-B(5). Static sampling includes at least one example from each training program and fills the remaining slots by random task and input 31
sampling. The implemented sampler permits empty words, although the metric-extraction equivalence theorem restricts the unbounded claim to nonempty words. Evaluation includes all five training families and five held-out programs: bit inversion (flip), prefix parity (cum-sum), parity-dependent bit deletion (bit-delete), reversal, and copying. The last two programs require repeated scans over growing tape regions. The scaling tests set the program parameter to the candidate input length, so evaluation at 500 increases both input length and encoded machine size. scaling-A(s) executes s nonhalting steps followed by one stopping action; scaling-B(s) follows a parity-dependent walk through a finite chain of states. These families test new program sizes as well as longer inputs. Table 7 summarizes the implemented programs. Alternatively, readers can inspect animated executions through the public controller-animation notebook or the animation command, for example del animate tp:copy ’1011’.
Table 7: Implemented Binary Turing Machines. Examples start from 1011 in cells 0, . . . , 3, with the head at cell 0. Notation v@j places word v starting at cell j; λ denotes a blank, and all unlisted cells remain blank. Scaling examples use parameter s = 5. Program
Tape transformation
Final tape example
parity
Erases the input and writes the parity of the number of ones immediately after the original word. Moves the entire word one cell left, preserving bit order. Moves the entire word one cell right, preserving bit order. Performs s state-indexed bit-flipping moves, then a symbolpreserving stopping action; see the rule below. Performs s parity-dependent rewrites, changing direction after encountering blanks; the final rewrite stops.
1@4
shift-left shift-right scaling-A(s) scaling-B(s) flip cum-sum bit-delete reverse copy
Replaces each bit b with 1 − b in place. Replaces each bit with the parity of the input prefix ending at that position. Retains zeros for even input length and ones for odd input length; replaces other bits with blanks without compacting the tape. Reverses the word and relocates the result to cells −(n − 1), . . . , 0 for nonempty input of length n. Retains the input and appends a second copy after one blank cell.
1011@−1 1011@1 00111@−1 11011@0 0100@0 1101@0 λ0λλ@0 1101@−3 1011λ1011@0
For scaling-A(s), step i = 0, . . . , s − 1 maps 0 to 1 and moves left, or maps 1 to 0 and moves right. On a blank, step i writes (i + 1) mod 2 and moves left for even i, right for odd i. For scaling-B(s), initialize parity p = 0 and direction right. Reading a bit b writes p ⊕ b and updates p to that value; reading a blank writes p and reverses the direction for the next step. Each nonfinal step moves in the direction held before the read; step s writes and stops.
F.4
Generalization across Training Configurations
Figure 13 collects every evaluated universal configuration across all ten tasks. All three ordinaryDFST runs with 500k updates reach the 500-symbol cap on every task. At 250k updates, the runs reach the cap on eight, eight, and nine tasks for N = 75, 150, 225, respectively. The remaining failures involve reversal, copying, or the second scaling family. For Softmax DFSTs, two of nine configurations reach the cap on all ten tasks after 100k updates: (d, N ) = (30, 150) and (45, 75). Several other configurations succeed on all eight fixed programs but fail on at least one scaling family. Thus generalization across fixed programs does not guarantee extrapolation in encoded machine size, and increasing dimension or dataset size does not uniformly improve the outcome. 32
DFST · Hidden Dimensions 15 · Dataset Size 75 · Steps 500,000 Seen Tasks
Unseen Tasks
DFST_Softmax · Hidden Dimensions 30 · Dataset Size 150 · Steps 100,000 Seen Tasks
Unseen Tasks
≥ 500
Copy
Reverse
≥ 500
Reverse
≥ 500
Bit-Delete
≥ 500
Bit-Delete
≥ 500
Cum-Sum
≥ 500
Cum-Sum
≥ 500
Flip
≥ 500
Flip
≥ 500
Parity
≥ 500
Parity
≥ 500
Shift-Right
≥ 500
Shift-Left
≥ 500
Scaling-B
≥ 500
Scaling-A
Copy
Shift-Right
Model Size 4,335 Parameters
Shift-Left Training Set 75 PTOs
Scaling-B Scaling-A 1
5
10
100
1,000
≥ 500
≥ 500 ≥ 500
Model Size 12,720 Parameters
≥ 500 Training Set 150 PTOs
≥ 500 ≥ 500
1
5
Input Length (Log Scale)
10
100
1,000
Input Length (Log Scale)
(a) DFST: d = 15, N = 75, 500k Updates.
(b) Softmax DFST: d = 30, N = 150, 100k Updates.
Figure 12: Generalization across Encoded Programs before Extraction. Selected differentiably trained controllers reach the 500-symbol cap on all ten evaluation tasks. Training inputs contain at most five symbols. The scaling tests also increase the program parameter from 5 to 500. F.5
PTO Lengths at the Evaluation Caps
Operand length understates the execution horizon. Direct replay of the expert transition maps gives 50 070 010 PTO steps for adding two 5000-digit copies of the maximal digit and 15 012 991 steps for multiplying two 1000-digit copies, in both radix 2 and radix 10. These counts include exactly one stopping action. The maximal-digit examples belong to the evaluated repdigit family. The counts describe expert trajectories used by the cap probes; the counts do not constitute additional neural-model evaluations. For universal simulation, replaying the ten deterministic evaluation inputs at length 500 for each task gives the maxima below. The longest sampled trajectory contains 15 316 822 steps, for copying. Thus a successful 500-symbol probe can require more than fifteen million consecutive action matches. Table 8: Maximum Expert PTO Length among the 10 Seeded 500-Symbol Evaluation Inputs per Universal Task. Each count includes the final stopping action once. Task
PTO steps
Task
PTO steps
parity cum-sum shift-left reverse scaling-A(500)
9295 9298 41 806 14 911 144 25 784
flip bit-delete shift-right copy scaling-B(500)
9295 24 838 54 086 15 316 822 427 803
33
N=75, T=250k
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
274
292
≥ 500
≥ 500
N=150, T=250k
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
393
≥ 500
≥ 500
433
N=225, T=250k
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
378
≥ 500
≥ 500
N=75, T=500k
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
N=150, T=500k
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
N=225, T=500k
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
rity
Fli
rse
py Co
p
Pa
m
Su m-
Cu
eft
t-L hif
S
ght
Ri ift-
Sh
lete
e it-D
B
ve Re
g-A
in cal
S
g-B
500
250
Tested Input Length
DFST: 15 Hidden Coordinates
0
in cal
S
(a) Ordinary DFST: Dataset Size and Update Budget. Softmax DFST: 100k Training Updates ≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
485
≥ 500
d=15, N=150
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
485
≥ 500
d=15, N=225
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
485
≥ 500
d=30, N=75
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
17
6
d=30, N=150
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
d=30, N=225
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
485
≥ 500
d=45, N=75
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
d=45, N=150
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
17
6
d=45, N=225
≥ 500
≥ 500
≥ 500
≥ 500
≥ 500
0
1
1
26
6
ty ari
Fli
p
m -Su
t
te ele
rs eve
e
py Co
-A ing
-B ing
P
Cu
m
ft
Sh
Le ift-
Sh
i
igh ft-R
Bit
-D
R
l
Sca
l
Sca
500
250
Tested Input Length
d=15, N=75
0
(b) Softmax DFST: Hidden Dimension and Dataset Size.
Figure 13: Complete Universal-Simulation Sweeps before Extraction. Each cell reports the tested input length under exact PTO agreement. The notation ≥ 500 marks the evaluation cap. Training inputs contain at most five symbols; N counts PTOs, d denotes hidden dimension, and T counts training updates. Scaling tests increase the encoded machine size together with input length.
34
G
Extracting Interpretable Finite-State Controllers
A trained recurrent controller already induces a finite-state machine under fixed finite-precision execution. Extraction seeks a compact description of the learned policy, suitable for interpretation and mathematical verification. We use two complementary constructions: metric extraction groups hidden states with similar geometry; annealing encourages a Softmax DFST to approach deterministic transitions. Neither construction uses expert hidden-state labels. The equivalence proofs in Section H concern the resulting discrete controllers. Transferring those proofs to the neural controllers requires the additional conditions stated below. Executable notebooks accompany both metric extraction and annealing, with saved cases and instructions for analyzing another trained checkpoint. G.1
Metric Extraction from DFST Trajectories
Autonomous Trajectory Collection. Fix a trained controller with hidden-state update fx and decoded action gx , where x ∈ Σ and gx (h) ∈ Σ × M. For a DFST, fx (h) = A[x]h and gx (h) = argmax B[x]h, argmax C[x]h . The readouts use the hidden state before the transition. From each sampled valid initial environment z, run the neural controller autonomously: the predicted write and movement determine the next observation. Record (ht−1 , xt , st , mt , ht ), 1 ≤ t ≤ L(z). Thus extraction observes the controller’s actual policy rather than a teacher-forced continuation after an erroneous action. A stopping action contributes the final PTO triple exactly once. Nonfinite states and runs exceeding the collection budget trigger failure rather than a fictitious halt. The metric case studies use the unrescaled sequential DFST recurrence during collection; any transfer claim refers to the same arithmetic and execution convention. Geometric Grouping and Deterministic Closure. For a finite trajectory collection, connect two nonterminal hidden-state occurrences whenever the Euclidean distance does not exceed ε. Take the connected components of this proximity graph. Connectedness permits chains of nearby points; a component need not have diameter at most ε. For each component q and observation x, inspect all recorded transitions. Conflicting write–movement pairs invalidate the threshold. Otherwise, merge the successor components whenever the same pair (q, x) reaches several successors, and repeat the consistency check and successor merging. Keep a distinguished halt state separate from nonterminal components; a required halt/nonhalt merger also invalidates the threshold. Every successful merger reduces the finite component count, so closure either terminates with a deterministic graph or detects a conflict. In the accepted graph G(S, ε), an unobserved state–symbol pair remains undefined. Threshold selection uses the complete extraction sample before measuring graph stability. Starting from a proposed ε, halve the threshold after a conflict and restart from the original observations. The implementation permits 65 positive-threshold attempts followed by a zero-threshold attempt; an unresolved conflict aborts extraction. A successful threshold supplies consistency with the collected trajectories, without certifying behavior beyond those trajectories. Exact Quotient Reduction. Redirect stopping transitions to a single halt node, preserving the written symbol. Conventional halt self-loops only describe behavior after execution has stopped. Apply Hopcroft partition refinement to the resulting partial Mealy transducer, distinguishing final status, output labels, and definedness. Two states can share a quotient class only when every symbol has matching definedness and, for each defined transition, matching outputs and successor classes. The quotient therefore preserves all defined traces and all missing transitions. This reduction differs from completing unknown transitions or merging states merely because the observed samples fail to distinguish the states. The case studies additionally check the quotient map transition by transition and replay every extraction trajectory. What Graph Stability Requires. At the accepted threshold, add trajectories one at a time and compare the rooted, input/output-labeled graphs up to state renaming. The comparison preserves the initial state, halt status, missing edges, and every transition label. Equal numbers of nodes and edges alone do not establish graph identity. In the five case studies, the final unchanged suffix begins at sample 4, 42, 143, 1,870, and 23 for add2, mult2, add10, mult10, and universal, respectively. Figure 14 displays the corresponding finite observations. 35
Task
Inputs
ε
Raw states
Raw edges
Quotient states
add2 mult2 add10 mult10 universal
100 100 250 2,000 100
0.5 0.125 0.5 0.25 0.5
23 70 52 195 49
44 133 223 1,282 78
22 61 52 182 44
Table 9: Metric Extraction Case Studies. Raw counts describe the final deterministic graph before quotient reduction and before conventional halt loops. State counts include the halt node. Arithmetic extraction samples use operands of at most 10 digits for addition and five digits for binary multiplication. Decimal multiplication combines 355 random inputs with operands of at most two digits and 1,645 protocol-covering teaching inputs with operands of at most five digits; these inputs support extraction and do not constitute additional gradient-training examples. Universal extraction uses length-five inputs across all ten evaluation task families.
Assumption H.1 requires substantially more: every finite enlargement of the sample by valid executions must preserve the same rooted labeled graph. For a nonhalting universal computation, the requirement extends to every finite execution prefix. A finite plateau provides evidence for this assumption, never a proof. Under the assumption, every valid neural trajectory follows a path already represented by the stable graph. Trace-preserving quotient reduction then transfers the neural policy to the compact controller, as formalized in Theorem 4.3. The assumption must refer to the deployed recurrence, rounding convention, and state normalization; changing those conventions requires a corresponding argument. G.2
Annealing and Argmax Extraction from Softmax DFSTs
A Differentiable Probabilistic Parametrization. The model DFST_Softmax replaces unconstrained DFST tensors by column-stochastic tensors. For trainable logits ΘA , ΘB , ΘC and θh , define exp(ΘA [x]ij ) A[x]ij = Pd , A k=1 exp(Θ [x]kj )
exp(θih ) h0,i = Pd , h k=1 exp(θk ) exp(ΘC [x]mj ) . C v∈M exp(Θ [x]vj )
exp(ΘB [x]sj ) , B u∈Σ exp(Θ [x]uj )
C[x]mj = P
B[x]sj = P
(3) (4)
The case studies use a fixed one-hot input embedding. In exact arithmetic, ht = A[xt ]ht−1 remains in the probability simplex, and B[xt ]ht−1 and C[xt ]ht−1 give distributions over writes and movements. Execution selects the largest coordinate of each readout. Softmax changes the parameterization, while the recurrence still admits the associative matrix scan used for DFST training. A deterministic FST corresponds to simplex vertices: one-hot initial state and one-hot columns of all three tensors. Differentiable Concentration toward Deterministic Transitions. After ordinary PTO training, continue optimizing the same supervised objective with a concentration penalty. With K = |Σ|, define ! d X X X 1 XX 2 2 R(θ) = 1− P [x]ij + 1 − h0,i . (5) Kd j=1 i i P ∈{A,B,C}
x∈Σ
Each summand vanishes at a simplex vertex and penalizes distributed probability mass. At update k = 1, . . . , N , optimize (k−1)/(N −1) λend LPTO (θ) + λk R(θ), λk = λstart . (6) λstart All three case studies start from a 100,000-update checkpoint and use a fresh Adam optimizer at constant learning rate 10−3 for N = 5, 000 additional updates, with λstart = 10−5 and λend = 105 . The continuation retains the training data, supervised loss, clipping, and sampling settings. Thus annealing strengthens a differentiable penalty, rather than imposing a hard state assignment during optimization. The phrase exponential annealing refers to the regularization schedule, not to a softmax-temperature schedule. 36
Reading Out the Discrete Controller. For each hidden coordinate j and symbol x, set δ(j, x) = argmax A[x]ij ,
w(j, x) = argmax B[x]sj , s
i
m(j, x) = argmax C[x]vj , v
q0 = argmax h0,i .
(7)
i
Fix deterministic tie breaking. Retain states reachable from q0 , introduce the halt convention, and apply the same exact quotient reduction as above. The extracted transition reads the pre-transition coordinate j, matching the neural recurrence. Unlike metric extraction, argmax extraction defines an action for every symbol at each retained state. The final minimization yields 17 states for binary addition, 52 for binary multiplication, and 28 for universal simulation, including halt states. Argmax supplies a deterministic decoder of differentiably learned probabilities; the decoder itself does not supply gradients or an equivalence proof. Uniform Leakage and Readout Margins. Fix a deterministic recurrent implementation, including rounding, and the effective readout tensors B, C with entries in [0, 1]. Let Tb denote the unminimized columnwise-argmax controller before adjoining the conventional halt node. Each state q corresponds to the one-hot vector eq ; motion S terminates execution. Fix tie breaking and the valid input domain Z. For each z ∈ Z, run Tb and record the pre-action states qt (z) and observations xt+1 (z). Drive the implemented neural recurrence from the trained initial state with this same observation stream, obtaining ht (z). The index t includes every pre-action state through the stopping action, or every finite time for a nonhalting execution. Define the hidden-state leakage by X ℓt (z) = ∥ht (z) − eqt (z) ∥1 = |ht,qt (z) (z) − 1| + |ht,j (z)|. (8) j̸=qt (z)
This definition controls both off-target mass and drift of the intended coordinate, without assuming that rounded states remain exactly normalized. For P ∈ {B, C}, write aP (q, x) = argmaxi P [x]iq for the prescribed write or motion. Over state–symbol pairs occurring on valid executions of Tb, define the minimum readout margin µ= min P [x]aP (q,x),q − max P [x]bq . (9) (q,x), P ∈{B,C}
b̸=aP (q,x)
The minimum ranges over finitely many columns. A certified superset of the reachable pairs supplies a conservative lower bound. Let yetP (z) denote the implemented readout, while P [xt+1 (z)]ht (z) denotes the exact real matrix-vector product of the stored tensor and hidden-state values. Assumption G.1 (Uniformly Bounded Leakage). There exist constants ε, ρ ≥ 0, independent of input and execution length, with ε + 2ρ < µ, such that every z ∈ Z and every pre-action time t satisfy ℓt (z) ≤ ε, ∥e ytP (z) − P [xt+1 (z)]ht (z)∥∞ ≤ ρ for P ∈ {B, C}. (10) The constant ρ bounds per-component readout rounding error; exact readout arithmetic permits ρ = 0. Proposition G.2 (Faithfulness under Bounded Leakage). Under Assumption G.1, the neural controller and Tb produce identical PTOs on all valid inputs, including simultaneous stopping and every finite prefix of a nonhalting execution. Any trace-preserving quotient inherits this equivalence. Proof. Fix z, t, put q = qt (z), x = xt+1 (z), and h = ht (z), and consider either readout head P . Let a = aP (q, x) and let b ̸= a denote any competing action. Since the entries of P [x] lie in [0, 1], the row difference satisfies ∥P [x]a: − P [x]b: ∥∞ ≤ 1. Therefore (P [x]h)a − (P [x]h)b = P [x]aq − P [x]bq + (P [x]a: − P [x]b: )(h − eq ) ≥ µ − ∥h − eq ∥1 ≥ µ − ε. Readout rounding changes each score by at most ρ, so the implemented gap satisfies P P yet,a (z) − yet,b (z) ≥ µ − ε − 2ρ > 0.
Thus both implemented heads choose the prescribed actions on the supplied observation stream. 37
Now compare autonomous executions. Initially, both controllers receive the same grid, head position, and rune records. If all earlier actions agree, both environments supply xt+1 (z), and the deterministic neural implementation reaches the same ht (z) as on the supplied stream. The margin argument gives the same write and motion, preserving the environment correspondence. A stopping action terminates both executions; otherwise induction continues. This proves agreement through every finite prefix and simultaneous stopping. Trace-preserving quotient reduction retains every such PTO. Sharp readout columns allow a larger tolerance for hidden-state leakage. For example, if every prescribed entry exceeds 1 − β and every competing entry remains below β, then µ > 1 − 2β. Uniform leakage bounds concern the entire recurrent execution, whereas column sharpness concerns individual parameters. Exact one-hot tensors and initialization satisfy Assumption G.1 with ε = ρ = 0 whenever the implemented arithmetic preserves vertex operations. Evidence and Proof Play Different Roles. The saved finite checks for metric binary addition, binary multiplication, decimal addition, and universal simulation, and for all three annealed controllers, each report 100 exact PTO matches on 100 inputs of length 100. Arithmetic checks use two length-100 operands; universal checks sample length-100 binary words and task instances. These checks compare the extracted controller against the expert. The neural length-generalization experiments in Section 3 provide separate evidence before extraction. Neither evidence source replaces the inductive proofs in Section H, and neither proves Assumptions G.1 and H.1. The eight proofs establish exact algorithmic learning for the extracted controllers; the stated graph-stability or bounded-leakage assumptions transfer the corresponding conclusion to the trained neural controllers.
38
Epsilon-Chain Stability (² = 0:5)
45
Epsilon-Chain Stability (² = 0:125) 1
40
Components Edges Graph Changed
30
110
Count
35
Graph Changed
120
Graph Changed
Count
1
130
100 90 80
25
70
1
12
23
34
45
56
67
78
89
Components Edges
60
0
20 100
Graph Changed
1
12
23
45
56
67
78
Sampled PTOs
Sampled PTOs
(a) Binary Addition
(b) Binary Multiplication
Epsilon-Chain Stability (² = 0:5)
89
0
100
Epsilon-Chain Stability (² = 0:25) 1
200
150 Components Edges
125
Graph Changed
100 75
1
1000
Count
Graph Changed
175
Components Edges Graph Changed
1200
Graph Changed
225
Count
34
800 600 400 200
50 0
25
0 0
1
29
56
84
112
139
167
195
222
250
1
223
445
667
Sampled PTOs
889
1112
1334
1556
1778
2000
Sampled PTOs
(c) Decimal Addition
(d) Decimal Multiplication Epsilon-Chain Stability (² = 0:5) 1
75
Graph Changed
70
Count
65 60 55 50 Components
45
Edges Graph Changed
40 1
12
23
34
45
56
67
78
89
0
100
Sampled PTOs
(e) Universal Controller
Figure 14: Empirical Graph Stability under Metric Extraction. The plots track components, observed edges, and changes as additional autonomous trajectories enter the extraction sample. The graph comparison also checks full rooted labeled structure independently of state numbering. Late plateaus support the geometric hypothesis on the sampled inputs; Assumption H.1 quantifies over all valid executions.
39
Worst Column Maximum
Largest Runner-Up Probability 0.500
1.00
B
C
Mean Column Entropy h0
Entropy (Nats)
Probability
0.50
0.250
0.125
0.25
0.35
A
B
C
h0
2000
3000
4000
5000
0.30
0.375
0.75
Probability
A
0.25 0.20 0.15 0.10 0.05
B
A
C
h0
2000
3000
0.00 0
1000
0.00
0.000 4000
5000
0
1000
Annealing Step
2000
3000
4000
5000
0
1000
Annealing Step
Annealing Step
(a) Binary Addition Largest Runner-Up Probability
0.75
0.375
0.50
A
B
C
Mean Column Entropy A
B
C
h0
2000
3000
4000
5000
0.10
0.250
0.125
0.25
0.12
h0
Entropy (Nats)
0.500
Probability
Probability
Worst Column Maximum 1.00
0.08 0.06 0.04 0.02
B
A
C
h0
2000
3000
0.00 0
1000
0.00
0.000 4000
5000
0
1000
Annealing Step
2000
3000
4000
5000
0
1000
Annealing Step
Annealing Step
(b) Binary Multiplication Worst Column Maximum
Largest Runner-Up Probability 0.500
1.00
A
B
C
Mean Column Entropy h0
A
B
2000
3000
C
h0
4000
5000
0.5
Probability
Probability
0.50
Entropy (Nats)
0.375
0.75
0.250
0.125
0.25
0.4 0.3 0.2 0.1
B
A
C
h0
2000
3000
0
1000
Annealing Step
0.0
0.000
0.00 4000
5000
0
1000
2000
3000
4000
Annealing Step
5000
0
1000
Annealing Step
(c) Universal Controller
Figure 15: Concentration during Differentiable Annealing. Exponentially increasing the concentration penalty sharpens the transition and readout columns. At the final update, the smallest column maximum across A, B, C, h0 exceeds 1 − 1.2 · 10−7 for both arithmetic controllers and 1 − 2.4 · 10−7 for the universal controller. These finite-precision measurements demonstrate near-deterministic parameters, but do not establish equivalence with the extracted FST for unbounded execution lengths.
40
H
Proving Exact Learning
LLM Assistance. We used GPT-6 Astra to generate the controller-equivalence proofs and verified the arguments ourselves. Executable certificate checkers validate the finite transition obligations; the unbounded equivalence claims additionally rely on the mathematical invariants and induction arguments presented below. We take responsibility for the correctness of the final statements and proofs. We separate three claims: equality of sampled PTOs, exact equivalence of an extracted controller, and transfer of that equivalence to the trained neural controller. The proofs below establish the second claim without a length bound. Transfer requires the graph-stability or bounded-leakage assumptions discussed in Section 4; finite experiments alone establish neither assumption. The public proof bundles supply machine-readable transition maps and executable checks of the finite certificate obligations. The arguments below establish the unbounded claims independently of the accompanying code. H.1
Why Finite Testing Cannot Certify General Equivalence
With fixed weights and deterministic arithmetic, D recurrent scalars stored in b bits induce at most 2bD memory encodings. Restricting each scalar to a finite IEEE binary32 value gives (232 − 224 )D encodings, counting signed zeros separately. Here D = d for DFSTs, Softmax DFSTs, RNNs, and GRUs. This enormous FST remains difficult to inspect; ordinary FST equivalence on arbitrary read strings does not resolve equivalence under an unbounded environment. Proof of Lemma 4.1. Suppose an algorithm computes the claimed horizon. Given a Turing machine N and input w, construct two grid agents that simulate exactly |z| steps of N (w) on input z, using identical visible actions throughout the simulation. If the simulation detects halting, the agents emit different final actions; otherwise both agents stop with the same PTO. Every such execution terminates. The agents agree on every input precisely when N (w) never halts. A computed horizon would reduce this universal equivalence claim to finitely many terminating comparisons, deciding nonhalting and therefore halting. This contradiction proves the claim. The obstruction concerns controllers interacting with an unbounded environment; ordinary finite-state transducer equivalence on unrestricted read strings remains decidable. H.2
Transferring an Extracted Certificate to a Trained Controller
Let G(S, ε) denote the deterministic, trace-consistent graph extracted from valid neural executions S at threshold ε, including finite prefixes of nonhalting executions. Assumption H.1 (Graph Stability). For some ε > 0 and finite sample S, every finite extension S ′ by valid neural execution traces or prefixes yields a successful extraction and a graph G(S ′ , ε) isomorphic to G(S, ε), preserving the root, read symbols, output labels, and stopping actions. Proof of Theorem 4.3. For metric extraction, fix a valid input and any finite execution prefix of the trained controller. Extend the extraction data by that prefix. Trace consistency embeds every observed transition into the resulting graph. Graph stability identifies the extended rooted, input/output-labeled graph with the original graph, including the initial node and stopping convention. Thus the original graph reproduces every action of the prefix. Induction synchronizes the controller and graph: equal grids and head positions provide equal read symbols; equal output labels produce equal writes and motions and preserve the next configuration. Rune records, when present, evolve identically under the same actions. Since the argument permits every prefix length, the complete finite PTOs agree, or every finite prefix agrees for a nonterminating execution. Any subsequent merging that preserves all defined traces preserves this conclusion. Composing this equality with an extracted-controller certificate proves equivalence to the expert. Equality of node or edge counts alone would not supply the labeledgraph identity used in this argument. For Softmax DFSTs, Proposition G.2 establishes equality of every finite PTO prefix under Assumption G.1. Trace-preserving reduction and composition with the expert-equivalence certificate give the same conclusion. 41
H.3
A Common Simulation Principle
Write E for an expert and C for an extracted controller. A transition δ(q, x) = (q ′ , w, M ) reads x, writes w, performs motion M , and enters state q ′ . Motion S writes and stops without moving. PTOs contain read/write/motion triples and count the final stopping action once; halt loops contribute no additional observations. Arithmetic inputs occupy row 0 from column 0, with all other cells blank and the head initially at (0, 0). Arithmetic coordinates increase rightward and downward. Operand words may have unequal positive lengths and leading zeros. A phase records the expert control state together with finite geometric or arithmetic context. A phase need not correspond to a distinct machine state. The following lemma explains why a finite certificate can establish equality of arbitrarily long executions. Lemma H.2 (Phase Simulation). Suppose a protocol covers every valid expert execution. Assign expert state gi and a nonempty controller-state set Qi to each phase i. Assume the initial states x belong to the initial phase relation. For each permitted edge i − → j and every q ∈ Qi , suppose δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M ),
q ′ ∈ Qj .
(11)
Assume stopping occurs exactly on edges to terminal phases. Then the two controllers produce identical PTOs on the valid input domain, with identical environment configurations at every step. Proof. Relate configurations with the same grid, head, and, where applicable, rune records, and control states gi and q ∈ Qi . Initially this relation holds. Protocol coverage provides an allowed read symbol; equal configurations provide the same symbol to both controllers. Equation (11) gives the same write and motion and relates the successor states. The deterministic environment update preserves the relation. Induction proves equality of every finite prefix. The stopping condition gives simultaneous termination, or equal infinite PTOs. No undefined transition can occur along a valid execution. The tables below give the necessary transition maps on valid executions. An entry x : (j, w, M ) specifies a successor phase j, with expert successor gj and controller successor in Qj ; ordinary transition tables instead list actual successor states. Multivalued Qi capture different internal realizations of the same phase. Each listed branch applies to every state in the corresponding set. Undefined or unlisted branches require no completion when the coverage proof excludes those branches. Local identities can therefore be checked by finite substitution, while the geometric invariants supply the unbounded claim. Task
Extraction
States
Phases
Related pairs
Local checks
add2
Metric Annealing Metric Annealing Metric Metric Metric Annealing
22 17 61 52 52 182 44 28
27 27 67 94 59 207 92 91
28 30 67 109 60 208 96 93
50 52 130 201 266 1,509 160 162
mult2 add10 mult10 universal
State counts include the designated halt state. All eight finite certificates satisfy the local obligations. The following arguments establish coverage for every input in each stated domain. H.4
Binary Addition: Two Certificates, One Arithmetic Invariant
Let D = {0, 1} and consider a + b with a ∈ Dm , b ∈ Dn , m, n ≥ 1. Write A = val2 (a) and B = val2 (b). The expert starts in state 0 and halts in state 10. The metric and annealed controllers start in state 0 and halt in states 21 and 16, respectively. Theorem H.3 (Exact Binary Addition). Both extracted controllers produce the expert PTO on every valid binary-addition input, with identical grids and head positions at every step. 42
H.4.1
Shared Expert Behavior and Observation Protocol
Pn−1 Accumulator and Marker Invariant Write B = j=0 bj 2j , with b0 the rightmost digit. The expert scans to the separator at column m, steps left and down, writes a working + below column m − 1, and enters state 8 above the marker. Lemma H.4 (Round Invariant). After processing k right-operand digits, 0 ≤ k ≤ n, the expert enters state 8 at (pk , 0), where pk = m − 1 − k. At this point: • Row 1 contains exactly one nonblank symbol: a + at column pk . • Row 0 contains a contiguous accumulator on [ℓk , m − 1], with value Ck = A + and left edge ℓk ≤ pk + 1. Column m − 1 carries the units digit.
j j<k bj 2
P
• The separator remains at column m. The unprocessed prefix of b occupies columns m + 1, . . . , m + n − k. All remaining cells contain blanks.
Proof. Initialization gives k = 0, ℓ0 = 0, C0 = A, and p0 = m − 1. State 8 preserves the digit at pk , or writes 0 on a blank. A blank at pk forces ℓk = pk + 1, so zero extension preserves contiguity. For k < n, the right scan reaches the blank after the unprocessed prefix, steps left to digit bk at rk = m + n − k, erases bk , and descends. The expert transports bk left along row 1 to the marker. The distance satisfies rk − pk = n + 1 ≥ 2.
(12)
Consequently, the first two transport steps read blanks. At the marker, the expert ascends and adds bk to the accumulator digit e at column pk . If e + bk < 2, the expert writes e + bk and descends. Otherwise, the expert writes e + bk − 2, moves left, and propagates one carry. Each digit 1 changes to 0; the first smaller digit increases by one, or a blank changes to 1. The update adds exactly bk 2k and preserves contiguity. The expert returns along row 1, erases the marker, steps left, writes the next marker at pk+1 = pk − 1, and ascends into state 8. The earlier zero extension gives ℓk+1 ≤ pk = pk+1 + 1. The accumulator now has value Ck+1 , establishing the next round.
Lemma H.5 (Termination and Final Configuration). The expert terminates with only the padded base-2 representation of A + B on row 0, ending at column m − 1. The final head stops at (m − n − 1, 0). Writing ℓ2 (s) for the binary digit count, with ℓ2 (0) = 1, the output width equals L = max{m, n + 1, ℓ2 (A + B)}.
Proof. Each round consumes one of the n right-operand digits. Every scan crosses a finite interval, and every carry reaches a digit below 1 or a blank. After round n, state 8 ensures a digit at pn . The next right scan returns to the separator. State 3 erases the separator and descends. State 9 walks left, erases the final marker, ascends, preserves the accumulator digit, and stops. The invariant gives Cn = A + B, and cleanup removes all work symbols. The original m columns persist, and marker extension reaches pn , ensuring at least n + 1 digits. Every additional carry extension contributes a digit required by the current numerical value. Partial sums never decrease, so the final width equals L.
The following phases refine the expert states by geometric context. The protocol covers every valid execution and may also admit additional observation sequences. Write d ∈ {0, 1}. An edge x : j reads x and advances to phase j; d : j permits either digit. Expert state gi supplies the write and motion from Section H.4.2. A dash denotes a terminal phase with no outgoing transition. 43
i
Phase meaning
gi
Allowed reading : next phase
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
First input digit Seek the separator Initial descent Place the marker Ensure an accumulator digit Digit after zero extension Scan toward separator First cell after separator Scan remaining right operand Read rightmost factor digit Transport zero: first blank Transport zero: second blank Transport zero: walk left Add zero above marker Transport one: first blank Transport one: second blank Transport one: walk left Add one above marker Propagate a carry First return cell after carry Return to the marker At marker, without carry Erase the input separator First cleanup cell Find and erase final marker Preserve result and stop Halted
0 0 1 1 8 2 2 2 2 3 4 4 4 4 5 5 5 5 6 7 7 7 3 9 9 9 10
d:1 d:1 +:2 d:3 λ:4 d:6 λ:5 d:6 d:6 +:7 d : 8 λ : 22 d:8 λ:9 0 : 10 1 : 14 λ : 11 λ : 12 λ : 12 + : 13 d : 21 λ : 15 λ : 16 λ : 16 + : 17 0 : 21 1 : 18 1 : 18 0 : 19 λ : 19 λ : 20 λ : 20 + : 3 +:3 + : 23 λ : 24 λ : 24 + : 25 d : 26 –
Lemma H.6 (Protocol Coverage). Every execution of E from a valid input follows this protocol, starting at phase 0 and ending at phase 26.
Proof. The nonempty first operand establishes phases 0–3. Lemma H.4 places a digit immediately after a zero extension in phase 4, establishing phase 5. The right scan meets the separator before any blank. To the separator’s right, a first blank means the next left step reads the separator (phase 22); after any digit, that step reads a digit (phase 9). Equation (12) guarantees two initial blank readings while transporting either bit. The cell above the marker contains a digit. A carry ends strictly left of the marker, so the first return cell contains a blank. A noncarry addition returns directly to the marker. Erasing and shifting the marker reaches a blank. Finally, cleanup starts below the separator on a blank, reaches the marker and then a digit. These facts justify every branch of the table. Induction over the steps and rounds proves coverage; Lemma H.5 supplies the final phase.
H.4.2
Metric-Extraction Certificate
Phase Relation and Local Checks For phase i, write Qi for the controller-state set in the following table. The relation pairs an expert configuration in phase i with a controller configuration having the same grid and head and a state in Qi . 44
Phase i 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Expert state gi
Meaning First input digit Seek the separator Initial descent Place the marker Ensure an accumulator digit Digit after zero extension Scan toward separator First cell after separator Scan remaining right operand Read rightmost factor digit Transport zero: first blank Transport zero: second blank Transport zero: walk left Add zero above marker Transport one: first blank Transport one: second blank Transport one: walk left Add one above marker Propagate a carry First return cell after carry Return to the marker At marker, without carry Erase the input separator First cleanup cell Find and erase final marker Preserve result and stop Halted
Controller states Qi {0} {1} {2} {3} {4} {15} {5} {6} {6} {7} {12} {13} {13} {14} {8} {9} {9} {10} {18} {19, 20} {20} {11} {7} {16} {16} {17} {21}
0 0 1 1 8 2 2 2 2 3 4 4 4 4 5 5 5 5 6 7 7 7 3 9 9 9 10
x
Local Transition Identity. For every listed q ∈ Qi and every allowed edge i − → j from the protocol, the transition maps satisfy δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M ),
q ′ ∈ Qj .
(13)
Every required controller entry exists. A transition reaches the halt state exactly when j = 26, with motion S. The certificate contains 28 phase–state pairs (including the terminal pair) and 50 local checks. The checks cover 43 distinct nonterminal controller entries. Section H.4.2 provides the tables for direct inspection; direct substitution checks every instance of (13). Transition Tables Each entry lists (next state, written symbol, motion). The symbol λ means blank; a dash means an undefined transition. State numbers identify the extracted controllers throughout each certificate. Binary-Addition Expert.
Initial state 0; halt 10. State
λ
+
0
1
0 1 2 3 4 5 6 7 8 9 10
(10, λ, S) (8, +, U) (3, λ, L) (10, λ, S) (4, λ, L) (5, λ, L) (7, 1, D) (7, λ, R) (2, 0, R) (9, λ, L) (10, λ, S)
(1, +, L) (10, +, S) (2, +, R) (9, λ, D) (4, +, U) (5, +, U) (10, +, S) (1, λ, L) (10, +, S) (9, λ, U) (10, +, S)
(0, 0, R) (1, 0, D) (2, 0, R) (4, λ, D) (7, 0, D) (7, 1, D) (7, 1, D) (10, 0, S) (2, 0, R) (10, 0, S) (10, 0, S)
(0, 1, R) (1, 1, D) (2, 1, R) (5, λ, D) (7, 1, D) (6, 0, L) (6, 0, L) (10, 1, S) (2, 1, R) (10, 1, S) (10, 1, S)
Metric-Extracted Controller.
Initial state 0; halt 21. 45
H.4.3
State
λ
+
0
1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
– – – (4, +, U) (15, 0, R) – (7, λ, L) – (9, λ, L) (9, λ, L) – – (13, λ, L) (13, λ, L) – – (16, λ, L) – (20, 1, D) (20, λ, R) (20, λ, R) (21, λ, S)
– (2, +, L) – – – (6, +, R) – (16, λ, D) – (10, +, U) – (3, λ, L) – (14, +, U) – – (17, λ, U) – – – (3, λ, L) (21, +, S)
(1, 0, R) (1, 0, R) (3, 0, D) – (5, 0, R) (5, 0, R) (6, 0, R) (12, λ, D) – – (11, 1, D) – – – (11, 0, D) (5, 0, R) – (21, 0, S) (19, 1, D) – – (21, 0, S)
(1, 1, R) (1, 1, R) (3, 1, D) – (5, 1, R) (5, 1, R) (6, 1, R) (8, λ, D) – – (18, 0, L) – – – (11, 1, D) (5, 1, R) – (21, 1, S) (18, 0, L) – – (21, 1, S)
Annealing Certificate
Phase Relation and Local Checks For phase i, write Qi for the controller-state set in the following table. The relation pairs an expert configuration in phase i with a controller configuration having the same grid and head and a state in Qi . Phase i 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Expert state gi
Meaning First input digit Seek the separator Initial descent Place the marker Ensure an accumulator digit Digit after zero extension Scan toward separator First cell after separator Scan remaining right operand Read rightmost factor digit Transport zero: first blank Transport zero: second blank Transport zero: walk left Add zero above marker Transport one: first blank Transport one: second blank Transport one: walk left Add one above marker Propagate a carry First return cell after carry Return to the marker At marker, without carry Erase the input separator First cleanup cell Find and erase final marker Preserve result and stop Halted
46
0 0 1 1 8 2 2 2 2 3 4 4 4 4 5 5 5 5 6 7 7 7 3 9 9 9 10
Controller states Qi {0} {0} {7} {3, 9} {6} {6} {4} {8} {4} {13} {2} {2} {2} {7} {4} {13} {15} {1} {1} {5} {5} {3, 5, 9} {12} {11} {14} {10} {16}
x
Local Transition Identity. For every listed q ∈ Qi and every allowed edge i − → j from the protocol, the transition maps satisfy δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M ),
q ′ ∈ Qj .
(14)
Every required controller entry exists. A transition reaches the halt state exactly when j = 26, with motion S. The certificate contains 30 phase–state pairs (including the terminal pair) and 52 local checks. The checks cover 37 distinct nonterminal controller entries. Section H.4.3 provides the tables for direct inspection; direct substitution checks every instance of (14). Transition Tables Each entry lists (next state, written symbol, motion). The symbol λ means blank; a dash means an undefined transition. State numbers identify the extracted controllers throughout each certificate. Annealed Controller.
Initial state 0; halt 16. State
λ
+
0
1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
(13, λ, L) (5, 1, D) (2, λ, L) (6, +, U) (13, λ, L) (5, λ, R) (6, 0, R) (6, +, U) (12, λ, L) (6, +, U) (14, +, U) (14, λ, L) (15, λ, L) (15, λ, L) (14, λ, L) (15, λ, L) (16, λ, S)
(7, +, L) (3, λ, L) (7, +, U) (3, λ, L) (8, +, R) (9, λ, L) (7, +, L) (3, λ, L) (8, +, R) (9, λ, L) (10, λ, D) (10, λ, D) (11, λ, D) (11, λ, D) (10, λ, U) (1, +, U) (16, +, S)
(0, 0, R) (5, 1, D) (5, λ, D) (5, 1, D) (4, 0, R) (4, 0, R) (4, 0, R) (9, 0, D) (4, 0, R) (4, 0, R) (16, 0, S) (16, 0, S) (4, λ, D) (2, λ, D) (4, 0, R) (4, 0, R) (16, 0, S)
(0, 1, R) (1, 0, L) (4, λ, D) (1, 0, L) (4, 1, R) (4, 1, R) (4, 1, R) (3, 1, D) (4, 1, R) (8, 1, R) (16, 1, S) (16, 1, S) (4, λ, D) (4, λ, D) (4, 1, R) (4, 1, R) (16, 1, S)
Proof of Theorem H.3. The common round invariant proves protocol coverage and termination. The two state relations separately satisfy (11): the metric certificate contains 50 local identities, and the annealing certificate contains 52. Both relations contain the initial pair and terminate only after the common final S action. Apply Lemma H.2 to each relation. The final grid contains the padded representation of A + B specified by Lemma H.5. H.5
Binary Multiplication: Shared Products and Refined Protocols
Consider a x b with a ∈ {0, 1}m , b ∈ {0, 1}n , m, n ≥ 1, where x denotes the multiplication separator. Write A = val2 (a) and B = val2 (b). The expert has initial state 0 and halt state 31. Both extracted controllers start in state 0; metric extraction yields halt state 60, and annealing yields halt state 51. Theorem H.7 (Exact Binary Multiplication). Both extracted controllers produce the expert PTO on every valid binary-multiplication input. Both executions terminate with the (m+n)-bit representation of AB, including leading-zero padding, on row n − 1 in columns −n, . . . , m − 1. The final head stops at (−n − 1, n − 1). H.5.1
Shared Expert Behavior
Pn−1 Copying and Partial Products Write b = bn−1 · · · b0 , so B = i=0 bi 2i . Assign global weight 2m−1−z to column z. Column m − 1 carries the units digit of the final product. Lemma H.8 (Copy Staircase). Before product formation, the expert constructs exactly n occupied rows. For 0 ≤ i < n, row i contains a x bn−1 · · · bi
starting in column − i.
The last row contains one right-operand bit. All remaining cells contain blanks. 47
(15)
Proof. Row 0 contains the input. On row i, the expert scans to the first blank, steps left to bi , then steps left again. A digit at this position implies at least two remaining right-operand bits. The expert copies every symbol except bi one row down and one column left, proceeding from right to left. Every destination contains a blank before writing; the source word remains unchanged. The first descent reaches a blank on the new row. Each later descent reaches the copied right neighbor: a digit, except directly below the last digit of a, where the copied separator x occupies the lower cell. The cell below the source separator contains a digit. After copying the first digit of a, the expert reads the blank immediately to the left and descends to the first digit of the new row. The new row satisfies (15) for i + 1, with one fewer right-operand bit. When one right-operand bit remains, the second left step reads x and starts product formation. Thus n − 1 copies produce exactly n occupied rows. Lemma H.9 (Aligned Partial Products). After product formation, row i contains the (m + 1)-bit representation of Abi in columns −i − 1, . . . , m − i − 1, with a leading 0. In global column weights, row i represents Abi 2i . All remaining cells contain blanks. Proof. The expert forms products from row n − 1 upwards. On row i, the expert erases the rightmost factor bit bi , the remaining factor prefix, and x, then walks left across a. For bi = 0, the expert writes zeros; for bi = 1, the expert preserves the digits of a. Both branches write one additional 0 on the left blank. The resulting word has the claimed support and value, with a leading zero because Abi < 2m . The expert scans right to the blank at column m − i and moves up. For i > 0, the upper cell contains the last digit of a on row i − 1; the next cell contains x. The expert scans the remaining factor prefix, selects the last bit, and repeats. Each upper prefix contains at least two bits, so another digit follows the selected bit during leftward erasure. For i = 0, the upper cell contains a blank, ending product formation and starting summation on row 0. Both passes terminate: each copy shortens the remaining factor prefix, and product formation visits each of the n rows once. Every horizontal scan crosses a finite word. A Fixed-Width Addition Invariant Lemma H.10 (Accumulated Product). After merging through row k, 0 ≤ k < n, all rows above k contain only blanks. Row k contains a contiguous (m + k + 1)-bit accumulator on columns −k − 1, . . . , m − 1, with value k X Sk = A bi 2i . i=0
Rows below k retain the partial products from Lemma H.9. At the inspection of the next row, the expert occupies state 20 with head (−k − 2, k + 1). Proof. For k = 0, the initial left scan crosses the product on row 0, reads the leading 0, reaches the blank at column −2, and descends. If row k + 1 exists, the inspected cell contains the leading 0 at column −k − 2. The expert scans right across the lower product to the first blank, at column m − k − 1. Moving up reaches an accumulator digit because −k − 1 ≤ m − k − 1 ≤ m − 1. The expert scans the remaining upper digits, reaches the right blank, and steps left to column m − 1. The lower cell contains a blank because the original lower product ends at m − k − 2. The first column therefore adds the upper bit to zero without a carry. The expert processes the remaining columns from right to left. For upper bit u, lower bit v (with a blank counting as zero), and incoming carry c, the update satisfies u + v + c = w + 2c′ ,
c′ ∈ {0, 1}.
w ∈ {0, 1}, ′
(16)
The expert erases the upper bit, writes w below, and stores c in the control state. The processed lower suffix contains the correct sum suffix, the unprocessed cells retain the previous values, and the carry records the contribution to the next column. Equation (16) preserves this invariant. 48
The original lower word extends one column farther left than the upper word, with a leading 0 at −k − 2. After consuming the upper word, carry zero preserves this bit, whereas carry one changes the bit to 1 and clears. The expert reaches the blank at −k − 3 on row k + 1 and descends. Row k now contains only blanks, and row k + 1 represents Sk + Abk+1 2k+1 = Sk+1 on the claimed support. Lemma H.11 (Carry Confinement). During an upper-digit update with incoming carry 1, the lower cell contains an original binary digit. If the carry outlives the upper word, the next lower cell contains the original leading 0. Proof. A blank gap lies to the right of the original lower product. The first column has carry zero, and u + 0 + 0 ≤ 1, so no carry originates in the gap. A carry first arises inside the lower digit block. Further leftward steps remain inside that block until the leading zero. The upper word ends one column before that zero, where 0 + 0 + 1 = 1 clears the carry. Each merge consumes finitely many upper digits and at most one extra carry column. After n − 1 merges, state 20 reads the blank below the final row and moves up to state 30, which emits the final S action and enters halt state 31. Lemma H.10 gives the (m + n)-bit product and final head (−n − 1, n − 1). All other cells contain blanks. H.5.2
Metric-Extraction Certificate
The observation protocol refines expert states by geometric context. Each phase records the permitted read symbols and successor phases. Section H.5.2 gives the complete protocol together with the controller-state relation; the shared tables avoid repeating the same phase definitions. Lemma H.12 (Protocol Coverage). Every expert execution on a well-formed multiplication follows the 67 phases in Section H.5.2, from phase 0 to phase 66. Proof. Lemma H.8 supplies the copy-phase conditions; Lemma H.9 supplies the product-phase conditions. Lemma H.10 and Lemma H.11 supply the alignment, addition, carry and boundary conditions. The explanations below the three tables account for the first and last cell readings in each phase. Induction over the individual transitions, the copied rows, and the merged rows establishes coverage. The finite-pass arguments in the expert invariants give termination in the final phase. The Copying Phases The following three tables define a finite protocol and a simulation relation. Phase i pairs expert state gi with controller state q ∈ Qi on an identical grid and head. Each set Qi contains the single listed state. An entry x : (j, w, M ) means: read x, write w, move M , and advance to phase j. Here d ∈ {0, 1} denotes either digit, consistently within each entry. The index j denotes a phase. Successors comprise expert state gj and controller state q ′ ∈ Qj . The listed transitions specify the required local identities. The protocol starts at phase 0. i Phase
gi Q i
0 First left-operand digit 1 Scan left operand 2 First right-operand digit 3 Scan right operand 4 Skip last right-operand digit 5 Copy more, or start products 6 First copied 0: descend 7 First copied 0: write 8 First copied 1: descend 9 First copied 1: write 10 Continue after first copy 11 Copy 0 above a lower digit
0 0 0 0 1 2 3 6 4 7 9 3
Read : (next phase, write, move)
{0} d : (1, d, R) {1} d : (1, d, R) x : (2, x, R) {2} d : (3, d, R) {3} d : (3, d, R) λ : (4, λ, L) {4} d : (5, d, L) {5} 0 : (6, 0, D) 1 : (8, 1, D) x : (22, x, R) {52} λ : (7, λ, L) {53} λ : (10, 0, U) {6} λ : (9, λ, L) {7} λ : (10, 1, U) {8} 0 : (11, 0, D) 1 : (13, 1, D) x : (16, x, D) {16} d : (12, d, L)
49
i Phase
gi Q i
12 Write copied 0 13 Copy 1 above a lower digit 14 Write copied 1 15 Continue the copy 16 Descend below operator 17 Write shifted operator 18 Copy last left-operand digit 19 Copied 0 above lower operator 20 Copied 1 above lower operator 21 Begin scan on copied row
6 4 7 9 5 8 9 3 4 0
Read : (next phase, write, move)
{17} λ : (15, 0, U) {9} d : (14, d, L) {10} λ : (15, 1, U) {11} 0 : (11, 0, D) 1 : (13, 1, D) x : (16, x, D) {12} d : (17, d, L) {13} λ : (18, x, U) {14} 0 : (19, 0, D) 1 : (20, 1, D) {55} x : (12, x, L) {15} x : (14, x, L) {0} d : (1, d, R)
λ : (21, λ, D)
Why the Listed Read Symbols Cover Every Copy. The nonempty operands ensure that the initial scan reads a digit, the separator, and at least one factor digit before reaching a blank. The second left step sees either a digit to copy or x when only one factor bit remains. Lemma H.8 identifies the three possible cells below a copied digit: blank for the first copy, x immediately after copying the separator, and a digit otherwise. Every destination contains a blank. Copying the first digit of a exposes the left blank; restarting on the new row therefore reads a digit. These facts establish the table’s geometric restrictions. The protocol permits arbitrary operand lengths and may admit additional observation sequences. Every valid execution follows permitted branches; checking all such branches therefore establishes the required local agreement. The One-Bit Product Phases Phase i pairs expert state gi with controller state q ∈ Qi . An edge x : (j, w, M ) reads x, writes w, performs motion M , and advances to phase j. The product phases preserve the exact leading-zero convention of the expert. i Phase
gi Qi
Read : (next phase, write, move)
22 Read the last remaining factor bit 10 {18} 0 : (23, λ, L) 23 Erase operator for factor 0 11 {56} x : (24, λ, L) 24 First digit of product by 0 13 {32} d : (25, 0, L) 25 Continue product by 0 13 {33} d : (25, 0, L) 26 Erase operator for factor 1 12 {19} x : (27, λ, L) 27 First digit of product by 1 14 {20} d : (28, d, L) 28 Continue product by 1 14 {21} d : (28, d, L) 29 Scan completed partial product 15 {22} d : (29, d, R) 30 Inspect the row above 16 {23} d : (31, d, R) 31 Cross upper operator 17 {24} x : (32, x, R) 32 First bit in upper factor prefix 17 {25} d : (33, d, R) 33 Scan upper factor prefix 17 {26} d : (33, d, R) 34 Read upper row factor bit 10 {27} 0 : (35, λ, L) 35 First remaining bit to erase (0) 11 {30} d : (36, λ, L) 36 Erase factor prefix (0) 11 {31} d : (36, λ, L) 37 First remaining bit to erase (1) 12 {28} d : (38, λ, L) 38 Erase factor prefix (1) 12 {29} d : (38, λ, L)
1 : (26, λ, L)
λ : (29, 0, R)
λ : (29, 0, R) λ : (30, λ, U) λ : (39, λ, D)
λ : (34, λ, L) 1 : (37, λ, L) x : (24, λ, L) x : (27, λ, L)
First and Subsequent Product Rows. The bottom row contains one factor bit. Erasing that bit moves the head directly onto x. Every higher row has at least two right-operand bits: after erasing the selected last bit, the expert erases another digit before reaching the separator. These facts justify the separate “single” and “first remaining bit” phases in the table. Upper-Row Alignment. A finished product occupies [−i − 1, m − i − 1] on row i. The right scan ends at column m − i. An existing upper row has the last left-operand digit at that column, followed immediately by x. After that separator comes a nonempty remaining right operand. If no row above exists, the expert reads a blank and starts summation. Lemma H.9 proves these conditions for every operand length, including operands containing only zeros. 50
Product-Scan Coverage. Multiplication by 0 turns each left-operand digit into 0; multiplication by 1 preserves each digit. Both passes have at least one digit to process and finish on a blank by writing a padding 0. The subsequent right scan sees only digits followed by a blank. A completed product row contains no separators. Summation, Carry and the Final Stop These phases refine the expert’s addition states by the position in a merge and the carry condition. This refinement supplies every required transition in the partial controller table on all well-formed multiplications.
i Phase
gi Qi
Read : (next phase, write, move)
39 Start summing the product rows 18 {34} λ : (40, λ, L) 40 First digit of initial left scan 19 {35} 0 : (41, 0, L) 1 : (42, 1, L) 41 Left scan after reading zero 19 {36} 0 : (41, 0, L) 1 : (42, 1, L) λ : (43, λ, D) 42 Left scan after reading one 19 {35} 0 : (41, 0, L) 1 : (42, 1, L) 43 Inspect fresh lower leading cell 20 {37} 0 : (44, 0, R) λ : (65, λ, U) 44 First digit after lower leading zero 21 {22} d : (45, d, R) 45 Scan the lower partial product 21 {22} d : (45, d, R) λ : (46, λ, U) 46 First upper alignment digit 28 {23} d : (47, d, R) 47 Next upper alignment cell 28 {24} d : (48, d, R) λ : (49, λ, L) 48 Finish aligning the upper row 28 {45} d : (48, d, R) λ : (49, λ, L) 49 Read upper units digit 22 {38} 0 : (50, λ, D) 1 : (51, λ, D) 50 Write units digit 0 below 24 {39} λ : (52, 0, U) 51 Write units digit 1 below 25 {54} λ : (52, 1, U) 52 Return above, carry zero 23 {40} λ : (53, λ, L) 53 Read upper bit, carry zero 22 {41} 0 : (54, λ, D) 1 : (55, λ, D) λ : (60, λ, D) 54 Add value zero below 24 {42} d : (52, d, U) λ : (52, 0, U) 55 Add value one below 25 {46} λ : (52, 1, U) 0 : (52, 1, U) 1 : (56, 0, U) 56 Return above, carry one 27 {47} λ : (57, λ, L) 57 Read upper bit, carry one 26 {48} 0 : (58, λ, D) 1 : (59, λ, D) λ : (62, λ, D) 58 Add one inside lower digit block 25 {50} 0 : (52, 1, U) 1 : (56, 0, U) 59 Add two inside lower digit block 29 {49} d : (56, d, U) 60 Preserve unneeded leading zero 19 {43} 0 : (61, 0, L) 61 Blank to the left of merged row 19 {44} λ : (43, λ, D) 62 Apply final carry to leading zero 25 {57} 0 : (63, 1, U) 63 Return after final carry 23 {58} λ : (64, λ, L) 64 Step down left of merged row 22 {59} λ : (61, λ, D) 65 Emit final stop 30 {51} λ : (66, λ, S) 66 Halted 31 {60} –
Boundary Restrictions. The initial left scan can encounter a blank only after reading the product’s leading 0. The next inspection reads either a blank or the fresh row’s leading 0. Alignment always starts on an upper digit, and the first lower units cell contains a blank. Lemma H.11 excludes lower blanks in the carry-one digit phases and forces 0 for the final carry extension. With no final carry, the expert preserves the untouched leading 0; after either branch, the next cell to the left of the result contains a blank. The final stop also reads a blank. These facts, together with contiguity of every accumulator, justify all read restrictions in this table. The restrictions exclude every missing transition that could otherwise obstruct a valid multiplication. Local Transition Identity. For each of the 130 listed read/action cases and the unique q ∈ Qi , direct comparison with the two transition maps gives δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M ),
q ′ ∈ Qj .
(17)
Every required entry exists. A transition reaches a halt state exactly when j = 66, with motion S. The certificate covers all 119 defined nonterminal controller entries. The remaining four entries contain halt loops. 51
H.5.3
Annealing Certificate
The annealed controller reuses internal states more extensively. The refined protocol remembers unchanged factor bits and distinguishes one-digit scans from longer scans; these annotations belong to the proof, without adding memory to either controller. The observation protocol refines expert states by geometric context. Each phase records the permitted read symbols and successor phases. Section H.5.3 gives the complete protocol together with the controller-state relation; the shared tables avoid repeating the same phase definitions. Lemma H.13 (Protocol Coverage). Every expert execution on a well-formed multiplication follows the 94 phases in Section H.5.3, from phase 0 to phase 93. Proof. The copy and product invariants (Lemma H.8–Lemma H.9) give all copying and productreading conditions. The scan annotations remember unchanged cells and distinguish one digit from at least two; the explanations in Section H.5.3–Section H.5.3 prove these refinements. Lemma H.10– Lemma H.11 and the blank-gap argument in Section H.5.3 supply the addition and boundary conditions. Induction over each transition, each copied row and each merged row establishes coverage. The finite-pass arguments in the expert invariants give termination in phase 93. Copying and Remembered Factor Bits The next four tables define a finite protocol and simulation relation. Phase i pairs expert state gi with a controller state q ∈ Qi , with identical grids and heads. An entry x : (j, w, M ) means read x, write w, move M , and advance to phase j. The symbol d ∈ {0, 1} means either digit, consistently within that entry. For each q ∈ Qi , the actual successor lies in Qj . i Phase
gi Q i
0 First left-operand digit 1 Scan left operand 2 First right-operand digit 3 Scan factor; last bit 0 4 Scan factor; last bit 1 5 Revisit last factor bit 0 6 Revisit last factor bit 1 7 Copy or use remembered bit 0 8 Copy or use remembered bit 1 9 First copied 0: descend 10 First copied 0: write 11 First copied 1: descend 12 First copied 1: write 13 Continue after first copy 14 Copy 0 above a lower digit 15 Write copied 0 16 Copy 1 above a lower digit 17 Write copied 1 18 Continue the copy 19 Descend below operator 20 Write shifted operator 21 Copy last left-operand digit 22 Copied 0 above lower operator 23 Copied 1 above lower operator 24 Begin scan on copied row
0 0 0 0 0 1 1 2 2 3 6 4 7 9 3 6 4 7 9 5 8 9 3 4 0
Read : (next phase, write, move)
{0} d : (1, d, R) {0, 24} d : (1, d, R) x : (2, x, R) {7} 0 : (3, 0, R) 1 : (4, 1, R) {48} 0 : (3, 0, R) 1 : (4, 1, R) λ : (5, λ, L) {48} 0 : (3, 0, R) 1 : (4, 1, R) λ : (6, λ, L) {14} 0 : (7, 0, L) {14} 1 : (8, 1, L) {49} 0 : (9, 0, D) 1 : (11, 1, D) x : (25, x, R) {19} 0 : (9, 0, D) 1 : (11, 1, D) x : (26, x, R) {16} λ : (10, λ, L) {13} λ : (13, 0, U) {4} λ : (12, λ, L) {41} λ : (13, 1, U) {35} 0 : (14, 0, D) 1 : (16, 1, D) x : (19, x, D) {44, 47} d : (15, d, L) {9, 49} λ : (18, 0, U) {26} d : (17, d, L) {2, 3} λ : (18, 1, U) {34} 0 : (14, 0, D) 1 : (16, 1, D) x : (19, x, D) λ : (24, λ, D) {45} d : (20, d, L) {5} λ : (21, x, U) {34} 0 : (22, 0, D) 1 : (23, 1, D) {44} x : (15, x, L) {26} x : (17, x, L) {36} d : (1, d, R)
Coverage. Both operands contain at least one digit. The initial scan therefore meets a digit, x, and a right-operand digit before a blank. Phases 3–8 remember the last factor bit: the scan’s last digit, the digit revisited by the first left step, and (if only one factor bit remains) the digit selected for multiplication all refer to the same unchanged cell. Lemma H.8 proves the remaining restrictions: the first descent sees a blank; subsequent descents see the already copied right-neighbor digit, except below the last left-operand digit, where the lower cell 52
contains x. Every destination contains a blank. Copying x exposes a source digit. Restarting on a copied row also reads a digit. These conditions hold for arbitrary operand lengths and values. Forming and Scanning Partial Products The product scan starts just to the right of the new padding zero. “One” denotes a scan after exactly one product digit; the remaining scan phases follow at least two product digits. Each scan also records the most recently read digit. i Phase
gi Qi
Read : (next phase, write, move)
25 Select remembered factor bit 0 10 {10} 0 : (27, λ, L) 26 Select remembered factor bit 1 10 {3} 1 : (28, λ, L) 27 Erase operator for factor 0 11 {10} x : (29, λ, L) 28 Erase operator for factor 1 12 {4} x : (31, λ, L) 29 First digit of product by 0 13 {25} d : (30, 0, L) 30 Continue product by 0 13 {25} d : (30, 0, L) 31 First digit of product by 1 14 {6} d : (32, d, L) 32 Continue product by 1 14 {6} d : (32, d, L) 33 First digit after product padding 15 {15, 36} 0 : (34, 0, R) 34 After one product digit 0 15 {0} 0 : (36, 0, R) 35 After one product digit 1 15 {24} 0 : (36, 0, R) 36 Product scan; last digit 0 15 {24} 0 : (36, 0, R) 37 Product scan; last digit 1 15 {24} 0 : (36, 0, R) 38 Inspect above one-digit product 0 16 {39} d : (42, d, R) 39 Inspect above one-digit product 1 16 {17} d : (42, d, R) 40 Inspect above; last digit 0 16 {17} d : (42, d, R) 41 Inspect above; last digit 1 16 {17} d : (42, d, R) 42 Cross upper operator 17 {8, 43} x : (43, x, R) 43 First bit in upper factor prefix 17 {16} 0 : (44, 0, R) 44 Scan factor; last bit 0 17 {16} 0 : (44, 0, R) 45 Scan factor; last bit 1 17 {16} 0 : (44, 0, R) 46 Select remembered factor bit 0 10 {13} 0 : (48, λ, L) 47 Select remembered factor bit 1 10 {13} 1 : (50, λ, L) 48 First remaining bit to erase (0) 11 {27} d : (49, λ, L) 49 Erase factor prefix (0) 11 {10} d : (49, λ, L) 50 First remaining bit to erase (1) 12 {22} d : (51, λ, L) 51 Erase factor prefix (1) 12 {1} d : (51, λ, L)
λ : (33, 0, R) λ : (33, 0, R) 1 : (35, 1, R) 1 : (37, 1, R) 1 : (37, 1, R) 1 : (37, 1, R) 1 : (37, 1, R) λ : (52, λ, D) λ : (53, λ, D) λ : (54, λ, D) λ : (55, λ, D)
λ : (38, λ, U) λ : (39, λ, U) λ : (40, λ, U) λ : (41, λ, U)
1 : (45, 1, R) 1 : (45, 1, R) λ : (46, λ, L) 1 : (45, 1, R) λ : (47, λ, L)
x : (29, λ, L) x : (31, λ, L)
Coverage. Lemma H.9 gives a nonempty block of m product digits after the padding zero. This justifies the first-digit phase and the split into exactly one or at least two scanned digits. At the right blank, the most recently read digit equals the units digit. The bottom row contains one factor bit; erasing that bit exposes x. Every higher row contains at least two factor bits, so another digit precedes x during erasure. An upward return from a completed row reaches either a blank or the last left-operand digit followed by x. The upper factor scan records the last bit, which remains unchanged until selection. All these facts follow from the copy staircase. Starting the Sum and Aligning a Row These phases retain the last product digit until the next visit and distinguish a one-digit left operand from a longer operand. The remembered bit and length class serve as proof annotations without adding machine registers. i Phase
gi Qi
Read : (next phase, write, move)
52 Begin one-digit sum; last bit 0 53 Begin one-digit sum; last bit 1 54 Begin sum; remember last digit 0 55 Begin sum; remember last digit 1 56 Revisit sole product digit 0 57 Revisit sole product digit 1 58 Revisit product units digit 0 59 Revisit product units digit 1
18 {20} 18 {42} 18 {42} 18 {42} 19 {28} 19 {11} 19 {11} 19 {11}
λ : (56, λ, L) λ : (57, λ, L) λ : (58, λ, L) λ : (59, λ, L) 0 : (60, 0, L) 1 : (60, 1, L) 0 : (62, 0, L) 1 : (62, 1, L)
53
i Phase
gi Qi
Read : (next phase, write, move)
60 Read the sole leading zero 19 {2} 0 : (61, 0, L) 61 Left boundary after sole digit 19 {23} λ : (66, λ, D) 62 Second digit of initial left scan 19 {2, 26} d : (63, d, L) 63 Third digit of initial left scan 19 {2, 23} 0 : (64, 0, L) 1 : (65, 1, L) 64 Left scan after reading zero 19 {23} 0 : (64, 0, L) 1 : (65, 1, L) λ : (66, λ, D) 65 Left scan after reading one 19 {23} 0 : (64, 0, L) 1 : (65, 1, L) 66 Inspect fresh lower leading cell 20 {12, 36} 0 : (67, 0, R) λ : (92, λ, U) 67 First digit after lower leading zero 21 {0} d : (68, d, R) 68 Scan the lower partial product 21 {24} d : (68, d, R) λ : (69, λ, U) 69 First upper alignment digit 28 {17} d : (70, d, R) 70 Next upper alignment cell 28 {8} d : (71, d, R) λ : (72, λ, L) 71 Finish aligning the upper row 28 {4, 8} d : (71, d, R) λ : (72, λ, L)
Initial Left-Scan Coverage. On the top row, the product’s units digit has not changed between the right scan and the first left step of summation. If m = 1, the full padded word equals 0d: scanning left reads d, then 0, then a blank (phases 56–57, 60–61). If m ≥ 2, the padded word has at least three digits, so two more digits must follow the first one (phases 62–63). In both cases the padding zero immediately precedes the left blank. Alignment Coverage. Lemma H.10 gives either a blank in the inspected lower cell (no remaining row) or the next row’s leading 0. After that zero comes at least one digit. The upward move from the lower right boundary reaches an upper digit, so alignment begins inside the upper word. The expert scans to the right blank and then returns left to the units digit. The first lower units cell contains a blank. These facts justify every alignment branch here and the first three phases in the next certificate subsection. Column Addition, Carries and Stopping Separate phases track carry-zero returns from lower blanks and lower digits. This distinction prevents an impossible early end of the upper word from entering the proof protocol. i Phase
gi Qi
Read : (next phase, write, move)
72 Read upper units digit 22 {32, 41} 0 : (73, λ, D) 73 Write units digit 0 below 24 {27, 46} λ : (88, 0, U) 74 Write units digit 1 below 25 {22} λ : (88, 1, U) 75 Return above, carry zero 23 {50} λ : (76, λ, L) 76 Read upper bit, carry zero 22 {37} 0 : (77, λ, D) 77 Add value zero below 24 {30} d : (75, d, U) 78 Add value one below 25 {29} λ : (90, 1, U) 79 Return above, carry one 27 {10} λ : (80, λ, L) 80 Read upper bit, carry one 26 {38} 0 : (81, λ, D) 81 Add one inside lower digit block 25 {29} 0 : (75, 1, U) 82 Add two inside lower digit block 29 {9} d : (79, d, U) 83 Preserve unneeded leading zero 19 {20} 0 : (84, 0, L) 84 Blank to the left of merged row 19 {31, 34} λ : (66, λ, D) 85 Apply final carry to leading zero 25 {42} 0 : (86, 1, U) 86 Return after final carry 23 {47} λ : (87, λ, L) 87 Step down left of merged row 22 {33} λ : (84, λ, D) 88 Return after units digit 23 {18, 21} λ : (89, λ, L) 89 Read the second upper digit 22 {21} 0 : (77, λ, D) 90 Return from the lower blank gap 23 {21} λ : (91, λ, L) 91 Upper digit after lower blank gap 22 {21} 0 : (77, λ, D) 92 Emit final stop 30 {35, 40} λ : (93, λ, S) 93 Halted 31 {51} –
1 : (74, λ, D)
1 : (78, λ, D) λ : (83, λ, D) λ : (90, 0, U) 0 : (75, 1, U) 1 : (79, 0, U) 1 : (82, λ, D) 1 : (79, 0, U)
λ : (85, λ, D)
1 : (78, λ, D) 1 : (78, λ, D)
The Lower Blank Gap. While merging row k into row k + 1, the upper word begins at −k − 1; the original lower word ends at m − k − 2 ≥ −k − 1. A blank below an upper digit must therefore lie 54
to the right of that lower endpoint. The next column left still has index at least −k − 1, so the next upper reading contains a digit. This proves the restriction in phase 91. Independently, the upper word has length m + k + 1 ≥ 2, proving the second-digit restriction in phase 89. Carry and Boundary Coverage. Lemma H.11 excludes lower blanks in the carry-one digit phases and forces 0 for the final carry extension. Returning above a written lower digit reads the upper blank just erased. When the upper word ends, the next lower cell contains the original leading zero: carry zero preserves this bit, whereas carry one changes the bit to 1. Both branches reach the blank to the left of the merged row. When no next row remains, the upward move reaches a blank, and the expert emits the final S. Phase 93 has no further PTO actions. Local Transition Identity. For every listed input branch x : (j, w, M ) and every q ∈ Qi , direct comparison with the two transition maps gives δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M )
for some q ′ ∈ Qj .
(18)
The certificate contains 109 phase–state pairs and 201 local checks, covering 133 distinct nonterminal controller entries. A transition reaches a halt state exactly when j = 93, with M = S. Initially g0 = 0 and Q0 = {0}. Protocol coverage excludes the remaining controller entries on valid inputs. Proof of Theorem H.7. The copy, partial-product, and accumulation invariants establish the claimed product and termination for the expert. The metric protocol covers every valid execution through 67 phases; the refined annealing protocol covers every valid execution through 94 phases. The respective transition maps satisfy all 130 and 201 local identities, including the initial and terminal conditions. Applying Lemma H.2 separately to the two protocols proves both equivalence claims. H.6
Decimal Addition
Let D = {0, . . . , 9} and consider a + b, with a ∈ Dm , b ∈ Dn and m, n ≥ 1. Write A = val10 (a) and B = val10 (b). The expert and metric-extracted controller start in state 0 and halt in states 18 and 51, respectively. Theorem H.14 (Exact Decimal Addition). The metric-extracted controller produces the expert PTO on every valid decimal-addition input, with identical grids and head positions at every step. Pn−1 Accumulator and Marker Invariant Write B = j=0 bj 10j , with b0 the rightmost digit. The expert scans to the separator at column m, steps left and down, writes a working + below column m − 1, and enters state 16 above the marker. Lemma H.15 (Round Invariant). After processing k right-operand digits, 0 ≤ k ≤ n, the expert enters state 16 at (pk , 0), where pk = m − 1 − k. At this point: • Row 1 contains exactly one nonblank symbol: a + at column pk . • Row 0 contains a contiguous accumulator on [ℓk , m − 1], with value Ck = A + and left edge ℓk ≤ pk + 1. Column m − 1 carries the units digit.
P
j<k bj 10
j
• The separator remains at column m. The unprocessed prefix of b occupies columns m + 1, . . . , m + n − k. All remaining cells contain blanks. Proof. Initialization gives k = 0, ℓ0 = 0, C0 = A, and p0 = m − 1. State 16 preserves the digit at pk , or writes 0 on a blank. A blank at pk forces ℓk = pk + 1, so zero extension preserves contiguity. For k < n, the right scan reaches the blank after the unprocessed prefix, steps left to digit bk at rk = m + n − k, erases bk , and descends. The expert transports bk left along row 1 to the marker. The distance satisfies rk − pk = n + 1 ≥ 2. (19) Consequently, the first two transport steps read blanks. At the marker, the expert ascends and adds bk to the accumulator digit e at column pk . If e + bk < 10, the expert writes e + bk and descends. Otherwise, the expert writes e + bk − 10, moves left, and propagates one carry. Each digit 9 changes to 0; the first smaller digit increases by one, or a blank changes to 1. The update adds exactly bk 10k and preserves contiguity. 55
The expert returns along row 1, erases the marker, steps left, writes the next marker at pk+1 = pk − 1, and ascends into state 16. The earlier zero extension gives ℓk+1 ≤ pk = pk+1 + 1. The accumulator now has value Ck+1 , establishing the next round. Lemma H.16 (Termination and Final Configuration). The expert terminates with only the padded base-10 representation of A + B on row 0, ending at column m − 1. The final head stops at (m − n − 1, 0). Writing ℓ10 (s) for the decimal digit count, with ℓ10 (0) = 1, the output width equals L = max{m, n + 1, ℓ10 (A + B)}. Proof. Each round consumes one of the n right-operand digits. Every scan crosses a finite interval, and every carry reaches a digit below 9 or a blank. After round n, state 16 ensures a digit at pn . The next right scan returns to the separator. State 3 erases the separator and descends. State 17 walks left, erases the final marker, ascends, preserves the accumulator digit, and stops. The invariant gives Cn = A + B, and cleanup removes all work symbols. The original m columns persist, and marker extension reaches pn , ensuring at least n + 1 digits. Every additional carry extension contributes a digit required by the current numerical value. Since partial sums never decrease, the final width equals L. The observation protocol refines expert states by geometric context. Each phase records the permitted read symbols and successor phases. Section H.6 gives the complete protocol together with the controller-state relation; the shared tables avoid repeating the same phase definitions. Lemma H.17 (Protocol Coverage). Every expert execution on a valid decimal addition grid follows the 59 phases in Section H.6, starting at phase 0 and ending at phase 58. Proof. Initialization satisfies the first phases because both operands contain a digit. Lemma H.15 gives the contiguous accumulator, the ensured digit, the single working marker and the remaining right-operand prefix in every round. The explanations in Section H.6 and Section H.6 establish all first-cell, boundary, transport and return readings. The carry rule processes exactly the digits permitted in phase 50. Induction over the transitions of each round preserves these conditions. Lemma H.16 establishes finite cleanup and the final phase. Scanning, Carrying, and Cleanup A proof phase records geometric context. Phase i pairs expert state gi with controller state q ∈ Qi , with identical grids and heads. An entry x : (j, w, M ) means read x, write w, move M , and advance to phase j. The index j denotes a phase. Each Qi lists the related controller states. Here e ∈ D and h ∈ {0, . . . , 8}. A digit denotes the corresponding symbol when read or written. Phases 10–49 comprise ten digit-transport families in the next certificate subsection, with Fd = 10 + 4d. i Phase
gi Qi
0 First left-operand digit 0 {0} 1 Find the input separator 0 {0} 2 Descend below units digit 1 {1} 3 Place the working marker 1 {2} 4 Ensure a digit above marker 16 {3} 5 Adjacent existing digit 2 {4} 6 Scan accumulator to separator 2 {4} 7 Inspect remaining right operand 2 {5} 8 Scan remaining right operand 2 {5} 9 Read rightmost factor digit 3 {6} 50 Propagate decimal carry 51 First return cell after carry 52 Return to working marker 53 Erase and shift marker 54 Erase input separator
Read : (next phase, write, move) e : (1, e, R) e : (1, e, R) + : (2, +, L) e : (3, e, D) λ : (4, +, U) e : (6, e, R) λ : (5, 0, R) e : (6, e, R) e : (6, e, R) + : (7, +, R) e : (8, e, R) λ : (54, λ, L) e : (8, e, R) λ : (9, λ, L) d : (Fd , λ, D) (d ∈ D)
14 {11} 9 : (50, 0, L) h : (51, h + 1, D) 15 {15} λ : (52, λ, R) 15 {15} λ : (52, λ, R) + : (3, λ, L) 15 {11, 15} + : (3, λ, L) 3 {6} + : (55, λ, D)
56
λ : (51, 1, D)
i Phase
gi Qi
Read : (next phase, write, move)
55 Begin cleanup below separator 56 Erase final working marker 57 Preserve final digit and stop 58 Halted
17 {24} 17 {25} 17 {26} 18 {51}
λ : (56, λ, L) λ : (56, λ, L) e : (58, e, S) –
+ : (57, λ, U)
Why These Read Symbols Cover Every Valid Run. Both operands contain at least one digit. Initialization therefore reads a digit before the separator, descends below a digit and places the marker on a blank. Lemma H.15 places an existing digit immediately after each zero extension. The scan crosses the contiguous accumulator to the separator. Immediately to the separator’s right, a blank means the next left step reads that separator; after any digit, the next left step instead reads a digit. A carry moves strictly left of the marker, so the first return cell on row 1 contains a blank. A noncarry addition descends directly onto the marker. Erasing and shifting the marker reaches a blank. Cleanup starts below the separator on a blank, walks to the marker, then ascends to a digit. These facts establish the table’s restrictions. Digit-Transport Phases
For each d ∈ D, four phases carry the selected digit to the accumulator:
Fd = 10 + 4d,
Hd = Fd + 1,
Wd = Fd + 2,
Ad = Fd + 3.
All four phases use expert state 4 + d, paired with singleton controller sets containing fd , hd , wd , ad , respectively. The protocol follows: Phase
Meaning
Read : (next phase, write, move)
Fd Hd Wd Ad
First transport blank Second transport blank Walk left to the marker Add at the marked column
λ : (Hd , λ, L) λ : (Wd , λ, L) λ : (Wd , λ, L) + : (Ad , +, U) e : (53, d + e, D) if d + e < 10 e : (50, d + e − 10, L) if d + e ≥ 10
The Actual Controller-State Numbers. This table expands the entire 40-phase family. d Expert 4 + d fd hd wd ad 0 1 2 3 4 5 6 7 8 9
4 27 28 29 30 5 12 13 14 11 6 39 40 41 42 7 31 32 33 34 8 43 44 45 46 9 47 48 49 50 10 7 8 9 10 11 20 21 22 23 12 16 17 18 19 13 35 36 37 38
Transport Coverage. Equation (19) gives rk − pk = n + 1 ≥ 2. The first two transport cells therefore contain blanks. After two left steps, the head reaches either the marker or a blank to the marker’s right. The walk reaches the marker and ascends to a digit ensured at the start of the round. The two branches implement decimal addition with at most one carry: d + e = s + 10c,
s ∈ D,
c ∈ {0, 1}.
This accounts for every pair (d, e), including 0, 9 and all carry cases. Multiple Roles of Controller State 11. State 11 performs addition of 1 when reading a digit, propagates carries when entered to the left of an overflowing column, and erases the marker when reading +. With d = 1 and no carry, the controller enters state 15; every other noncarry branch enters state 11. Both belong to Q53 = {11, 15} and have the same required action on +. Every overflow 57
enters state 11 ∈ Q50 . The phase relation distinguishes these geometric contexts and therefore does not require a one-to-one correspondence between controller states. Local Transition Identity. For every phase i, controller state q ∈ Qi and listed branch x : (j, w, M ), direct comparison with the transition maps gives δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M ),
q ′ ∈ Qj .
(20)
Every required entry exists. A transition reaches a halt state exactly when j = 58, with M = S. The certificate contains 60 phase–state pairs, including the terminal pair, and 266 local checks of (20). The checks cover all 223 defined nonterminal controller entries. The remaining 12 entries contain halt loops, excluded from PTOs. Proof of Theorem H.14. The accumulator invariant and the ten digit-transport families cover every possible decimal digit pair and carry. Every valid execution follows the 59-phase protocol and terminates. The state relation satisfies all 266 instances of (11), including the initial pair and final stopping action. Thus Lemma H.2 proves equality of the complete PTOs and final configurations. H.7
Decimal Multiplication
Let D = {0, . . . , 9} and consider a x b, with a ∈ Dm , b ∈ Dn , m, n ≥ 1. Write A = val10 (a) and B = val10 (b). The expert and metric-extracted controller start in state 0 and halt in states 107 and 181, respectively. Theorem H.18 (Exact Decimal Multiplication). The metric-extracted controller produces the expert PTO on every valid decimal-multiplication input. Both executions terminate with the (m + n)digit decimal representation of AB, including leading-zero padding, on row n − 1 in columns −n, . . . , m − 1. The final head stops at (−n − 1, n − 1). Pn−1 Copying and Partial Products Write b = bn−1 · · · b0 , so B = i=0 bi 10i . Assign global weight 10m−1−z to column z. Column m − 1 carries the units digit of the final product. Lemma H.19 (Copy Staircase). Before product formation, the expert constructs exactly n occupied rows. For 0 ≤ i < n, row i contains a x bn−1 · · · bi
starting in column − i.
(21)
All remaining cells contain blanks. Proof. Row 0 contains the input. On row i, the expert scans to the right blank, steps left over bi , and inspects the preceding cell. A digit at this position implies at least two remaining factor digits. The expert copies every symbol except bi one row down and one column left, from right to left. Each destination contains a blank before writing; the source row remains unchanged. The first descent reaches a blank. Subsequent descents reach the copied right neighbor: a digit, except when copying the last digit of a, where the lower cell contains the copied x. The descent from the source x reaches a digit. After copying the first digit of a, the expert reads the left blank and descends onto the first digit of the new row. The new row satisfies (21), with one fewer factor digit. When one factor digit remains, the second left step reaches x and starts product formation. Thus n − 1 copies produce exactly the stated staircase. Lemma H.20 (Aligned Partial Products). After product formation, row i contains the (m + 1)-digit representation of Abi on columns −i − 1, . . . , m − i − 1. The leading digit belongs to {0, . . . , 8}. In global column weights, this row represents Abi 10i . All remaining cells contain blanks. Proof. The expert processes rows from n − 1 upwards. On row i, the expert erases the selected factor f = bi , the remaining factor prefix, and x, then walks left across a. For f = 0, each digit becomes 0, followed by one padding 0 on the left blank. For 1 ≤ f ≤ 9, the control state stores carry c, initially 0, and applies f d + c = w + 10c′ ,
w = (f d + c) mod 10, 58
c′ = ⌊(f d + c)/10⌋.
(22)
The bound 0 ≤ c < f persists because f d + c ≤ 9f + f − 1 = 10f − 1. The usual suffix invariant for (22) gives the product digits; the left blank receives the final carry. Thus the leading digit never exceeds f − 1 ≤ 8. The right scan ends at column m − i and moves up. For i > 0, the upper cell contains the last digit of a, followed by x and the remaining factor prefix. The expert scans this prefix, selects the last digit, and repeats. Every higher row contains at least two factor digits, so at least one further digit follows the selected factor during leftward erasure. For i = 0, the upper cell contains a blank, starting summation on row 0. Every scan crosses a finite word. Copying shortens the factor prefix; product formation visits each occupied row once. Both passes terminate. Accumulation and Carry Confinement Lemma H.21 (Fixed-Width Accumulator). After merging through row k, 0 ≤ k < n, all rows above k contain blanks. Row k contains a contiguous (m + k + 1)-digit accumulator on columns −k − 1, . . . , m − 1, with value k X Sk = A bi 10i . i=0
Rows below k retain the partial products from Lemma H.20. At inspection of the next row, expert state 88 has head (−k − 2, k + 1). Proof. For k = 0, the expert scans left across the product on row 0, reaches column −2, and descends to inspect row 1. If row k + 1 exists, inspection reads the fresh leading digit in {0, . . . , 8}. The expert scans the lower product to the right blank at m − k − 1 and moves up. The upper cell contains an accumulator digit, since −k − 1 ≤ m − k − 1 ≤ m − 1. The expert scans to the upper right blank and steps left to column m − 1. The lower product ends at m − k − 2, so the first lower cell contains a blank. For upper digit u, lower digit v (a blank contributes zero), and incoming carry c ∈ {0, 1}, the update applies u + v + c = w + 10c′ , w ∈ D, c′ ∈ {0, 1}. (23) The expert erases u, writes w below, returns to the erased upper cell, and moves left. The processed lower suffix contains the correct sum suffix; the unprocessed cells retain the old digits; c′ records the contribution to the next column. Equation (23) preserves this invariant. The lower word extends one column farther left than the upper word. After the upper word ends, carry zero preserves this lower leading digit. Carry one increments the leading digit and clears, since the digit never exceeds 8. The expert reaches column −k − 3 on row k + 1 and descends. Row k contains only blanks; row k + 1 represents Sk + Abk+1 10k+1 = Sk+1 on the claimed support. Lemma H.22 (Boundary Restrictions). A carry-one update beneath an upper digit reads an original lower digit. A blank lower update guarantees another upper digit on the next left step. A carry beyond the upper word reads a lower digit in {0, . . . , 8} and clears. Proof. The blank gap lies strictly to the right of the original lower word. The first update has carry zero, and u + 0 ≤ 9, so no carry originates inside this gap. Carry one can first arise only inside the lower digit block; further leftward updates stay inside that block until the leading digit. A blank lower cell has column z ≥ m − k − 1. The next upper column satisfies z − 1 ≥ m − k − 2 ≥ −k − 1, using m ≥ 1, and therefore still contains a digit. Finally, the lower leading digit lies one column left of the upper word. Lemma H.20 bounds this untouched digit by 8; adding 1 clears any final carry without extending the fixed-width support. Each merge consumes finitely many upper digits and at most one extra carry column. After n − 1 merges, state 88 reads the blank below the final row, moves up to state 106, and emits S into halt state 107. Lemma H.21 gives the final product, padding, and head position. 59
Section H.7 gives 207 phases. Phase i pairs expert state gi with controller state q ∈ Qi , on an identical x grid and head. An edge i − → j permits read symbol x and advances to phase j. The protocol begins at phase 0 and ends at phase 206. All phase sets contain one controller state except Q201 = {26, 106}. Lemma H.23 (Protocol Coverage). Every expert execution in the stated domain follows the protocol in Section H.7 from phase 0 to phase 206. Proof. The following geometric and arithmetic conditions justify every read restriction. Copying. The initial scan and every restart encounter a nonempty left operand, then x, then a nonempty right operand before the right blank. The second left step reads a factor digit or x. Lemma H.19 distinguishes the first descent (blank), ordinary descents (digits), and the descent directly above the copied operator (x). Every destination contains a blank. After the first copied symbol, the next source symbol contains a digit or x; no left blank can occur yet. After copying x, the next source symbol contains the last digit of a. The ordinary copy loop eventually reaches the left blank and restarts. Products. The bottom row contains one factor digit; erasing that digit immediately exposes x. Every higher row contains at least two factor digits; erasing the selected factor therefore exposes another digit before x. After erasing x, the first product update reads a digit because m ≥ 1. Later updates read digits followed by the left blank. Equation (22) determines the next carry phase and preserves the carry bound. The completed product scan reads digits followed by a blank. Lemma H.20 places the head on an upper digit followed by x and a nonempty factor prefix, or on a blank above row 0. Alignment and Summation. Summation starts on the right blank of row 0. The initial left scan crosses a nonempty product. Inspection below reads a fresh leading digit from {0, . . . , 8} or a blank below the last row. After a leading digit, at least one lower digit remains because m ≥ 1. Lemma H.21 places the first upper alignment step on a digit; further alignment steps read digits until the right blank. The first upper units digit has carry zero and a blank lower cell. After every lower update, the upper return cell contains the erased blank. A blank lower update leads to a nonblank upper read by Lemma H.22. An update inside the lower digit block leads to an upper digit or the left blank. Carry-one digit updates remain inside the lower digit block. At the end of the upper word, carry zero preserves the untouched lower leading digit, while carry one increments that digit and clears. Both paths reach the blank immediately left of the merged word. The final stop reads a blank. These conditions give exactly the permitted branches used by the expert. Induction over individual moves, copied rows, and merged rows establishes coverage. The finite-pass arguments in Lemma H.19–Lemma H.21 give termination at phase 206. The protocol may permit additional observation sequences. Checking every permitted branch therefore suffices for all valid grid executions. x
Finite Local Certificate. For every protocol edge i − → j and every q ∈ Qi , direct comparison with the two transition maps gives δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M ),
q ′ ∈ Qj .
(24)
Every required entry exists. A transition reaches halt exactly when j = 206, with motion S. Direct substitution verifies all 1,509 obligations across 208 phase–state pairs. These obligations cover all 1,259 defined nonterminal controller entries. The remaining 12 defined entries contain halt loops, which never contribute to a PTO. The Expert Transition Map. The following formulas supply every action needed by the decimal certificate. Let d, f ∈ {0, . . . , 9} and z ∈ {λ, x, 0, . . . , 9}. Define f (f − 1) 92 + v, 0 ≤ v < 10, Pf,c = 38 + + c (1 ≤ f ≤ 9, 0 ≤ c < f ), Vv = 105, v = 10. 2 An entry (q, x) 7→ (q ′ , w, M ) specifies an actual state transition. A symbol d in a written field denotes the corresponding decimal digit.
60
State
Read
(successor, write, motion)
0 0 1 2 2 3+d 13 14 + d 24 25 25 25 26 27 + f 27 27 + f , f > 0 37 37 Pf,c Pf,c 83 83 84 84 85 85 86 87 87 88 88 89 89 104 104 90 90 102 102 91 103 Vv 106
d, x λ d d x z d λ λ d x λ f d x x d λ d λ d λ d λ d, x λ λ d λ d λ d λ d λ d λ d λ λ λ d or λ z
(0, read, R) (1, λ, L) (2, d, L) (3 + d, d, D) (26, x, R) (14 + d, z, L) (24, d, L) (25, d, U ) (25, x, U ) (3 + d, d, D) (13, x, D) (0, λ, D) (27 + f, λ, L) (27 + f, λ, L) (37, λ, L) (Pf,0 , λ, L) (37, 0, L) (83, 0, R) (Pf,c′ , w, L), where f d + c = 10c′ + w, 0 ≤ w < 10 (83, c, R) (83, d, R) (84, λ, U ) (85, d, R) (86, λ, D) (85, read, R) (26, λ, L) (87, λ, L) (87, d, L) (88, λ, D) (89, d, R) (106, λ, U ) (89, d, R) (104, λ, U ) (104, d, R) (90, λ, L) (Vd , λ, D) (87, λ, D) (Vd+1 , λ, D) (93, λ, D) (90, λ, L) (102, λ, L) (91 + 12c′ , w, U ), where v + d = 10c′ + w and a blank contributes d = 0 (107, z, S)
The phase restrictions below exclude every omitted expert transition. In particular, a final carry only encounters a lower leading digit at most 8. Phases and Controller-State Relation The table gives the phase index i, expert state gi , controller set Qi , and permitted reads with successor phase indices. For a digit vector [j0 , . . . , j9 ], read d advances to jd . The notation D : j sends every decimal digit to phase j; 0:8 : j permits only digits 0, . . . , 8. Unlisted reads never occur in the corresponding phase of a valid input. The expert transition supplies the write and motion for each edge; Equation (24) checks both transition maps against that action. The copying moves follow Lemma H.19; product updates follow (22); addition updates follow (23). Phase labels describe positions before the next action.
61
i Phase
gi Qi
0 First left-operand digit 1 Scan left operand 2 First factor digit 3 Scan right operand 4 Skip last factor digit 5 Copy or start products 6 First descent, digit 0 7 First copied write, digit 0 8 First descent, digit 1 9 First copied write, digit 1 10 First descent, digit 2 11 First copied write, digit 2 12 First descent, digit 3 13 First copied write, digit 3 14 First descent, digit 4 15 First copied write, digit 4 16 First descent, digit 5 17 First copied write, digit 5 18 First descent, digit 6 19 First copied write, digit 6 20 First descent, digit 7 21 First copied write, digit 7 22 First descent, digit 8 23 First copied write, digit 8 24 First descent, digit 9 25 First copied write, digit 9 26 Source after first copy 27 Ordinary descent, digit 0 28 Ordinary copied write, digit 0 29 Ordinary descent, digit 1 30 Ordinary copied write, digit 1 31 Ordinary descent, digit 2 32 Ordinary copied write, digit 2 33 Ordinary descent, digit 3 34 Ordinary copied write, digit 3 35 Ordinary descent, digit 4 36 Ordinary copied write, digit 4 37 Ordinary descent, digit 5 38 Ordinary copied write, digit 5 39 Ordinary descent, digit 6 40 Ordinary copied write, digit 6 41 Ordinary descent, digit 7 42 Ordinary copied write, digit 7 43 Ordinary descent, digit 8 44 Ordinary copied write, digit 8 45 Ordinary descent, digit 9 46 Ordinary copied write, digit 9 47 Continue source copy 48 Descend below operator 49 Write copied operator 50 Copy last digit of a 51 Descend above x, digit 0 52 Descend above x, digit 1 53 Descend above x, digit 2 54 Descend above x, digit 3 55 Descend above x, digit 4 56 Descend above x, digit 5 57 Descend above x, digit 6
0 0 0 0 1 2 3 14 4 15 5 16 6 17 7 18 8 19 9 20 10 21 11 22 12 23 25 3 14 4 15 5 16 6 17 7 18 8 19 9 20 10 21 11 22 12 23 25 13 24 25 3 4 5 6 7 8 9
{0} {0} {1} {1} {2} {3} {172} {173} {123} {124} {64} {65} {4} {5} {87} {88} {39} {40} {163} {164} {51} {52} {128} {129} {79} {80} {6} {178} {159} {134} {135} {68} {67} {125} {11} {166} {90} {165} {131} {55} {42} {170} {148} {150} {116} {167} {54} {12} {7} {8} {9} {158} {145} {66} {10} {89} {130} {41}
Read : next phase D:1 D:1 x:2 D:3 D:3 λ:4 D:5 D : [6, 8, 10, 12, 14, 16, 18, 20, 22, 24] x : 62 λ:7 λ : 26 λ:9 λ : 26 λ : 11 λ : 26 λ : 13 λ : 26 λ : 15 λ : 26 λ : 17 λ : 26 λ : 19 λ : 26 λ : 21 λ : 26 λ : 23 λ : 26 λ : 25 λ : 26 D : [27, 29, 31, 33, 35, 37, 39, 41, 43, 45] x : 48 D : 28 λ : 47 D : 30 λ : 47 D : 32 λ : 47 D : 34 λ : 47 D : 36 λ : 47 D : 38 λ : 47 D : 40 λ : 47 D : 42 λ : 47 D : 44 λ : 47 D : 46 λ : 47 D : [27, 29, 31, 33, 35, 37, 39, 41, 43, 45] x : 48 λ : 61 D : 49 λ : 50 D : [51, 52, 53, 54, 55, 56, 57, 58, 59, 60] x : 28 x : 30 x : 32 x : 34 x : 36 x : 38 x : 40 Continued on the next page
62
Simulation Certificate (Continued) i Phase 58 Descend above x, digit 7 59 Descend above x, digit 8 60 Descend above x, digit 9 61 Restart on copied row 62 Bottom-row factor 63 Erase x, bottom factor 0 64 First product digit, factor 0 65 Continue product by zero 66 Erase x, bottom factor 1 67 First product digit, factor 1 68 Product by 1, carry 0 69 Erase x, bottom factor 2 70 First product digit, factor 2 71 Product by 2, carry 0 72 Product by 2, carry 1 73 Erase x, bottom factor 3 74 First product digit, factor 3 75 Product by 3, carry 0 76 Product by 3, carry 1 77 Product by 3, carry 2 78 Erase x, bottom factor 4 79 First product digit, factor 4 80 Product by 4, carry 0 81 Product by 4, carry 1 82 Product by 4, carry 2 83 Product by 4, carry 3 84 Erase x, bottom factor 5 85 First product digit, factor 5 86 Product by 5, carry 0 87 Product by 5, carry 1 88 Product by 5, carry 2 89 Product by 5, carry 3 90 Product by 5, carry 4 91 Erase x, bottom factor 6 92 First product digit, factor 6 93 Product by 6, carry 0 94 Product by 6, carry 1 95 Product by 6, carry 2 96 Product by 6, carry 3 97 Product by 6, carry 4 98 Product by 6, carry 5 99 Erase x, bottom factor 7 100 First product digit, factor 7 101 Product by 7, carry 0 102 Product by 7, carry 1 103 Product by 7, carry 2 104 Product by 7, carry 3 105 Product by 7, carry 4 106 Product by 7, carry 5 107 Product by 7, carry 6 108 Erase x, bottom factor 8 109 First product digit, factor 8 110 Product by 8, carry 0 111 Product by 8, carry 1 112 Product by 8, carry 2 113 Product by 8, carry 3
gi Qi 10 11 12 0 26 27 37 37 28 38 38 29 39 39 40 30 41 41 42 43 31 44 44 45 46 47 32 48 48 49 50 51 52 33 53 53 54 55 56 57 58 34 59 59 60 61 62 63 64 65 35 66 66 67 68 69
{147} {115} {53} {13} {14} {111} {62} {62} {78} {24} {24} {69} {70} {70} {143} {15} {16} {16} {48} {155} {75} {76} {76} {91} {77} {117} {43} {44} {44} {153} {144} {45} {95} {107} {108} {108} {171} {110} {174} {142} {109} {56} {57} {57} {168} {127} {179} {59} {169} {58} {112} {113} {113} {137} {121} {114}
Read : next phase x : 42 x : 44 x : 46 D:1 D : [63, 66, 69, 73, 78, 84, 91, 99, 108, 118] x : 64 D : 65 D : 65 λ : 129 x : 67 D : 68 D : 68 λ : 129 x : 70 D : [71, 71, 71, 71, 71, 72, 72, 72, 72, 72] D : [71, 71, 71, 71, 71, 72, 72, 72, 72, 72] λ : 129 D : [71, 71, 71, 71, 71, 72, 72, 72, 72, 72] λ : 129 x : 74 D : [75, 75, 75, 75, 76, 76, 76, 77, 77, 77] D : [75, 75, 75, 75, 76, 76, 76, 77, 77, 77] λ : 129 D : [75, 75, 75, 76, 76, 76, 76, 77, 77, 77] λ : 129 D : [75, 75, 75, 76, 76, 76, 77, 77, 77, 77] λ : 129 x : 79 D : [80, 80, 80, 81, 81, 82, 82, 82, 83, 83] D : [80, 80, 80, 81, 81, 82, 82, 82, 83, 83] λ : 129 D : [80, 80, 80, 81, 81, 82, 82, 82, 83, 83] λ : 129 D : [80, 80, 81, 81, 81, 82, 82, 83, 83, 83] λ : 129 D : [80, 80, 81, 81, 81, 82, 82, 83, 83, 83] λ : 129 x : 85 D : [86, 86, 87, 87, 88, 88, 89, 89, 90, 90] D : [86, 86, 87, 87, 88, 88, 89, 89, 90, 90] λ : 129 D : [86, 86, 87, 87, 88, 88, 89, 89, 90, 90] λ : 129 D : [86, 86, 87, 87, 88, 88, 89, 89, 90, 90] λ : 129 D : [86, 86, 87, 87, 88, 88, 89, 89, 90, 90] λ : 129 D : [86, 86, 87, 87, 88, 88, 89, 89, 90, 90] λ : 129 x : 92 D : [93, 93, 94, 94, 95, 96, 96, 97, 97, 98] D : [93, 93, 94, 94, 95, 96, 96, 97, 97, 98] λ : 129 D : [93, 93, 94, 94, 95, 96, 96, 97, 97, 98] λ : 129 D : [93, 93, 94, 95, 95, 96, 96, 97, 98, 98] λ : 129 D : [93, 93, 94, 95, 95, 96, 96, 97, 98, 98] λ : 129 D : [93, 94, 94, 95, 95, 96, 97, 97, 98, 98] λ : 129 D : [93, 94, 94, 95, 95, 96, 97, 97, 98, 98] λ : 129 x : 100 D : [101, 101, 102, 103, 103, 104, 105, 105, 106, 107] D : [101, 101, 102, 103, 103, 104, 105, 105, 106, 107] D : [101, 101, 102, 103, 103, 104, 105, 106, 106, 107] D : [101, 101, 102, 103, 104, 104, 105, 106, 106, 107] D : [101, 102, 102, 103, 104, 104, 105, 106, 106, 107] D : [101, 102, 102, 103, 104, 104, 105, 106, 107, 107] D : [101, 102, 102, 103, 104, 105, 105, 106, 107, 107] D : [101, 102, 103, 103, 104, 105, 105, 106, 107, 107] x : 109 D : [110, 110, 111, 112, 113, 114, 114, 115, 116, 117] D : [110, 110, 111, 112, 113, 114, 114, 115, 116, 117] D : [110, 110, 111, 112, 113, 114, 114, 115, 116, 117] D : [110, 111, 111, 112, 113, 114, 115, 115, 116, 117] D : [110, 111, 111, 112, 113, 114, 115, 115, 116, 117]
λ : 129 λ : 129 λ : 129 λ : 129 λ : 129 λ : 129 λ : 129
λ : 129 λ : 129 λ : 129 λ : 129
Continued on the next page
63
Simulation Certificate (Continued) i Phase 114 Product by 8, carry 4 115 Product by 8, carry 5 116 Product by 8, carry 6 117 Product by 8, carry 7 118 Erase x, bottom factor 9 119 First product digit, factor 9 120 Product by 9, carry 0 121 Product by 9, carry 1 122 Product by 9, carry 2 123 Product by 9, carry 3 124 Product by 9, carry 4 125 Product by 9, carry 5 126 Product by 9, carry 6 127 Product by 9, carry 7 128 Product by 9, carry 8 129 Scan completed product 130 Inspect row above 131 Cross upper operator 132 First upper factor digit 133 Scan upper factor prefix 134 Select upper factor 135 First prefix erasure, factor 0 136 Later prefix erasure, factor 0 137 First prefix erasure, factor 1 138 Later prefix erasure, factor 1 139 First prefix erasure, factor 2 140 Later prefix erasure, factor 2 141 First prefix erasure, factor 3 142 Later prefix erasure, factor 3 143 First prefix erasure, factor 4 144 Later prefix erasure, factor 4 145 First prefix erasure, factor 5 146 Later prefix erasure, factor 5 147 First prefix erasure, factor 6 148 Later prefix erasure, factor 6 149 First prefix erasure, factor 7 150 Later prefix erasure, factor 7 151 First prefix erasure, factor 8 152 Later prefix erasure, factor 8 153 First prefix erasure, factor 9 154 Later prefix erasure, factor 9 155 Start summation 156 First initial left digit 157 Continue initial left scan 158 Inspect fresh lower row 159 First digit after leading cell 160 Scan lower product 161 First upper alignment digit 162 Continue upper alignment 163 Read upper units digit 164 First lower update, value 0 165 First lower update, value 1 166 First lower update, value 2 167 First lower update, value 3 168 First lower update, value 4 169 First lower update, value 5
gi Qi
Read : next phase
70 {132} 71 {149} 72 {120} 73 {136} 36 {81} 74 {82} 74 {82} 75 {151} 76 {177} 77 {154} 78 {176} 79 {83} 80 {156} 81 {152} 82 {98} 83 {17} 84 {18} 85 {19} 85 {20} 85 {20} 26 {21} 27 {60} 27 {61} 28 {22} 28 {23} 29 {71} 29 {72} 30 {46} 30 {47} 31 {92} 31 {93} 32 {84} 32 {85} 33 {140} 33 {141} 34 {160} 34 {161} 35 {118} 35 {119} 36 {96} 36 {97} 86 {25} 87 {26} 87 {26} 88 {27} 89 {28} 89 {28} 104 {29} 104 {30} 90 {31} 92 {63} 93 {99} 94 {138} 95 {32} 96 {73} 97 {133}
D : [110, 111, 112, 112, 113, 114, 115, 116, 116, 117] D : [110, 111, 112, 112, 113, 114, 115, 116, 116, 117] D : [110, 111, 112, 113, 113, 114, 115, 116, 117, 117] D : [110, 111, 112, 113, 113, 114, 115, 116, 117, 117] x : 119 D : [120, 120, 121, 122, 123, 124, 125, 126, 127, 128] D : [120, 120, 121, 122, 123, 124, 125, 126, 127, 128] D : [120, 121, 121, 122, 123, 124, 125, 126, 127, 128] D : [120, 121, 122, 122, 123, 124, 125, 126, 127, 128] D : [120, 121, 122, 123, 123, 124, 125, 126, 127, 128] D : [120, 121, 122, 123, 124, 124, 125, 126, 127, 128] D : [120, 121, 122, 123, 124, 125, 125, 126, 127, 128] D : [120, 121, 122, 123, 124, 125, 126, 126, 127, 128] D : [120, 121, 122, 123, 124, 125, 126, 127, 127, 128] D : [120, 121, 122, 123, 124, 125, 126, 127, 128, 128] D : 129 λ : 130 D : 131 λ : 155 x : 132 D : 133 D : 133 λ : 134 D : [135, 137, 139, 141, 143, 145, 147, 149, 151, 153] D : 136 D : 136 x : 64 D : 138 D : 138 x : 67 D : 140 D : 140 x : 70 D : 142 D : 142 x : 74 D : 144 D : 144 x : 79 D : 146 D : 146 x : 85 D : 148 D : 148 x : 92 D : 150 D : 150 x : 100 D : 152 D : 152 x : 109 D : 154 D : 154 x : 119 λ : 156 D : 157 D : 157 λ : 158 0:8 : 159 λ : 205 D : 160 D : 160 λ : 161 D : 162 D : 162 λ : 163 D : [164, 165, 166, 167, 168, 169, 170, 171, 172, 173] λ : 174 λ : 174 λ : 174 λ : 174 λ : 174 λ : 174
λ : 129 λ : 129 λ : 129 λ : 129
λ : 129 λ : 129 λ : 129 λ : 129 λ : 129 λ : 129 λ : 129 λ : 129 λ : 129
Continued on the next page
64
Simulation Certificate (Continued) i Phase
gi Qi
170 First lower update, value 6 171 First lower update, value 7 172 First lower update, value 8 173 First lower update, value 9 174 Return after lower blank 175 Read next upper digit 176 Return with carry zero 177 Read upper, carry zero 178 Add 0 below 179 Add 1 below 180 Add 2 below 181 Add 3 below 182 Add 4 below 183 Add 5 below 184 Add 6 below 185 Add 7 below 186 Add 8 below 187 Add 9 below 188 Return with carry one 189 Read upper, carry one 190 Add 1 inside lower block 191 Add 2 inside lower block 192 Add 3 inside lower block 193 Add 4 inside lower block 194 Add 5 inside lower block 195 Add 6 inside lower block 196 Add 7 inside lower block 197 Add 8 inside lower block 198 Add 9 inside lower block 199 Add 10 inside lower block 200 Preserve leading digit 201 Blank left of merged row 202 Increment leading digit 203 Return after final carry 204 Step down left of sum 205 Emit final stop 206 Halted
Read : next phase
98 {94} λ : 174 99 {162} λ : 174 100 {49} λ : 174 101 {146} λ : 174 91 {33} λ : 175 90 {34} D : [178, 179, 180, 181, 182, 183, 184, 185, 186, 187] 91 {36} λ : 177 90 {37} D : [178, 179, 180, 181, 182, 183, 184, 185, 186, 187] 92 {35} D : 176 λ : 174 93 {50} D : [176, 176, 176, 176, 176, 176, 176, 176, 176, 188] 94 {122} D : [176, 176, 176, 176, 176, 176, 176, 176, 188, 188] 95 {86} D : [176, 176, 176, 176, 176, 176, 176, 188, 188, 188] 96 {74} D : [176, 176, 176, 176, 176, 176, 188, 188, 188, 188] 97 {139} D : [176, 176, 176, 176, 176, 188, 188, 188, 188, 188] 98 {157} D : [176, 176, 176, 176, 188, 188, 188, 188, 188, 188] 99 {175} D : [176, 176, 176, 188, 188, 188, 188, 188, 188, 188] 100 {100} D : [176, 176, 188, 188, 188, 188, 188, 188, 188, 188] 101 {126} D : [176, 188, 188, 188, 188, 188, 188, 188, 188, 188] 103 {101} λ : 189 102 {102} D : [190, 191, 192, 193, 194, 195, 196, 197, 198, 199] 93 {50} D : [176, 176, 176, 176, 176, 176, 176, 176, 176, 188] 94 {122} D : [176, 176, 176, 176, 176, 176, 176, 176, 188, 188] 95 {86} D : [176, 176, 176, 176, 176, 176, 176, 188, 188, 188] 96 {74} D : [176, 176, 176, 176, 176, 176, 188, 188, 188, 188] 97 {139} D : [176, 176, 176, 176, 176, 188, 188, 188, 188, 188] 98 {157} D : [176, 176, 176, 176, 188, 188, 188, 188, 188, 188] 99 {175} D : [176, 176, 176, 188, 188, 188, 188, 188, 188, 188] 100 {100} D : [176, 176, 188, 188, 188, 188, 188, 188, 188, 188] 101 {126} D : [176, 188, 188, 188, 188, 188, 188, 188, 188, 188] 105 {180} D : 188 87 {26} 0:8 : 201 87 {26, 106} λ : 158 93 {103} 0:8 : 203 91 {104} λ : 204 90 {105} λ : 201 106 {38} λ : 206 107 {181} –
λ : 200 λ : 174 λ : 174 λ : 174 λ : 174 λ : 174 λ : 174 λ : 174 λ : 174 λ : 174 λ : 202
Proof of Theorem H.18. The staircase, partial-product, accumulator, and boundary invariants establish coverage of the 207-phase protocol for arbitrary operand lengths. The displayed state relation contains 208 phase–state pairs and satisfies 1,509 local identities. The protocol excludes every undefined controller transition and terminates after the common final action. Apply Lemma H.2; the accumulator invariant supplies the final padded product and head position. H.8
Universal Computation: Two Certificates for One Interpreter
A simulated Turing machine has states {0, . . . , N − 1}, N ≥ 1, tape alphabet Γ = {λ, 0, 1}, and a total transition function δ : {0, . . . , N − 1} × Γ −→ {0, . . . , N − 1} × Γ × {L, R, S}. The simulated machine starts in state 0; motion S stops after writing. The encoding below admits arbitrary program sizes. Both interpreter controllers start in state 0; the expert, metric controller, and annealed controller have halt states 14, 43, and 27, respectively. Theorem H.24 (Exact Universal Interpretation). For every correctly encoded machine and every nonempty binary input, both extracted controllers produce the expert PTO. The annealed controller additionally covers empty binary input. At every step, the visible grids, heads, and rune records agree, 65
including symbols hidden beneath runes. Both controllers and the expert halt simultaneously, or all corresponding finite execution prefixes agree forever. H.8.1
Shared Encoding and Expert Invariants
Encoding and Rune Semantics Let κ = max(1, ⌈log3 N ⌉). Encode each state with a fixed-width, most-significant-first ternary word using L, R, S for 0, 1, 2 respectively. Write this word as c(q). The trit symbol S encodes the value 2; the motion S stops execution. Order tape symbols as σ0 = λ < σ1 = 0 < σ2 = 1. For δ(q, σi ) = (q ′ , w, M ), program row r = 3q + i contains σi , λ, c(q), 0, c(q ′ ), 0, w, M . (25) The source and successor codes each occupy κ separate cells. Thus the program has 3N rows, ordered by state and then by read symbol. Columns
Field
Purpose
0 1 2, . . . , κ + 1 κ+2 κ + 3, . . . , 2κ + 2 2κ + 3 2κ + 4 2κ + 5
σi λ c(q) 0 c(q ′ ) 0 w M
Simulated tape read symbol Bookmark column for rune X Source-state code First delimiter Successor-state code Second delimiter Symbol to write Simulated move L, R or S
Initial Placement. Row r occupies grid height y = −r, so D advances down the table and U moves up the table. Initially X covers the blank at (1, 0); no cell contains Y or Z. The input occupies columns 1, . . . , |v| of row 3N , at height −3N . The controller starts at (1, −3N ), including for empty input. The tape row extends infinitely in both horizontal directions. Rune Semantics. Each of X, Y, Z has one position and a hidden symbol. Writing a rune first restores the hidden symbol at the old rune position, then installs the rune over the symbol at the new position. Rewriting a rune in place preserves the hidden symbol. Writing an ordinary symbol at a rune removes that rune. A motion X, Y or Z jumps to the corresponding rune after the write. Ordinary motions move one cell; S stops without moving. The logical program means the program with every rune replaced by the corresponding hidden symbol. Correctness depends on preserving this logical program, not on treating a rune as a destructive overwrite. Endpoint and Prefix Invariant Lemma H.25 (Endpoint and Prefix Invariant). At the start of every simulated step, the expert occupies state 0 at the simulated tape head. Rune X occupies column 1 on the first or last row of the current simulated state’s three-row block. After matching j successor trits, X occupies column 1 + j on a row with the correct length-j successor prefix. The row index remains congruent to 0 or 2 modulo 3. The logical program remains unchanged. Proof. Initially X occupies the first row of state 0. Assume the invariant at the start of a simulated step. The expert reads the tape symbol, installs Z, jumps to X, and steps left. The symbol search selects the matching row within the current state’s three-row block. The following right scan crosses column 1 and the source code to the first delimiter, leaving X in place. For successor trit t, the expert places Y on the trit, jumps to X, and steps right to the next sourcecode column. All rows sharing the matched prefix form one interval. Within that interval, next-trit values increase monotonically down the table. The successor state exists, so a nonempty subinterval contains next trit t. Moving down on a smaller trit, or up on a larger trit, reaches t before leaving the matched-prefix interval. An immediate match preserves the endpoint. A downward search enters the target subinterval at the first row, with read symbol λ; an upward search enters at the last row, with read symbol 1. Both 66
rows occupy endpoints of three-row state blocks. Writing X advances the matched prefix by one trit. Jumping to Y resumes instruction decoding. After all κ trits, X occupies a row in the successor state’s block. The second delimiter triggers a leftward rewind of X to column 1 on the same row. The expert then applies the prescribed write and motion at Z. Rune relocation restores every covered program symbol, preserving the logical program. Each nonstopping motion establishes the next simulated step. Lemma H.26 (No Missing Middle Trit). Within a fixed source-code prefix block, a vertical search cannot pass directly between an L region and an S region. A nonempty R region separates the two regions. Proof. The state numbers fill the contiguous interval 0, . . . , N − 1, with a common encoding width. A prefix block contains a possibly truncated interval of consecutive integers. A block containing nexttrit values L and S also contains every state in the intervening R subinterval. Each state contributes all three read-symbol rows. Corollary H.27 (Faithful Expert Simulation). Each simulated TM transition takes finitely many controller steps and performs the write and motion prescribed by δ. The expert halts exactly when the simulated TM issues S. Proof. Lemma H.25 selects the correct instruction and successor. Every scan stays within a finite program interval, and every trit search reaches a nonempty target interval. The final two instruction fields supply the prescribed write and motion at Z. Only a simulated S triggers a stopping transition.
H.8.2
Metric-Extraction Certificate: Nonempty Inputs
The protocol records finite geometric context. Let e ∈ {0, 2} identify the endpoint row occupied by X. Use r, j ∈ {0, 1, 2} to index tape symbols and t, a ∈ {L, R, S} to denote trits. A vertical search records the last observed trit. Each phase and parameter tuple determines an expert state. Phase
Expert state
Initial Dispatch(e) Selection jump(e, r) Select(e, r, j)
0 0 1+r 1+r
Cross(e, r) First source trit(e) Source scan(e) First successor trit(e) Successor scan(e) Match jump(e, t) First comparison(e, t)
4 4 4 5 5 gt gt
Search down(t, a)
gt
Search up(t, a)
gt
Resume(e, t) Rewind jump(e) Rewind(e) Rewind return(e) Read write(e) Read motion(e, r) Apply(e, r, M )
gt 9 9 9 10 11 + r hr,M
Halt
14
Allowed reading and continuation Read 0 or 1; select the matching row from endpoint 0. Read σr ; jump to selection of r. Read X; step left to row index j = e. Read σj ; if j = r, cross column 1; otherwise change j by sgn(r − j). Read X if e = r, and λ otherwise; enter first source trit. Read any trit; enter remaining source-code scan. Trit: repeat. Delimiter 0: enter first successor trit. Read a trit t; jump to X for matching t. Trit t: match t. Delimiter 0: start rewind. Read X; step right and begin comparison. Read a. If a = t, resume with endpoint e; if a < t, search down; if a > t, search up. Read a or the immediate successor of a. Repeat until t; then resume with endpoint 0. Read a or the immediate predecessor of a. Repeat until t; then resume with endpoint 2. Read Y ; advance to successor scan with endpoint e. Read X; step left. Trit: continue left. Blank: move X here and jump to Y . Read Y ; step right to the write field. Read σr ; remember this write symbol. Read M ∈ {L, R, S}; jump to Z. Read Z; write σr and move M . Dispatch(e) if M ̸= S; otherwise halt. No outgoing action.
67
Here gL = 6, gR = 7, gS = 8, and hr,L = 1 + 2r,
hr,R = 2 + 2r,
hr,S = 11 + r.
The protocol starts at Initial; later simulated steps start at Dispatch(e). Searches update the remembered trit after each change. Thus a downward search for S that has seen L must see R before S. The protocol permits unbounded repetition while retaining finite annotations. Lemma H.28 (Protocol Coverage). Every expert execution on a correct encoding with nonempty input follows this protocol. Proof. Initially the tape head reads 0 or 1, and X occupies endpoint 0. Endpoint selection and the following column-1 reading follow from Lemma H.25. Both state codes have positive width. Prefix-block monotonicity and Lemma H.26 give the allowed vertical-search readings and endpoint updates. Rewind reaches the blank in column 1, then Y , the write field, the motion field and Z. These exhaust the phases of one simulated step; induction gives coverage for every finite prefix of the execution. The protocol permits additional observation sequences, including unequal lengths for the two code scans. The certificate checks every permitted transition, so this overapproximation preserves the equivalence argument. Initial Entry, Row Selection and Code Scanning For phase i, write Qi for the controller-state set specified in the following certificate subsections. Relate configurations with identical grids, heads and rune records, with expert state gi and controller state in Qi . Initial and Subsequent Dispatches. The Initial phase has Qi = {0} and permits 0, 1 only, with successors 1, 35, respectively. Dispatch(e) has Qi = {17} for either endpoint e, with successors 18, 24, 26 on λ, 0, 1. Every permitted transition writes Z and teleports to X, matching expert state 0. The certificate distinguishes the two initial selection routes. The Complete Row-Selection Routes. Each state list gives the controller state before each reading; after the final reading, the controller enters state 5 at the first source-code trit. The table represents each endpoint by the corresponding read symbol, λ or 1. Entry Endpoint Wanted Readings in order States in order Initial Initial
λ λ
0 1
X, λ, 0, λ X, λ, 0, 1, λ
1, 2, 3, 4 35, 36, 37, 38, 4
Later Later Later Later Later Later
λ λ λ 1 1 1
λ 0 1 λ 0 1
X, λ, X X, λ, 0, λ X, λ, 0, 1, λ X, 1, 0, λ, λ X, 1, 0, λ X, 1, X
18, 19, 20 24, 25, 3, 4 26, 27, 37, 38, 4 18, 19, 32, 33, 4 24, 25, 3, 4 26, 27, 20
The expert uses state 1 + r during selection of σr , then state 4 for the final column-1 reading. The X step moves left; comparisons move up or down toward the wanted symbol; the matching and crossing steps move right. Every step preserves the read symbol. Substitution in the transition maps checks every route and successor state 5. Taking the union where Initial and Later routes share a phase gives exactly the needed multivalued sets. For endpoint 0 and wanted symbol 0, the selection-jump and first-comparison sets equal {1, 24} and {2, 25}, respectively. For endpoint 0 and wanted symbol 1, the same sets equal {26, 35} and {27, 36}. Every other phase/parameter set contains one controller state. Source and Successor Code Scans. The first and subsequent source-trit phases both have Qi = {5}. State 5 preserves each trit, moves right, and remains 5. On delimiter 0, state 5 preserves 0, moves right, and enters state 6. Both the first successor-trit phase and the subsequent successor scan have Qi = {6}, with the following transitions: 68
Controller state
Read L
Read R
Read S
Read 0
6
7
10
28
11
Entries list successor states; each action writes Y and teleports to X. The delimiter branch follows at least one successor trit. Expert state 5 enters 6, 7, 8 for trits L, R, S, and 9 for the delimiter. This gives the match-jump states 7, 10, 28 and rewind-jump state 11. Matching Trits, Rewinding and Updating the Tape Match One Successor Trit. The match-jump states 7, 10, 28 preserve X, move right and enter 8, 10, 29, respectively, for targets L, R, S. The following table gives the comparison actions. Target
State
Read L
Read R
Read S
L R S
8 10 29
(9, X, Y) (10, L, D) (29, L, D)
(8, R, U) (9, X, Y) (29, R, D)
(8, S, U) (10, S, U) (9, X, Y)
These rows cover every permitted first-comparison and vertical-search phase, paired with expert states 6, 7, 8. On a match, writing X advances the bookmark and teleporting to Y returns to the instruction. Resume(e, t) has Qi = {9} for every endpoint and target: state 9 preserves Y , moves right, and enters state 6. Rewind X and Reach the Write Field. All rewind phases use expert state 9 and follow this sequence: Phase
Controller state
Reading
Transition
11 12 12 13
X t ∈ {L, R, S} λ Y
(12, X, L) (12, t, L) (13, X, Y) (14, Y, R)
Rewind jump Rewind through code Rewind reaches column 1 Rewind return
The final step enters expert state 10, so ReadWrite(e) has Qi = {14}. On reading λ, 0, 1, state 14 preserves that symbol, moves right and enters 15, 21, 30, respectively. The corresponding expert transitions enter states 11, 12, 13. Motion Decoding and Tape Update. Each motion-reading transition writes Y , teleports to Z, and enters the apply state below. That state reads Z, writes the row’s symbol and performs exactly the chosen motion. Write symbol Motion-reading state Apply L Apply R Apply S λ 0 1
15 21 30
16 40 39
23 22 31
34 42 41
The L and R apply transitions return to controller state 17, paired with expert state 0 in Dispatch(e). Either motion may reach a blank tape cell; state 17 handles that case correctly. The S transitions enter controller halt state 43, paired with expert halt state 14. Certificate Size. These certificate subsections specify every Qi , including the four doubletons caused by initial versus later selection. The 92 reachable parameterized phases produce 96 related phase–state pairs. The 160 local checks cover all 73 defined nonterminal entries of the extracted controller. The remaining nine defined entries contain halt loops, excluded from PTOs. Every permitted successor belongs to the next phase’s controller-state set. x
For each permitted protocol edge i − → j and each q ∈ Qi , the preceding certificate establishes δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M ),
q ′ ∈ Qj .
(26)
Every required entry exists. A transition reaches a halt state exactly on an edge to the terminal phase, with motion S. 69
H.8.3
Annealing Certificate: Arbitrary Binary Inputs
The protocol records finite geometric context. Let e ∈ {0, 2} identify the endpoint row occupied by X. Use r, j ∈ {0, 1, 2} to index tape symbols and t, a ∈ {L, R, S} to denote trits. A vertical search records the last observed trit. Each phase and parameter tuple determines an expert state. Phase
Expert state
Dispatch(e) Selection jump(e, r) Select(e, r, j)
0 1+r 1+r
Cross(e, r) First source trit(e) Source scan(e) First successor trit(e) Successor scan(e) Match jump(e, t) First comparison(e, t)
4 4 4 5 5 gt gt
Search down(t, a)
gt
Search up(t, a)
gt
Resume(e, t) Rewind jump(e) Rewind(e) Rewind return(e) Read write(e) Read motion(e, r) Apply(e, r, M )
gt 9 9 9 10 11 + r hr,M 14
Halt
Allowed reading and continuation Read σr ; jump to selection of r. Read X; step left to row index j = e. Read σj ; if j = r, cross column 1; otherwise change j by sgn(r − j). Read X if e = r, and λ otherwise; enter first source trit. Read any trit; enter remaining source-code scan. Trit: repeat. Delimiter 0: enter first successor trit. Read a trit t; jump to X for matching t. Trit t: match t. Delimiter 0: start rewind. Read X; step right and begin comparison. Read a. If a = t, resume with endpoint e; if a < t, search down; if a > t, search up. Read a or the immediate successor of a. Repeat until t; then resume with endpoint 0. Read a or the immediate predecessor of a. Repeat until t; then resume with endpoint 2. Read Y ; advance to successor scan with endpoint e. Read X; step left. Trit: continue left. Blank: move X here and jump to Y . Read Y ; step right to the write field. Read σr ; remember this write symbol. Read M ∈ {L, R, S}; jump to Z. Read Z; write σr and move M . Dispatch(e) if M ̸= S; otherwise halt. No outgoing action.
Here gL = 6, gR = 7, gS = 8, and hr,L = 1 + 2r,
hr,R = 2 + 2r,
hr,S = 11 + r.
The protocol starts at Dispatch(0). Searches update the remembered trit after each change. Thus a downward search for S that has seen L must see R before S. The protocol permits unbounded repetition while retaining finite annotations. Lemma H.29 (Protocol Coverage). Every expert execution on a correct encoding follows this protocol. Proof. Endpoint selection and the following column-1 reading follow from Lemma H.25. Both state codes have positive width. Prefix-block monotonicity and Lemma H.26 give the allowed verticalsearch readings and endpoint updates. Rewind reaches the blank in column 1, then Y , the write field, the motion field and Z. These exhaust the phases of one simulated step; induction gives coverage for every finite prefix of the execution. The protocol permits additional observation sequences, including unequal lengths for the two code scans. The certificate checks every permitted transition, so this overapproximation preserves the equivalence argument. Dispatch, Row Selection and Code Scanning For phase i, write Qi for the controller-state set specified in the following certificate subsections. The simulation relation pairs expert state gi with controller state q ∈ Qi , with identical grids, heads, and rune records. Dispatch. For either endpoint e, phase Dispatch(e) has Qi = {0}. On reading λ, 0, 1, state 0 writes Z, jumps to X, and enters controller state 23, 0, 22, respectively. These actions match expert state 0. 70
All Six Row-Selection Cases. The following lists the readings from arrival at X through crossing column 1. The controller-state list gives the state before each reading. Each route ends in controller state 10 at the first source-code trit. The table represents endpoint e by the corresponding read symbol, λ or 1. Endpoint
Wanted
λ λ λ 1 1 1
λ 0 1 λ 0 1
Readings in order
Controller states in order
X, λ, X X, λ, 0, λ X, λ, 0, 1, λ X, 1, 0, λ, λ X, 1, 0, λ X, 1, X
23, 10, 19 0, 20, 7, 25 22, 7, 19, 25, 25 23, 10, 10, 9, 22 0, 20, 4, 25 22, 7, 19
Each route uses expert state 1 + r during selection and state 4 for the final column-1 reading. The X step moves left; comparisons move up or down toward the wanted symbol; the match and crossing steps move right. Every step preserves the read symbol. Substitution in the transition map verifies each route, including successor state 10. Scan the Source-State Code. The first trit uses controller state 10; subsequent trits use states from {4, 18}. All of the following writes preserve the read symbol and move right: Controller state
Read L
Read R
Read S
Read delimiter 0
10 4 18
18 18 18
4 4 4
4 4 18
excluded at first trit 25 25
Entries list successor states. Expert state 4 remains 4 on trits and enters 5 on the delimiter. Thus Qi = {10} at the first source trit, Qi = {4, 18} during the remaining source scan, and Qi = {25} during the successor scan, including the first successor trit. Successor-Code Dispatch. Controller state 25 has the four relevant transitions read successor
L R 7 26
S 15
0 9
and in every case writes Y and jumps to X. The corresponding expert transitions enter states 6, 7, 8, 9. The delimiter case occurs only after at least one successor trit. The match jumps therefore use states 7, 26, 15, and the rewind jump uses state 9, independently of the endpoint. Trit Matching, Rewind and Tape Updates Match One Successor Trit. The match-jump states 7, 26, 15 preserve X and move right, entering 19, 17, 16 respectively. The following table gives all comparison cases. Each entry lists (successor, written symbol, motion). Context
State
Read L
Read R
Read S
Target L Target R Target S: first comparison Target S: previous trit L Target S: previous trit R
19 17 16 3 5
(18, X, Y) (17, L, D) (3, L, D) (3, L, D) excluded
(19, R, U) (2, X, Y) (5, R, D) (5, R, D) (5, R, D)
(19, S, U) (17, S, U) (3, X, Y) excluded (3, X, Y)
The corresponding expert states have indices 6, 7, 8. The exclusions follow from the protocol, especially Lemma H.26. After equality, states 18, 2, 3 respectively read and preserve Y , then move right to state 25. These states represent Resume(e, L), Resume(e, R), and Resume(e, S). An immediate match retains the endpoint; a downward search selects endpoint 0, and an upward search selects endpoint 2. Rewind X and Reach the Write Field. Expert state 9 corresponds to the following exact sequence: 71
Phase
Controller state
Reading
Transition
9 14 14 19
X t ∈ {L, R, S} λ Y
(14, X, L) (14, t, L) (19, X, Y) (8, Y, R)
Rewind jump Rewind through code Rewind reaches column 1 Rewind return
The last step enters expert state 10, so Qi = {8} in phase ReadWrite(e). On reading λ, 0, 1, state 8 preserves the symbol, moves right and enters 21, 9, 8 respectively; the expert transitions enter states 11, 12, 13. Motion Decoding and Tape Update. For each row below, reading the selected motion writes Y , teleports to Z, and enters the listed controller state. That state then reads Z, writes the indicated symbol and performs exactly the selected move. Write symbol
Motion-reading state
Apply L
Apply R
Apply S
λ 0 1
21 9 8
7 3 11
4 26 1
14 18 15
The L and R cases return to controller state 0, matching expert state 0. The S cases enter controller halt state 27, matching expert halt state 14. These establish all Apply phases and the terminal pair. Together, the certificate subsections specify Qi for every reachable protocol phase and verify every permitted transition. Only source-code scanning requires multivalued sets: {4, 18} for each endpoint. All other phase–parameter combinations have a unique controller state. The certificate contains 91 reachable parameterized phases and 93 related phase–controller pairs, x including the terminal pair. For every allowed protocol edge i − → j and every controller state q ∈ Qi , the preceding certificate gives δE (gi , x) = (gj , w, M ),
δC (q, x) = (q ′ , w, M ),
q ′ ∈ Qj .
(27)
The 162 local checks cover 81 distinct nonterminal entries of the controller table. A transition reaches a halt state exactly on an edge to the terminal phase. Proof of Theorem H.24. The endpoint and prefix invariant keeps every program search inside the correct code-prefix interval. The no-missing-middle-trit lemma justifies the refined search branches. Both protocols therefore cover every finite expert execution prefix on the respective domains. The metric relation satisfies 160 local identities, and the annealing relation satisfies 162. Equal writes and motions preserve visible cells and hidden rune symbols simultaneously. The prefix form of Lemma H.2 gives equality of complete finite PTOs and of every finite prefix for nonhalting computations. Faithful expert simulation identifies the common execution with the encoded Turing machine. Why the Metric Theorem Excludes Empty Input. The metric controller lacks an initial blank transition. Consider a one-state machine with δ(0, s) = (0, s, S) for every s ∈ Γ and empty tape input. The expert starts with (λ, Z, X), whereas the metric controller cannot take the first step. Hence extending the metric theorem to empty input would give a false claim. Later blank readings remain covered. The annealed controller handles the initial blank and needs no such restriction.
72
I
Short-Input Agreement Does Not Identify an Algorithm
Small training datasets do not force the expert arithmetic rule, even within compact controller classes. We construct two counterexamples using the same alphabets, grid, initial placement, and action vocabulary as the binary experts. Both controllers reproduce every expert PTO within the traininglength bounds, including all write and motion decisions. Both nevertheless stop prematurely on longer inputs. Thus the ambiguity persists even with exhaustive supervision over the short-input domain. +
Throughout this section, a, b ∈ {0, 1} denote nonempty binary operand words, with leading zeros permitted. The input a + b or axb occupies row zero from column zero; the head starts at the first leftoperand digit and every other cell starts blank. Each table entry gives the next state, written symbol, and motion. Motion S writes once and stops; the stopping-state loops specify a total transition map but add no further PTO steps. All state counts include the stopping state. I.1
A Fourteen-State Spurious Addition Controller
The binary-addition expert uses eleven states, including the stopping state. Replace the initial scanning state by a counter with states 0, 11, 12, 13, representing zero, one, two, and three scanned left-operand digits. The resulting controller contains fourteen states. Proposition I.1 (Short-Input Agreement without Exact Addition). The controller in Table 22 produces + the expert PTO on every input a + b with 1 ≤ |a| ≤ 3 and b ∈ {0, 1} , including leading zeros. For + every |a| ≥ 4 and b ∈ {0, 1} , execution stops on the fourth left-operand digit and leaves the input unchanged. Proof. Before reaching the separator, the expert remains in state 0 and writes each read digit unchanged while moving right. The counter states produce exactly these writes and motions for the first three digits. On reading +, every counter state enters expert state 1 with the same write and left move. No expert transition from states 1, . . . , 10 returns to state 0. Consequently, the controllers have identical states, grids, and heads after the separator transition and follow the same remaining execution, including the stopping action. If a fourth left-operand digit occurs, state 13 instead writes the digit unchanged and stops, whereas the expert moves right. The unchanged input still contains + and therefore fails the output contract. For example, 1111 + 1 triggers the discrepancy at step four: the expert emits (1, R), while the spurious controller emits (1, S). The expert eventually leaves 10000 on the grid. Thus even all 142 = 196 operand pairs with lengths at most three cannot distinguish these controllers through PTO supervision. I.2
A Thirty-Eight-State Spurious Multiplication Controller
Let T× denote the 32-state binary-multiplication expert. Define Te× by retaining all expert transitions and adding six states 32, . . . , 37 for the initial scan of the left operand. State 32 + j records j digits already scanned. The initial state becomes 32; the halt state remains 31. The added states preserve each scanned symbol and move right, except that reading a sixth digit triggers an immediate stop. Reading the separator x enters expert state 0 with the expert’s write and motion. m
Proposition I.2. For every a ∈ {0, 1} with 1 ≤ m ≤ 5 and every nonempty binary word b, the complete PTOs of Te× and T× on axb agree. For every left operand of at least six digits and every nonempty right operand, the spurious controller stops after six actions and leaves the input expression unchanged. Proof. For the first m ≤ 5 digit readings, both controllers preserve the read symbol and move right. The expert remains in state 0, while the spurious controller reaches state 32 + m. On the separator, both controllers write x, move right, and enter state 0. The grid, head, and control state then coincide, and all remaining transitions agree. For m ≥ 6, the first five actions agree, but state 37 stops on the sixth digit while the expert moves right. Every preceding action preserves the input, so the final grid still contains the separator and both operands, violating the arithmetic output specification. 73
Table 22: Complete Spurious-Addition Transition Map. Initial state 0; stopping state 10. Each entry gives (next state, write, motion) for the column’s read symbol. Motion S writes once and terminates execution. State
λ
+
0
1
0 1 2 3 4 5 6 7 8 9 10 11 12 13
(10, λ, S) (8, +, U) (3, λ, L) (10, λ, S) (4, λ, L) (5, λ, L) (7, 1, D) (7, λ, R) (2, 0, R) (9, λ, L) (10, λ, S) (10, λ, S) (10, λ, S) (10, λ, S)
(1, +, L) (10, +, S) (2, +, R) (9, λ, D) (4, +, U) (5, +, U) (10, +, S) (1, λ, L) (10, +, S) (9, λ, U) (10, +, S) (1, +, L) (1, +, L) (1, +, L)
(11, 0, R) (1, 0, D) (2, 0, R) (4, λ, D) (7, 0, D) (7, 1, D) (7, 1, D) (10, 0, S) (2, 0, R) (10, 0, S) (10, 0, S) (12, 0, R) (13, 0, R) (10, 0, S)
(11, 1, R) (1, 1, D) (2, 1, R) (5, λ, D) (7, 1, D) (6, 0, L) (6, 0, L) (10, 1, S) (2, 1, R) (10, 1, S) (10, 1, S) (12, 1, R) (13, 1, R) (10, 1, S)
For example, 111111x1 requires the product 111111 (decimal 63), allowing leading-zero padding. The spurious controller instead leaves 111111x1 on the grid and halts at the sixth digit. Exhaustive enumeration of all 622 = 3844 pairs with operand lengths from one through five confirms complete PTO agreement; the argument above additionally covers arbitrary right-operand lengths. Table 23: Complete Transition Map of the 38-State Spurious Multiplication Controller. Each entry gives (next state, written symbol, motion). Initial state 32; halt state 31. Motion S writes once and stops. State
λ
0
1
x
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
(1, λ, L) (31, λ, S) (31, λ, S) (6, λ, L) (7, λ, L) (31, λ, S) (9, 0, U) (9, 1, U) (9, x, U) (0, λ, D) (31, λ, S) (31, λ, S) (31, λ, S) (15, 0, R) (15, 0, R) (16, λ, U) (18, λ, D) (10, λ, L) (19, λ, L) (20, λ, D) (30, λ, U) (28, λ, U) (19, λ, D) (22, λ, L) (23, 0, U) (23, 1, U)
(0, 0, R) (2, 0, L) (3, 0, D) (6, 0, L) (7, 0, L) (8, 0, L) (31, 0, S) (31, 0, S) (31, 0, S) (3, 0, D) (11, λ, L) (11, λ, L) (12, λ, L) (13, 0, L) (14, 0, L) (15, 0, R) (17, 0, R) (17, 0, R) (31, 0, S) (19, 0, L) (21, 0, R) (21, 0, R) (24, λ, D) (31, 0, S) (23, 0, U) (23, 1, U)
(0, 1, R) (2, 1, L) (4, 1, D) (6, 1, L) (7, 1, L) (8, 1, L) (31, 1, S) (31, 1, S) (31, 1, S) (4, 1, D) (12, λ, L) (11, λ, L) (12, λ, L) (13, 0, L) (14, 1, L) (15, 1, R) (17, 1, R) (17, 1, R) (31, 1, S) (19, 1, L) (21, 1, R) (21, 1, R) (25, λ, D) (31, 1, S) (23, 1, U) (27, 0, U)
(0, x, R) (31, x, S) (10, x, R) (6, x, L) (7, x, L) (31, x, S) (31, x, S) (31, x, S) (31, x, S) (5, x, D) (31, x, S) (13, λ, L) (14, λ, L) (31, x, S) (31, x, S) (31, x, S) (31, x, S) (17, x, R) (31, x, S) (31, x, S) (31, x, S) (31, x, S) (31, x, S) (31, x, S) (31, x, S) (31, x, S)
Continued on the next page.
74
I.3
State
λ
0
1
x
26 27 28 29 30 31
(25, λ, D) (26, λ, L) (22, λ, L) (27, 0, U) (31, λ, S) (31, λ, S)
(25, λ, D) (31, 0, S) (28, 0, R) (27, 0, U) (31, 0, S) (31, 0, S)
(29, λ, D) (31, 1, S) (28, 1, R) (27, 1, U) (31, 1, S) (31, 1, S)
(31, x, S) (31, x, S) (31, x, S) (31, x, S) (31, x, S) (31, x, S)
32 33 34 35 36 37
(1, λ, L) (1, λ, L) (1, λ, L) (1, λ, L) (1, λ, L) (1, λ, L)
(33, 0, R) (34, 0, R) (35, 0, R) (36, 0, R) (37, 0, R) (31, 0, S)
(33, 1, R) (34, 1, R) (35, 1, R) (36, 1, R) (37, 1, R) (31, 1, S)
(0, x, R) (0, x, R) (0, x, R) (0, x, R) (0, x, R) (0, x, R)
Capacity Does Not Exclude the Counterexamples
The constructions add only three states to the eleven-state addition expert and six states to the thirty-two-state multiplication expert. Every training subset within the stated length bounds supplies identical PTO targets for the expert and the corresponding spurious controller. Theorem 2.5 represents the two controllers using ordinary DFST dimensions 14 and 38. For Softmax DFSTs with finite logits in exact real arithmetic, dimensions 15 and 39 suffice for exact argmax behavior. These bounds provide sufficient capacities, without asserting minimality. Padding the discrete controllers with unreachable states extends the construction to every larger dimension. In particular, the addition sweeps at dimensions 22 and 33 and the multiplication sweeps at dimensions 64 and 96 can express the counterexamples. Action agreement and fitting the one-hot training targets require separate statements. The exact-real softmax construction in Section B guarantees the correct argmax actions, but need not produce one-hot readouts. For any PTO dataset within the stated training-length bounds, softmax logits approaching the deterministic vertices instead drive the MSE arbitrarily close to zero: finite-horizon recurrence and readout maps depend continuously on the effective parameters. Under rounded arithmetic that saturates softmax at vertices and preserves vertex operations, the one-hot realization gives exactly zero training MSE. One explicit choice assigns logit 0 to each selected transition, output, and initial-state coordinate, and −128 to every other coordinate under correctly rounded binary32 exponentiation. Table 24: Generalization despite Capacity for Short-Input Counterexamples. The wider Softmax DFST sweeps each contain six configurations. Five reach the robust testing cap in each task. Task add2 mult2
Expert states
Spurious states
Tested dimensions
Cap-reaching runs
11 32
14 38
22, 33 64, 96
5/6 5/6
The wider sweeps exclude insufficient capacity as the explanation for avoiding these two spurious rules (Table 24 and fig. 9). The experiments support a useful implicit bias of parametrization, initialization, and gradient-based optimization toward length-independent behavior. However, no claim identifies the failed runs with the constructed counterexamples, and the results do not establish that gradient descent always selects the simplest controller. Extracted state counts alone need not capture the relevant notion of simplicity. I.4
A Simple Model for Studying Algorithmic Learning
The ordinary DFST uses three input-indexed tensors and an initial-state vector. Each recurrence and readout consists of a matrix-vector product, without nonlinear activations. This stepwise multilinearity offers a transparent starting point for analyzing which solutions gradient-based optimization favors. Repeated use of shared transition parameters across a trajectory still produces a nonconvex learning 75
problem; neither the complete trajectory map nor the MSE objective generally remains multilinear in the shared parameters. The softmax parametrization adds another nonlinearity through the logits.
76
NeurIPS Paper Checklist 1. Claims Question: Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? Answer: [Yes] Justification: In the abstract and introduction, we claim that we introduce a simple learning framework capable of achieving extreme length generalization and exact learning on arithmetic and universal simulation tasks. We substantiate these claims with experimental results and mathematical proofs. Guidelines: • The answer [N/A] means that the abstract and introduction do not include the claims made in the paper. • The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A [No] or [N/A] answer to this question will not be perceived well by the reviewers. • The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings. • It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper. 2. Limitations Question: Does the paper discuss the limitations of the work performed by the authors? Answer: [Yes] Justification: We provide evidence of hyperparameter configurations where our differentiable controllers cannot achieve extreme length generalization and provably do not exactly learn the ground-truth procedure. Guidelines: • The answer [N/A] means that the paper has no limitation while the answer [No] means that the paper has limitations, but those are not discussed in the paper. • The authors are encouraged to create a separate “Limitations” section in their paper. • The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be. • The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated. • The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon. • The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size. • If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness. • While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren’t acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations. 3. Theory assumptions and proofs 77
Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof? Answer: [Yes] Justification: We provide the full set of empirically falsifiable assumptions for our theorems. All theorems are carefully proved in the appendix sections. Guidelines: • The answer [N/A] means that the paper does not include theoretical results. • All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced. • All assumptions should be clearly stated or referenced in the statement of any theorems. • The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition. • Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material. • Theorems and Lemmas that the proof relies upon should be properly referenced. 4. Experimental result reproducibility Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)? Answer: [Yes] Justification: In our appendix section about implementation details, we provide full details on our training procedure. Furthermore, we make our code publicly available (alongside the weights of the runs discussed in the paper) so that other researchers can experiment with and visualize learning from Turing-machine computation. Guidelines: • The answer [N/A] means that the paper does not include experiments. • If the paper includes experiments, a [No] answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not. • If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable. • Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed. • While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example (a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm. (b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully. (c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset). 78
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results. 5. Open access to data and code Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material? Answer: [Yes] Justification: We provide a well documented codebase with sufficient instructions. Guidelines: • The answer [N/A] means that paper does not include experiments requiring code. • Please see the NeurIPS code and data submission guidelines (https://neurips.cc/ public/guides/CodeSubmissionPolicy) for more details. • While we encourage the release of code and data, we understand that this might not be possible, so [No] is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark). • The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https: //neurips.cc/public/guides/CodeSubmissionPolicy) for more details. • The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc. • The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why. • At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable). • Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted. 6. Experimental setting/details Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer) necessary to understand the results? Answer: [Yes] Justification: We completely specify all details in the appendix section about implementations. We also provide the code, hyperparameter configurations, and trained final weights in our GitHub repository. Guidelines: • The answer [N/A] means that the paper does not include experiments. • The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them. • The full details can be provided either with the code, in appendix, or as supplemental material. 7. Experiment statistical significance Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments? Answer: [Yes] Justification: Our DSFT models are deterministically initialized so the only source of randomness comes from the dataset generation. We achieve our length-generalization results across all tasks on many different random seeds (details in the appendix). Guidelines: 79
• The answer [N/A] means that the paper does not include experiments. • The authors should answer [Yes] if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper. • The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions). • The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.) • The assumptions made should be given (e.g., Normally distributed errors). • It should be clear whether the error bar is the standard deviation or the standard error of the mean. • It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified. • For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g., negative error rates). • If error bars are reported in tables or plots, the authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text. 8. Experiments compute resources Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments? Answer: [Yes] Justification: As we mention in the appendix, we trained on single NVIDIA A100-SXM440GB and Tesla V100-SXM2-32GB GPUs. Guidelines: • The answer [N/A] means that the paper does not include experiments. • The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage. • The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute. • The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn’t make it into the paper). 9. Code of ethics Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines? Answer: [Yes] Justification: We carefully reviewed the ethics guidelines and confirm that our research respects them. Guidelines: • The answer [N/A] means that the authors have not reviewed the NeurIPS Code of Ethics. • If the authors answer [No], they should explain the special circumstances that require a deviation from the Code of Ethics. • The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction). 10. Broader impacts Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed? 80
Answer: [N/A] Justification: This paper presents work whose goal is to advance the field of machine learning. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here. Guidelines: • The answer [N/A] means that there is no societal impact of the work performed. • If the authors answer [N/A] or [No], they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations. • The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate Deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster. • The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology. • If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML). 11. Safeguards Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pre-trained language models, image generators, or scraped datasets)? Answer: [N/A] Justification: We don’t believe our research holds such risks. Guidelines: • The answer [N/A] means that the paper poses no such risks. • Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters. • Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images. • We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort. 12. Licenses for existing assets Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected? Answer: [Yes] Justification: We, the authors, are the original owners of the assets used in the paper. Guidelines: • The answer [N/A] means that the paper does not use existing assets. 81
• The authors should cite the original paper that produced the code package or dataset. • The authors should state which version of the asset is used and, if possible, include a URL. • The name of the license (e.g., CC-BY 4.0) should be included for each asset. • For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided. • If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset. • For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided. • If this information is not available online, the authors are encouraged to reach out to the asset’s creators. 13. New assets Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets? Answer: [Yes] Justification: We believe that the codebase for our paper is well documented. Guidelines: • The answer [N/A] means that the paper does not release new assets. • Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc. • The paper should discuss whether and how consent was obtained from people whose asset is used. • At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file. 14. Crowdsourcing and research with human subjects Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)? Answer: [N/A] Justification: The paper does not involve crowdsourcing nor research with human subjects. Guidelines: • The answer [N/A] means that the paper does not involve crowdsourcing nor research with human subjects. • Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper. • According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector. 15. Institutional review board (IRB) approvals or equivalent for research with human subjects Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained? Answer: [N/A] Justification: The paper does not involve crowdsourcing nor research with human subjects. 82
Guidelines: • The answer [N/A] means that the paper does not involve crowdsourcing nor research with human subjects. • Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper. • We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution. • For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review. 16. Declaration of LLM usage Question: Does the paper describe the usage of LLMs if it is an important, original, or non-standard component of the core methods in this research? Note that if the LLM is used only for writing, editing, or formatting purposes and does not impact the core methodology, scientific rigor, or originality of the research, declaration is not required. Answer: [Yes] Justification: We used LLMs for code writing and for the generated controller equivalence proofs. The proofs have been carefully reviewed by the authors of the paper. Guidelines: • The answer [N/A] means that the core method development in this research does not involve LLMs as any important, original, or non-standard components. • Please refer to our LLM policy in the NeurIPS handbook for what should or should not be described.
83
Related documents
- Privileged observations enable rapid and reliable policy discovery directly in the physical world#1070736
- PC-Diffuser: Path-Consistent Capsule CBF Safety Filtering for Diffusion-Based Trajectory Planner#1216253
- Neural Kalman Filtering for Unknown Dynamics: Task-Aware Learning with a Koopman Backbone#1051166
- Improving Policy Learning from Delayed Interventions#1342174
- Transportable Offline Reinforcement Learning in Presence of Unmeasured Confounding#1489045
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive