Prime Fourier Embeddings: A Principled Basis for Modular Arithmetic

Hyunsang Hwang, Suhyun Bae, Donghun Lee
6/22/2026
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

Numbers have algebraic structure that standard neural embeddings often fail to expose. We introduce Prime Fourier Embeddings (PFE), which encode integers as prime-indexed (cos, sin) pairs derived from the harmonic analysis of Q, providing a pre-structured representation in which modular arithmetic reduces to selecting the relevant prime channel rather than discovering algebraic structure from scratch. We prove that any linear map equivariant with respect to the product group action on PFE must be block-diagonal with one independent block per prime -- a consequence of Schur's lemma applied to the resulting character decomposition. For square-free composite moduli, the Chinese Remainder Theorem predicts which prime channels are task-relevant. Both predictions are confirmed empirically: ablation studies show specialization ratios exceeding 500x between task-relevant and task-irrelevant channels, with perfect in-distribution test accuracy across all square-free composite moduli tested.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{hwang2026prime,
  title  = {Prime Fourier Embeddings: A Principled Basis for Modular Arithmetic},
  author = {Hyunsang Hwang and Suhyun Bae and Donghun Lee},
  year   = {2026},
  eprint = {2606.23044},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.23044v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.23044.svg)](https://codeofpaper.com/paper/2606.23044)

Discussion