MiniCPM-SALA: 효율적인 긴 문맥 모델링을 위한 희소 및 선형 어텐션의 하이브리드 결합
MiniCPM-SALA: Hybridizing Sparse and Linear Attention for Efficient Long-Context Modeling
초장기 문맥(ultra-long contexts)을 처리하는 애플리케이션으로 대형 언어 모델(LLM)이 발전함에 따라, 트랜스포머(Transformer) 아키텍처의 높은 계산 및 메모리 비용으로 인한 과제에 직면하고 있다. 기존의 희소(sparse) 및 선형(linear) 어텐션 메커니즘이 이러한 문제를 완화하려고 시도하지만, 일반적으로 메모리 효율성과 모델 성능 간의 절충(trade-off)이 수반된다. 본 논문은 희소 어텐션(InfLLM-V2)의 고충실도 긴 문맥 모델링과 선형 어텐션(Lightning Attention)의 전역적 효율성을 통합한 90억(9B) 파라미터 규모의 하이브리드 아키텍처인 MiniCPM-SALA를 소개한다. 이 모델은 레이어 선택 알고리즘을 적용하여 두 메커니즘을 1:3 비율로 통합하고 하이브리드 위치 인코딩(HyPE)을 활용함으로써, 긴 문맥 작업에서의 효율성과 성능을 유지한다. 또한, 사전 학습된 트랜스포머 기반 모델을 하이브리드 모델로 변환하는 비용 효율적인 지속 학습(continual training) 프레임워크를 도입하여, 처음부터 학습하는 것에 비해 학습 비용을 약 75% 절감한다. 광범위한 실험을 통해 MiniCPM-SALA가 향상된 효율성을 제공하는 동시에 풀 어텐션(full-attention) 모델에 필적하는 일반 역량을 유지함을 보여준다. 단일 NVIDIA A6000D GPU 환경에서 이 모델은 256K 토큰의 시퀀스 길이에서 풀 어텐션 모델 대비 최대 3.5배의 추론 속도를 달성하며, 기존의 풀 어텐션 8B 모델이 메모리 한계로 실패하는 규모인 최대 100만(1M) 토큰의 문맥 길이를 지원한다.
The evolution of large language models (LLMs) towards applications with ultra-long contexts faces challenges posed by the high computational and memory costs of the Transformer architecture. While existing sparse and linear attention mechanisms attempt to mitigate these issues, they typically involve a trade-off between memory efficiency and model performance. This paper introduces MiniCPM-SALA, a 9B-parameter hybrid architecture that integrates the high-fidelity long-context modeling of sparse attention (InfLLM-V2) with the global efficiency of linear attention (Lightning Attention). By employing a layer selection algorithm to integrate these mechanisms in a 1:3 ratio and utilizing a hybrid positional encoding (HyPE), the model maintains efficiency and performance for long-context tasks. Furthermore, we introduce a cost-effective continual training framework that transforms pre-trained Transformer-based models into hybrid models, which reduces training costs by approximately 75% compared to training from scratch. Extensive experiments show that MiniCPM-SALA maintains general capabilities comparable to full-attention models while offering improved efficiency. On a single NVIDIA A6000D GPU, the model achieves up to 3.5x the inference speed of the full-attention model at the sequence length of 256K tokens and supports context lengths of up to 1M tokens, a scale where traditional full-attention 8B models fail because of memory constraints.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.