arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.27124cs.LGq-bio.QM
收藏

更好的模型,更快的训练:Sigmoid 注意力用于单细胞基础模型

Better Models, Faster Training: Sigmoid Attention for single-cell Foundation Models

Merck & Co., Inc.(默克公司)

Vijay Sadashivaiah, Georgios Dasoulas, Judith Mueller, Soumya Ghosh

AI总结:

本文提出Sigmoid注意力机制,通过改进表示学习、加速训练和提升稳定性,在单细胞数据集上实现了更优的细胞类型分离和更低的验证损失。

摘要:

训练稳定的生物基础模型需要重新考虑注意力机制:我们发现使用Sigmoid注意力作为Softmax的替代方案,一方面在六个多样化的单细胞数据集上实现了25%更高的细胞类型分离,更好的细胞类型凝聚度指标和更低的验证损失;另一方面训练速度更快,具有Sigmoid注意力的模型比Softmax模型快10%;此外,Sigmoid注意力通过消除Softmax中固有的不稳定性来源,使训练更加稳定。我们证明Sigmoid注意力具有全局有界的导数(≤0.25),与Softmax的密集耦合结构形成对比,这有助于缓解训练不稳定性。在1.6亿参数的双向注意力模型上进行压力测试时,Softmax在没有梯度裁剪的情况下崩溃,梯度爆炸了四个数量级,而Sigmoid保持稳定。最后,我们实现了并开源了TritonSigmoid,一个高效的GPU内核,在H100 GPU上达到515 TFLOPS,优于FlashAttention-2和FlashSigmoid,具有原生的填充支持,这对生物序列至关重要。我们的结果证明Sigmoid注意力在生物基础模型中理论和实证上都更优越。代码可在https://github.com/MSDLLCpapers/triton-sigmoid获取。

英文摘要:

Training stable biological foundation models requires rethinking attention mechanisms: we find that using sigmoid attention as a drop in replacement for softmax attention a) produces better learned representations: on six diverse single-cell datasets, sigmoid achieves 25% higher cell-type separation, better cell-type cohesion metrics, and lower validation loss, b) faster training, models with sigmoid attention train up to 10% faster than their softmax counterparts, and c) more stable training by eliminating inherent sources of instability in softmax attention. We establish that sigmoid attention has globally bounded derivatives ($\leq 0.25$) as opposed to softmax, and a diagonal Jacobian structure in contrast with softmax's dense coupling, which together help alleviate training instabilities. In stress tests on 160M-parameter bidirectional attention models trained without gradient clipping on 8K-token sequences, softmax diverges catastrophically, with gradients exploding by four orders of magnitude, while sigmoid remains stable. Finally, we implement and open-source TritonSigmoid, an efficient GPU kernel that achieves 515 TFLOPS on H100 GPUs, outperforming both FlashAttention-2 and FlashSigmoid, with native padding support, which is essential for biological sequences. Our results establish sigmoid attention as both theoretically grounded and empirically superior for biological foundation models. Code is available at https://github.com/MSDLLCpapers/triton-sigmoid

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

↑