InfLLM-V2: 短距離から長距離へのシームレスな適応のための密疎切り替え可能なアテンション
InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation
September 29, 2025
著者: Weilin Zhao, Zihan Zhou, Zhou Su, Chaojun Xiao, Yuxuan Li, Yanghao Li, Yudi Zhang, Weilun Zhao, Zhen Li, Yuxiang Huang, Ao Sun, Xu Han, Zhiyuan Liu
cs.AI
要旨
長文処理は、現代の大規模言語モデルにとって重要な能力である。しかし、標準的なTransformerアーキテクチャにおけるセルフアテンション機構は、長文を処理する際に深刻な計算量とメモリのボトルネックに直面する。学習可能なスパースアテンション手法は有望な解決策を提供するが、NSAなどの既存のアプローチは過剰な追加パラメータを導入し、従来の「短いシーケンスで事前学習し、長いシーケンスで微調整する」ワークフローを妨げるため、収束が遅く、高速化が困難である。これらの制限を克服するため、我々は密-疎切り替え可能なアテンションフレームワーク「InfLLM-V2」を提案する。InfLLM-V2は、短いシーケンスから長いシーケンスへモデルをシームレスに適応させる学習可能なスパースアテンションである。具体的には、InfLLM-V2はパラメータフリーなアーキテクチャ変更を通じて密アテンションパラメータを再利用し、短いシーケンスと長いシーケンスの処理間の一貫性を維持する。さらに、InfLLM-V2は、短い入力に対しては密アテンションを使用し、長いシーケンスに対してはスムーズにスパースアテンションに移行することで、すべてのシーケンス長において計算効率を確保する。実用的な高速化を実現するため、我々はInfLLM-V2の効率的な実装をさらに導入し、計算オーバーヘッドを大幅に削減した。長文脈理解と連鎖的推論に関する実験により、InfLLM-V2は密アテンションよりも4倍高速でありながら、それぞれ98.1%と99.7%の性能を維持することが示された。InfLLM-V2フレームワークに基づき、我々はハイブリッド推論モデル「MiniCPM4.1」(https://huggingface.co/openbmb/MiniCPM4.1-8B)を学習し、オープンソース化し、研究コミュニティに再現可能な実装を提供した。
English
Long-sequence processing is a critical capability for modern large language
models. However, the self-attention mechanism in the standard Transformer
architecture faces severe computational and memory bottlenecks when processing
long sequences. While trainable sparse attention methods offer a promising
solution, existing approaches such as NSA introduce excessive extra parameters
and disrupt the conventional pretrain-on-short, finetune-on-long
workflow, resulting in slow convergence and difficulty in acceleration. To
overcome these limitations, we introduce dense-sparse switchable attention
framework, termed as InfLLM-V2. InfLLM-V2 is a trainable sparse attention that
seamlessly adapts models from short to long sequences. Specifically, InfLLM-V2
reuses dense attention parameters through parameter-free architecture
modification, maintaining consistency between short and long sequence
processing. Additionally, InfLLM-V2 ensures computational efficiency across all
sequence lengths, by using dense attention for short inputs and smoothly
transitioning to sparse attention for long sequences. To achieve practical
acceleration, we further introduce an efficient implementation of InfLLM-V2
that significantly reduces the computational overhead. Our experiments on
long-context understanding and chain-of-thought reasoning demonstrate that
InfLLM-V2 is 4times faster than dense attention while retaining 98.1% and
99.7% of the performance, respectively. Based on the InfLLM-V2 framework, we
have trained and open-sourced MiniCPM4.1
(https://huggingface.co/openbmb/MiniCPM4.1-8B), a hybrid reasoning model,
providing a reproducible implementation for the research community.