arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.06875cs.LGq-fin.CP
收藏

通过现代Hopfield能量的兰格vin动力学实现随机注意力

Stochastic Attention via Langevin Dynamics on the Modern Hopfield Energy

R.F. Smith School of Chemical and Biomolecular Engineering(R.F. Smith 化学与生物分子工程学院)

Abdulrahman Alswaidan, Jeffrey D. Varner

AI总结:

本文提出了一种基于现代Hopfield能量的随机注意力机制,通过兰格vin动力学实现无训练的注意力采样,能够在不同温度下实现精确检索与开放生成,适用于低数据场景。

摘要:

注意力头检索:给定一个查询,它们返回存储值的加权平均。我们证明了这种计算是现代Hopfield能量上的梯度下降一步,且从相应玻尔兹曼分布进行兰格vin采样可得到随机注意力,这是一种无训练的采样器,仅由单个温度参数控制。降低温度可获得精确检索;提高温度可实现开放生成。由于能量梯度等于注意力图,无需评分网络、训练循环或学习模型,使该方法特别适用于低数据场景,其中学习生成模型缺乏训练信号。我们推导了熵反折条件,确定了任意记忆几何下的检索到生成转换温度,并在五个领域验证了采样器,涵盖两个数量级的维度范围。一个简单的布尔掩码应用于注意力softmax,与transformers中使用的因果掩码相同,但沿记忆轴而非序列轴应用,使采样器成为无需重新训练和无需学习分类器的零样本类条件生成器,在Olivetti人脸上表现优异。在MNIST数字图像上,随机注意力生成的样本比最佳学习基线更新颖、更多样,同时匹配了Metropolis校正的黄金标准。在蛋白质序列上,生成模式在保持氨基酸组成方面比变分自编码器更忠实,表明无训练的评分函数保留了家族级的保真度,而学习模型失去。去噪扩散基线在所有测试的记忆大小上均失败,生成的样本与各向同性噪声无法区分。该方法无需对底层注意力机制进行架构更改。

英文摘要:

Attention heads retrieve: given a query, they return a weighted average of stored values. We showed that this computation is one step of gradient descent on the modern Hopfield energy, and that Langevin sampling from the corresponding Boltzmann distribution yielded stochastic attention, a training-free sampler controlled by a single temperature parameter. Lowering the temperature gave exact retrieval; raising it gave open-ended generation. Because the energy gradient equals the attention map, no score network, training loop, or learned model was required, making the approach particularly suited to the low-data regime where learned generative models are starved of training signal. We derived an entropy inflection condition that identified the retrieval-to-generation transition temperature for any memory geometry and validated the sampler on five domains spanning two orders of magnitude in dimension. A single Boolean mask on the attention softmax, identical to the causal mask used in transformers but applied along the memory axis rather than the sequence axis, turned the sampler into a zero-shot class-conditional generator on Olivetti faces with no retraining and no learned classifier. On MNIST digit images, stochastic attention produced samples that were markedly more novel and more diverse than the best learned baseline while matching a Metropolis-corrected gold standard. On protein sequences from a small Pfam family, the generation regime preserved amino acid composition far more faithfully than a variational autoencoder at matched novelty, indicating that the training-free score function retained family-level fidelity that learned models lost. A denoising diffusion baseline failed across all memory sizes tested, producing samples indistinguishable from isotropic noise. The approach required no architectural changes to the underlying attention mechanism.

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

↑