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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Xu, Jiaming, Pan, Jiayi, Wang, Hanzhen, Zhou, Yongkang, Ye, Jiancai, Wang, Yu, Dai, Guohao
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911294930550784
author Xu, Jiaming
Pan, Jiayi
Wang, Hanzhen
Zhou, Yongkang
Ye, Jiancai
Wang, Yu
Dai, Guohao
author_facet Xu, Jiaming
Pan, Jiayi
Wang, Hanzhen
Zhou, Yongkang
Ye, Jiancai
Wang, Yu
Dai, Guohao
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2512_00722
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle SpeContext: Enabling Efficient Long-context Reasoning with Speculative Context Sparsity in LLMs
Xu, Jiaming
Pan, Jiayi
Wang, Hanzhen
Zhou, Yongkang
Ye, Jiancai
Wang, Yu
Dai, Guohao
Artificial Intelligence
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.
title SpeContext: Enabling Efficient Long-context Reasoning with Speculative Context Sparsity in LLMs
topic Artificial Intelligence
url https://arxiv.org/abs/2512.00722