Manuscript Offprint

arXiv:2609.04661

Interpretability for Turing Machines

Billy Snikkers, Rumi Salazar, Daniel Murfet, Will Troiani

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We show that susceptibilities, an interpretability technique developed for neural networks, can identify the presence of algorithmic structure in Turing machines by probing the local loss landscape of a learning problem for noisy Turing machines introduced in [MT25]. We prove that symmetries and path separation in the algorithm implemented by a Turing machine induce permutation symmetries and low-rank blocks in its susceptibility matrix. We study this empirically on a set of deterministic finite automata (DFAs) and demonstrate that algorithmic features can be recovered by principal component analysis and clustering methods in susceptibility space.

Figure

Figure 1: Turing machines in susceptibility space. A UMAP embedding of the susceptibility matrices of 38,019 deterministic finite automata (DFAs) that agree with the language LA,0\mathcal{L}_{A,0} of strings containing an AA or a 00 on a finite set of test strings (Sections 5.1 and 5.4). Each DFA is coloured by PSVminPSV_{min}, which is zero when accepted and rejected inputs pass through disjoint sets of intermediate states, and grows as they overlap. The fully path-separated machines form the large purple cluster on the left. Three example machines are shown of varying path-separability: in M1M_1 every accepted input passes through s1s_1 only and every rejected input through s2s_2 only, while in the two machines on the right, accepted and rejected inputs share intermediate states.

*^Equal contribution. Resolution. billy@resolution.org

†^Equal contribution. University of Melbourne. ruminawi.salazar@gmail.com

‡Resolution. murfet@resolution.org

§Resolution. will@resolution.org

Contents

1 Introduction 3 1.1 Path separation and low-rank blocks ..... 4 1.2 Recoding symmetries and permutation symmetries ..... 6 1.3 Further contributions ..... 7

2 Noisy Turing machines 8 2.1 Pseudo-UTMs ..... 8 2.2 Smooth relaxation of a pseudo-UTM ..... 10 2.3 The noisy Turing machine truth-model-prior triple ..... 12 2.4 Components, observables, and susceptibilities ..... 14

3 Structures in Turing machines 14 3.1 Path separation partitions ..... 15 3.2 Recoding symmetries ..... 15 3.3 Examples ..... 16

4 Theorems 17 4.1 Rank bounds from path separation ..... 17 4.2 Susceptibility symmetry from recoding symmetry ..... 20

5 Experiments 22 5.1 The DFA task and parameter space ..... 23 5.2 From theoretical to empirical susceptibilities ..... 23 5.3 Block structure in estimated susceptibilities ..... 25 5.4 The solution set in susceptibility space ..... 31 5.5 Symmetry statistics ..... 33 5.6 Rank statistics ..... 34 5.7 UMAP embeddings of susceptibilities ..... 36 5.8 Interpreting clusters ..... 36

A Details of the model 39 A.1 The lookup pseudo-UTM ..... 39 A.2 Circuits ..... 42 A.3 The cycle circuits ..... 46 A.3.1 Resolve ..... 48 A.3.2 Update ..... 51 A.4 The cycle maps in closed form ..... 53 A.5 Invariance and equivariance of the cycle maps ..... 55

B Details of the experiments 56 B.1 Reparametrising the loss preserves the rank bound and the equivariance ..... 56 B.2 Properties of the localiser and the estimator ..... 58 B.3 The GRLD sampler ..... 61 B.4 Embedding and compute ..... 62 B.5 Input kernels of the running examples ..... 63 B.6 Eigenmatrix parities ..... 64 B.7 Cluster validation ..... 65 B.8 The weights of the binary classifier ..... 66 B.9 The temperature sweep ..... 67 B.10 Halting-time organisation ..... 68

C Minimal theoretical example: What is the simplest thing susceptibilities see that the Hessian does not? 69 C.1 The noisy absorbing DFA ..... 69 C.2 Exact error probabilities and Hessian blindness ..... 71 C.3 The Gibbs distribution and monomial asymptotics ..... 72 C.4 Susceptibilities ..... 74 C.5 Computational interpretation ..... 74 C.6 Extension: noisy writes and flat directions ..... 75

References (77)

  • A general framework for updating belief distributions
  • Structural inference: Interpreting small language models with susceptibilities
  • Derivatives of Turing machines in Linear Logic (opens arXiv in a new tab)
  • Geometry of program synthesis (opens arXiv in a new tab)
  • Susceptibilities and patterning: A primer on linear response in Bayesian learning (opens arXiv in a new tab)
  • Towards spectroscopy: Susceptibility clusters in language models
  • The No-U-Turn sampler: Adaptively setting path lengths in Hamiltonian Monte Carlo
  • The geometry of tensor calculus, I. Advances in Mathematics, 88(1):55–112, 1991
  • Similarity of neural network representations revisited
  • UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction
  • Programs as singularities (opens arXiv in a new tab)
  • Stochastic gradient Riemannian Langevin dynamics on the probability simplex
  • [Xu21] Adrian K. Xu. Smooth relaxation preserving Turing machines. arXiv preprint arXiv:2106.00956, 2021. (opens arXiv in a new tab)
  • We identify a classical code with
  • The staging tape has three cells, initially XXX, the state tape contains the simulated state, and the working tape contains the simulated tape
  • The auxiliary tapes are Aux = {description, staging} and the tape alphabet is $\Sigma_{\mathrm{UTM}} := \Sigma \sqcup Q \sqcup D \sqcup \{X\}$
  • The set of states is
  • The lookup machine reads the pair once (into the UTM state), and thus its naive probabilistic extension does not (Corollary A.18)
  • the right-hand form is the same gate with its inputs and outputs each gathered into a bundle
  • a gate with no inputs is a constant $r \in R_1 \times \cdots \times R_m$, drawn with only its output wires
  • It discards its input, and is drawn as a small hollow circle terminating the wire:
  • Under these identifications, $f^*$ is the morphism of polynomial algebras determined by
  • The empty product of variables is $1\in k$, and the formula reads $f^{*}(z_{r^{\prime}}^{(j)})=\mathbb{1}[r^{\prime}=r_{j}]$
  • Its coordinate interpretation is the composite of the coordinate interpretations of its gates, the underlying algebra morphisms applying in the opposite order: writing $A_{\mathbb{B}} = k[x_0, x_1]$ at the input and $k[z_0, z_1]$ at the output
  • the morphism describes a random variable in terms of the random variables it depends on
  • For the count of type $R$ it is the unique map $\Delta R\to\{*}$, forgetting the distribution
  • For $\bullet \in \{\mathrm{lookup}, \mathrm{staged}\}$ the circuit presents one period of the corresponding pseudo-UTM (Appendix A.1; [MT25, §5.1])
  • $\mathrm{resolve}_{\bullet}$ emits $(\sigma', q', d)$, $\mathrm{update}$ applies $\sigma'$ and $d$ to the head-centred tape, and the next state $q'$ passes directly to the output
  • Write $j = 1, \ldots, N$ for the description positions and $(\sigma_j, q_j)$ for the input of the tuple at position $j$
  • The staging triple starts unresolved at the X-constant gates and is threaded up through the stages
  • On the unmatched branch export writes the no-op triple: write the recorded symbol back, keep the recorded state, stay
  • The gate compInit records the read pair $(\sigma_0, q)$ on the UTM-state wire, the $j$-th cmp replaces it by the entry $w_j$ on a match, and each export emits the triple the UTM state determines
  • By Definition A.6, $\Delta \mathrm{eval}_{f}(\sigma_{0},\mathbf{q},w_{f})=\sum_{j}\lambda_{j}w_{j,f}$, so
  • Each eval_f selects the f-entry of the code tuple addressed by $(\sigma_0, q)$
  • Together with the overwrite it is the tape part of the update function above
  • Each square is duplicated by a diagonal $\Delta_3$ (Example A.8) to the three cells that read it, and the direction $d$ is copied along a chain of diagonals, one copy entering each cell's east port
  • Since compInit is injective, Definition A.6 gives
  • The output triple is therefore
  • simulating the machine and then relaxing agrees with relaxing the machine's own step
  • Fix a recoding $(a, s)$
  • The same computation in the other two fields gives $\mathbf{q}'_{(a,s)\cdot w,(a,s)\cdot z} = s_* \mathbf{q}'_{w,z}$ and, the direction values being untouched by the action, $\mathbf{d}_{(a,s)\cdot w,(a,s)\cdot z} = \mathbf{d}_{w,z}$
  • It first checks that the rank bound and the equivariance survive replacing the squared error by the log-loss
  • Both conclusions therefore pass to any such reparametrisation of the loss, the log-loss included
  • Put $\omega_x := \omega \circ h_x$, $\Omega := \mathbb{E}_{x \sim q}[\omega_x]$, and $p_\beta^\Omega \propto \exp\{-\beta\Omega\} \varphi$
  • Taking $\omega(t)=t^{2}$ recovers $\chi_{x}^{C}$
  • So the integral tends to zero, which is the first claim
  • Thus $f^\mu e^{-\beta L^\mu}$ is bounded uniformly in $\mu$
  • Fix a classical solution $M$ and a component $C$
  • Written out
  • At the vertex $p = e_{[M]_{C'}}$ on which it concentrates, the coordinate $p([M]_{C'}) = 1$ contributes $1^{\gamma + \alpha - 1} = 1$, and each of the other $k_{C'} - 1$ coordinates contributes $0^{\alpha - 1}$
  • Everything we compute, however, lives on the cancelled side: the renormalised $\tilde{\chi}$ is the second factor above, and the estimator (22) replaces its $p_C$- and $p$-expectations by sample means
  • Then $[g \cdot M] \in W^{\mathrm{sol}}$ for every $[M] \in W^{\mathrm{sol}}$ (28)
  • Then the susceptibility map is equivariant: for every classical solution $M$
  • Both recodings of Section 3.2 are symmetries of $M_5$, so the lemmas apply to them
  • The equivariance of Theorem 4.13 therefore passes from $\chi$ to the renormalised $\tilde{\chi}$ and the standardised $\psi$
  • The first term is therefore a number $c_{C}$ independent of $x$
  • The susceptibility matrix is then assembled from the sample means via (22)
  • the largest between-machine CKA in a 2,216-machine reference set is 0.995, so self-similarity 0.999 identifies a machine with margin
  • The 35 jobs took a median of 3.3 hours each on a single RTX 4090 (3.2 to 9.7 hours, the slowest at the divergence-prone low-$\beta$ end), summing to about 145 GPU-hours for the sweep
  • For inputs $x, y \in \Sigma^*$, the value at $K(\widehat{\psi}([M_i]))_{x,y}$ is proportional to the cosine-similarity between rows $\widehat{\psi}([M_i])_x$ and $\widehat{\psi}([M_i])_y$, with a strong positive value indicating similar response-vectors
  • Each machine is represented as $\hat{\chi}$ or $\hat{\psi}$, flattened or through its input kernel $K(\cdot)$, and a linear SVM (class-balanced, five-fold cross-validation) is scored by class-balanced accuracy on held-out machines
  • The 35 checkpoints are embedded jointly by aligned UMAP [MHM18], so that a machine's position is comparable across $\beta$
  • the 35 slices are optimised jointly, at the parameters above, with a relation regularisation $\lambda$ penalising the displacement of each machine's position between consecutive slices (window size 2)
  • The terminal states absorb (Section 5.1), so the run remains there
  • The first blank acts as a repair boundary: it sends either state to $q_1$, after which the run is locked into the correct sink
  • Using $\mathbf{y}_0 = e_{\sigma_1}$ in the state update gives
  • The iterated formula follows by induction: the shifted tape again satisfies the hypotheses, with the string $\sigma_{2}\sigma_{3}\cdots$ under the head
  • On a blank, the machine moves to $q_{1}$ with probability 1
  • Regardless of the state at that moment, the first blank sends the machine to $q_{1}$ deterministically, so the final state cannot be $q_{0}$
  • The machine ends in $q_0$ exactly when it takes the noisy self-loop on every one of the $T$ consecutive A-steps
  • For $T \geq 2$, however
  • So the Hessian completely misses an error direction
  • (This matches Definition 2.17, which uses the per-input squared error
  • Once the first blank is read, both states map deterministically to $q_1$
  • The common factor decreases when $\beta$ grows (the Gibbs distribution concentrates) and when $T$ grows (a longer uninterrupted run of noisy A-steps is needed for the fault to reach the output)
  • Rename the transition parameter of the previous subsections from $w$ to $a$, freeing $w$ for the full parameter $w = (a,b)$
  • The state evolution therefore depends only on the input string and on $a$, so