ResearchTrend.AI
  • Papers
  • Communities
  • Events
  • Blog
  • Pricing
Papers
Communities
Social Events
Terms and Conditions
Pricing
Parameter LabParameter LabTwitterGitHubLinkedInBlueskyYoutube

© 2025 ResearchTrend.AI, All rights reserved.

  1. Home
  2. Papers
  3. 2410.03569
22
0

Teaching Transformers Modular Arithmetic at Scale

4 October 2024
Eshika Saxena
Alberto Alfarano
Emily Wenger
Kristin E. Lauter
ArXivPDFHTML
Abstract

Modular addition is, on its face, a simple operation: given NNN elements in Zq\mathbb{Z}_qZq​, compute their sum modulo qqq. Yet, scalable machine learning solutions to this problem remain elusive: prior work trains ML models that sum N≤6N \le 6N≤6 elements mod q≤1000q \le 1000q≤1000. Promising applications of ML models for cryptanalysis-which often involve modular arithmetic with large NNN and qqq-motivate reconsideration of this problem. This work proposes three changes to the modular addition model training pipeline: more diverse training data, an angular embedding, and a custom loss function. With these changes, we demonstrate success with our approach for N=256,q=3329N = 256, q = 3329N=256,q=3329, a case which is interesting for cryptographic applications, and a significant increase in NNN and qqq over prior work. These techniques also generalize to other modular arithmetic problems, motivating future work.

View on arXiv
Comments on this paper