potentialpaper

Learning Large-Scale Modular Addition with an Auxiliary Modulus

Hanato Kikuchi, Ryosuke Masuya, Kazuhiko Kawamoto, Hiroshi Kera

AI4Math @ ICML 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Learning parity functions, or more generally modular addition, is a challenging machine learning task due to its input sensitivity. A recent study substantially scaled modular addition learning in both the number of summands and the modulus. Its key idea is to increase zeros in training sequences, reducing the effective number of summands and thus controlling training difficulty; however, this induces covariate shift between training and test input distributions. This study theoretically and empirically analyzes this side effect and proposes a covariate-shift-free method for modular addition. Specifically, we introduce an auxiliary modulus KqKq during training, which reduces wrap-around frequency and problem difficulty while preserving the same input distribution across training and testing. Experiments show strong scalability and sample efficiency: even for large input length NN, large modulus qq, and small datasets---where the sparse method fails to learn---our method achieves equal or better match accuracy and relaxed τ\tau-accuracy. For example, at N=128N=128 and q=974269q=974269, our method trained on 1M samples achieves 97.0%97.0\% τ\tau-accuracy at τ=0.005\tau=0.005, while the sparse method achieves only 9.5%9.5\% with the same data size and 93.9%93.9\% even when extended to 10M samples.

From the authors: Hiroshi Kera · edit · also an author?

Nothing yet.

How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

FromAToBDateVersionSubmitted toPDFEvidence
30 Apr 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]PDF[1]
25 May 2026AI4Math @ ICML 2026submittedAI4Math @ ICML 2026Accepted · Poster—[1]
Their titles, abstracts and, where both have a PDF, the text.Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:43 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

This paper is about training neural nets to solve modular addition of multiple inputs: adding up N numbers mod q.

Part of the difficulty in this problem is apparently the number of wrap-arounds induced by the mod operation. Earlier work identified this key issue and introduced a method of mitigating it during training by sparsifying the list of input numbers (i.e., having some fraction of them be zero). The current paper points out that this introduces a sort of distribution shift since test samples will likely not have the same sparse structure. The authors suggest a modified training scheme: one in which the modulus q is randomly beefed up to Kq some fraction of the time.

The reviewers have several significant concerns about the paper that should be addressed, to the extent possible in the limited response time:

  1. Extending to other modular arithmetic operations, e.g multiplication.

  2. Questions about natural baselines (e.g. without sparse or auxiliary training), alternative strategies (e.g., pretraining on sparse then finetuning), and experimental details.

  3. Questions about tau-accuracy and alternatives.

Final justification

The reviewers' questions were addressed satisfactorily (and in detail) by the author feedback, as a result of which all reviewers ultimately gave the paper a positive score.

Area Chair EoKB · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

This paper is about training neural nets to solve modular addition of multiple inputs: adding up N numbers mod q.

Part of the difficulty in this problem is apparently the number of wrap-arounds induced by the mod operation. Earlier work identified this key issue and introduced a method of mitigating it during training by sparsifying the list of input numbers (i.e., having some fraction of them be zero). The current paper points out that this introduces a sort of distribution shift since test samples will likely not have the same sparse structure. The authors suggest a modified training scheme: one in which the modulus q is randomly beefed up to Kq some fraction of the time.

The reviewers have several significant concerns about the paper that should be addressed, to the extent possible in the limited response time:

  1. Extending to other modular arithmetic operations, e.g multiplication.

  2. Questions about natural baselines (e.g. without sparse or auxiliary training), alternative strategies (e.g., pretraining on sparse then finetuning), and experimental details.

  3. Questions about tau-accuracy and alternatives.

Final justification

The reviewers' questions were addressed satisfactorily (and in detail) by the author feedback, as a result of which all reviewers ultimately gave the paper a positive score.

Reviewer VsoUOpenReview ↗
Rating
4/6
Confidence
4/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The main problem that this paper addresses is of training ML models on modular addition problems with large number of summands, and for a large value of the modulus. This problem is of importance for LWE attacks on post-quantum cryptography. This paper studies the pros and cons of the previous SoTA: the sparse method, and show that a good solution reduces wrap around frequency and avoids covariate shift between train and test data. The sparse method only reduces wrap around frequency, but not covariate shift. The paper proposes a method using an inflated intermediate modulus. Using this method, the authors achieve 97% τ\tau-accuracy with tolerance parameter τ=0.05\tau=0.05 with only 100K samples, whereas the previous SoTA achieves only 9.5%. When the number of samples is bumped up to 1M samples then the previous SoTA reaches around 94% accuracy which further evidence that avoiding covariate shift is a fundamental improvement in the context of machine learning and therefore allows the new method to achieve far superior accuracy with much fewer data points.

Strengths and weaknesses

Strengths

  • Avoids covariate shift unlike previous methods
  • Analysis provided in propositions 1 and 2 and the detailed analysis in appendix A and C are valuable.

Weaknesses

  • The evaluation metric seems very relaxed which is obvious in table 2 numbers reaching 100% making the evaluation weak. For example with τ\tau = 0.05, and q = 974269, the allowed distance is roughly around 49000! Which means I can make any prediction around y-49000 and y+49000 (wrapping around the modulus q). What is the reality when the tolerance is decreased?
  • Evaluation further seems unsound due to incorrectly reported training sizes, e.g. in table 2 columns vs captions.
  • Evaluation seems to be point estimates.
  • Although implementation details are available, a code implementation could be provided. This is important from no repetition of codes principles and ensures that everyone can get their hands on a good implementation which will definitely reproduce the numbers mentioned in the paper.
  • Several readability issues (see presentation issues below)
Questions

Question

  • Why is studying the problem of modular arithmetics important? Is the following scenario not better: where AI models can be supplemented with a calculator like tool which computes the modular addition in an agentic framework?
  • As I understand, this method creates a model that predicts approximate modular sums. In which down-stream task is this useful?
  • Is τ\tau-accuracy a good metric for large values of q? For example with τ\tau = 0.05, and q = 974269, the allowed distance is roughly around 49000! Which means I can make any prediction around y-49000 and y+49000 (wrapping around the modulus q).

Presentation issues

  • The first sentence of the abstract is a bit ambiguous in that it is not clear which is the generalization and which is the specialization. Even if it is obvious to many, it may not be obvious to every reader. This can be improved a bit by changing the wording.
  • Lines 23-24 has a repeated phrase.
  • Line 98 has a spurious link to Definition 1. It goes nowhere.
  • Notational consistency and introduction of notation is needed across the document. An example is the use of g and finvsqrtf_{inv_sqrt} for the same object in multiple places, e.g. lines 482-483 but also in the main text. Another is the use of DqD_q without any introduction.
  • Line 188: what is "scholar n"?
  • In table 2, it is I see two sample sizes "100K and 1M" in the caption and "1M and 10M" in the column labels.
  • Appendix A and C discuss theoretical results, extend propositions 1 and 2. Sandwiched between them is appendix B which discusses empirical results. Maybe putting A and C first as the new A and B, and then placing the original B as the new C would be better. This also improves the flow of appendix B with related appendices D and E.

Suggestions

Instead of τ-accuracy, define the worst-case τ-bound as the minimum value of τ needed to achieve 100% τ-accuracy. Now extend this to α-worst-case τ-bound := minimum value of τ needed to achieve α% τ-accuracy. Now, vary the value of α and find the values of τ needed. Plot it.

Another informative plot could be the following: just vary the values of τ and get corresponding values of τ-accuracy. Plot this. Also on this, place the random-baseline τ-accuracy, i.e., the τ-accuracy that you would get from random predictions.

Of course, do these for both your proposed method and the baseline in one single plot.

Then also provide your analysis of the plot.

Openreview will not allow you to share images, but sharing links is fine I think.

Limitations

yes

Final justification

The rebuttal was detailed and addressed my concerns.

Formatting concerns

No concerns

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the reviewer for the careful and constructive feedback, especially for valuing the covariate-shift analysis (Propositions 1–2) and for concrete evaluation suggestions (accuracy–tolerance curves and α\alpha-worst-case τ\tau-bounds). Below we follow the review structure: Weaknesses first, then Questions.

On Weaknesses

W1. τ\tau-accuracy is too relaxed / evaluation is weak

Response. The τ\tau settings follow Saxena et al. (ICML 2025) for fair comparison. Details are in Q3. In summary: (i) the printed τ=0.1,0.05\tau = 0.1, 0.05 were erroneous—the actual evaluation used τ=0.01,0.005\tau = 0.01, 0.005 (an order of magnitude stricter); (ii) under still tighter τ\tau and relative to chance (≈2τ\approx 2\tau), the ordering Ours ≫\gg Sparse ≫\gg chance persists, so the gap is not an artifact of a lenient tolerance; (iii) moreover, Section 5.1 reports exact match accuracy as the primary metric, and we do not claim τ\tau-accuracy as evidence of exact arithmetic at large qq. Tolerance sweeps and α\alpha-worst-case τ\tau-bounds appear as tables in Q3 (plots and external links are disallowed on OpenReview).

W2. Inconsistent training sample sizes in Table 2

Response. We agree: the caption (100K/1M) contradicts the column labels (1M/10M). The correct sizes are 1M and 10M (caption error). The principal result (Ours 97.0% vs baseline 9.5%) is for N=128N=128, q=974269q=974269, 1M samples (true τ=0.005\tau=0.005; see W1/Q3). The numerical values are unchanged; we will unify the caption, Abstract, and Section 5.2.

W3. Point estimates only

Response. We agree that the submission reported only single-run point estimates. We repeated the Section 5.1 exact modular addition experiments with angular embedding at 100K samples (match accuracy) for our method and the sparse method over 10 seeds (42–51), fixing our method at K=6K=6, r=0.5r=0.5 (more conservative than Table 1).

Excerpt (match accuracy %):

(N,q)(N, q) Ours mean ±\pm std (Min–Max) Sparse mean ±\pm std (Min–Max)
(16, 97) 98.23 ±\pm 0.37 (97.78–98.91) 30.89 ±\pm 1.99 (27.23–34.06)
(32, 257) 66.09 ±\pm 3.80 (59.93–73.98) 1.18 ±\pm 0.55 (0.55–1.98)
(64, 433) 15.09 ±\pm 1.84 (12.58–17.74) 0.22 ±\pm 0.03 (0.18–0.26)

Across all 9 settings, Ours min > Sparse max. The Section 5.1 sample-efficiency conclusion holds under repeated runs.

W4. Code release

Response. We agree that reproducibility is important. Training, data generation, and evaluation code are ready and will be released with the camera-ready version.

W5. Presentation issues

Response. We will correct the verified issues in the final version (claims unchanged). The sample-size inconsistency in Table 2 is addressed in W2.

  1. Abstract opening: Clarify the contrast between generalization (parity -> modular addition) and specialization of the sparse method (changing the input distribution).
  2. Lines 23–24: Remove the repeated phrase.
  3. Definition 1 reference: The definition and the reference both exist in the source. We could not reproduce a broken link.
  4. Notation: Unify symbols such as gg and define them at first use.
  5. “scholar nn”: Typographical error; the correct term is scalar nn.
  6. Appendix order: Grouping the theory appendices (A, C) first would clarify the theory-versus-experiments flow. However, the current order follows the order of in-text citations; the proposed reordering would break that alignment, so we retain the current order.

On Questions

Q1 & Q2. Why learn modular arithmetic, and where is approximate modular sum useful?

Response. A calculator is appropriate when the modular sum is already available as an external computation; that is not our goal. We study whether neural nets can learn modular addition, motivated by (1) learnability and (2) ML-based LWE attacks, where prior work shows approximate predictions can suffice.

  1. Scientific understanding of learnability. Modular addition is a known hard case for deep learning (parity q=2q=2: Shalev-Shwartz et al. 2017; Hahn & Rofin 2024). We study when and how neural nets can learn it at large NN and qq. Required samples grow with NN and qq, so a practical question is whether learning remains possible at larger scale and with fewer data.

  2. Central to ML-based LWE attacks (Q2). LWE provides public samples (A,b)(A,b) with b≈As mod qb\approx As\bmod q. SALSA and follow-ups (Wenger et al. 2022; Li et al. 2023, among others) train models to predict modular linear forms from such samples and use those predictions for secret recovery; approximate predictions already suffice for distinguishers / recovery in this pipeline. For binary secrets, As mod qAs\bmod q reduces to modular sums of AA's rows, so the hard learning subproblem is modular addition, and scaling it to large N,qN,q is a known bottleneck (Saxena et al. 2025). Our τ\tau-accuracy evaluation follows this LWE-motivated setting.

Our study focuses on sample-efficient learning of modular addition and does not report end-to-end LWE secret recovery; the utility of approximate prediction follows from those prior results. We will clarify this positioning in the Introduction.

Q3. Is τ\tau-accuracy a good metric for large qq? (including Suggestions; details for W1)

Correction. For q=974269q=974269, τ=0.005\tau=0.005 allows a distance of about 4,871 (not ∼\sim 49,000). Re-aggregation gives Sparse τ\tau-accuracy of 9.52% / 18.59% at τ=0.005\tau=0.005 / 0.010.01, matching the paper’s “τ=0.05\tau=0.05” / “τ=0.1\tau=0.1” columns. We apologize for this error, which was the direct cause of the concern.

Role of the metric. We agree that a single fixed τ\tau is insufficient to characterize learning at large qq. We use τ\tau-accuracy because (i) Saxena et al. (ICML 2025) introduced it in the LWE setting discussed in Q1–Q2, and (ii) it enables a fair comparison in Section 5.2. Our primary metric remains exact match in Section 5.1; τ\tau is a diagnostic and comparative metric for large-scale regimes.

Response to Suggestions. We conducted the evaluations you proposed—(A) τ\tau-accuracy versus τ\tau with a chance baseline, and (B) α\alpha-worst-case τ\tau-bounds—for both our method and the sparse method under the same conditions. Because OpenReview forbids file uploads and links, we report the curves as tables rather than plots.

(A) τ\tau-accuracy vs τ\tau (chance rate ≈2τ\approx 2\tau). Section 5.2 settings, 1M training samples, fixed K=5K=5, r=0.4r=0.4. Under circular distance, chance rate is theoretically ≈2τ\approx 2\tau (exact: 1/q1/q). For N=128N=128, q=974269q=974269 (%):

τ\tau Ours Sparse Chance (≈2τ\approx2\tau)
0 (exact) 0.01 0.00 ≈\approx 0.0001
0.0001 2.84 0.21 0.02
0.0005 13.52 1.00 0.10
0.001 25.83 2.07 0.20
0.005 85.81 9.52 1.00
0.01 98.14 18.59 2.00
0.05 99.92 60.99 10.00
0.10 99.93 74.11 20.00

Analysis. (1) At τ=0.001\tau=0.001 (allowed distance ≈974\approx 974), Ours 25.83% ≫\gg Sparse 2.07% ≫\gg chance 0.20% (≈2τ\approx 2\tau). (2) Our method separates from chance already at τ=0.0001\tau=0.0001 (2.84% vs 0.02%). (3) At large qq, exact match is essentially zero (Ours 0.01%). At the same τ\tau and q=974269q=974269, for N=16,32,64,128N = 16,32,64,128: Ours 87.90 / 82.52 / 72.53 / 25.83% vs Sparse 39.01 / 24.11 / 12.52 / 2.07%.

(B) α\alpha-worst-case τ\tau-bound. Minimum τ\tau needed to reach α\alpha% τ\tau-accuracy (recomputed from a 66-point discrete τ\tau grid on the same run; N=128N=128, q=974269q=974269, 1M1\text{M}):

Method 90% 95% 99% 100%
Ours ≤\leq 0.00607 ≤\leq 0.00786 ≤\leq 0.01364 ≤\leq 0.5
Sparse ≤\leq 0.35 ≤\leq 0.45 ≤\leq 0.5 ≤\leq 0.5
Chance (≈2τ\approx2\tau) 0.45 0.475 0.495 0.5

Accuracy at the bound (reference): Ours 90.9% at τ≈0.0061\tau\approx 0.0061, 95.5% at τ≈0.0079\tau\approx 0.0079, 99.4% at τ≈0.0136\tau\approx 0.0136; Sparse 91.4% at τ=0.35\tau=0.35, 97.1% at τ=0.45\tau=0.45. Our method reaches 90%/95% at approximately 50–60 ×\times smaller τ\tau than the sparse method, and 99% at τ≤0.0136\tau\le 0.0136 versus τ≤0.5\tau\le 0.5 for Sparse. However, 100% still requires τ≤0.5\tau\le 0.5 even for our method, which underscores the limits of approximate metrics.

We especially appreciate Q3 and the evaluation suggestions, which substantially strengthened the empirical case. We will incorporate the corrections and new results into the final version and welcome further discussion.

Reviewer VsoU · CommentOpenReview ↗

Dear authors,

Thanks for the rebuttal. This has strengthened the work. I will increase the score.

Authors · CommentOpenReview ↗

Dear Reviewer VsoU,

Thank you very much for your positive update. We sincerely appreciate your careful review and constructive feedback.

Best regards, The Authors

Reviewer SF7vOpenReview ↗
Rating
4/6
Confidence
3/5
Quality
3/4
Clarity
4/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper tackles the problem of learning modular addition using Neural Networks by solving an auxiliary task. Module arithematic is something current models still struggle with. This was done is previous works using an easier task which introduced sparse inputs. While this reduces the complexity of the task it leads to a covariate shift which does not scale across different ranges of q and N (i.e. size of a single data point x).

Strengths and weaknesses

Strengths:

  • Quality: Really well motivated especially in reference to the sparse-method.
  • Clarity: Good presentation with strong emphasis on theoretical and empirical analysis of current and previous works
  • Clarity: Strong reproducibility from text alone Weaknesses:
  • Significance and originality concerns: Although the method introduces a new auxiliary task it tries to carve out a novelty in an already very niche task of addition. Like the previous works extending the auxiliary task to Modular Multiplication would be an interesting domain if theoretically possible.
  • Experiment Concerns: Some experimental rigour seems still due in terms of grid search concerns. Baseline fairness and etc. Please refer to the questions for more on this.
Questions
  • Baseline: Would be also interesting to see a baseline without sparse or auxiliary training to be able to isolate the effect of token and angular embedding.
  • Combining with Sparse: A very natural and potentially useful missing ablation in my opinion is to finetune the sparse training with auxiliary training to see if a combination is in fact something that would be a better combination than just one or the other. If it works the sparse method may not be fundamentally limited or atleast it may not be a bad initial training phase. If the authors decide to do this it would make sense to do this with the same number of total samples and compute budget for 1) sparse method 2) auxiliary task method 3) sparse -> auxiliary
  • Sparse + Simple Finetuing: Did you try pretraining with the sparse distribution and then fine-tuning on the uniform/dense distribution? This seems like a direct way to address the covariate shift while retaining the optimization benefits of sparse examples.
  • It is also unclear whether a similar grid search is allowed for the baseline for their hyperparameters. Is this possible for e.g. parameters that control sparsity in input?
  • The abstract states (N=64, q=974269) gives 97.0% and baseline 9.5%, but Table 2 appears to show these numbers for (N=128, q=974269). Also Section 5.2 says N \in {16,32,64}, while Table 2 includes (N=128). This might be a mistake worth fixing.
  • I think it will definitely work towards making the current work more significant if, like Saxena et al., the authors also try to implement modular multiplication and compare some preliminary results with the sparse baseline. The concepts that help for modular addition should theoretically apply similarly to other tasks.
Limitations

yes

Final justification

The authors have additionally ablated over several requested training/finetuning experiments which do not expose any overlooked aspects. The authors did more experiments which showed general applicability on the modular multiplication which showed positive results however not across all settings. These drawbacks, as the authors said, will be explicitly mentioned in the limitations section which should be beneficial for the community at large. For this reason my recommendation now leans toward accepting the work.

Formatting concerns
3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the reviewer for the careful and constructive feedback, and for concrete suggestions that strengthen the rigor of our comparisons. Below we follow the review structure: Weaknesses first, then Questions.

On Weaknesses

W1. Significance / originality

Response. We focus on modular addition because it is significant on both theoretical and applied grounds.

Theoretically, parity (q=2q=2) and modular addition are hard for deep learning due to extreme input sensitivity (Shalev-Shwartz et al. 2017; Hahn & Rofin 2024). Modular addition has therefore become a standard testbed for studying how models acquire input-sensitive functions, with substantial work on learning mechanisms (e.g., Nanda et al. 2023; Power et al. 2022; Zhong et al. 2023).

On the applied side, modular-addition learning is central to ML-based attacks on LWE. SALSA and follow-ups (Wenger et al. 2022; Li et al. 2023, among others) predict modular linear forms from LWE samples and use those predictions for secret recovery. For binary secrets, As mod q\mathbf{As} \ \mathrm{mod} \ q reduces to modular addition, and scaling to large N,qN, q is a bottleneck (Saxena et al. 2025). For large-scale modular-addition learning, the sparse method of Saxena et al. is the SoTA; we improve sample efficiency at the same scale while avoiding its covariate shift. That said, SALSA-style attacks also involve dataset design and substantial computational cost, so this submission focuses first on improving their core component—modular-addition learning.

We also explore an extension to modular multiplication; see Q1 (positive indications at small scale; large-scale regimes remain future work).

W2. Experimental rigor (baseline fairness / grid search, etc.)

Response. We address the concerns about the rigor of comparison in Questions as follows:

  • Standard baseline (no sparse method / no auxiliary) and isolating embedding effects -> Q2
  • Matched-budget Sparse -> Auxiliary / Sparse -> Uniform -> Q3 & Q4
  • Grid search for the baseline and fairness -> Q5

On Questions

Q1. Extension to modular multiplication?

Response. As the reviewer suggests, the auxiliary-task approach is not specific to modular addition and is in principle applicable to multiplication. We designed a multiplication-oriented auxiliary and ran preliminary experiments. Scaling to practically relevant large regimes remains incomplete; results below are single-seed and limited, so we do not claim broad generalization—yet they support the applicability of the framework.

Task: fq(x)=(∏ixi) mod qf_q(\mathbf{x})=(\prod_i x_i)\bmod q, token embedding, match accuracy. Multiplication is more sensitive to the product structure than addition. While addition uses modulus KqKq to reduce wrap-around, mod qK\mathrm{mod} \ q^K is a natural difficulty-reducing auxiliary along the product scale. As in addition, we keep the input distribution fixed and replace the target with mod qK\mathrm{mod} \ q^K with probability rr.

Preliminary results (N=8N=8, 1M samples, K=2K=2, r=0.5r=0.5). Comparing mod qK\mathrm{mod} \ q^K, Sparse, and Standard (no auxiliary):

(N,q)(N, q) mod qK\mathrm{mod} \ q^K Sparse Standard
(8, 31) 98.1 99.9 3.19
(8, 97) 1.11 99.9 1.05
(8, 257) 0.38 0.40 0.54

At N=8N=8, q=31q=31, mod qK\mathrm{mod} \ q^K reaches 98.1% (comparable to Sparse) and substantially exceeds Standard (3.19%), showing that a suitable auxiliary can induce learning for multiplication. At q=97q=97, Sparse succeeds while mod qK\mathrm{mod} \ q^K stays near chance level; at q=257q=257 all methods fail.

We use token embedding here: the angular embedding (x↦(cos⁡(2πx/q),sin⁡(2πx/q))x\mapsto(\cos(2\pi x/q),\sin(2\pi x/q))) is an inductive bias for modular addition, and Saxena et al.\ likewise use token embedding for multiplication. Under token embedding, however, the output-head dimension for mod qK\mathrm{mod} \ q^K becomes large qKq^K; a multiplication-appropriate representation remains future work.

In summary, the extension is theoretically and methodologically viable, with positive indications in a small setting. Remaining issues are scaling to larger N,qN,q and representation design. The main contribution remains modular addition; we will note the multiplication direction briefly in Limitations.

Q2. Can a baseline without Sparse/Auxiliary isolate token vs angular effects?

Response. Yes. We added a Standard baseline (ordinary training on the uniform distribution, without the sparse method or the auxiliary) to isolate the contribution of the embedding alone. Performance gains are primarily attributable to the auxiliary objective; the choice of embedding is complementary.

Setup. Same as Table 1, 100K samples, match accuracy (%). Ours / Sparse from the paper; Standard is new. Representative settings below (same pattern elsewhere; full tables in the final version).

(a) Token embedding

(N,q)(N, q) Ours Sparse Standard
(8, 31) 89.1 3.2 3.0
(16, 97) 6.2 1.0 0.9
(32, 257) 0.5 0.4 0.5

(b) Angular embedding

(N,q)(N, q) Ours Sparse Standard
(16, 97) 98.9 32.2 27.5
(32, 257) 73.5 0.6 0.4
(64, 433) 29.0 0.2 0.3

Token embedding alone remains near chance level. Angular embedding alone helps on easier settings (e.g., 27.5%) but stays substantially below Ours (98.9%), and Standard is near chance at large NN. We will add a Standard column to Table 1.

Q3 & Q4. Does Sparse -> Auxiliary or Sparse -> Uniform work?

Response. Under matched total sample size and the same model, sparse pretraining yields no additional improvement over Auxiliary-only, and Sparse -> Uniform improves Sparse-only only marginally; both remain substantially below Auxiliary-only.

Setup. Angular embedding, total budget 100K. Staged training: sparse 75K pretrain, then 25K with Aux or Uniform (weights only; no optimizer state; lr 3×10−53\times10^{-5}, warmup 0.05). Sparse-only / Aux-only match Table 1(b). Representative settings (same conclusions in all 9; full table in the final version):

(N,q)(N, q) Sparse only Aux only (Ours) Sparse -> Uniform Sparse -> Aux
(16, 97) 32.2 98.9 32.6 63.8
(32, 257) 0.6 73.5 4.0 21.6
(64, 433) 0.2 29.0 0.3 0.3
  • Q3: Sparse -> Aux < Aux-only in all 9 settings (e.g., 63.8% vs 98.9%). Under this 75K/25K matched budget, we find no extra gain supporting sparse as a useful initial stage.
  • Q4: Sparse -> Uniform outperforms Sparse-only in 7/9 settings, but gains are small (e.g., 32.2% -> 32.6%). Dense fine-tuning may partially mitigate covariate shift but is insufficient; the auxiliary is substantially more effective.

Q5. Was an equal grid search allowed for the baseline?

Response. For the sparsity parameters of the sparse method, we did not perform our own grid search. We adopted the setting reported as best by Saxena et al. (g(z)∝1/N−z+1g(z)\propto 1/\sqrt{N-z+1}). All other conditions (model, sample size, number of steps, evaluation) are identical for both methods.

For our method, we perform a grid search over $K = 4,\ldots, 9 $ and r=0.1,…,0.4r = 0.1,\ldots,0.4 at 100K samples for each (N,q)(N,q), and reuse the selected values for all sample sizes (selection metric: match accuracy for token embedding; τ\tau-accuracy for angular embedding).

Moreover, Table 3 reports the minimum, average, and maximum over the full search space: even under the worst (K,r)(K,r), our method outperforms the baseline (e.g., angular embedding, N=64N=64, q=433q=433: min 34.0% vs 11.4%; token embedding, N=16N=16, q=97q=97: min 76.1% vs 1.1%). The performance gap cannot be explained by unequal search alone. We will state this explicitly in the experimental setup.

Q6. Abstract N=64N=64 vs Table 2 N=128N=128

Response. We acknowledge the notational error. The principal result (Ours 97.0% vs.\ Sparse 9.5%) is for N=128N=128, q=974269q=974269, 1M samples. Section 5.2 covers $N = 16,32,64,128 $ (N=128N=128 was omitted in the text). The Abstract statement “N=64N=64” is erroneous. Separately, the Table 2 caption reporting 100K/1M should read 1M/10M. The reported numerical values are correct; only the labels are wrong. We will correct the Abstract, Section 5.2, and the caption.

Under the added Standard baseline and staged-training comparisons, the central claim holds: the auxiliary enables learning without covariate shift and substantially outperforms matched-budget sparse training and staged fine-tuning. We will incorporate these results and welcome further discussion.

Reviewer SF7v · CommentOpenReview ↗

I thank the authors for the really convincing rebuttal. I find the extension to modular multiplication extremely beneficial to strenghten the general applicability of the method and hopefully it naturally exposes an avenue for future research. As the authors mentioned, a brief mention in the limitation section would make the work more valuable to the community. Sparse -> Auxiliary or Sparse -> Uniform experiment were equally thorough and cleared up my doubts. I have updated my score to reflect this.

Authors · CommentOpenReview ↗

Dear Reviewer SF7v,

Thank you very much for your positive update. We sincerely appreciate your thoughtful feedback and your engagement with our paper.

Best regards,

The Authors

Reviewer 4fHVOpenReview ↗
Rating
5/6
Confidence
4/5
Quality
4/4
Clarity
4/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper introduces a novel training method to teach neural networks to perform modular addition (the task of adding up NN input integers and returning the sum modulo qq). This operation is critical for (1) attacking the Learning with Errors (LWE) problem in post-quantum cryptography, and (2) understanding the limits of deep learning.

Learning modular addition is difficult because of the "wraps" (discontinuities) introduced by the modulo operation. These wraps cause the output to be highly sensitive to individual inputs. Therefore, the expected number of wraps encountered is a measure of difficulty of the algorithmic datasets used for training/testing. Previous methods have reduced this training difficulty by injecting zeros (sparsifying) into the training inputs. However, this creates a distribution shift between the training and testing data, where the latter is comprised of denser inputs than the former.

The authors overcome this discrepancy by stochastically introducing an auxiliary modulus KqKq (K>1K > 1) into the training objection in addition to qq. Since KqKq results in a fewer number of wraps, it reduces the training difficulty. Therefore, the training process can be made easier while keeping train and test distributions identical. The authors theoretically demonstrate that their method achieves the same reduction in computational difficulty as the sparse approach and empirically show that it delivers superior performance and sample efficiency as both the number of summands and the modulus size increase.

Strengths and weaknesses

Quality

This paper studies an important problem, and it encompasses well-crafted theoretical justifications and experiments. Proposition 1 establishes the generalization problem associated with the sparse method, and the proposition 2 theoretically shows why the auxiliary modulus reduces the problem difficulty. However, the authors have dropped the floor function from the theoretical analysis for the sake of simplicity . Also, in the empirical study, the authors do not report the error bars computed over repeated runs, undermining the empirical findings. While the authors discuss these limitations, I believe incorporating them can strengthen the paper.

Clarity

The paper is written well. It is quite easy to follow. It includes a cohesive narrative. However, I think the angular embedding deserves a slightly better treatment. Given the inherent periodic nature of the modulo operation, baking an inductive bias favoring the periodicity will have non-trivial consequences. I think the authors should discuss this in depth and even add an ablation study that includes the angular embedding without the auxiliary modulus objective.

Significance

The proposed method achieves significant gains in performance and sample efficiency compared to the baselines. This is achieved through a simple but elegant fix that is theoretically grounded. While the authors note that this problem has significant implications for post-quantum cryptography, the current discussion may not be sufficient for readers who are not experts in the area. Adding a dedicated paragraph that explains these implications and their broader significance would improve the paper's accessibility and provide valuable context for a wider audience.

Originality

This paper proposes a simple but elegant method (adding an auxiliary objective) to improve the training of neural networks aimed at performing modular addition. The method is sufficiently novel and it successfully overcomes an issue encountered by a previous method. But I think the angular embedding could also be playing a non-trivial role here. The authors should include an empirical study that decouples the contributions rendered by the auxiliary objective and the angular embedding.

Questions

Suggestions

  • Expand the experiments to have repeated runs and include error bars.
  • Emphasize the effect of the angular embedding. Add an ablation study where the network includes the angular embedding but not the extra objective.
  • Expand the experiments to include models other than Transformers (e.g. a simple MLP)
  • Theoretical analysis where the floor function is not dropped (not a much, but nice to have)
Limitations

Yes

Formatting concerns

None

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the reviewer for the positive and constructive assessment, and for concrete suggestions that strengthen the empirical and explanatory parts of the paper. Below we follow the review structure: Weaknesses first, then Questions / Suggestions.

On Weaknesses

W1. No repeated runs / error bars (Quality)

Response. We agree that the submission reported only single-run point estimates. Full results over 10 random seeds are given in S1. In summary: under Section 5.1 with angular embedding, 100K samples, and match accuracy, comparing our method with the sparse method over 10 runs yields Ours min > Sparse max in all 9 settings, so the conclusion remains unchanged.

W2. Angular embedding contribution not isolated (Clarity / Originality)

Response. We agree that angular embedding can introduce a periodic inductive bias. Isolation via a Standard condition (neither the sparse method nor the auxiliary) and a conceptual separation are detailed in S2 & S3. In summary: performance gains are primarily attributable to the auxiliary objective; angular embedding is complementary (e.g., N=16N=16, q=97q=97: Standard 27.5% vs Ours 98.9%).

W3. Floor function omitted in the theory (Quality)

Response. As Reviewer 4fHV noted, Proposition 2 omits the floor function for simplicity. As your suggestion, we checked and confirmed that retaining the floor preserves the conclusion that the auxiliary modulus reduces the expectation of wraps. Because the absolute error between the floored and floor-free expectations is at most 11, for large NN they approximately coincide. We will make this statement and proof more explicit in the final version.

W4. PQC / LWE link unclear for non-experts (Significance)

Response. We agree that the explanation was insufficient. We will add a short Introduction paragraph that explains the connection to post-quantum cryptography and its broader significance for non-expert readers.

On Suggestions

S1. Repeated runs and error bars (details for W1)

Response. We repeated the exact modular addition experiments in Section 5.1 with angular embedding at 100K samples (match accuracy)—the regime in which sample efficiency is most apparent—for our method and the sparse method over 10 seeds (42–51). Our method uses fixed K=6K=6, r=0.5r=0.5 (more conservative than the per-setting best K,rK,r in Table 1).

(N,q)(N, q) Ours mean$\pm$std Ours Min–Max Sparse mean$\pm$std Sparse Min–Max
(16, 97) 98.23 ±\pm 0.37 97.78–98.91 30.89 ±\pm 1.99 27.23–34.06
(16, 257) 85.79 ±\pm 1.14 84.37–87.88 11.81 ±\pm 0.98 10.00–13.25
(16, 433) 69.18 ±\pm 3.24 62.61–73.41 7.14 ±\pm 0.72 6.04–8.43
(32, 97) 91.71 ±\pm 1.92 86.37–92.81 3.31 ±\pm 1.42 1.49–5.72
(32, 257) 66.09 ±\pm 3.80 59.93–73.98 1.18 ±\pm 0.55 0.55–1.98
(32, 433) 45.00 ±\pm 3.87 36.76–50.22 0.72 ±\pm 0.43 0.26–1.76
(64, 97) 51.50 ±\pm 4.87 43.35–59.12 0.98 ±\pm 0.08 0.83–1.07
(64, 257) 24.61 ±\pm 4.41 18.71–30.98 0.36 ±\pm 0.05 0.32–0.46
(64, 433) 15.09 ±\pm 1.84 12.58–17.74 0.22 ±\pm 0.03 0.18–0.26

Across all 9 settings, Ours min > Sparse max (e.g., at N=64N=64, q=433q=433: 12.58>0.2612.58 > 0.26). Although there is variation across seeds, the advantage does not depend on the choice of seed.

S2 & S3. Emphasize angular embedding; evaluate without the auxiliary (details for W2)

Conceptual separation. Angular embedding maps x↦(cos⁡ϕ,sin⁡ϕ)x\mapsto(\cos\phi,\sin\phi) with ϕ=2πx/q\phi=2\pi x/q, which makes the periodic structure modulo qq easier to represent. The auxiliary modulus leaves the input distribution and representation unchanged and instead modifies the training targets to reduce wrap-around frequency. The two operate through different mechanisms (representation vs training objective).

Experiments. Same setting as Table 1, 100K samples, match accuracy (%).

(a) Angular (embedding-only contribution)

(N,q)(N, q) Ours Sparse Standard
(16, 97) 98.9 32.2 27.5
(16, 257) 93.0 11.8 6.4
(16, 433) 80.7 6.8 8.9
(32, 97) 95.6 4.2 0.9
(32, 257) 73.5 0.6 0.4
(32, 433) 57.5 0.9 0.3
(64, 97) 83.2 0.9 1.1
(64, 257) 43.2 0.3 0.3
(64, 433) 29.0 0.2 0.3

(b) Token (the auxiliary does not depend on the embedding type)

(N,q)(N, q) Ours Sparse Standard
(8, 31) 89.1 3.2 3.0
(8, 97) 13.9 0.9 0.9
(16, 31) 58.4 3.3 3.0
(16, 97) 6.2 1.0 0.9
(32, 31) 33.1 2.9 3.1
(32, 97) 1.7 1.1 0.9

Angular embedding with Standard training yields moderate accuracy on easier settings (e.g., 27.5%) but remains substantially below our method (98.9%) on the same setting, and is near chance level at large NN. Under both embeddings, our method substantially exceeds Standard, so the large gains at 100K samples are attributable to the auxiliary. The reviewer’s “angular without auxiliary” condition corresponds exactly to the Standard column. We will add it to Table 1 and expand the discussion of Approach 2.

S4. Evaluate non-Transformer models (e.g., MLP)

Response. The method modifies only the training objective and is, by design, independent of architecture; however, we were unable to conduct MLP experiments within the rebuttal deadline. Current empirical evidence is limited to Transformers; we will state this in Limitations and leave evaluation on other architectures to future work.

Your suggestions substantially improve empirical robustness and clarity. We will incorporate the above into the final version and welcome further discussion.

Reviewer 4fHV · CommentOpenReview ↗

Thank you for the rebuttal

Dear authors,

Thank you for addressing and clarifying the concerns I had raised. I will maintain my score.

Best, 4fHV

Authors · CommentOpenReview ↗

Dear Reviewer 4fHV,

Thank you very much for your positive response. We sincerely appreciate your thoughtful review and are pleased that our rebuttal addressed your concerns.

Best regards,

The Authors

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…