Title: Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks
Venue: NeurIPS 2025
Accepted: yes
Keywords: mechanistic interpretability

interpretability

universality

modular addition

group theory
Abstract: We propose a testable universality hypothesis, asserting that seemingly disparate neural network solutions observed in the simple task of modular addition actually reflect a common abstract algorithm. While prior work interpreted variations in neuron-level representations as evidence for distinct algorithms, we demonstrate---through multi-level analyses spanning neurons, neuron clusters, and entire networks---that multilayer perceptrons and transformers universally implement the abstract algorithm we call the approximate Chinese Remainder Theorem. Crucially, we introduce approximate cosets and show that neurons activate exclusively on them. Furthermore, our theory works for deep neural networks (DNNs). It predicts that universally learned solutions in DNNs with trainable embeddings or more than one hidden layer require only $\mathcal{O}(\log n)$ features, a result we empirically confirm. This work thus provides the first theory‑backed interpretation of \textit{multilayer} networks solving modular addition. It advances generalizable interpretability and opens a testable universality hypothesis for group multiplication beyond modular addition.


Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper presents a universal algorithm -  through the notion of approximate cosets - to explain learned feature representations in models solving modular arithmetic.\n\nSTRENGTHS AND WEAKNESSES:\nStrengths:\n- The abstraction is useful since it unifies previous interpretations of learned features in modular arithmetic datasets, as well as provides a universal testable hypothesis.\n- The authors perform extensive sets of experiments, across various architectures and range of moduli, which shows that their claims are universally true.\n\n\nWeaknesses: \n- It would be useful if Section 4.1, Approximate cosets, can be rewritten to distinguish between precise cosets and approximate cosets, maybe with an example.\n- It wasn't immediately obvious why activation on approximate cosets can help the model solve modular arithmetic.\n- Missing reference to previous work : the order-1 sinusoids in layer 1 was analyzed in [1], Section 2.2.\n\nQUESTIONS:\n- Definition 4.2 doesn't clarify what $c, d$ are in the particular context. In particular, how does $d$ which is a function of $f, n$ relate to $c$? \n\n- The authors show that the simple neuron model activates on approximate cosets with ReLU activation. How does this extend to smooth activations like tanh and quadratic?\n\n- The assumption that training converges to simple neuron models, may not necessarily be true, as Ref. 6 in the paper (Fig 5) shows that the final trained model differs from the \"simple neuron model\". This is however not in conflict with the accuracy remaining unchanged in Fig. 6 of the paper, since the simple neuron model can give high accuracy but high MSE loss.\n\n- In Section 4.4 \"depth's effect on neural preactivations\", what exactly do the authors mean by fitting cos(a+b), cos a + cos b ? What are the fitting parameters in each case?\n\nLIMITATIONS:\n- While the paper addresses applications to discrete group operations, insights on how to generalize this notion for arbitrary tasks, including continuous groups, is missing. For example, what is the equivalent of the \"simple neuron model\" for a continuous group like $U(1)$? \n\n- Apart from that, I think the authors acknowledge other important limitations.\n\n[1] Doshi, D., Das, A., He, T., \\& Gromov, A. (2024). To grok or not to grok: Disentangling generalization and memorization on corrupted algorithmic datasets. In Proceedings of the International Conference on Learning Representations (ICLR). https://openreview.net/forum?id=UHjE5v5MB7\n\nOverall, I feel the paper does a good job of tackling an important question, but could do with some improvements.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "CLARITY": 2, "IMPACT": 3, "ORIGINALITY": 4, "DATE": "2025-06-24"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper introduces a unifying theory to show how the model learn to sum two numbers mod $n$. \n\nThey introduce the aCRT idea and show that NN model requires $O(\\log n)$ features, which is the upper bound of the number of prime factors which divides $n$. aCRT theory in conjunction with the experimental section shows also why NN networks solve modular addition.\n\nSTRENGTHS AND WEAKNESSES:\nS1. The most important contribution is how authors unified the theory behind modular arithmetic disseminated across multiple works into a single theory. Also, although I didn't check all the details of the theorems, it sounds pretty right.\n\nS2. Authors opened a new route on the mechanical interpretability, without looking only at the model weights only or PCA style analysis, but more holistically at the entire model itself. \n\nS3. The experimental section is just enough to show results that are coming from the theory.\n\nW1. I suggest authors to change the \"spectacular\" wording used in the abstract: I am not sure this understanding cannot be easily extended to other modular tasks, especially when other operations are introduced. \n\nObservation. I probably need more explanations on how model goes from coset to the final output representation, it's not super clear from the writing. It's written in Remark 4.5 that \"the argmax of ... selects the correct answer\", but I am interested to clearly understand the mechanism to select the correct answer.\n\nQUESTIONS:\nQ1. Do you have an explanation of why 1 layer model cannot learn this? Is it related to the famous paper from Antrophic about induction head and non-learnability of the copy task from 1 layer model?\n\nQ2. Going from $O(\\log n)$ to $O(1)$ features is extremely important. Can we find some particular versions of NN with some form of induction heads to effectively use less features?\n\nLIMITATIONS:\nyes", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "CLARITY": 3, "IMPACT": 2, "ORIGINALITY": 3, "DATE": "2025-06-29"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper examines the mechanism by which neural networks solve the modular addition task and advances a testable universality hypothesis. While prior studies have attributed diverse internal representations—such as the block and pizza algorithms—to fundamentally different learned solutions, the authors argue that these can be unified under a single abstract algorithm, namely the approximate Chinese Remainder Theorem (aCRT). A key theoretical contribution is the derivation that deep neural networks (DNNs) require only $O(\\log n)$ features to solve modular addition, matching the empirical results.\n\n\n**Overall Recommendation**\nThe paper presents an interesting attempt to unify multiple mechanisms by which DNNs solve modular addition tasks. However, it lacks a clear articulation of how the proposed aCRT framework differs from and subsumes prior interpretations. Providing a clearer intuition explanation  would substantially enhance the contribution and may warrant a higher score.\n\nSTRENGTHS AND WEAKNESSES:\n**Strengths**\n\n- Clear and straightforward setup\n\n- The paper offers a conceptually compelling attempt to unify disparate neural network mechanisms for modular addition within a single theoretical framework, called the approximate Chinese Remainder Theorem. The motivation and ides are interesting.\n\n- In illustrating how many frequencies are needed to instantiate the aCRT, Figure 3 provides strong empirical support for the theoretical result established in Theorem 4.7.\n\n**Weakness**\n-  The formal definitions (Definition 4.1, 4.2 and 4.3 ) are difficult to follow and lack sufficient intuitive grounding. To enhance clarity and accessibility, it is recommended that the authors illustrate key concepts—such as step size, frequency normalization, and approximate sets—through simplified, concrete examples. In addition, the manuscript would benefit from a clearer articulation of the motivation and underlying intuition behind these definitions.\n- From the reader’s perspective, the proposed explanation based on the approximate Chinese Remainder Theorem offers an alternative perspective on how neural networks solve the modular addition task. However, it remains unclear whether this explanation genuinely subsumes prior interpretations—such as the pizza and clock algorithms—or merely stands as another competing account. The manuscript lacks a clear theoretical or intuitive justification for why these previously observed mechanisms can be interpreted as specific instances of the proposed abstract algorithm. To strengthen the unifying claim, the authors are encouraged to provide deeper theoretical insights or illustrative examples demonstrating how and why these distinct algorithmic patterns emerge as manifestations of their framework.\n- The authors draw conclusions based on a narrow set of experimental conditions, while the phenomena they aim to unify were originally observed in diverse settings.  The paper would be more convincing if it provided experimental evidence from the original settings used by others and demonstrated that the coset explanation holds consistently across different settings for the same task.\n\nQUESTIONS:\n- Could the proposed explanation be extended to modular addition tasks with longer length, i.e., $a_1 + \\cdots+a_k (\\text{mod}   p)$? \n-  Could the authors clarify, perhaps through a simple example, how the approximate Chinese Remainder Theorem is applied to modular addition? Traditionally, the Chinese Remainder Theorem addresses systems of congruences rather than modular addition itself.\n\nLIMITATIONS:\nyes", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 3, "CLARITY": 3, "IMPACT": 2, "ORIGINALITY": 3, "DATE": "2025-06-30"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis work presents a theory of how ReLU neural networks (MLPs and Transformers) learn to perform modular addition. The algorithm implemented by the network is termed the approximate Chinese Remainder Theorem (aCRT). This is achieved by forming structures called approximate cosets - a generalisation of cosets which define equivalence classes within the cyclic group defined by the modulo operator. The generalisation to approximate cosets then lets sets of \"close\" cosets be treated equivalently. Empirical experiments support that neurons in networks trained to perform modular addition can be replaced by \"simple neurons\" - neurons specialised to specific frequencies - without a significant drop in performance, support the notion that the networks are learning the aCRT.\n\nSTRENGTHS AND WEAKNESSES:\n# Strengths\n## Quality\nThe work does a good job of covering the theoretical background on group theory. Particularly sections 1, 2 and 3 are particularly effective at contextualising the work and also introducing the technical details of modular arithmetic. The assumptions necessary for the theory are stated clearly and the design of the experiments is well suited to establishing the validity of the assumptions. Precise definitions are given for the necessary concepts. Overall, the goals of the work are clear and the theory presented is precise with the necessary empirical support to justify the framework.\n\n## Clarity\nI reiterate that I think the first few sections (up to Section 4) are very well done and support clarity immensely. Figures, particularly Figure 2, are helpful with sufficiently detailed captions to aid understanding. I also appreciated the helpful analogies which help broaden the applicable audience of the work by given more readers something to related to - for example the analogy to the breadth-first search on Lines 161 to 168. The notation used is intuitive and consistent which aids clarity.\n\n## Significance\nThe claimed findings of this work unify a number of different perspectives on a topic which has received quite a bit of recent interest. Thus, the work stands to be highly significant. I do have some questions about the precision of the framework, but taking the claims on their own merit then I think this work will likely inform a lot of subsequent work and provide a useful perspective on the emergent behaviour of neural networks on algorithmic tasks. I also find the comparison between MLPs and Transformers here useful and the general lack of a very clear behavioural difference is interesting as I usually only associate these sorts of tasks (and mechanistic interpretability broadly) with Transformers.\n\n## Originality\nSimilar to the point on significance, I think that the combination of recent ideas from the literature being combined is original and results in a potentially powerful framework for understanding the sub circuits responsible for modular addition. The approximation to the CRT is also new and so there is a decent amount of originality overall. The originality is also supported by the detailed background in Section 2 which helps make it clear what is new to this work.\n\n# Weaknesses\n## Clarity\nSection 4 and the following sections do lose some of the clarity which was fantastic up to that point. For example, the equations on the bottom of page 3 are foundational to the rest of the work (introducing the very concept of a simple neutron) but introduced quickly in comparison to the previous concepts. I also just found the notation of $\\omega(A,B)$ to be a bit unintuitive as it is the dot product of an embedding $U$ with a set of weights not depicted as parameters to the function. Secondly, Theorem 4.7 and Corollary 4.8 are the main theoretical results and yet they are stated quite bluntly, with little attempt to provide intuition or any sort of proof sketch. Some intuition on why is the key equation of interest here $m' -h(k) >\\delta m'$ would be very helpful. As a minor point I also think writing this as $m'(1-\\delta) > h(k)$ would be more intuitive and in line with the point of the theorem.\n\n## Quality\nSome of the results of the theory appear to be true by construction or at least the conclusions drawn seem to not be wholly justified. I am hoping these concerns are more a consequence of my own misunderstanding. Firstly, Figure 1 shows the preactivations of a neuron where the frequency has been normalised. It is claimed that this figure shows the qualitative equivalence of the neurons, but to me everything about it seems different except for the frequency. The range of values and the phase are different, so it is unclear what qualitative property I should be focusing on here. Secondly, the general approach of Section 4.4 is a bit of a concern, but also the statement on Lines 188 and 189 which says that all architectures trained to perform modular addition are abstracted by approximate cosets. I am not certain what the alternative would be - is this not true by virtue of the network being trained to perform modular addition itself? This alone does not seem to be a tight enough correspondence to draw conclusions about the actual circuitry of the network itself. Relatedly, in Figure 7 for example there are points where the $R^2$ value is as low as $0.2$ to $0.3$ between the network and simple neutron replacement but then there is still a green tick (this occurs in Clock: $1^{st}/4)$ for example. The green ticks presenting no loss in accuracy is used as the key point demonstrating that simple neurons are a good abstraction but this just makes me thing the green arrows are not a precise enough measure of success when it can have such as high range of $R^2$ values. Finally, in Theorem 4.7, it appears strange to me that the bound is given in terms of the maximum output logic across the dataset ($m'$) when it is compared to individual output logics $(h(k))$. I appreciate that the point is to show that sufficiently large bounds exists between the maximum logit and all possible incorrect logins, but the fact that this is not done per data point seems to make this quite imprecise. I suspect this question has more to do with my difficulty with the clarity of this portion of the paper.\n\nQUESTIONS:\n1. What qualitative differences should I be noting in Figure 1.\n2. Why is an $R^2$ score of $0.3$ acceptable in Figure 7 as long as the green tick is there?\n3. How does the presence of a green tick in Figure 6 and 7 corresponding to the actual behaviour or representations of the network.\n4. Why is the maximum output logit over the entire dataset used in Theorem 4.7 and is there no tighter bound for this?\n\nI would definitely be inclined to raise my score if some of the questions were answered and it turns out I have missed something important.\n\nLIMITATIONS:\nOverall the assumptions of the work are clearly stated and the Discussion section is fair and stated the necessary limitations.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "CLARITY": 3, "IMPACT": 3, "ORIGINALITY": 3, "DATE": "2025-07-02"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper presents a novel theoretical framework for understanding how neural networks solve modular addition tasks through a method called aCRT. The authors propose that various neural network architectures utilize the same underlying algorithm to tackle these tasks, relying on a mechanism based on approximate cosets.  The paper also extends the framework to group multiplication tasks, offering empirical results to support the validity of the proposed theory.\n\nSTRENGTHS AND WEAKNESSES:\nStrengths:\n- This paper presents a novel approach by unifying previous interpretations of modular addition and extending this to group multiplication, which could have broader implications for understanding neural network mechanis\n- The concept of aCRT and the use of approximate cosets to explain modular addition provides a new perspective on neural network behavior and offers potential computational benefits, improving efficiency.\n- The theoretical framework is backed by solid empirical results that demonstrate its applicability to neural network architectures.\n \nWeaknesses:\n- The experiments in the paper primarily focus on modular addition tasks, with limited validation in more complex or real-world tasks. While the theoretical framework is strong, there is less discussion on its practical applications. Could you provide more experiments on the framework's application to more complex tasks, especially those beyond modular addition and group multiplication? This would help better understand the framework's generalizability and practical feasibility.\n- The paper introduces the aCRT framework but does not directly compare it with existing similar methods. A comparison with existing approaches would offer clearer insights into the advantages and limitations of the framework in practical applications.\n\nQUESTIONS:\nHow does the proposed framework extend beyond modular addition? Can you provide experiments showing its applicability to more complex tasks? How does the framework apply to tasks beyond modular arithmetic or group multiplication? Are there limitations in generalizing the aCRT framework to other operations? I would appreciate some clarification on these points, particularly in the context of LLM applications. How could aCRT be applied to LLMs? Can it improve efficiency or interpretability, especially for tasks like reasoning or generation?\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 4, "CLARITY": 3, "IMPACT": 3, "ORIGINALITY": 4, "DATE": "2025-07-04"}