arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.15036cs.LGmath.NT
收藏

Transformer学习Mestre-Nagao启发式方法

Transformers Learn the Mestre-Nagao Heuristic

Pranav Venkata Konda(普拉纳夫·文卡塔·科恩达)

Pranav Venkata Konda

AI总结:

训练两层Transformer编码器对有理椭圆曲线进行秩分类(rank 0/1),精度>99%,并通过机械可解释性发现模型学到了Mestre-Nagao和启发式权重,且CLS嵌入编码了L(E,1)的对数。

摘要:

我们训练了一个两层Transformer编码器,用于将导子≤10000的有理椭圆曲线$E/\mathbb{Q}$从前128个归一化Frobenius迹分类为秩0或秩1。我们在两个类别上都达到了>99%的准确率,并且在测试曲线上(训练集中没有同源或二次扭的曲线)准确率基本不变。然后,我们应用机械可解释性技术,如注意力分析、线性探针、激活修补、logit归因和神经元级电路分析,来逆向工程模型(函数空间中的质心)学到的算法。我们发现,在平台期,一个由512个第一层MLP神经元中的20个组成的稀疏电路足以在AUROC为0.992的线性探针下进行秩预测,实现了秩0和秩1检测器的推挽检测架构,并带有单侧读出。然而,我们注意到模型存在次优的读出问题,表明读出路径与判别电路之间的秩顺序不匹配。关键的是,顶部判别神经元的学得输入权重与Mestre-Nagao和启发式权重$\log(p)/(p\cdot \log{B})$匹配,Spearman系数$r=0.997$,Pearson系数$r=0.952$:模型仅从Frobenius迹数据就学到了解析数论的一个结果。我们还发现,所有50个独立训练的模型都将CLS注意力集中在素数位置,其速率是合数位置的2-50倍。CLS嵌入编码了$\log{L(E,1)}$,在50个模型中的$R^2=0.962\pm 0.011$(在控制导子后)。激活修补分析表明,注意力权重与因果信息流分离。此外,训练得到的50个解在函数空间上几乎相同(成对一致性>98.8%),尽管权重空间存在巨大障碍。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑