ChatPaper.aiChatPaper

SpeContext: Effizientes Langkontext-Rationalisieren durch spekulative Kontextsparsität in LLMs

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

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

papers.abstract

In diesem Beitrag weisen wir darauf hin, dass das Ziel von Retrieval-Algorithmen darin besteht, sich mit dem LLM abzustimmen, was dem Ziel der Wissensdistillation in LLMs ähnelt. Wir analysieren die Ähnlichkeit der Informationsfokussierung zwischen dem distillierten Sprachmodell (DLM) und dem ursprünglichen LLM aus informationstheoretischer Perspektive und schlagen darauf aufbauend ein neuartiges Paradigma vor, das ein DLM als Retrieval-Algorithmus nutzt. Auf dieser Grundlage präsentieren wir SpeContext, einen co-Design-Ansatz für Algorithmus und System für Long-Context Reasoning. (1) Auf Algorithmus-Ebene führt SpeContext einen leichtgewichtigen Retrieval-Head ein, der auf den Head-level-Attentionsgewichten des DLM basiert und durch Redundanzreduzierung eine Parameterverringerung von >90 % erreicht. (2) Auf System-Ebene entwirft SpeContext einen asynchronen Prefetch-Datenfluss mittels einer elastischen Lade-Strategie, der die KV-Cache-Abfrage effektiv mit der LLM-Berechnung überlappt. (3) Auf Compiler-Ebene konstruiert SpeContext ein theoretisches Speichermodell und implementiert ein adaptives Speicherverwaltungssystem, um durch Maximierung der GPU-Speichernutzung eine Beschleunigung zu erzielen. Wir setzen SpeContext in zwei ressourcenbeschränkten Umgebungen (Cloud und Edge) ein und evaluieren es. Umfangreiche Experimente zeigen, dass SpeContext im Vergleich zum Huggingface-Framework einen bis zu 24,89-fachen Durchsatz in der Cloud und eine 10,06-fache Beschleunigung am Edge bei vernachlässigbarer Genauigkeitseinbuße erreicht und damit die Pareto-Front von Genauigkeit und Durchsatz verschiebt.
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