arXiv:2606.23044cs.LGcs.AI2026-06

用素数傅里叶嵌入让模运算自动选通道,比传统方法快500倍以上。

Prime Fourier Embeddings: A Principled Basis for Modular Arithmetic

论文配图:Prime Fourier Embeddings: A Principled Basis for Modular Arithmetic
图 1 · 摘自论文原文
  • 将整数编码为素数索引的(cos, sin)对,使模运算变成选通道
  • 实验证明关键通道与无关通道的激活差距超500倍,测试准确率100%
  • 适合研究数论结构或高效模运算的模型设计者

数字具有代数结构,但标准神经嵌入常无法揭示。我们提出素数傅里叶嵌入(PFE),将整数编码为源自有理数域调和分析的素数索引(cos, sin)对,构建预结构化表示:模运算退化为选择相关素数通道,而非从零发现代数结构。我们证明,任何在PFE上保持乘法群作用等变的线性映射必为分块对角阵,每素数对应一个独立块——由特征分解后施图姆引理推导得出。对于无平方因子的合数模,中国剩余定理可预测任务相关通道。实验验证两者:消融研究显示任务相关与无关通道的激活比超过500倍,所有测试的无平方因子合数模下均达100%分布内测试准确率。

原文摘要 · Abstract (English)

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.

数论嵌入傅里叶编码模运算结构化表示

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。