ChatPaper.aiChatPaper

SpeContext: Habilitando Raciocínio Eficiente de Longo Contexto com Especulação de Esparsidade Contextual em LLMs

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

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

Resumo

Neste artigo, apontamos que o objetivo dos algoritmos de recuperação é alinhar-se com o LLM, o que é semelhante ao objetivo da destilação de conhecimento em LLMs. Analisamos a similaridade no foco de informações entre o modelo de linguagem destilado (DLM) e o LLM original a partir da perspectiva da teoria da informação e, assim, propomos um novo paradigma que aproveita um DLM como algoritmo de recuperação. Com base nessa visão, apresentamos o SpeContext, um projeto conjunto de algoritmo e sistema para raciocínio de contexto longo. (1) No nível do algoritmo, o SpeContext propõe um cabeçalho de recuperação leve baseado nos pesos de atenção a nível de cabeçalho do DLM, alcançando uma redução de > 90% nos parâmetros por meio da poda da redundância. (2) No nível do sistema, o SpeContext projeta um fluxo de dados de pré-busca assíncrona por meio da estratégia de carregamento elástico, sobrepondo efetivamente a recuperação do cache KV com a computação do LLM. (3) No nível de compilação, o SpeContext constrói o modelo de memória teórico e implementa um sistema de gerenciamento de memória adaptativo para alcançar aceleração maximizando a utilização da memória da GPU. Implantamos e avaliamos o SpeContext em dois ambientes com recursos limitados, nuvem e borda. Experimentos extensivos mostram que, em comparação com a estrutura Huggingface, o SpeContext alcança uma melhoria de throughput de até 24,89x na nuvem e uma aceleração de 10,06x na borda com perda de precisão insignificante, empurrando a fronteira de Pareto entre precisão e throughput.
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.
PDF162February 26, 2026