要約
ロータリー位置の埋め込み(ロープ)を改善することにより、言語モデル(LMS)のコンテキスト長を拡張することがトレンドになりました。
既存の作業は主に注意メカニズム内でのロープの制限に対処していますが、このペーパーでは、LMSのほぼすべての部分で分析を提供し、ロープベースの注意のための長さの一般化に対する悪影響を明らかにします。
離散信号処理理論を使用して、不均一な離散フーリエ変換を暗黙的に達成することにより、ロープが周期的な注意を可能にすることを示します。
ただし、この周期性は、次のことによって引き起こされるスペクトル損傷によって損なわれます。1)線形層と注意の外側の活性化機能。
2)時間領域の切り捨てによってもたらされる訓練された周波数成分が不十分です。
観察に基づいて、フーリエの位置埋め込み(FOPE)を提案します。これにより、周期的な拡張と長さの一般化の両方を改善するために、注意の周波数ドメイン特性が強化されます。
FOPEはフーリエシリーズを構築し、破壊的な周波数成分をゼロアウトし、スペクトル損傷に対するモデルの堅牢性を高めます。
さまざまなモデルスケールとベンチマークの実験では、さまざまなコンテキストウィンドウ内で、FopeはロープやAlibiに比べてより安定した性能を維持していることが示されています。
いくつかの分析とアブレーションは、私たちの方法と理論モデリングをさらにサポートします。
要約(オリジナル)
Extending the context length of Language Models (LMs) by improving Rotary Position Embedding (RoPE) has become a trend. While existing works mainly address RoPE’s limitations within attention mechanism, this paper provides an analysis across nearly all parts of LMs, uncovering their adverse effects on length generalization for RoPE-based attention. Using Discrete Signal Processing theory, we show that RoPE enables periodic attention by implicitly achieving Non-Uniform Discrete Fourier Transform. However, this periodicity is undermined by the spectral damage caused by: 1) linear layers and activation functions outside of attention; 2) insufficiently trained frequency components brought by time-domain truncation. Building on our observations, we propose Fourier Position Embedding (FoPE), which enhances attention’s frequency-domain properties to improve both its periodic extension and length generalization. FoPE constructs Fourier Series and zero-outs the destructive frequency components, increasing model robustness against the spectrum damage. Experiments across various model scales and benchmarks show that, within varying context windows, FoPE maintains a more stable performance compared to RoPE and ALiBi. Several analyses and ablations bring further support to our method and theoretical modeling.
arxiv情報
著者 | Ermo Hua,Che Jiang,Xingtai Lv,Kaiyan Zhang,Ning Ding,Youbang Sun,Biqing Qi,Yuchen Fan,Xuekai Zhu,Bowen Zhou |
発行日 | 2025-05-06 07:47:40+00:00 |
arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google