Making Hard Problems Easier with Custom Data Distributions and Loss Regularization: A Case Study in Modular Arithmetic
Not on the map. Why?
Abstract (arXiv)
Recent work showed that ML-based attacks on Learning with Errors (LWE), a hard problem used in post-quantum cryptography, outperform classical algebraic attacks in certain settings. Although promising, ML attacks struggle to scale to more complex LWE settings. Prior work connected this issue to the difficulty of training ML models to do modular arithmetic, a core feature of the LWE problem. To address this, we develop techniques that significantly boost the performance of ML models on modular arithmetic tasks, enabling the models to sum up to N=128 elements modulo q ≤ 974269. Our core innovation is the use of custom training data distributions and a carefully designed loss function that better represents the problem structure. We apply an initial proof of concept of our techniques to LWE specifically and find that they allow recovery of 2x harder secrets than prior work. Our techniques also help ML models learn other well-studied problems better, including copy, associative recall, and parity, motivating further study.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 19 of its 32 references that are in the map. First posted on arXiv 4 Oct 2024.
Builds on
19 of 32 references.
References · 19
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
- 2014Neural Turing Machinescited by 644
- 2023Grokking modular arithmeticcited by 83
- 2017Failures of Gradient-Based Deep Learningcited by 80
- 2023Length Generalization in Arithmetic Transformerscited by 66
- 2021Linear algebra with transformerscited by 63
- 2024Why Do You Grok? A Theoretical Analysis of Grokking Modular Additioncited by 36
- 2023Learning the greatest common divisor: explaining transformer predictionscited by 33
- 2022SALSA: Attacking Lattice Cryptography with Transformerscited by 28
- 2023Provable Advantage of Curriculum Learning on Parity Targets with Mixed Inputscited by 22
7 more
- 2024Grokking Modular Polynomialscited by 18
- 2023SALSA PICANTE: a machine learning attack on LWE with binary secretscited by 11
- 2021Analyzing the Nuances of Transformers' Polynomial Simplification Abilitiescited by 9
- 2023Learning to Compute Gr"obner Basescited by 7
- 2024Salsa Fresca: Angular Embeddings and Pre-Training for ML Attacks on Learning With Errorscited by 7
- 2024Benchmarking Attacks on Learning with Errorscited by 4
- 2024Machine learning for modular multiplicationcited by 2
Built on by
Citing papers per year: 2025: 2; 2026: 2.
4 papers.
- 2025TAPAS: Datasets for Learning the Learning with Errors Problemcited by 0
- 2025Learning Pseudorandom Numbers with Transformers: Permuted Congruential Generators, Curricula, and Interpretabilitycited by 0
- 2026Improving ML Attacks on LWE with Data Repetition and Stepwise Regressioncited by 0
- 2026Learning Large-Scale Modular Addition with an Auxiliary Moduluscited by 0
- 2026Learning Large-Scale Modular Addition with an Auxiliary Modulus8 May 2026
- 2026Improving ML Attacks on LWE with Data Repetition and Stepwise Regression5 Apr 2026
- 2025Learning Pseudorandom Numbers with Transformers: Permuted Congruential Generators, Curricula, and Interpretability30 Oct 2025
- 2025TAPAS: Datasets for Learning the Learning with Errors Problem9 Oct 2025