대규모 환경에서의 엔드 투 엔드 컨텍스트 압축
End-to-End Context Compression at Scale
장문 컨텍스트를 사용하는 언어 모델 추론은 메모리 문제로 인해 병목 현상을 겪습니다. KV 캐시가 컨텍스트 길이에 따라 증가하기 때문입니다. 최근의 KV 캐시 압축 기술들은 성능 저하가 심하거나, 단일 긴 프롬프트를 압축하는 데 상당한 시간과 컴퓨팅 자원이 필요하다는 한계점을 가지고 있습니다. 또한 많은 방법들이 입력 데이터를 대상 모델의 컨텍스트 창 내에 맞춰야 하며, 일반적으로 최신 생산 추론 엔진과는 호환되지 않습니다. 인코더-디코더 압축 방식은 긴 토큰 시퀀스를 짧은 잠재 임베딩 시퀀스로 변환하여 디코더가 사용하는 방식으로, 이론적으로는 매력적인 대안입니다. 그러나 기존의 접근 방식들은 정확도와 효율성 측면에서 KV 캐시 압축에 비해 경쟁력이 떨어집니다. 본 연구에서는 인코더-디코더 압축 방식을 재검토하고 이러한 간극을 해소하고자 합니다. 먼저, 아키텍처 검색을 수행하여 다양한 변형 모델을 처음부터 학습시키면서, 인코더-디코더 압축기를 설계하고 훈련하는 최적의 방법을 결정합니다. 연구 결과를 바탕으로, 0.6B 매개변수의 인코더와 4B 매개변수의 디코더를 가진 모델들을 350억 개 이상의 토큰 데이터로 1:4, 1:8, 1:16의 압축 비율로 지속적으로 사전 학습시킵니다. 우리는 전반적인 성능, 압축 속도 및 최대 메모리 사용량 측면에서 파레토 최적점(Pareto frontier)을 개선하는 압축기 패밀리인 Latent Context Language Models (LCLMs)를 소개합니다. LCLMs는 장기적인 목표를 가진 에이전트의 효율적인 기반 모델 역할을 할 수 있으며, 에이전트는 압축된 긴 컨텍스트를 빠르게 처리하고 필요한 부분만 선택적으로 확장하여 사용할 수 있습니다.
Long-context language model inference is bottlenecked by memory, as the KV cache grows with context length. Recent techniques to compress the KV cache fall short: they either degrade model quality substantially or require considerable time and compute to compress a single long prompt. Furthermore, many methods require the input to fit within the target model's context window, and are generally incompatible with modern production inference engines. Encoder-decoder compressors, which map a long token sequence to a shorter sequence of latent embeddings consumed by a decoder, are an appealing alternative in principle. However, existing approaches are not competitive with KV cache compression on the accuracy-efficiency frontier. In this work, we revisit encoder-decoder compression and close this gap. We first perform an architecture search, pre-training many variants from scratch to determine how best to design and train encoder-decoder compressors. Guided by our findings, we continually pre-train a family of 0.6B-encoder, 4B-decoder models on over 350B tokens each, at compression ratios of 1:4, 1:8, and 1:16. We introduce Latent Context Language Models (LCLMs), a family of compressors that improve the Pareto frontier across general-task performance, compression speed, and peak memory usage. We demonstrate that LCLMs serve as efficient backbones for long-horizon agents, letting the agent skim through a compressed long context and adaptively expand relevant segments on demand.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.