InfLLM-V2: Dichte-Sparse Schakelbare Aandacht voor Naadloze Aanpassing van Kort naar Lang
InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation
September 29, 2025
Auteurs: 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
Samenvatting
Langereeksverwerking is een cruciale capaciteit voor moderne grote taalmodellen. Het zelf-attentiemechanisme in de standaard Transformer-architectuur ondervindt echter ernstige computationele en geheugenknelpunten bij het verwerken van lange reeksen. Hoewel trainbare sparse-attentiemethoden een veelbelovende oplossing bieden, introduceren bestaande benaderingen zoals NSA overmatige extra parameters en verstoren ze het conventionele workflow van vooraf trainen op korte reeksen en finetunen op lange reeksen, wat resulteert in trage convergentie en moeilijkheden bij versnelling. Om deze beperkingen te overwinnen, introduceren we een dense-sparse switchable attention-framework, genaamd InfLLM-V2. InfLLM-V2 is een trainbare sparse-attentie die modellen naadloos aanpast van korte naar lange reeksen. Specifiek hergebruikt InfLLM-V2 dense-attentieparameters via parameterloze architectuurmodificatie, waardoor consistentie tussen korte en lange reeksverwerking wordt behouden. Daarnaast zorgt InfLLM-V2 voor computationele efficiëntie over alle reekslengtes, door dense-attentie te gebruiken voor korte invoer en soepel over te schakelen naar sparse-attentie voor lange reeksen. Om praktische versnelling te bereiken, introduceren we verder een efficiënte implementatie van InfLLM-V2 die de computationele overhead aanzienlijk vermindert. Onze experimenten op het gebied van lang-contextbegrip en chain-of-thought redeneren tonen aan dat InfLLM-V2 4 keer sneller is dan dense-attentie terwijl het respectievelijk 98,1% en 99,7% van de prestaties behoudt. Op basis van het InfLLM-V2-framework hebben we MiniCPM4.1 (https://huggingface.co/openbmb/MiniCPM4.1-8B) getraind en open-source gemaakt, een hybride redeneermodel, dat een reproduceerbare implementatie biedt voor de onderzoeksgemeenschap.
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.