플럭스 어텐션: 효율적인 대규모 언어 모델 추론을 위한 컨텍스트 인식 하이브리드 어텐션
Flux Attention: Context-Aware Hybrid Attention for Efficient LLMs Inference
April 8, 2026
저자: Quantong Qiu, Zhiyi Hong, Yi Yang, Haitian Wang, Kebin Liu, Qingqing Dang, Juntao Li, Min Zhang
cs.AI
초록
표준 어텐션 메커니즘의 2차 계산 복잡도는 장문맥 시나리오에서 LLM의 확장성에 심각한 병목 현상을 초래합니다. 완전 어텐션(FA)과 희소 어텐션(SA)을 결합한 하이브리드 어텐션 메커니즘이 잠재적 해결책으로 제시되지만, 기존 방법들은 일반적으로 다양한 과제의 가변적인 정보 검색 요구를 수용하지 못하는 정적 할당 비율에 의존합니다. 더욱이 헤드 수준의 동적 희소성은 종종 심각한 계산 부하 불균형 및 동기화 지연을 초래하여 자동회귀 디코딩 과정의 하드웨어 가속을 저해합니다. 이러한 격차를 해결하기 위해 본 연구에서는 계층 수준에서 어텐션 계산을 동적으로 최적화하는 컨텍스트 인식 프레임워크인 Flux Attention을 소개합니다. 고정된 사전 학습 LLM에 경량 Layer Router를 통합함으로써, 제안 방법은 입력 컨텍스트를 기반으로 각 계층을 FA 또는 SA로 적응적으로 라우팅합니다. 이 계층별 라우팅은 연속적인 메모리 접근을 보장하면서 고품질 정보 검색을 유지하여 이론적인 계산량 감소를 실제 속도 향상으로 전환합니다. 매개변수 효율적 접근법으로서, 본 프레임워크는 8개의 A800 GPU로 단 12시간의 학습만으로 충분합니다. 여러 장문맥 및 수학적 추론 벤치마크에서의 광범위한 실험을 통해 Flux Attention이 기준 모델 대비 성능과 추론 속도 사이에서 우수한 균형을 달성함을 입증하였으며, 프리필 단계와 디코드 단계에서 각각 최대 2.8배 및 2.0배의 속도 향상을 보였습니다.
English
The quadratic computational complexity of standard attention mechanisms presents a severe scalability bottleneck for LLMs in long-context scenarios. While hybrid attention mechanisms combining Full Attention (FA) and Sparse Attention (SA) offer a potential solution, existing methods typically rely on static allocation ratios that fail to accommodate the variable retrieval demands of different tasks. Furthermore, head-level dynamic sparsity often introduces severe computational load imbalance and synchronization long-tails, which hinder hardware acceleration during autoregressive decoding. To bridge this gap, we introduce Flux Attention, a context-aware framework that dynamically optimizes attention computation at the layer level. By integrating a lightweight Layer Router into frozen pretrained LLMs, the proposed method adaptively routes each layer to FA or SA based on the input context. This layer-wise routing preserves high-fidelity information retrieval while ensuring contiguous memory access, translating theoretical computational reductions into practical wall-clock speedups. As a parameter-efficient approach, our framework requires only 12 hours of training on 8timesA800 GPUs. Extensive experiments across multiple long-context and mathematical reasoning benchmarks demonstrate that Flux Attention achieves a superior trade-off between performance and inference speed compared with baseline models, with speed improvements of up to 2.8times and 2.0times in the prefill and decode stages.