ChatPaper.aiChatPaper

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 아키텍처의 self-attention 메커니즘은 긴 시퀀스를 처리할 때 심각한 계산 및 메모리 병목 현상을 겪습니다. 학습 가능한 희소 주의(sparse attention) 방법이 유망한 해결책으로 제시되지만, NSA와 같은 기존 접근 방식은 과도한 추가 매개변수를 도입하고, 짧은 시퀀스로 사전 학습한 후 긴 시퀀스로 미세 조정하는 기존 워크플로를 방해하여 느린 수렴 속도와 가속화의 어려움을 초래합니다. 이러한 한계를 극복하기 위해, 우리는 밀집-희소 전환 가능한 주의 프레임워크인 InfLLM-V2를 소개합니다. InfLLM-V2는 짧은 시퀀스에서 긴 시퀀스로 모델을 원활하게 적응시키는 학습 가능한 희소 주의 메커니즘입니다. 구체적으로, InfLLM-V2는 매개변수 없는 아키텍처 수정을 통해 밀집 주의(dense attention) 매개변수를 재사용함으로써 짧은 시퀀스와 긴 시퀀스 처리 간의 일관성을 유지합니다. 또한, InfLLM-V2는 짧은 입력에 대해서는 밀집 주의를 사용하고, 긴 시퀀스에 대해서는 희소 주의로 부드럽게 전환함으로써 모든 시퀀스 길이에서 계산 효율성을 보장합니다. 실질적인 가속화를 달성하기 위해, 우리는 InfLLM-V2의 효율적인 구현을 추가로 도입하여 계산 오버헤드를 크게 줄였습니다. 긴 문맥 이해와 사고 연쇄(chain-of-thought) 추론에 대한 실험 결과, 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.
PDF122September 30, 2025