소프트픽: 어텐션 싱크 없음, 정규화된 소프트맥스로 인한 대규모 활성화 없음
Softpick: No Attention Sink, No Massive Activations with Rectified Softmax
April 29, 2025
저자: Zayd M. K. Zuhri, Erland Hilman Fuadi, Alham Fikri Aji
cs.AI
초록
우리는 트랜스포머 어텐션 메커니즘에서 소프트맥스의 대체제로 사용할 수 있는, 합이 1이 되지 않도록 조정된 '소프트픽(softpick)'을 소개한다. 이 방법은 어텐션 싱크(attention sink)와 과도한 활성화 문제를 제거한다. 3억 4천만 개의 파라미터를 가진 모델을 사용한 실험에서, 소프트픽은 표준 벤치마크에서 소프트맥스와 동등한 성능을 유지하면서 0%의 싱크 비율을 달성했다. 소프트픽 트랜스포머는 훨씬 낮은 첨도(kurtosis)를 보이는 은닉 상태를 생성하며(340 대 33,510), 희소한 어텐션 맵을 만든다(46.97% 희소성). 양자화(quantization) 시 소프트픽을 사용한 모델은 소프트맥스를 사용한 모델보다 일관되게 더 나은 성능을 보였으며, 특히 낮은 비트 정밀도에서 그 장점이 두드러졌다. 우리의 분석과 논의는 소프트픽이 양자화, 저정밀도 학습, 희소성 최적화, 가지치기(pruning), 해석 가능성(interpretability) 등에 새로운 가능성을 열어줄 잠재력을 가지고 있음을 보여준다. 코드는 https://github.com/zaydzuhri/softpick-attention에서 확인할 수 있다.
English
We introduce softpick, a rectified, not sum-to-one, drop-in replacement for
softmax in transformer attention mechanisms that eliminates attention sink and
massive activations. Our experiments with 340M parameter models demonstrate
that softpick maintains performance parity with softmax on standard benchmarks
while achieving 0% sink rate. The softpick transformer produces hidden states
with significantly lower kurtosis (340 vs 33,510) and creates sparse attention
maps (46.97% sparsity). Models using softpick consistently outperform softmax
when quantized, with particularly pronounced advantages at lower bit
precisions. Our analysis and discussion shows how softpick has the potential to
open new possibilities for quantization, low-precision training, sparsity
optimization, pruning, and interpretability. Our code is available at
https://github.com/zaydzuhri/softpick-attention.