ChatPaper.aiChatPaper

SpeContext: Обеспечение эффективного логического вывода в длинных контекстах с помощью спекулятивной разреженности контекста в больших языковых моделях

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