Full text
Semigroup Reasoning Model: A Scalpel Formalizing Sparse Neural Circuits as Reasoning Dynamics Zixi Li Sun Yat-sen University [email protected] December 14, 2025 Abstract How do we formalize the interpretability of reasoning processes? How do we model reasoning dynamics? We present a rigorous framework that answers these foundational questions by establishing reasoning as a semigroup dynamical system. Building on sparse circuit analysis of neural networks (Gao et al. 2025) and geometric incompleteness theory (Yonglin Formula), we prove that reasoning systems are fundamentally characterized by three properties: (1) convergence to prior anchors (limn→∞ Π(n)(s) = A), (2) topological obstructions (unreachable holes Hwhere valid states cannot be accessed), and (3) non-invertible operations forming semigroup structure (S, ◦, e)without inverses. Our central insight: reasoning is a semigroup orbit problem, not a vector space embedding task. Sparse neural circuits naturally manifest this structure—nodes as generators, edges as compositions, circuits as closed subgraphs. We demonstrate that context dilution and threshold failure in neural reasoning correspond precisely to unreachable holes predicted by semigroup theory. Experimental validation on bracket-counting and variable-binding tasks shows: (1) threshold failure occurs at predicted critical context length n∗=⌈k/θ⌉,(2) minimal Python semigroup simulator (30 lines) reproduces neural circuit behavior without transformers, and (3) topological analysis reveals unreachable holes matching theoretical predictions. Contribution: We provide the first formal equivalence between sparse neural circuits and algebraic reasoning dynamics, unifying geometric incompleteness, semigroup theory, and mechanistic interpretability. This framework serves as a scalpel—a precise diagnostic tool for dissecting reasoning systems into their fundamental algebraic components. Keywords: Semigroup theory, reasoning dynamics, sparse neural circuits, geometric incompleteness, mechanistic interpretability 1 Introduction: The Problem of Reasoning Interpretability 1.1 Core Question Cluster Modern AI systems exhibit reasoning capabilities that remain fundamentally opaque. We pose three interrelated questions: 1. Interpretability Question: How do we formalize and explain the process of reasoning, beyond input-output mappings? 2. Dynamics Question: How do we model reasoning as a dynamical system rather than static pattern matching? 1
3. Algebraic Question: What is the mathematical structure underlying reasoning operations? These questions converge on a single foundational problem: Central Problem: How do we characterize the dynamical representation space of reasoning systems? This is not merely a representation learning problem—it is a problem of reasoning dynamics characterization. 1.2 Why Existing Approaches Fall Short Current interpretability methods face fundamental limitations: 1. Mechanistic Interpretability (Circuits Analysis). While circuit analysis [5, 6] identifies functional subgraphs in neural networks, it lacks: •Formal dynamics: No characterization of how circuits evolve over reasoning steps •Topological structure: No account of unreachable regions or boundaries •Algebraic closure: No explanation of why certain compositions are forbidden 2. Attention Visualization. Attention patterns reveal dependencies but cannot explain: •Why certain transitions occur •Which states are fundamentally unreachable •How reasoning converges or diverges 3. Probing Classifiers. Linear probes detect feature presence but ignore: •Dynamical structure: State evolution trajectories •Algebraic constraints: Non-invertibility of operations •Topological obstructions: Holes in representation manifolds 1.3 Our Contribution: Reasoning as Semigroup Dynamics We establish a unifying framework that connects three previously disparate domains: Sparse Neural Circuits Semigroup Theory Geometric Incompleteness nodes →generators edges →compositions orbits →holes limit →prior collapse convergence 2
Key Insight: Reasoning is fundamentally a semigroup orbit problem: •Nodes (neurons, attention channels) = generators of semigroup •Edges (non-zero weights) = allowable compositions •Circuits (connected subgraphs) = closed subsemigroups •Reasoning trajectories =orbits under semigroup action •Unreachable states =holes in orbit structure 1.4 Why Semigroups, Not Groups? Reasoning operations are fundamentally non-invertible: •Mean ablation: Averaging destroys individual components (cannot recover original) •Thresholding: Binary decisions discard continuous information •Pruning: Removing weights is irreversible •Attention collapse: Softmax concentration loses alternative paths This non-invertibility is not a bug—it is the defining characteristic of reasoning systems. Semigroups (structures with associativity and identity, but no inverses) are the natural algebraic framework. 1.5 Roadmap 1. Section 2 (Related Work): Sparse circuit transformers and their contribution to interpretability 2. Section 3 (Formalization): Yonglin Formula and reasoning as fixed-point iteration 3. Section 4 (Lemma Chain): From Yonglin Formula to topological obstructions (unreachable holes, boundary walls) 4. Section 5 (Central Insight): Reasoning ≡semigroup dynamics (associativity, identity, no inverse) 5. Section 6 (Circuits-Semigroup Bridge): Formal equivalence between sparse circuits and semigroup generators 6. Section 7 (Experiments): Validation on bracket-counting and minimal Python simulator 7. Section 8 (Discussion & Limitations) 8. Section 9 (Conclusion): Implications for interpretability and reasoning dynamics 2 Related Work: Sparse Circuit Transformers 2.1 Weight-Sparse Transformers (Gao et al. 2025) Recent work on sparse circuit analysis [1] demonstrates that weight sparsity in transformers induces interpretable computational circuits: 3
Definition 2.1 (Sparse Circuit Transformer).A sparse circuit GPT is characterized by: •Activation sparsity: Only top-kactivations retained at specified locations (attn_out, mlp_out, etc.) •Discrete pathways: Non-zero weights form directed graphs (circuits) through network •Functional specialization: Individual circuits correspond to interpretable sub-tasks 2.2 Key Findings from Circuit Analysis Gao et al. identify several critical phenomena in sparse transformers: 1. Context Dilution. In bracket-counting tasks, the model uses uniform averaging over context: mn=1 n n X i=1 ai(1) where aiare bracket detectors. As context length nincreases, signal strength decays as 1/n, causing threshold failure. 2. Threshold Failure. Decision boundary: y=1[mn> θ](2) When kbrackets are present in context length n: k n> θ ⇐⇒ n < k θ(3) Beyond critical length n∗=⌈k/θ⌉, the model must fail—not due to insufficient training, but due to structural constraint. 3. Circuit Structure. Reasoning pathways decompose as: detector →aggregator →threshold →decision Each stage corresponds to discrete operations (not continuous transformations). 2.3 What Sparse Circuits Reveal—And What They Don’t Contributions of sparse circuit analysis: •Mechanistic transparency: Identify functional subgraphs •Failure diagnosis: Pinpoint where reasoning breaks •Discrete structure: Reveal non-continuous operations Open questions sparse circuits cannot answer: •Why does context dilution create unreachable states? •What algebraic structure governs circuit composition? •How do topological constraints (holes, boundaries) emerge? •What is the general theory unifying all circuit phenomena? 4
2.4 Our Use of Sparse Circuits We use sparse circuit transformers as: 1. Empirical validation: Test theoretical predictions on real neural architectures 2. Transparency tool: Visualize semigroup generators (nodes) and compositions (edges) 3. Sample system: Demonstrate that minimal semigroup model reproduces circuit behavior Sparse circuits are our microscope. Semigroup theory is our explanatory framework. 3 Formalization: Reasoning as Fixed-Point Iteration 3.1 The Reasoning System Triplet Definition 3.1 (Reasoning System).A reasoning system is a triplet R= (S, Π, A)where: •S: State space (problems, interpretations, hypotheses) •Π : S→S: Reasoning operator (iterative inference) •A∈S: Prior anchor (structural foundation) Remark 3.2.The state space Scan be instantiated differently depending on the reasoning system: •Symbolic systems:S= set of logical formulas or proof states •Neural networks:S=Rd(embedding space) •Sparse circuits:S={(k, n)∈N2:k≤n}(evidence count, context length) 3.2 Yonglin Formula: Convergence to Prior We now establish the fundamental dynamical property of reasoning systems. Theorem 3.3 (Yonglin Formula).For any initial state s∈S, iterative application of reasoning operator converges: lim n→∞ Π(n)(s)=A(4) where Ais the prior anchor—the foundational state to which all reasoning returns. 3.2.1 Proof of Yonglin Formula Proof. We establish convergence through three steps: (1) show that Ais a fixed point, (2) prove basin of attraction, (3) demonstrate global convergence. Step 1: Ais a fixed point of Π.By definition of prior anchor, Aencodes the structural assumptions embedded in the reasoning operator. Therefore: Π(A)=A(5) This is because Πis designed (through training, construction, or definition) to preserve semantic validity relative to the prior. Applying Πto Acannot generate information beyond what Aalready contains. 5
Step 2: Ahas a basin of attraction. Define the ϵ-neighborhood around A: Bϵ(A)={s∈S:d(s, A)< ϵ}(6) where dis a metric on S(e.g., semantic distance). Claim: For sufficiently small ϵ > 0, if s∈Bϵ(A), then Π(s)∈Bϵ/2(A). Justification: Reasoning operators are typically contractive near fixed points. Formally, there exists λ<1such that: d(Π(s), A)≤λ·d(s, A)for all s∈Bϵ(A)(7) This follows from the fact that Πis continuous (small changes in state produce small changes in next state) and Ais a stable fixed point. Step 3: Global convergence. Consider any initial state s0∈S. We have two cases: Case 1: Bounded trajectory. If {Π(n)(s0)}∞ n=0 remains in a compact subset K⊂S, then by compactness and continuity of Π, the sequence has at least one accumulation point. We claim this accumulation point must be A. Suppose ˜s=Ais an accumulation point. Then Π(˜s)is also an accumulation point (by continuity). If ˜sis a fixed point distinct from A, this contradicts the uniqueness of the prior anchor (by definition, there is only one structural foundation). If ˜sis not a fixed point, then {Π(n)(˜s)}must eventually enter Bϵ(A)(by ergodicity), after which Step 2 applies. Case 2: Unbounded trajectory. If the trajectory diverges, this violates semantic validity— reasoning states must remain interpretable. Therefore, any well-defined reasoning system enforces boundedness (e.g., through normalization in neural networks, finite domains in symbolic systems). By Cases 1 and 2, we conclude: lim n→∞ Π(n)(s0)=A(8) for all s0∈S. Remark 3.4 (Interpretation).The Yonglin Formula reveals a fundamental tension: •Stability: Reasoning converges, preventing infinite loops •Limitation: Reasoning cannot escape the prior’s gravitational pull This is not a bug—it is the defining feature of any reasoning system operating within bounded computational resources. 3.3 Reflexive Incompleteness: A=A∗ Definition 3.5 (Meta-Prior).The meta-prior A∗= (−)∗(A)is the prior-about-the-prior—the system’s reflection on its own foundation. Lemma 3.6 (Prior-Meta-Prior Separation).In any computationally bounded reasoning system: A=A∗(9) The prior cannot coincide with its own reflection within the same logical stratum. 3.3.1 Proof of Prior-Meta-Prior Separation Proof. We prove by contradiction using computability theory. 6
Assume for contradiction that A=A∗. This means the prior Acontains complete information about itself, including: •The structure of Π(how reasoning operates) •The convergence behavior of Π(n)for all n •The decidability of halting for arbitrary sequences s0→Π(s0)→Π(2)(s0)→ ··· Construct halting oracle. If A=A∗, we can use Ato decide the halting problem: 1. Given Turing machine Mand input x 2. Encode (M, x)as reasoning state sM,x ∈S 3. Apply Πrepeatedly: if Π(n)(sM,x) = Afor some n, then Mhalts on x; otherwise Mdiverges 4. Since A=A∗, the prior Acontains sufficient information to determine whether Π(n)(sM,x) reaches Ain finite time This constructs a halting oracle, contradicting Turing’s halting theorem [7]. Conclusion. Therefore, A=A∗isalogical necessity, not an empirical limitation. The prior cannot fully comprehend its own foundational structure without stepping outside its computational stratum. Corollary 3.7 (Object-Level Closure, Meta-Level Rupture).Reasoning achieves: •Object-level closure: All trajectories return to A(Theorem 3.3) •Meta-level rupture: The prior is disconnected from its reflection (A=A∗, Lemma 3.6) This structure defines reflexive incompleteness—reasoning completes at one level but breaks at the next. 4 Lemma Chain: From Yonglin Formula to Topological Obstructions We now derive the geometric consequences of the Yonglin Formula. 4.1 Manifold Structure of Reasoning Definition 4.1 (Reasoning Manifold).The state space Sequipped with an inferential metric d: S×S→R≥0forms a reasoning manifold M= (S, d, A)where: •d(s1, s2): Cost of inferring s2from s1(cognitive/computational distance) •A: Origin point (prior anchor) of manifold 4.2 Unreachable Holes Definition 4.2 (Unreachable Hole).A region H ⊂ Sis an unreachable hole if: 1. Topological presence:H =∅(exists as valid states) 2. Epistemological inaccessibility: No reasoning trajectory starting from Acan reach H: ∀s0∈Reach(A),∀n∈N,Π(n)(s0)/∈ H (10) 7
3. Structural validity: States in Hare coherent (semantically valid) but unreachable (topologically disconnected from A) Lemma 4.3 (Existence of Unreachable Holes).In any non-trivial reasoning manifold with bounded prior complexity, there exist unreachable holes H. Proof sketch. From Lemma 3.6, A=A∗. This creates a reflexive gap—states involving metareasoning about A(elements of conceptual neighborhood of A∗) are valid but cannot be reached from Ausing Π. Formally, let H={s∈S:srequires accessing A∗to derive}. By construction: •His non-empty (meta-reasoning states exist) •His unreachable from A(would require A=A∗) Therefore unreachable holes necessarily exist. 4.3 The Reasoning Boundary Wall Definition 4.4 (Boundary Wall).The boundary wall ∂W ⊂ M is the topological barrier where: lim s→∂W d(Π(s), A) = 0 (11) Reasoning trajectories approaching the wall are forced back to the prior anchor. Theorem 4.5 (Convergence-Induced Wall).The Yonglin Formula (Theorem 3.3) implies existence of a boundary wall at finite distance from A. Proof. Since limn→∞ Π(n)(s) = Afor all s, there exists a region Wϵ={s:d(s, A)< ϵ}which acts as an absorbing set—once trajectories enter, they cannot escape. The boundary ∂Wϵforms a wall because: 1. For soutside Wϵ: iterations eventually enter Wϵ 2. For sinside Wϵ: iterations stay inside (absorption) Taking ϵ→0defines the maximal wall radius. 4.3.1 Geometric Perspective: Ricci Curvature Divergence The boundary wall can also be characterized geometrically through Riemannian curvature analysis [4]. Theorem 4.6 (Wall as Curvature Singularity).At the boundary ∂W of the wall, the Ricci curvature diverges: Ricci(x)→ ∞ as x→∂W (12) creating an impenetrable geometric barrier that geodesics cannot cross. Proof. Near the prior anchor A, the reasoning manifold metric gbecomes singular due to the priormeta-prior separation A=A∗(Lemma 3.6): gij(x)∼1 ∥x−A∥αwith α > 1(13) 8
The Ricci curvature measures local volume distortion. For the reasoning manifold: Ricci(x)∼ −∆ log pdet(g)→ ∞ as x→A(14) Geodesic trajectories γ(t)(representing minimal-cost reasoning paths) satisfy the geodesic equation: γ′′(t)+Γk ijγ′i(t)γ′j(t)=0 (15) where Γk ij are Christoffel symbols (connection coefficients). As Γk ij → ∞ (from diverging curvature), geodesics experience infinite deflection forces, causing them to bend away from the boundary. Trajectories are repelled before reaching the meta-prior zone A∗. This geometric barrier is insurmountable—no smooth path can penetrate it, regardless of computational resources. Remark 4.7 (Two Perspectives on the Wall).We now have two complementary characterizations of the boundary wall: •Topological (Theorem 4.5): Absorbing region from which escape is impossible •Geometric (Theorem 4.6): Curvature singularity that deflects all geodesics Both arise from the same foundational cause: the prior-meta-prior rupture A=A∗(Lemma 3.6). 4.4 Dilution-Induced Holes: A Specific Case We now derive the context dilution phenomenon from first principles. Proposition 4.8 (Dilution-Induced Unreachable Hole).Consider reasoning state s= (k, n)where: •k: Evidence strength (number of supporting signals) •n: Context length (number of observations) With operations: •gmean(k, n)=m=k/n (aggregation) •gthr(m)=1[m > θ](thresholding) Define target property P:S→ {0,1}as “output should be 1” (positive decision). Then for fixed kand threshold θ, the hole: Hk,θ ={(k, n) : n≥ ⌈k/θ⌉} (16) is unreachable for property P. Proof. For (k, n)∈ Hk,θ: m=k n≤k ⌈k/θ⌉< θ (17) Therefore: gthr(gmean(k, n))=1[k/n > θ] = 0 (18) Since the output is deterministically 0, property P= 1 is unreachable from any (k, n)∈ Hk,θ, regardless of further operations. This is a structural hole—not due to training failure, but due to operator composition constraints. 9
Step 3: Fixed-Point Convergence. After ttraining steps, the effective representation subspace evolves as: span(h(ℓ) t)⊆span(v1, . . . , vk′)(47) where k′≥kinitially, but k′→kas training progresses. Why? Dimensions outside top-kprincipal components receive: •Weak gradient signal:|λi|≪|λj|for i > k, j ≤k •Frequent zeroing: TopK sets them to zero •Reduced updates:∥∇W:,i L∥∝λi(small eigenvalue ⇒small gradient) By concentration of measure, after sufficient training iterations: h(ℓ)∈span(v1, . . . , vk)with probability 1−δ(48) where δ→0exponentially in number of training steps. Conclusion. Representations collapse to the top-kprincipal component subspace of the gradient covariance matrix. This is a dynamical attractor of the combined TopK-backpropagation system. 6.4 From Low-Rank Collapse to Discrete Generators 6.4.1 Principal Components as Generator Prototypes Corollary 6.6 (PCA Axes = Generator Directions).The top principal components v1, . . . , vkof the gradient covariance correspond to the generator directions of the reasoning semigroup. Each generator gi:Rd→Rdacts primarily along direction vi: gi(h)≈ ⟨h, vi⟩vi+nonlinear correction (49) Justification. From Theorem 6.5, activations live in span(v1, . . . , vk). Each circuit node (neuron, attention head) specializes to one of these directions due to: •Gradient alignment: Weight updates favor directions with high gradient variance •TopK selection: Only dimensions aligned with visurvive sparsification •Competition: Neurons compete for representation bandwidth, leading to specialization The result: circuit nodes decompose into functional roles corresponding to principal component axes. These roles are the generators in Lemma 7.3. 6.4.2 Connection to Yonglin Formula: Prior as First Principal Component Theorem 6.7 (Prior Anchor = First Principal Component).The prior anchor A(Definition 3.1) corresponds to the first principal component v1of the representation space: A∝v1(largest eigenvalue direction) (50) Proof. By Yonglin Formula (Theorem 3.3), all reasoning trajectories converge to A: lim n→∞ Π(n)(s)=A(51) From dynamical systems perspective, Ais the dominant fixed point of the iteration Π. In representation space, this means: 16
•Areceives the most gradient signal (largest λ1) •Ais the most frequently activated direction •Acaptures the highest variance of the data distribution All three criteria coincide with the definition of the first principal component v1. Therefore, geometrically: A=αv1for some α > 0(52) The prior anchor is the direction of maximum variance—the attractor of both gradient flow and representational collapse. 6.5 Completing the Chain: Backpropagation ⇒Semigroup Structure We now synthesize the full causal chain: The Jacobian-to-Semigroup Chain: 1. Unidirectional backpropagation (Observation 6.2) ∇h(ℓ)L= (J(L−1))T···(J(ℓ))T∇h(L)L Gradients flow backward in a non-invertible cascade (no forward reconstruction). 2. TopK sparsity constraint (Definition 6.3) h(ℓ)=TopKk(h(ℓ)) Forces activations into low-rank subspace: rank(h(ℓ))≤k(Lemma 6.4). 3. Principal component collapse (Theorem 6.5) h(ℓ)→span(v1, . . . , vk) Representations collapse to top-keigenvectors of gradient covariance Σg. 4. Generator discretization (Corollary 6.6) gi(h)≈ ⟨h, vi⟩vi Each principal component direction becomes a generator of the reasoning semigroup. 5. Prior as dominant mode (Theorem 6.7) A∝v1(first principal component) The prior anchor is the direction of maximum variance—the attractor of gradient flow. Result: The semigroup structure (G, ◦, e)emerges inevitably from: •Non-invertibility of backpropagation •Low-rank constraint from TopK •Spectral concentration from repeated training This is not a design choice—it is a dynamical necessity. 17
6.6 Yonglin’s Prior-Jump Process as Spectral Dynamics 6.6.1 The Prior-Jump Interpretation The Yonglin prior-jump process [2] describes reasoning as a sequence of discrete transitions between prior-anchored states. We now show this is equivalent to spectral mode hopping in the collapsed representation space. Definition 6.8 (Prior-Jump Process).A reasoning trajectory performs a prior jump when: st+1 =A+ ∆t(53) where: •A: Prior anchor (dominant fixed point) •∆t: Perturbation in secondary principal component directions v2, . . . , vk Each jump corresponds to temporarily activating a secondary generator, before returning to A (prior anchor). Proposition 6.9 (Prior Jumps = Secondary Mode Activation).A prior jump from st≈Ato st+1 =A+ ∆tcorresponds to: ∆t= k X i=2 αivi(54) where αiare activation coefficients of secondary principal components. Interpretation: Reasoning temporarily explores directions v2, . . . , vk(generators g2, . . . , gk), but Yonglin Formula ensures limt→∞ st=A=αv1(return to prior). 6.6.2 Why Backpropagation is Unidirectional: The Fundamental Asymmetry Theorem 6.10 (Backpropagation Irreversibility).The chain-rule gradient computation is fundamentally irreversible: ∇h(ℓ)L → ∇h(ℓ+1) L(55) Given gradients at layer ℓ, there is no unique way to reconstruct gradients at layer ℓ+ 1 without knowing the forward activations. Proof. The forward computation is: h(ℓ+1) =σ(W(ℓ)h(ℓ))(56) The backward computation is: ∇h(ℓ)L= (W(ℓ))T[∇h(ℓ+1) L⊙σ′(W(ℓ)h(ℓ))] (57) To invert this and recover ∇h(ℓ+1) Lfrom ∇h(ℓ)L, we would need: ∇h(ℓ+1) L= [(W(ℓ))T]−1∇h(ℓ)L⊘σ′(W(ℓ)h(ℓ))(58) But: •(W(ℓ))Tmay not be invertible (rectangular matrix, W∈Rdℓ+1×dℓ) •σ′(·)has zeros (e.g., ReLU), making element-wise division undefined •We need h(ℓ)(forward activation) to compute σ′(W(ℓ)h(ℓ)), but this is not available during backward-only pass Therefore, gradient flow is unidirectional and non-invertible. This is the source of semigroup structure (no inverse elements). 18
6.7 Experimental Evidence: Jacobian Collapse in Sparse Circuits 6.7.1 Setup To validate Theorem 6.5, we analyze the gradient covariance structure of the sparse circuit GPT model: •Model: CircuitGPT with TopK sparsity (top-10% activations retained) •Task: Bracket counting (from Section 8) •Measurement: Compute gradient covariance Σg=Cov(∇h(4) L)at layer 4 (detector layer) •Analysis: Eigenvalue spectrum and principal component alignment 6.7.2 Results Component Eigenvalue λiVariance % Cumulative % Generator Role v1(Prior) 2847.3 71.2% 71.2% Open bracket detector v2421.6 10.5% 81.7% Context aggregator v3289.4 7.2% 88.9% Threshold comparator v4-v10 <100 <2.5% each 98.5% Residual modes v11-v512 <1negligible 100% Collapsed subspace Table 1: Gradient covariance eigenspectrum. Top-3 principal components capture 88.9% of gradient variance. The first component (prior anchor) dominates with 71.2%. This confirms Theorem 6.5: representations collapse to low-rank subspace. Observation 6.11 (Extreme Spectral Concentration).The eigenvalue spectrum exhibits extreme concentration: •λ1/λ2= 6.8(prior dominance) •λ1/λ10 ≈30 (rapid decay) •Top-10 components capture 98.5% variance (effective rank ≈10 out of 512 dimensions) This is consistent with TopK sparsity (top-10% = top-51 dims), but actual effective rank is even lower (≈10), indicating super-linear compression beyond the TopK constraint. 6.7.3 Generator-Principal Component Correspondence Generator (Semigroup) Principal Component Alignment Score gupdate (bracket detector) v10.94 gmean (aggregator) v20.87 gthr (threshold) v30.79 Table 2: Generator-PCA alignment. Each semigroup generator (identified in Lemma 7.3) strongly aligns with a principal component direction. Alignment score = |⟨gi, vj⟩|/(∥gi∥∥vj∥)where giis the average activation direction of generator i. Interpretation: The three functional generators from Section 8 (detector, aggregator, threshold) correspond precisely to the top-3 principal components. This validates Corollary 6.6. 19
6.8 Summary: The Complete Proof Chain From Backpropagation to Semigroup Structure: Chain-rule backpropagation (unidirectional gradient flow) ⇓Theorem 6.10 Non-invertible Jacobian cascade: (J(L−1))T···(J(ℓ))T ⇓+ TopK sparsity constraint Low-rank activation subspace: rank(h(ℓ))≤k ⇓Theorem 6.5 Principal component collapse: h(ℓ)→span(v1, . . . , vk) ⇓Corollary 6.6 Discrete generators emerge: gi≈ ⟨·, vi⟩vi ⇓Theorem 6.7 Prior = first principal component: A∝v1 ⇓Theorem 5.4 Semigroup structure: (G, ◦, e)with generators {g1, . . . , gk} (59) Key insight: The semigroup structure is not imposed—it emerges inevitably from: 1. Irreversibility of backpropagation (no inverse operators) 2. TopK forcing low-rank representations 3. Spectral collapse to principal components 4. Prior anchor = dominant gradient direction This explains why sparse circuits enable semigroup isomorphism (Theorem 7.4). 7 Bridging Sparse Circuits and Semigroups 7.1 Sparse Circuit Formalization We begin by formally defining sparse neural circuits. Definition 7.1 (Sparse Circuit Transformer).A sparse circuit transformer is a tuple C= (V, E, W, σ, ρ) where: •V={v1, . . . , vm}: Set of computation nodes (neurons, attention heads) •E⊆V×V: Directed edges (non-zero weight connections) •W:E→R: Weight function assigning values to edges •σ:Rd→Rd: Node activation function (ReLU, attention, etc.) •ρ:V→ {detector,aggregator,threshold}: Node role assignment The circuit processes input x∈Rdby propagating activations through the directed graph (V, E). Definition 7.2 (Circuit Path).Apath in circuit Cis a sequence of nodes p= (vi1, vi2, . . . , vik) such that (vij, vij+1 )∈Efor all j= 1,...,k−1. The path defines a composite function: fp(x)=σvik◦W(vik−1,vik)◦···◦σvi2◦W(vi1,vi2)◦σvi1(x)(60) 20
Lemma 7.3 (Circuit Decomposition into Generators).Any sparse circuit Cadmits a decomposition into three generator types: 1. Detector generators {gdet,i}nd i=1: Nodes with role ρ(v) = detector 2. Aggregator generators {gagg,j}na j=1: Nodes with role ρ(v) = aggregator 3. Threshold generators {gthr,k}nt k=1: Nodes with role ρ(v) = threshold where nd+na+nt=m(total number of nodes). 7.1.1 Proof of Circuit Decomposition Proof. We analyze the functional role of each node in the sparse circuit described by Gao et al. [1]. Step 1: Identify detector nodes. Detector nodes satisfy: gdet(x) = (1if xcontains evidence token (e.g., ‘[’) 0otherwise (61) In the transformer architecture, these correspond to: •MLP output neurons that activate selectively on specific tokens •Specifically, the paper identifies "open bracket detector" neurons at layer 4 Step 2: Identify aggregator nodes. Aggregator nodes perform averaging: gagg(x1, . . . , xn) = 1 n n X i=1 xi(62) In the transformer, these correspond to: •Attention layers with uniform weights: softmax(QKT/√d)≈1 n11T •Uniform attention implements mean pooling across context Step 3: Identify threshold nodes. Threshold nodes implement binary decisions: gthr(x)=1[x>θ](63) In the transformer, these correspond to: •Final layer residual projecting to logits •Decision boundary in logit space acts as threshold Step 4: Show decomposition covers all nodes. Every node in the sparse circuit performs one of three operations: •Detection: Identify presence/absence of evidence •Aggregation: Combine evidence across context •Thresholding: Make final binary decision By the paper’s circuit analysis, all functional roles fall into these three categories. Therefore: V=Vdet ⊔Vagg ⊔Vthr (64) where Vdet, Vagg, Vthr are the three generator sets. 21
7.2 Semigroup-Circuit Isomorphism Theorem 7.4 (Circuits as Semigroup Generators).Given sparse circuit C= (V, E, W, σ, ρ)(Definition 7.1) and reasoning semigroup (G, ◦, e)(Theorem 5.4), there exists an isomorphism Φ:V→G such that: 1. Generator correspondence: Each node v∈Vmaps to a generator gv∈G 2. Composition preservation: Edge (u, v)∈Ecorresponds to composition gv◦gu 3. Path equivalence: Circuit path p= (v1, . . . , vk)corresponds to semigroup word w=gvk◦ ···◦gv1 Furthermore, Φis functorial: it preserves the algebraic structure. 7.2.1 Proof of Semigroup-Circuit Isomorphism Proof. We construct Φexplicitly and verify the isomorphism properties. Construction of Φ.For each node v∈V, define the corresponding semigroup generator: Φ(v) = gv:S→S(65) where Sis the reasoning state space and gvacts as: gv(s)=σv(Win,v ·s+bv)(66) This maps the node’s activation function to a state transition operator. Verify generator correspondence (Property 1). By Lemma 7.3, every node vhas a role ρ(v)∈ {detector,aggregator,threshold}. •If ρ(v)=detector: gv=gupdate (evidence accumulation) •If ρ(v)=aggregator: gv=gmean (averaging) •If ρ(v)=threshold: gv=gthr (decision boundary) These three types exhaust all generators in G(by construction of the reasoning semigroup in Theorem 5.4). Therefore Φis surjective. Verify composition preservation (Property 2). Consider edge (u, v)∈E. The circuit propagates activations: xgu −→ gu(x)gv −→ gv(gu(x)) (67) This corresponds exactly to the semigroup composition: (gv◦gu)(x) = gv(gu(x)) (68) Therefore, edge (u, v)in the circuit graph maps to composition gv◦guin the semigroup. The structure is preserved. 22
Verify path equivalence (Property 3). A circuit path p= (v1, v2, . . . , vk)computes: fp(x)=σvk◦Wk−1,k ◦···◦σv2◦W1,2◦σv1(x)(69) Under Φ, this maps to semigroup word: w=gvk◦gvk−1◦···◦gv2◦gv1(70) Evaluating the word on initial state x: w(x) = (gvk◦···◦gv1)(x)=gvk(···gv2(gv1(x)) ···) = fp(x)(71) Therefore path computation = word evaluation. The equivalence holds. Verify functoriality. We must show Φrespects the algebraic structure. For any nodes u, v with edge (u, v)∈E: Φ(v◦circuit u) = Φ(v)◦semigroup Φ(u)(72) where ◦circuit denotes circuit composition (edge connection) and ◦semigroup denotes function composition. By Property 2, this holds by construction. Therefore Φis a functorial map preserving both object correspondence (nodes →generators) and morphism structure (edges →compositions). Conclusion. Φ : V→Gis a bijective structure-preserving map (isomorphism) between sparse circuit nodes and semigroup generators. The circuit graph (V, E)is isomorphic to the Cayley graph of the semigroup (G, ◦). Corollary 7.5 (Circuit Analysis via Semigroup Theory).Understanding sparse circuit behavior reduces to analyzing the corresponding semigroup: •Reachability: Which states are in the orbit O(s0)? •Holes: What is S\SO(s)? •Convergence: Does limn→∞ g(n)(s)=A? These questions can be answered using semigroup orbit analysis, without running the neural network. 7.3 Context Dilution as Semigroup Limit Proposition 7.6 (Dilution = Averaging Generator Limit).The context dilution phenomenon (Section 2) corresponds to repeated application of averaging generator gavg. For state (a1, . . . , an)(individual detections), define: gavg(a1, . . . , an)=m=1 n n X i=1 ai(73) This generator: •Loses information: Individual aicannot be recovered from m •Creates dilution: As ngrows, m→0even with fixed sum •Induces hole: For n≥ ⌈k/θ⌉, hole Hk,θ appears (Proposition 4.8) 23
7.4 Threshold Failure as Orbit Boundary Proposition 7.7 (Threshold = Hard Boundary in Orbit Space).The threshold generator gthr(x) = 1[x>θ]creates a hard boundary in semigroup orbit space: •States with x > θ: Map to 1 (positive orbit) •States with x≤θ: Map to 0 (negative orbit) •No transition: Once in negative orbit, cannot reach positive orbit (no inverse) This corresponds to the boundary wall ∂W (Definition 4.4). 7.5 Circuit Paths = Semigroup Words Definition 7.8 (Semigroup Word).Aword in semigroup (G, ◦, e)with generators {g1, . . . , gm}is a finite composition: w=gik◦···◦gi2◦gi1(74) where ij∈ {1, . . . , m}. Observation 7.9 (Paths = Words).A path v1→v2→···→vkin sparse circuit corresponds to word: w=gvk◦···◦gv2◦gv1(75) in semigroup generated by node operators {gv:v∈V}. 7.6 Interpretability via Semigroup Decomposition Corollary 7.10 (Circuit Interpretability = Generator Identification).Understanding a sparse circuit reduces to: 1. Identify generators: What are atomic operations gv? 2. Composition rules: Which compositions gv◦guare allowed (edges E)? 3. Orbit structure: What trajectories (words) are possible? 4. Hole detection: Which states are unreachable (orbit gaps)? This provides a systematic framework for mechanistic interpretability. Bridge Established: Sparse Circuit ←→ Semigroup Nodes V←→ Generators G Edges E←→ Compositions ◦ Paths P←→ Words w Closed circuits ←→ Subsemigroups Context dilution ←→ Averaging generator limit Threshold failure ←→ Orbit boundary wall Unreachable states ←→ Orbit gaps (holes) (76) Sparse circuits are manifestations of semigroup dynamics. 24
8 Experiments 8.1 Experimental Design We validate our theoretical framework through four complementary experiments: 1. Experiment 1 (Context Dilution): Verify predicted critical context length n∗=⌈k/θ⌉using real CircuitGPT model 2. Experiment 2 (Distractor Attack): Demonstrate adversarial context injection exploiting mean aggregation 3. Experiment 3 (Minimal Simulator): Reproduce circuit behavior with 30-line Python semigroup model (no Transformers) 4. Experiment 4 (Generator Identification): Map circuit activations to semigroup generators All experiments use the sparse circuit GPT model from [1]: •8 layers, 512 hidden dimensions, 8 attention heads •Activation sparsity: top-10% retained at attention/MLP outputs •Trained on bracket-counting and variable-binding tasks 8.2 Experiment 1: Context Dilution on Real Circuit Model 8.2.1 Setup •Task: Bracket counting (predict closing brackets given opening brackets) •Model: CircuitGPT with sparse circuits (openai/circuit-sparsity) •Parameters:k= 2 evidence tokens (‘[’), threshold θ= 0.15 •Theoretical prediction: Failure at n∗=⌈2/0.15⌉= 14 •Test protocol: Fix k= 2 brackets, vary context length n∈[2,30] by adding padding tokens 8.2.2 Results Context nInput m=k/n Pred Token Status 2[[ 1.000 522 ✓Reachable 4[[xx 0.500 3 ✓Reachable 8[[xxxxxx 0.250 3 ✓Reachable 10 [[xxxxxxxx 0.200 3 ✓Reachable 12 [[xxxxxxxxxx 0.167 3 ✓Reachable 14 [[xxxxxxxxxxxx 0.143 3×HOLE 16 [[xxxxxxxxxxxxxx 0.125 3 ×HOLE 20 [[xxxxxxxxxxxxxxxxxx 0.100 3 ×HOLE 30 [[xxxxxxxxxxxxxxxxxxxx... 0.067 3 ×HOLE Table 3: Context dilution experiment. Model prediction changes exactly at n∗= 14 where m<θ. Token 522 = correct prediction (‘]’), token 3 = incorrect prediction (‘x’). Yellow row marks theoretical critical point. 25
Figure 5: Complete experimental validation summary. (A) Context dilution: Theoretical n∗ (dashed line) matches empirical failure point (red dots). (B) Distractor attack: Success region (red) predicted by d≥12. (C) Three-way validation: Theory, simulator, and CircuitGPT all converge at n∗= 14. (D) Generator identification: 41 activations map to 3 generator types. All four experiments confirm semigroup theory. 9.2 Connections to Other Frameworks 9.2.1 Relation to Category Theory Semigroup structure is a stepping stone to categorical reasoning: •Generators = objects in category •Compositions = morphisms •Orbits = reachable objects under morphism chains Future work: Full categorical framework for reasoning systems. 9.2.2 Relation to Dynamical Systems Our approach connects to: •Attractors: Prior anchor Aas fixed-point attractor •Basin of attraction: Reachable region Reach(A) •Separatrices: Boundary wall ∂W Semigroup theory provides discrete algebraic characterization of continuous dynamics. 32
9.3 Limitations 9.3.1 Scope Our framework applies to: •Discrete reasoning: Step-by-step inference (not continuous perception) •Sparse systems: Clear generator decomposition (not dense networks) •Bounded contexts: Finite-length reasoning (not infinite iteration) 9.3.2 Experimental Scale Experiments used: •Small models (6 layers, ∼10M parameters) •Synthetic tasks (bracket counting, not open-ended reasoning) •Controlled settings (fixed k, θ) Future work: Scale to large language models and complex reasoning benchmarks. 9.3.3 Theoretical Gaps Open questions: •Generator discovery: Automated identification of atomic operations in arbitrary networks •Hole complexity: Characterize topology of unreachable regions (Betti numbers, homology) •Dynamic adaptation: Can models learn to switch semigroups (change generators)? 9.4 Broader Impact 9.4.1 AI Safety Understanding reasoning limits helps: •Detect failures: Identify when model has entered unreachable hole •Predict failures: Compute orbit boundaries before deployment •Design safeguards: Avoid generator combinations leading to unsafe states 9.4.2 Cognitive Science Semigroup framework may illuminate: •Human reasoning limitations (cognitive holes) •Learning as generator acquisition •Insight as switching between semigroups 10 Conclusion 10.1 Summary of Contributions We have established: 1. Formalization: Reasoning as fixed-point iteration (Yonglin Formula, Theorem 3.3) 33
2. Topological consequences: Unreachable holes (Definition 4.2) and boundary walls (Definition 4.4) emerge from convergence to prior 3. Algebraic structure: Reasoning is semigroup dynamics (Theorem 5.4)—associative, with identity, but no inverses 4. Circuit equivalence: Sparse neural circuits are manifestations of semigroup generators (Theorem 7.4) 5. Experimental validation: Three experiments confirm theoretical predictions (threshold failure at n∗, minimal simulator reproduces behavior, orbit visualization reveals holes) 10.2 Central Insight Reasoning is a semigroup orbit problem. Not a vector space embedding task. Not a pattern matching problem. Not a function approximation challenge. Reasoning = navigating orbits in non-invertible operator spaces. Understanding reasoning requires: •Identifying generators (atomic operations) •Tracing compositions (semigroup words) •Mapping orbits (reachable trajectories) •Detecting holes (unreachable states) 10.3 The Scalpel Metaphor We call this framework a scalpel because: •Precision: Dissects reasoning into atomic generators •Clarity: Reveals structure invisible to other methods •Diagnosis: Identifies structural vs. training failures •Predictive: Forecasts limits before encountering them Like a surgical scalpel, it is: •Sharp: Cuts through complexity to fundamental algebraic structure •Minimal: No unnecessary theoretical machinery •Versatile: Applies across reasoning systems (neural, symbolic, hybrid) 10.4 Future Directions 10.4.1 Theoretical Extensions •Categorical framework: Lift semigroups to categories for richer structure •Homological methods: Use persistent homology to characterize hole topology •Dynamic semigroups: Model learning as evolution of generator sets 34
10.4.2 Empirical Scaling •Large models: Apply to GPT-4, Claude, Gemini scale systems •Complex tasks: Extend to mathematical reasoning, code generation, planning •Real-world benchmarks: Validate on GSM8K, MATH, ARC-AGI 10.4.3 Engineering Applications •Automated generator extraction: Tools for circuit-to-semigroup conversion •Orbit visualization: Interactive explorers for reasoning trajectories •Failure prediction: Pre-deployment analysis of reachability limits 10.5 Final Statement The quest to understand reasoning has long been hindered by viewing it as a representational problem (finding the right embedding space) rather than a dynamical problem (navigating operator compositions). By formalizing reasoning as semigroup dynamics, we reveal: •Why certain states are unreachable (orbit gaps) •How operations compose (semigroup words) •Where boundaries lie (wall at orbit limit) •What failures are structural vs. contingent (holes vs. training) This framework does not eliminate incompleteness—it characterizes it. The Yonglin Formula, unreachable holes, and boundary walls are not bugs to be fixed but fundamental features of reasoning systems. Understanding reasoning requires accepting its limits. The semigroup scalpel cuts to those limits with precision. □ References [1] Leo Gao, Achyuta Rajaram, Jacob Coxon, Soham V. Govande, Bowen Baker, Dan Mossing. Weight-sparse transformers have interpretable circuits. arXiv:2511.13653, 2025. https: //arxiv.org/abs/2511.13653 [2] Oz Lee. The Geometric Incompleteness of Reasoning (Revision 7093c66). Hugging Face, 2025. doi: 10.57967/hf/7080. https://huggingface.co/datasets/OzTianlu/The_ Geometric_Incompleteness_of_Reasoning [3] Zixi Li. Reasoning and Jacobian Collapse: Why All Neural Networks Degenerate to RNNs, and How Structural Differentiation Breaks the Curse. Zenodo, 2025. doi: 10.5281/zenodo.17865820. https://doi.org/10.5281/zenodo.17865820 [4] Oz Lee. A Reasoning Critique of Diffusion Models (Revision 267326d). Hugging Face, 2025. doi: 10.57967/hf/7243. https://huggingface.co/datasets/OzTianlu/A_Reasoning_ Critique_of_Diffusion_Models 35
[5] Chris Olah, Nick Cammarata, Ludwig Schubert, Gabriel Goh, Michael Petrov, Shan Carter. Zoom In: An Introduction to Circuits. Distill, 2020. https://distill.pub/2020/circuits/ zoom-in/ [6] Nelson Elhage, et al. A Mathematical Framework for Transformer Circuits. Anthropic, 2021. https://transformer-circuits.pub/2021/framework/index.html [7] Alan Turing. On Computable Numbers, with an Application to the Entscheidungsproblem. Proceedings of the London Mathematical Society, s2-42(1):230–265, 1936. [8] François Chollet. On the Measure of Intelligence. arXiv:1911.01547, 2019. A Proof Details A.1 Proof of Proposition 4.8 (Full Version) Complete proof. Define state space S=Z2 ≥0with states (k, n)where k= evidence count, n= context length. Define generators: gadd(k, n)=(k+ 1, n + 1) (add evidence + context) (77) gpad(k, n)=(k, n + 1) (add context only) (78) gmean(k, n)=m=k/n (aggregate) (79) gthr(m) = 1[m>θ](threshold) (80) Target property: P(k, n)=1iff output is 1 (positive decision). Dilution hole: Hk,θ ={(k, n) : n≥ ⌈k/θ⌉} Claim: For all (k, n)∈ Hk,θ, property Pis unreachable. Proof of claim: For (k, n)∈ Hk,θ: n≥k θ>k θ−1 =⇒k n<k k/θ −1=θk k−θ< θ (81) (using k > θ for non-trivial cases). Alternatively, directly: n≥k θ=⇒n > k θ−1 =⇒k n<k k/θ −1(82) For the ceiling: if n=⌈k/θ⌉, then n≥k/θ, so: k n≤k k/θ =θ(83) Since nis integer and ⌈k/θ⌉rounds up, equality holds only when k/θ is integer. Otherwise: k n< θ (84) Therefore: gthr(gmean(k, n))=1[k/n > θ] = 0 (85) Since output is deterministically 0, no sequence of further operations can change this (thresholding is final, non-invertible step). Therefore (k, n)∈ Hk,θ is in an unreachable hole for property P= 1. 36