Prime Fourier Embeddings: A Principled Basis for Modular Arithmetic
Hyunsang Hwang ⋅ SuHyun Bae ⋅ Donghun Lee
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 $\mathbb{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 across a systematic sweep of prime counts, composite moduli, and input ranges: ablation studies confirm the block-diagonal prediction, task-relevant channels cause large accuracy drops when ablated ($0.60$--$0.92$ diagonal drop) while task-irrelevant channels are effectively inert (off-diagonal drops at or below the statistical noise floor in the majority of configurations).
Chat is not available.
Successful Page Load