CompLLM: 장문 컨텍스트 질의응답을 위한 압축 기술
CompLLM: Compression for Long Context Q&A
September 23, 2025
저자: Gabriele Berton, Jayakrishnan Unnikrishnan, Son Tran, Mubarak Shah
cs.AI
초록
대규모 언어 모델(LLMs)은 자기 주의(self-attention)의 이차 복잡성으로 인해 긴 문맥을 처리할 때 상당한 계산적 어려움에 직면한다. 입력 텍스트를 더 작은 잠재 표현으로 매핑하는 소프트 문맥 압축 방법이 유망한 결과를 보여주고 있지만, 실제 적용은 제한적이다. 기존 기술은 일반적으로 문맥을 단일 단위로 압축하여 이차 압축 복잡성을 초래하고, 중복 문맥을 가진 쿼리 간 계산 재사용이 불가능하다. 본 연구에서는 실용적 배포를 위해 설계된 소프트 압축 기술인 CompLLM을 소개한다. CompLLM은 문맥을 전체적으로 처리하는 대신 세그먼트로 나누어 각각을 독립적으로 압축한다. 이 간단한 설계 선택은 세 가지 중요한 특성을 제공한다: 효율성, 문맥 길이에 대해 선형적으로 확장되는 압축 단계; 확장성, 짧은 시퀀스(예: 1k 토큰)로 훈련된 모델이 100k 토큰의 문맥으로 일반화할 수 있도록 함; 재사용성, 압축된 세그먼트를 캐시하여 다른 쿼리에서 재사용할 수 있음. 실험 결과, 2배 압축률에서 CompLLM은 높은 문맥 길이에서 첫 토큰까지의 시간(TTFT)을 최대 4배까지 단축하고 KV 캐시 크기를 50% 줄인다. 또한, CompLLM은 압축되지 않은 문맥에서 얻은 성능과 비슷한 결과를 달성하며, 매우 긴 시퀀스에서는 이를 능가하여 그 효과성과 실용성을 입증한다.
English
Large Language Models (LLMs) face significant computational challenges when
processing long contexts due to the quadratic complexity of self-attention.
While soft context compression methods, which map input text to smaller latent
representations, have shown promise, their real-world adoption is limited.
Existing techniques typically compress the context as a single unit, which
leads to quadratic compression complexity and an inability to reuse
computations across queries with overlapping contexts. In this work, we
introduce CompLLM, a soft compression technique designed for practical
deployment. Instead of processing the context holistically, CompLLM divides it
into segments and compresses each one independently. This simple design choice
yields three critical properties: efficiency, as the compression step scales
linearly with the context length; scalability, enabling models trained on short
sequences (e.g., 1k tokens) to generalize to contexts of 100k tokens; and
reusability, allowing compressed segments to be cached and reused across
different queries. Our experiments show that with a 2x compression rate, at
high context lengths CompLLM speeds up Time To First Token (TTFT) by up to 4x
and reduces the KV cache size by 50%. Furthermore, CompLLM achieves performance
comparable to that obtained with the uncompressed context, and even surpasses
it on very long sequences, demonstrating its effectiveness and practical
utility.