Papers
Topics
Authors
Recent
Search
2000 character limit reached

Clock and Pizza: Neural Manifold Insights

Updated 1 January 2026
  • Clock and Pizza interpretations are algorithmic frameworks where neural networks implement modular addition using distinct attention mechanisms—softmax for Clock and linear aggregation for Pizza.
  • Geometric and topological analyses reveal that both approaches are projections of a universal manifold-level solution, unifying distinct network behaviors.
  • Empirical evaluations using metrics like phase alignment, Betti numbers, and MMD demonstrate that architectural biases influence representation geometry while preserving end-to-end computation.

The Clock and Pizza interpretations characterize algorithmic solutions learned by neural network architectures—particularly transformers and MLPs—trained to implement modular addition. The modular addition task (a,b)(a+b)modn(a,b)\mapsto(a+b)\bmod n serves as a prototypical instance for analyzing internal circuit mechanisms and their representation geometry. Early mechanistic interpretability efforts claimed that small differences in architectural biases induce distinct algorithmic circuits, labeled "Clock" (for trainable/multiplicative attention) and "Pizza" (for uniform/linear attention). However, recent geometric and topological analyses reveal that these interpretations are not fundamentally disjoint; rather, they are projections of a universal manifold-level solution, unified within a geometric–topological framework.

1. Definitions and Mechanistic Characterization

The modular addition task involves mapping integer pairs (a,b)Zn2(a,b)\in\mathbb{Z}_n^2 (typically n=59n=59, prime) to their sum modulo nn. Models encode each input via learned embeddings EtRdE_t\in\mathbb{R}^d and process the pair [Ea;Eb][E_a;E_b] using a layer of either self-attention (parameterized by attention rate α\alpha) or purely linear MLP. Zhong et al. (2023) formalized two principal solution archetypes, each suggested by diagnostics such as gradient symmetricity and logit pattern analysis (Zhong et al., 2023):

  • Pizza (Attention 0.0): Uniform (fixed) attention yields a linear summation of input embeddings

Eab=Ea+EbE_{ab} = E_a + E_b

When embeddings are constructed on the unit circle

Ea=[cos(2πfa/n),  sin(2πfa/n)]E_a = [\cos(2\pi f\,a/n),\; \sin(2\pi f\,a/n)]

the summed embedding EabE_{ab} describes a filled disk in R2\mathbb{R}^2—the "pizza slice."

  • Clock (Attention 1.0): Trainable (softmax) attention enables nonlinear angle addition,

Eab=[cos(2πf(a+b)/n),  sin(2πf(a+b)/n)]E_{ab} = [\cos(2\pi f(a+b)/n),\; \sin(2\pi f(a+b)/n)]

encoding modular addition as a point on the unit circle.

The two procedures differ in their internal mechanism: the Clock algorithm executes explicit pairwise products (realizing trigonometric identities), while Pizza relies on linear aggregation and ReLU-induced nonlinearities. Both architectures output logits for candidate sums cc via dot product with output embeddings UcU_c.

2. Mathematical Structures: Embedding Spaces and Manifolds

The general form of input embeddings,

Ea=(cosθa,sinθa),θa=2πfanE_a = (\cos\theta_a, \sin\theta_a),\quad \theta_a = \frac{2\pi f a}{n}

provides a basis for analysis. With learned phase shifts ϕL,ϕR\phi^L, \phi^R, neuron preactivations are well-modeled by

N(a,b)=cos(θa+ϕL)+cos(θb+ϕR)N(a,b) = \cos(\theta_a + \phi^L ) + \cos(\theta_b + \phi^R )

For neuron clusters tuned to frequency ff at a given layer \ell, the point cloud of preactivations forms a discrete manifold,

$\mathcal{M}^\ell_f = \{ \preactivationmap{\ell}(a,b) : a, b \in \mathbb{Z}_n \} \subset \mathbb{R}^{d_{\ell,f}}$

Analogously, the logit manifold at frequency ff is

$\mathcal{L}_f = \{ \logitmap(a,b) : (a,b)\in\mathbb{Z}_n^2 \} \subset \mathbb{R}^n$

The geometry and topology of these manifolds are central to mechanistic interpretability.

3. Geometric and Topological Equivalence

A pivotal mathematical result, Theorem 3.1 (Disc–Torus dichotomy) (Moisescu-Pareja et al., 31 Dec 2025), distinguishes manifold geometry according to the phase alignment of constituent neurons:

  • Perfect phase correlation (ϕiL=ϕiR\phi^L_i = \phi^R_i) yields a vector-addition disc

V(a,b)disc=(cosθa+cosθb,  sinθa+sinθb)V^\mathrm{disc}_{(a,b)} = (\cos\theta_a + \cos\theta_b,\; \sin\theta_a + \sin\theta_b)

The preactivation matrix XX thus has rank 2, and Mf1\mathcal{M}^1_f is a filled disk.

  • Independent phases span the 4D torus

V(a,b)torus=(cosθa,sinθa,cosθb,sinθb)V^\mathrm{torus}_{(a,b)} = (\cos\theta_a, \sin\theta_a, \cos\theta_b, \sin\theta_b )

XX has rank 4, and Mf1\mathcal{M}^1_f samples S1×S1S^1 \times S^1.

Persistent homology analysis (via Betti numbers) demonstrates:

  • Pizza (Attention 0.0), Clock (Attention 1.0), and MLP-Add manifolds at layer 1 consistently yield Betti numbers (1,0,0)(1,0,0), indicative of a filled disc.
  • MLP-Concat architectures form a torus (1,2,1)(1,2,1).
  • Successive layers collapse both toroidal and disc structures onto a 1D circle (1,1,0)(1,1,0) corresponding to the desired logit structure.

This geometric correspondence establishes that the two architectures compute modular addition through homomorphic manifolds—disc and torus—related by linear projection, rather than fundamentally different solutions.

4. Empirical Algorithmic Phase Space and Statistical Analysis

Extensive empirical evaluation involved training 703 networks per architecture (MLP-Add, Attention 0.0, Attention 1.0, MLP-Concat) at n=59n=59, recording neuron activation peaks as the Phase Alignment Distribution (PAD) (Moisescu-Pareja et al., 31 Dec 2025). Metrics for comparison include:

  • Torus-distance (graph distance on Zn×Zn\mathbb{Z}_n \times \mathbb{Z}_n to diagonal a=ba=b)
  • Maximum Mean Discrepancy (MMD) with permutation-test pp-values

Findings:

  • Attention 0.0 (Pizza) and Attention 1.0 (Clock) manifest nearly identical PADs (MMD 0.03\lesssim 0.03, p0p \approx 0).
  • Both are statistically distant from MLP-Concat circuits.
  • Betti distributions across layers and architectures coincide within sampling error.

This large-scale analysis refutes the notion that Clock and Pizza are genuinely orthogonal algorithmic phases. Instead, architectural hyperparameters (attention strength, width, initialization) may bias the manifold structure but do not alter the end-to-end algorithm implemented.

5. Mechanistic Interpretability: Neuron Clusters and Manifold Perspective

Prior efforts focused on isolated neuron-wiring and single-weight deconstruction. Recent methodology analyzes neuron clusters by:

  • Constructing n×nn \times n preactivation heatmaps per neuron
  • Assigning neurons to frequency clusters via 2D DFT
  • Stacking flattened heatmaps to form the cluster-wide matrix XX
  • Characterizing XX using PCA, matrix factorization, and topological data analysis (TDA)

This collective perspective reveals the true manifold geometry underlying learned representations. Focusing on manifold invariants and global structures obviates misleading single-neuron interpretations and enables rigorous analysis of circuit universality, phase transitions, and solution multiplicity (Moisescu-Pareja et al., 31 Dec 2025).

6. Unified Solution Landscape and Implications

The synthesis of geometric and topological analysis supports the universality hypothesis: both Clock and Pizza circuits are not rival algorithms but facets of a universal torus-to-circle solution. Uniform-attention models bias the collapsed disc solution, while softmax attention retains capacity for the full torus but learns a manifold numerically indistinguishable from the disc projection. Subsequent layers irreversibly collapse either manifold onto the task-relevant circle.

This result demonstrates the power of geometric/topological methods—Betti numbers, PCA, MMD, manifold quotient maps—for interpreting neural network solutions. It asserts that, when analyzed at the manifold level, architectural variants converge toward equivalent algorithmic circuits, reshaping mechanistic interpretability paradigms (Moisescu-Pareja et al., 31 Dec 2025, Zhong et al., 2023).

7. Implications and Future Directions

The realization that manifold equivalence subsumes perceived algorithmic diversity has several significant consequences:

  • Interpretability methods should prioritize collective, manifold-based approaches rather than isolated neuron inspection.
  • Phase transitions between solution archetypes (Pizza, Clock, torus, disc) reflect biasing of representation geometry rather than algorithmic divergence.
  • Multiplicity and parallel ensemble phenomena, such as "accompanying pizzas," warrant systematic cataloguing.
  • The geometric–topological toolkit may generalize to richer tasks and deeper architectures, facilitating robust mapping of the algorithmic phase space.

A plausible implication is the tractability of extending these methodologies to more complex forms of learned computation and to the detection of universal circuits within high-dimensional, overparameterized neural networks.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Clock and Pizza Interpretations.