Manuscript Offprint

arXiv:2611.06876

SpecCompact: Accelerating LLM Agent Context Compaction with Slot-Parallel Semantic Speculative Verification

Yulu An, Yifei Feng, Xiangyang Yin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

LLM agents use context compaction to manage growing interaction histories, but summarizing long histories with large models can introduce substantial delays. Compaction therefore requires balancing information retention against latency. We observe that structured summary slots can retain information when generated independently. Based on this observation, we present SpecCompact, a framework that accelerates compaction through slot-parallel semantic speculation. SpecCompact fine-tunes a small drafter and generates slots in parallel. The target model verifies each proposed line and repairs rejected content, while subsequent drafting uses the updated slot prefix. System optimizations further reduce repeated context processing and model calls. Across AppWorld and τ3\tau^3 benchmarks with two target models, SpecCompact achieves 2.04−5.63×2.04-5.63\times compaction speedups over Hermes-style summarization. Separate downstream evaluations reveal model- and task-dependent performance trade-offs. A user study within Hermes further shows an 8.68×8.68\times median compaction speedup.

1 Introduction

Large language model (LLM) agents now handle a growing range of tasks, especially personal work and coding (Meta, 2026; OpenAI, 2026; Anthropic, 2025; OpenAI, 2025). While longer context windows have enabled better long-horizon performance, they also allow agents to accumulate larger histories of user requests, tool outputs, and intermediate decisions. Agent systems typically use context compaction to shorten these histories while retaining information needed for later actions (OpenClaw, 2026; Nous Research, 2026). However, compaction itself requires processing a

Figure

Figure 1: Task success and compaction speedup with Gemma4-31B-IT, measured in separate evaluations.

long context and decoding a summary token by token. The resulting delay can significantly degrade the user experience. Compaction therefore requires balancing information retention against the latency of producing the summary.

Token-level speculative decoding, a general method for accelerating decoding, can speed up this compaction process. Specifically, a smaller model with lower inference costs can accelerate generation while preserving the target model's output distribution by target model verification (Leviathan et al., 2023; Chen et al., 2023). However, valid summaries can differ in wording yet have the same effect on later actions. Thus, although speculative decoding preserves lossless compaction behavior, it may not fully exploit this flexibility. Recent semantic speculation methods use target-model judgments to accept sentence-level drafts (Pan et al., 2025; Hu et al., 2026), making them better suited to compaction. However, applying these methods to a single summary still requires sequential generation, which can be slow for long contexts. Moreover, asynchronous compaction overlaps summarization with continued agent execution, while parallel compaction summarizes input blocks concurrently (Chen et al., 2026; Cim et al., 2026). These approaches raise a further question: can the struc-

*Equal contribution.

†Corresponding author.

Figure

(a) Slot structure

Figure

(b) Independent generation

Figure 2: Slot structure and independent generation. (a) Fields in OpenClaw and Hermes compaction templates. (b) Reference adequacy over 100 trajectories on LiveClawBench (Long et al., 2026), with six slots per trajectory.

ture of the summary itself guide parallel generation and target-model verification?

Existing compaction templates provide a useful starting point. Agent frameworks such as OpenClaw and Hermes (OpenClaw, 2026; Nous Research, 2026) organize summaries into fields such as goals, constraints, progress, decisions, and next steps. We call these fields slots. Each slot describes one aspect of the task state and can be generated directly from the shared history. In our preliminary study, slots generated without using other slots' outputs still preserve the necessary information, showing the potential for independent slot generation. Furthermore, reversing the slot generation order has little effect on the retained information. These findings suggest that slots can serve as units for independent and parallel generation, with verification and repair performed within each slot.

We introduce SpecCompact, a framework for accelerating agent context compaction through slot-parallel semantic speculation. A fine-tuned small model drafts each slot from the shared history and the content already accepted in that slot. The target model checks whether each proposed line is supported by the history and consistent with the accepted content. It accepts the line or generates a local replacement. These draft-verify-repair loops run in parallel, and their outputs are combined into a structured summary. We also introduce system-level optimizations that reduce execution overhead and further accelerate compaction.

Our contributions are as follows:

  • We show that summary slots can retain relevant information without conditioning on other slots' outputs, supporting their use as

units of parallel compaction.

  • We introduce SpecCompact, which combines training, parallel drafting, and line-wise semantic verification with local repair. We further optimize its execution to reduce repeated context processing and model calls.

  • We demonstrate 2.04–5.63× compaction speedups over Hermes-style summarization, alongside downstream task evaluations and a native Hermes user study.

References (31)