ChatPaper.aiChatPaper

SpeContext: LLM에서 추론적 컨텍스트 희소성을 통한 효율적인 장문 컨텍스트 추론 지원

SpeContext: Enabling Efficient Long-context Reasoning with Speculative Context Sparsity in LLMs

November 30, 2025
저자: Jiaming Xu, Jiayi Pan, Hanzhen Wang, Yongkang Zhou, Jiancai Ye, Yu Wang, Guohao Dai
cs.AI

초록

본 논문에서는 검색 알고리즘의 목표가 LLM과의 정렬에 있음이 LLM의 지식 증류 목표와 유사함을 지적합니다. 우리는 정보 이론 관점에서 증류 언어 모델(DLM)과 원본 LLM 간 정보 초점의 유사성을 분석하고, 이를 바탕으로 검색 알고리즘으로 DLM을 활용하는 새로운 패러다임을 제안합니다. 이러한 통찰을 바탕으로 장문맥 추론을 위한 알고리즘 및 시스템 공동 설계인 SpeContext를 제시합니다. (1) 알고리즘 수준에서 SpeContext는 DLM의 헤드 수준 어텐션 가중치를 기반으로 한 경량화된 검색 헤드를 제안하여 중복성을 제거함으로써 90% 이상의 매개변수 감소를 달성합니다. (2) 시스템 수준에서 SpeContext는 탄력적 로딩 전략을 통한 비동기적 프리페치 데이터플로우를 설계하여 KV 캐시 검색과 LLM 연산을 효과적으로 중첩합니다. (3) 컴파일 수준에서 SpeContext는 이론적 메모리 모델을 구성하고 적응형 메모리 관리 시스템을 구현하여 GPU 메모리 활용도를 극대화함으로써 가속화를 달성합니다. 우리는 SpeContext를 클라우드와 엣지라는 두 가지 자원 제약 환경에 배포 및 평가했습니다. 광범위한 실험 결과, Huggingface 프레임워크 대비 SpeContext는 클라우드에서 최대 24.89배의 처리량 향상, 엣지에서 10.06배의 속도 향상을 정확도 손실은 미미한 수준으로 달성하여 정확도와 처리량의 파레토 최적 경계를 확장했습니다.
English
In this paper, we point out that the objective of the retrieval algorithms is to align with the LLM, which is similar to the objective of knowledge distillation in LLMs. We analyze the similarity in information focus between the distilled language model(DLM) and the original LLM from the perspective of information theory, and thus propose a novel paradigm that leverages a DLM as the retrieval algorithm. Based on the insight, we present SpeContext, an algorithm and system co-design for long-context reasoning. (1) At the algorithm level, SpeContext proposes lightweight retrieval head based on the head-level attention weights of DLM, achieving > 90% parameters reduction by pruning the redundancy. (2) At the system level, SpeContext designs an asynchronous prefetch dataflow via the elastic loading strategy, effectively overlapping KV cache retrieval with the LLM computation. (3) At the compilation level, SpeContext constructs the theoretical memory model and implements an adaptive memory management system to achieve acceleration by maximizing GPU memory utilization. We deploy and evaluate SpeContext in two resourceconstrained environments, cloud and edge. Extensive experiments show that, compared with the Huggingface framework, SpeContext achieves up to 24.89x throughput improvement in cloud and 10.06x speedup in edge with negligible accuracy loss, pushing the Pareto frontier of accuracy and throughput.
PDF111December 3, 2025