ChatPaper.aiChatPaper

SpeContext: Habilitación de razonamiento eficiente en contextos largos mediante esparcidad especulativa de contexto en 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

Resumen

En este artículo, señalamos que el objetivo de los algoritmos de recuperación es alinearse con el LLM, lo cual es similar al objetivo de la destilación de conocimiento en los LLM. Analizamos la similitud en el enfoque de información entre el modelo de lenguaje destilado (DLM) y el LLM original desde la perspectiva de la teoría de la información, y por lo tanto proponemos un nuevo paradigma que aprovecha un DLM como algoritmo de recuperación. Basándonos en esta idea, presentamos SpeContext, un diseño conjunto de algoritmo y sistema para el razonamiento de contexto largo. (1) A nivel de algoritmo, SpeContext propone un cabezal de recuperación ligero basado en los pesos de atención a nivel de cabezal del DLM, logrando una reducción de >90% en los parámetros mediante la poda de la redundancia. (2) A nivel de sistema, SpeContext diseña un flujo de datos de prebúsqueda asíncrona mediante la estrategia de carga elástica, solapando eficazmente la recuperación de la caché KV con el cálculo del LLM. (3) A nivel de compilación, SpeContext construye el modelo de memoria teórico e implementa un sistema de gestión de memoria adaptativo para lograr una aceleración maximizando la utilización de la memoria de la GPU. Desplegamos y evaluamos SpeContext en dos entornos con recursos limitados, la nube y el edge. Experimentos exhaustivos demuestran que, en comparación con el framework Huggingface, SpeContext logra una mejora de rendimiento de hasta 24.89x en la nube y una aceleración de 10.06x en el edge con una pérdida de precisión negligible, desplazando la frontera de Pareto de precisión y rendimiento.
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