IntSeqBERT: 通过模谱嵌入学习OEIS中的算术结构
IntSeqBERT: Learning Arithmetic Structure in OEIS via Modulo-Spectrum Embeddings
AI总结:
提出IntSeqBERT,一种双流Transformer编码器,通过连续对数幅度嵌入和100个模数的正弦/余弦模嵌入融合,在OEIS序列上联合训练三个预测头,显著提升了序列预测精度。
摘要:
OEIS中的整数序列涵盖从个位数常数到天文阶乘和指数,使得标准分词模型难以处理,因为它们无法处理词汇表外的值或利用周期性算术结构。我们提出IntSeqBERT,一种用于OEIS掩码整数序列建模的双流Transformer编码器。每个序列元素沿两个互补轴编码:连续对数尺度幅度嵌入和100个残差(模数$2$--$101$)的正弦/余弦模嵌入,通过FiLM融合。三个预测头(幅度回归、符号分类和100个模数的模预测)在274,705个OEIS序列上联合训练。在Large规模(9150万参数)下,IntSeqBERT在测试集上达到95.85%的幅度准确率和50.38%的平均模准确率(MMA),分别比标准分词Transformer基线高出$+8.9$和$+4.5$个百分点。去除模流的消融实验证实,模流贡献了$+15.2$个百分点的MMA增益,并额外贡献了$+6.2$个百分点的幅度准确率。基于概率中国剩余定理(CRT)的解算器将模型预测转化为具体整数,使得下一项预测比分词Transformer基线提升7.4倍(Top-1: 19.09% vs. 2.59%)。模谱分析显示,归一化信息增益(NIG)与欧拉函数比值$\varphi(m)/m$之间存在强负相关($r = -0.851$, $p < 10^{-28}$),为复合模数通过CRT聚合更有效地捕获OEIS算术结构提供了经验证据。
英文摘要:
Integer sequences in the OEIS span values from single-digit constants to astronomical factorials and exponentials, making prediction challenging for standard tokenised models that cannot handle out-of-vocabulary values or exploit periodic arithmetic structure. We present IntSeqBERT, a dual-stream Transformer encoder for masked integer-sequence modelling on OEIS. Each sequence element is encoded along two complementary axes: a continuous log-scale magnitude embedding and sin/cos modulo embeddings for 100 residues (moduli $2$--$101$), fused via FiLM. Three prediction heads (magnitude regression, sign classification, and modulo prediction for 100 moduli) are trained jointly on 274,705 OEIS sequences. At the Large scale (91.5M parameters), IntSeqBERT achieves 95.85% magnitude accuracy and 50.38% Mean Modulo Accuracy (MMA) on the test set, outperforming a standard tokenised Transformer baseline by $+8.9$ pt and $+4.5$ pt, respectively. An ablation removing the modulo stream confirms it accounts for $+15.2$ pt of the MMA gain and contributes an additional $+6.2$ pt to magnitude accuracy. A probabilistic Chinese Remainder Theorem (CRT)-based Solver converts the model's predictions into concrete integers, yielding a 7.4-fold improvement in next-term prediction over the tokenised-Transformer baseline (Top-1: 19.09% vs. 2.59%). Modulo spectrum analysis reveals a strong negative correlation between Normalised Information Gain (NIG) and Euler's totient ratio $φ(m)/m$ ($r = -0.851$, $p < 10^{-28}$), providing empirical evidence that composite moduli capture OEIS arithmetic structure more efficiently via CRT aggregation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。