Liger: 대규모 언어 모델을 게이트 순환 구조로 선형화하기
Liger: Linearizing Large Language Models to Gated Recurrent Structures
March 3, 2025
저자: Disen Lan, Weigao Sun, Jiaxi Hu, Jusen Du, Yu Cheng
cs.AI
초록
선형 순환 모델링을 적용한 트랜스포머는 선형 시간의 학습과 일정한 메모리 추론을 제공합니다. 이러한 비표준 아키텍처의 효율성과 성능이 입증되었음에도 불구하고, 처음부터 이러한 모델을 사전 학습하는 것은 여전히 비용이 많이 들고 위험성이 있습니다. 대규모 언어 모델(LLM)의 선형화는 사전 학습된 표준 모델을 선형 순환 구조로 변환하여 더 효율적인 배포를 가능하게 합니다. 그러나 현재의 선형화 방법은 일반적으로 추가적인 특징 맵 모듈을 도입하여 광범위한 미세 조정이 필요하며, 최신 선형 순환 모델에서 사용되는 게이트 메커니즘을 간과하는 경우가 많습니다. 이러한 문제를 해결하기 위해, 본 논문은 Liger(Linearizing LLMs to gated recurrent structures)를 제안합니다. Liger는 사전 학습된 LLM을 게이트 선형 순환 모델로 변환하는 새로운 접근 방식으로, 추가 매개변수를 도입하지 않고도 사전 학습된 키 행렬 가중치를 재활용하여 다양한 게이트 메커니즘을 구성합니다. 이를 통해 다양한 게이트 순환 구조를 형성하면서도 추가 구성 요소를 처음부터 학습할 필요를 피할 수 있습니다. Liger는 Low-Rank Adaptation(LoRA)를 사용한 경량 미세 조정을 통해 선형화된 게이트 순환 모델의 성능을 원래 LLM 수준으로 복원합니다. 또한, Liger Attention이라는 계층 내 하이브리드 어텐션 메커니즘을 도입하여 선형화 과정에서 0.02%의 사전 학습 토큰으로 트랜스포머 기반 LLM의 93%를 회복하며, 1B에서 8B 파라미터 범위의 모델에서 검증된 바와 같이 여러 벤치마크에서 경쟁력 있는 결과를 달성합니다. 코드는 https://github.com/OpenSparseLLMs/Linearization에서 확인할 수 있습니다.
English
Transformers with linear recurrent modeling offer linear-time training and
constant-memory inference. Despite their demonstrated efficiency and
performance, pretraining such non-standard architectures from scratch remains
costly and risky. The linearization of large language models (LLMs) transforms
pretrained standard models into linear recurrent structures, enabling more
efficient deployment. However, current linearization methods typically
introduce additional feature map modules that require extensive fine-tuning and
overlook the gating mechanisms used in state-of-the-art linear recurrent
models. To address these issues, this paper presents Liger, short for
Linearizing LLMs to gated recurrent structures. Liger is a novel approach for
converting pretrained LLMs into gated linear recurrent models without adding
extra parameters. It repurposes the pretrained key matrix weights to construct
diverse gating mechanisms, facilitating the formation of various gated
recurrent structures while avoiding the need to train additional components
from scratch. Using lightweight fine-tuning with Low-Rank Adaptation (LoRA),
Liger restores the performance of the linearized gated recurrent models to
match that of the original LLMs. Additionally, we introduce Liger Attention, an
intra-layer hybrid attention mechanism, which significantly recovers 93\% of
the Transformer-based LLM at 0.02\% pre-training tokens during the
linearization process, achieving competitive results across multiple
benchmarks, as validated on models ranging from 1B to 8B parameters. Code is
available at https://github.com/OpenSparseLLMs/Linearization.Summary
AI-Generated Summary