arXiv:2606.15036cs.LGmath.NT2026-06

Transformer从弗罗贝尼乌斯迹中学会数论中的梅斯特-那加奥判别法。

Transformers Learn the Mestre-Nagao Heuristic

论文配图:Transformers Learn the Mestre-Nagao Heuristic
图 1 · 摘自论文原文
  • 用2层Transformer编码器,仅凭前128个归一化弗罗贝尼乌斯迹分类椭圆曲线秩
  • 准确率超99%,且对未见同构/二次扭曲线仍保持高精度
  • 发现模型自学习到经典数论启发式,权重与理论公式高度一致

我们训练一个两层Transformer编码器,仅基于前128个归一化弗罗贝尼乌斯迹,对导数≤10000的有理椭圆曲线$E/\mathbb{Q}$进行秩0或秩1分类,达到>99%准确率。测试时对无同构或二次扭关系的曲线,准确率基本不变。通过机制可解释性技术分析发现:仅20个第一层MLP神经元构成稀疏电路,即可在线性探测下实现AUROC 0.992,采用推拉检测器架构。关键发现是最高判别神经元的输入权重与梅斯特-那加奥和启发式权重$\log(p)/(p\cdot \log{B})$相关性极强(斯皮尔曼$r=0.997$,皮尔逊$r=0.952$),表明模型从数据中复现了数论结果。50次独立训练中,所有模型的CLS注意力集中在素数位置,速率是合数的2-50倍。CLS嵌入与$\log{L(E,1)}$相关性达$R^2 = 0.962\pm 0.011$(控制导数后)。激活修补分析显示注意力权重与因果信息流解耦。各模型函数空间近似相同(两两一致率>98.8%),尽管权重空间差异大。

原文摘要 · Abstract (English)

We train a two-layer transformer encoder to classify rational elliptic curves $E/\mathbb{Q}$ of conductor $\leq 10000$ as either rank 0 or rank 1 from the first 128 normalized Frobenius traces. We achieve >99% accuracy on both classes, and accuracy is essentially unchanged on test curves with no isogeny or quadratic-twist relative in the training set. We then apply techniques from mechanistic interpretability such as attention analysis, linear probing, activation patching, logit attribution, and neuron-level circuit analysis to reverse-engineer the algorithm the (centroid in function space) model learned. We find that a sparse circuit of 20 out of 512 layer-1 MLP neurons is sufficient for rank prediction under a linear probe with an AUROC of 0.992 at plateau, implementing a push-pull detector architecture of rank-0 and rank-1 detectors with a one-sided readout. However, we notice that the model has sub-optimal readout problems indicating a mismatch in rank-order between the readout pathway and the discriminative circuit. Critically, the learned input weights of the top discriminating neuron match the Mestre-Nagao sum heuristic weights $\log(p)/(p\cdot \log{B})$ with a Spearman coefficient $r = 0.997$ and Pearson coefficient $r = 0.952$: the model has learnt a result from analytic number theory from the Frobenius trace data alone. We additionally find that all 50 independently trained models concentrate CLS attention on prime positions at 2-50$\times$ the rate of composite positions. The CLS embedding encodes $\log{L(E,1)}$ with $R^2 = 0.962\pm 0.011$ across the 50 models (after controlling for the conductor). Activation patching analysis reveals that attention weights are dissociated from causal information flow. Additionally, the 50 solutions from training are near-identical in function space (with pairwise agreement $>$98.8%) despite large weight space barriers.

Transformer数论可解释性椭圆曲线

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