iconLogo
Published:2026/1/7 3:52:49

タイトル & 超要約: SWAAって最強!長文LLMを賢くする魔法🪄

🌟 ギャル的キラキラポイント✨ ● 長文処理(ちょうぶんしょり)が得意(とくい)なLLMを作る方法を発見したってコト💖 ● 既存(きぞん)のLLMに、ちょい足しするだけで賢くなっちゃう優れもの🌟 ● 色んなITサービスが、もっと便利(べんり)になる未来が楽しみだね🎵

詳細解説 • 背景 Transformer(トランスフォーマー)モデルって、長文を処理するの苦手(にがて)だったの!計算量(けいさんりょう)が多すぎるから😩 それを解決(かいけつ)するのがSWAAっていうツールキットだよ。SWAっていう方法を使って、賢くするんだって✨

• 方法 FAで勉強したLLMを、SWAAを使ってSWAに対応させるんだって! 色んな方法を試して、一番良い組み合わせ(くみあわせ)を見つけたらしい💡 事前学習(じぜんがくしゅう)しなくてもOKって、マジ神じゃん?

• 結果 SWAAを使うと、LLMが長文をスムーズに処理できるようになるらしい! しかも、色んなITサービスで使えるから、めっちゃ便利になる予感💖 効率(こうりつ)も良くなって、パフォーマンスも上がるって、最強かよ😎

続きは「らくらく論文」アプリで

SWAA: Sliding Window Attention Adaptation for Efficient Long-Context LLMs Without Pretraining

Yijiong Yu / Jiale Liu / Qingyun Wu / Huazheng Wang / Ji Pei

The quadratic complexity of self-attention in Transformer-based Large Language Models (LLMs) renders long-context inference prohibitively expensive. While Sliding Window Attention (SWA), the simplest sparse attention pattern, offers a linear-complexity alternative, naively applying it to models pretrained with Full Attention (FA) causes catastrophic long-context performance collapse due to the training-inference mismatch. To address this, we propose Sliding Window Attention Adaptation (SWAA), a plug-and-play toolkit of recipes that adapt FA models to SWA without costly pretraining. SWAA systematically combines five strategies: (1) applying SWA only during prefilling; (2) preserving "sink" tokens; (3) interleaving FA/SWA layers; (4) chain-of-thought (CoT); and (5) fine-tuning. Our experiments demonstrate that while individual methods are insufficient, specific synergistic combinations can effectively recover original long-context capabilities. After further analyzing performance-efficiency trade-offs, we identify recommended SWAA configurations for diverse scenarios, which achieve 30% to 100% speedups for long-context LLM inference with acceptable quality loss. Our code is available at https://github.com/yuyijiong/sliding-window-attention-adaptation

cs / cs.CL / cs.AI