SepLLM: 하나의 세그먼트를 하나의 구분자로 압축하여 대형 언어 모델 가속화
SepLLM: Accelerate Large Language Models by Compressing One Segment into One Separator
December 16, 2024
저자: Guoxuan Chen, Han Shi, Jiawei Li, Yihang Gao, Xiaozhe Ren, Yimeng Chen, Xin Jiang, Zhenguo Li, Weiyang Liu, Chao Huang
cs.AI
초록
대형 언어 모델 (LLM)은 자연어 처리 작업 범위에서 우수한 성능을 나타내었습니다. 그러나 그들의 상당한 크기는 계산 요구와 추론 속도에서 특히 이차 복잡성으로 인해 상당한 어려움을 야기합니다. 본 연구에서는 핵심 패턴을 식별했습니다: 특정하게 의미 없어 보이는 특수 토큰 (즉, 구분자)이 의미 있는 토큰에 비해 주목할 만한 비중으로 주의를 끕니다. 이 관찰 결과, 이 구분자 토큰 사이 세그먼트의 정보가 상당한 정보 손실 없이 구분자 토큰 자체로 효과적으로 요약될 수 있다는 것을 시사합니다. 이 통찰력을 바탕으로, 우리는 이러한 세그먼트를 압축하고 중복 토큰을 제거하여 추론을 가속화하는 SepLLM이라는 플러그 앤 플레이 프레임워크를 소개합니다. 또한, 훈련 가속화를 위한 효율적인 커널을 구현합니다. 훈련 없이, 처음부터 훈련하거나 사후 훈련 설정에서의 실험 결과는 SepLLM의 효과를 입증합니다. 특히, Llama-3-8B 백본을 사용할 때, SepLLM은 GSM8K-CoT 벤치마크에서 KV 캐시를 50% 이상 줄이면서 비슷한 성능을 유지합니다. 더 나아가, 스트리밍 설정에서 SepLLM은 일관된 언어 모델링 능력을 유지하면서 최대 4백만 개 이상의 토큰 시퀀스를 효과적으로 처리합니다.
English
Large Language Models (LLMs) have exhibited exceptional performance across a
spectrum of natural language processing tasks. However, their substantial sizes
pose considerable challenges, particularly in computational demands and
inference speed, due to their quadratic complexity. In this work, we have
identified a key pattern: certain seemingly meaningless special tokens (i.e.,
separators) contribute disproportionately to attention scores compared to
semantically meaningful tokens. This observation suggests that information of
the segments between these separator tokens can be effectively condensed into
the separator tokens themselves without significant information loss. Guided by
this insight, we introduce SepLLM, a plug-and-play framework that accelerates
inference by compressing these segments and eliminating redundant tokens.
Additionally, we implement efficient kernels for training acceleration.
Experimental results across training-free, training-from-scratch, and
post-training settings demonstrate SepLLM's effectiveness. Notably, using the
Llama-3-8B backbone, SepLLM achieves over 50% reduction in KV cache on the
GSM8K-CoT benchmark while maintaining comparable performance. Furthermore, in
streaming settings, SepLLM effectively processes sequences of up to 4 million
tokens or more while maintaining consistent language modeling capabilities.