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

SpecCompact drafts summary slots in parallel to speed up agent context compaction

Yulu An, Yifei Feng, Xiangyang Yin · arXiv · 2026-11-4

- **Problem** Agents shorten long histories by writing a summary with a large model, one token at a time. That summary step adds delay that hurts the user experience.
- **Method** SpecCompact has a small drafter write each summary slot line by line in parallel, instead of one sequence, while the target model checks each line and repairs rejected ones.
- **Results** On AppWorld and τ 3, SpecCompact achieved 2.04 to 5.63× compaction speedups over Hermes-style summarization.

![Figure 3: Overview of SpecCompact](https://refivu.com/papers/38ad4f22-a54a-4711-9220-a0310bb8cf15/figures/figure-70ebc967ef896964465e2a7911c4c278.png?thumb=512)

**Figure 3** : Overview of SpecCompact.

[Original paper](https://arxiv.org/abs/2611.06876v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Yulu An, Yifei Feng, Xiangyang Yin · SpecCompact: Accelerating LLM Agent Context Compaction with Slot-Parallel Semantic Speculative Verification · Original paper figure · Extracted the figure area from page 3 of the original PDF.

## Why summary generation slows agents

Agents keep growing histories of user requests, tool outputs and decisions, and compaction shortens them so later steps stay usable. The catch is that compaction has to read a long context and then write the summary one token at a time, so the wait can hurt the user experience. So the design question is how much of that delay can be cut without losing what later actions need.

Speculative decoding is the usual remedy: a small model drafts tokens and a larger target model checks them, which keeps the target's output distribution. Its check works per token, though, and a summary can be worded many ways while doing the same job for later actions. Semantic speculation loosens that check by letting the target judge a whole sentence or reasoning step by its meaning.

Even so, those methods generate one summary sequentially, and that stays slow on long inputs.

## Are summary slots independent?

The authors treat the fields of OpenClaw and Hermes summary templates as the unit of generation and call them slots. Generating all slots as one sequence makes later slots wait for earlier ones, so the authors asked whether that sequential dependency is necessary. If slots truly depended on one another, generating them in parallel would lose information, so the authors tested that directly.

The authors compared monolithic generation, which produces all six slots in a single output, with independent generation, which produces each slot without access to the other slots' outputs. They ran this comparison on 100 LiveClawBench trajectories, with six slots per trajectory. Independent generation reached a mean score of 4.73, compared to 4.44 for monolithic generation.

The share of slots scoring at least 4 was 93% for independent generation and 85% for monolithic generation. Reversing the order changed the mean by at most 0.03, so order doesn't seem to carry the information. An LLM judge summed five binary criteria into a score from 0 to 5, so these scores show how much relevant history each slot keeps, as the judge reads it.

![Figure 2: Slot structure and independent generation. (a) Fields in OpenClaw and Hermes compaction templates. (b) Reference adequacy over 100 trajectories on Li…](https://refivu.com/papers/38ad4f22-a54a-4711-9220-a0310bb8cf15/figures/figure-38f3b0b670e8c2421f600ecfa12ca3e2.png?thumb=512)

**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.

[Original paper](https://arxiv.org/abs/2611.06876v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

The authors read this as a sign that the information a slot needs can usually be recovered from the history alone. That is what makes generating slots in parallel from one shared history plausible. This result is the basis for SpecCompact's design, where a fine-tuned drafter writes each slot from the shared history and the lines already accepted in that slot.

## How drafting and verification run

The key idea is to let a small drafter write each slot line by line, while the target model decides whether each line stays. When the target rejects a line, it writes a replacement, and the drafter continues from that corrected prefix.

The drafter is Qwen3-0.6B, and it receives supervised fine-tuning on slot content that the target model wrote. Training minimizes a cross-entropy loss over the target's slot tokens, conditioned on the history H, the slot instruction c\_s and the earlier slot tokens. \\\[ L\_{SFT}(\\theta) = -\\sum\_{j=1}^{L\_s}\\log q\_\\theta(y\_{s,j}\\mid H, c\_s, y\_{s,\<j}) \\\]

At run time each slot gets its own stream that shares the history but keeps its own accepted prefix. The drafter proposes the next line from the history, the slot instruction and the prefix \\(A\_{s,t-1}\\), as \\\[ \\tilde{\\ell}\_{s,t}\\sim q\_\\theta(\\cdot\\mid H, c\_s, A\_{s,t-1}) \\\] describes. The line joins the prefix only after verification, so each slot depends only on its own prefix and the six streams can run side by side.

For each proposed line the target returns one judgment token, and the authors read the positive and negative probabilities from its top-k tokens. The normalized acceptance score divides the positive probability by the sum of the positive and negative probabilities, \\\[ r\_{s,t}=\\frac{\\hat{p}^{+}\_{s,t}}{\\hat{p}^{+}\_{s,t}+\\hat{p}^{-}\_{s,t}} \\\].

A line is accepted when \\(r\_{s,t}\\) reaches the threshold \\(\\eta\\), which the latency experiments set to 0.7. If a label is missing from the top-k tokens, its substitute probability is the smaller of the leftover mass and the smallest returned probability.

A rejected line is replaced by a target-written line that sees the same history, instruction and accepted prefix, with the rejected line left out. The prefix then grows by either the accepted draft or the replacement, so later drafting builds on what was kept.

## Keeping the loop cheap

A naive verify loop repeats expensive work, because every verification call includes the same long history. Even a one-token verification response needs another prefill when the history is not reused. Requesting each draft line separately adds model-call overhead, and repair can decode lines that are never used. The authors address these costs with four optimizations, and they measure their combined effect later.

![Figure 4: Execution optimizations in SpecCompact: independent slot scheduling, shared-prefix caching, draft buffering, line-aware stopping, and lightweight che…](https://refivu.com/papers/38ad4f22-a54a-4711-9220-a0310bb8cf15/figures/figure-62d03fb4e51712387b356172ad7390a4.png?thumb=512)

**Figure 4** : Execution optimizations in SpecCompact: independent slot scheduling, shared-prefix caching, draft buffering, line-aware stopping, and lightweight checks with termination rules.

[Original paper](https://arxiv.org/abs/2611.06876v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

Independent slot scheduling runs the six slot streams concurrently, so each stream keeps its own accepted prefix and loop. While one slot waits for verification or repair, the other slots keep drafting or submit their own requests. This overlap lets the drafter and target work at the same time, and server-side batching groups requests across slots.

Shared-prefix caching places the history and all six slot contracts first, so verification requests keep the same leading tokens. Draft buffering lets the drafter generate several lines per call, and the buffered lines are reused only when their prefix exactly matches the accepted prefix. A target repair changes the prefix, so the remaining buffered lines are discarded and drafting restarts from the repaired prefix.

Checks and termination guard against repetitive drafter output. A proposed line that duplicates an accepted line or exceeds a character limit goes straight to target repair, skipping one semantic verification call. Lines starting with # and empty-slot markers such as (none) are accepted directly, because they are standard output forms.

## Speed against Hermes and OpenClaw

SpecCompact's speedup over Hermes depends on the target model, so the answer is no for a uniform gain. The latency comparison uses 20 matched inputs per workload, with Hermes as the reference for each row. On Gemma4, SpecCompact reached 4.28–5.63× speedups on the agent workloads. On Qwen3.5, the range was 2.04–2.41× on the same agent workloads.

On LongBench inputs of about 16k tokens, the speedups were 2.49× for Gemma4 and 1.36× for Qwen3.5.

![Table 3: Compaction latency and speedup on 20 matched inputs per workload. Speedup is relative to Hermes. Bold marks the best result within each target. SpecCo…](https://refivu.com/papers/38ad4f22-a54a-4711-9220-a0310bb8cf15/figures/figure-3b214b971c9b34b112d56845fa46cc6c.png?thumb=512)

**Table 3** : Compaction latency and speedup on 20 matched inputs per workload. Speedup is relative to Hermes. Bold marks the best result within each target. SpecCompact uses an additional drafter GPU.

[Original paper](https://arxiv.org/abs/2611.06876v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

Qwen3.5 gains less, and the authors give three reasons for it. First, Qwen3.5's baseline summarization is already faster than Gemma4's. Second, the 0.6B drafter matches Qwen3.5 less well, because the model-size gap is larger. The drafter's acceptance rate on Qwen3.5 was 19.6 percentage points lower than on Gemma4, which is the clearest measured sign of that weaker match.

Third, the vLLM deployment gives limited prefix-cache reuse for Qwen3.5's hybrid attention. Qwen3.5's linear-attention layers also need recurrent states restored from checkpoints at suitable positions, so matching text prefixes alone don't guarantee cache reuse. Against OpenClaw, SpecCompact was faster in seven of the eight settings. The exception was Qwen3.5 on τ 3, where SpecCompact took 8.71 seconds compared to 7.68 seconds for OpenClaw.

The system optimizations cut latency further, by 1.88–2.44× for Gemma4 and 1.19–1.51× for Qwen3.5. Gemma4's AppWorld Normal latency fell from 20.17 to 8.26 seconds, a large gain on the workload where the loop runs most often. The table measures all the optimizations together, so it doesn't show how much any single one contributes.

## Downstream task results: does compaction keep agents on task?

AppWorld tests task completion through code and application APIs, while τ 3 tests task completion through user interaction and tool use. The authors ran three trials per task on an 80-task random subset of τ 3 for each target model. They report TGC and SGC on AppWorld and task success rate on τ 3. Full History, which has no compaction, reaches 62.50 TGC for Gemma4 on AppWorld Normal, above every compacted variant.

![Table 1: Agent task performance (%). Full History is a reference without compaction. Bold marks the best compaction result. Gray subscripts show 95% confidence…](https://refivu.com/papers/38ad4f22-a54a-4711-9220-a0310bb8cf15/figures/figure-59e5a9eda7f6d091067a6fcc2f27b966.png?thumb=512)

**Table 1** : Agent task performance (%). Full History is a reference without compaction. Bold marks the best compaction result. Gray subscripts show 95% confidence intervals.

[Original paper](https://arxiv.org/abs/2611.06876v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

With Gemma4-31B-IT on AppWorld Normal, SpecCompact reaches 54.76 TGC, compared to 57.74 for Hermes. That is a reduction of 2.98 percentage points. On the same model, SpecCompact reduces τ 3 success by 2.50 points relative to Hermes. On AppWorld Challenge, the Gemma4 TGC drop against Hermes is 4.07 points.

With Qwen3.5-122B-A10B on AppWorld Normal, SpecCompact raises TGC to 33.33, compared to 28.57 for Hermes. That is an increase of 4.76 points, and τ 3 success rises by 0.83 points. Challenge SGC falls by 0.72 points, so the gain doesn't hold on every metric.

On Qwen3.5, SpecCompact stays within 0.6 points of Target-self on both LongBench datasets. On Gemma4, the same comparison is the opposite, so the model choice decides which side of the trade-off a team lands on.

## Long-context quality

The reference point for this section is Target-self, where the target model writes each slot directly without a drafter or semantic verification. The comparison covers LongBench GovReport and QMSum, scored with ROUGE-L, plus RULER at 8k and 16k using the official task-specific matching metrics. Full History, the uncompacted reference, scores highest on every column, so the gap to it shows how much each compaction method gives up.

On Gemma4-31B-IT, SpecCompact trails Target-self by 0.83 to 4.50 points across the four settings. The widest gap appears on RULER at 8k, where Target-self scores 71.00 and SpecCompact scores 66.50. Target-self is the stronger reference here, so the speculative path costs some summary quality on this model.

On Qwen3.5-122B-A10B, SpecCompact comes within 0.6 points of Target-self on both LongBench datasets. SpecCompact also scores higher at both RULER lengths, reaching 74.23 at 8k compared to 72.98 for Target-self. The two target models move in opposite directions, so the choice of target model changes summary quality as well as speed.

## Hermes user study: does the speedup survive in a real agent?

The authors integrated SpecCompact into the Hermes codebase and deployed it with Gemma4 on four NVIDIA RTX PRO 6000 GPUs. They built three scenarios from their own workflows, covering coding, math, and multitask question answering. Users triggered compaction from that same snapshot with each method and picked the one that felt faster, without knowing which method was which.

The background also logged the actual compaction time, so feel and measured latency could be compared.

Across the collected compaction data, median compaction latency dropped from 63.74 to 7.28 seconds. That gives a median paired speedup of 8.68×, so the lab speedups carry over to the native agent deployment.

The blind preference results split 28 responses across four outcomes. Eleven responses (39.3%) favored SpecCompact, while 8 (28.6%) favored Hermes. Eight responses (28.6%) rated the two summaries as similar, and 1 (3.6%) couldn't judge. With only 28 responses, the preference result rests on a small sample and doesn't carry the same weight as the latency numbers.

## Where the claims stop for SpecCompact

SpecCompact doesn't give a consistent accuracy gain over summarization by the target model, and the authors say so directly. The downstream results depend on the target model, so one model's outcome doesn't carry over to the other. With Gemma4, SpecCompact reduces TGC by 2.98 and 4.07 percentage points on AppWorld Normal and Challenge compared with Hermes.

Its Table 1 results for Qwen3.5 still show Challenge SGC falling by 0.72 points, so the gains aren't uniform across metrics.

The authors suggest that better drafter and target alignment could improve accuracy and give a better trade-off. They point to the reinforcement learning approach in DREAM-R as the kind of alignment that could help. Slots draw on the history in different places: Progress and Decisions use evidence spread across the context, while Goal, Constraints and Next Steps mainly rely on the beginning or end.

That difference motivates slot-conditioned sliding-window attention as a possible way to speed up drafting. The authors leave this direction to future work because of limited time and resources, so they don't test it.

## Paper info

- **Authors**: Yulu An, Yifei Feng, Xiangyang Yin
- **Venue**: arXiv · Preprint
- **First published**: 2026-11-4
- **Added**: 2026-11-6
- **Updated**: 2026-11-4
- **Version**: v1
- **arXiv**: 2611.06876
- **Category**: cs.CL
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.06876v1) · [PDF ↗](https://arxiv.org/pdf/2611.06876v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## 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$ benchmarks with two target models, SpecCompact achieves $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\\times$ median compaction speedup.

## Quote from the paper

Yulu An, Yifei Feng, Xiangyang Yin (2026). SpecCompact: Accelerating LLM Agent Context Compaction with Slot-Parallel Semantic Speculative Verification. arXiv:2611.06876v1. https://arxiv.org/abs/2611.06876v1

**BibTeX**

```
@misc{an2026speccompact,
  title = {{SpecCompact: Accelerating LLM Agent Context Compaction with Slot-Parallel Semantic Speculative Verification}},
  author = {Yulu An and Yifei Feng and Xiangyang Yin},
  year = {2026},
  eprint = {2611.06876},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.06876v1}
}
```

## Related papers

- [Fast Inference from Transformers via Speculative Decoding](https://refivu.com/en/papers/41a03564-b5d1-4b7f-8db4-502dbc43fbe0-fast-inference-from-transformers-via-speculative-decoding.md)
- [D3D: Decoupled Diffusion Drafting for Asynchronous Speculative Decoding](https://refivu.com/en/papers/d139d32b-32b6-47f1-801a-9c13102138d3-d3d-decoupled-diffusion-drafting-for-asynchronous.md)
- [Where Should LLM Agents Adapt at Test Time? In Context, in Weights, or Both](https://refivu.com/en/papers/39fae58e-bc8b-4dc6-bf76-acf24f94a299-where-should-llm-agents-adapt-at-test-time.md)
- [Coarse Semantic Blocks for Efficient Training-Free Sparse Attention](https://refivu.com/en/papers/52935b53-62a3-4266-90b0-b3631ba9ddcc-coarse-semantic-blocks-for-efficient-training-free-sparse.md)
- [Qwen2.5 Technical Report](https://refivu.com/en/papers/bbe09642-acbf-4c8a-ac5f-c376606e8d8b-qwen2-5-technical-report.md)
- [ChainFlow: Few-Step Latent Flow Matching for Speculative Decoding](https://refivu.com/en/papers/93c02290-232b-4fea-be96-dcb416a7416b-chainflow-few-step-latent-flow-matching-for-speculative.md)

## Other paper commentary

- [FrontierPhysics: Evaluating Agents for End-to-End Physics Research](https://refivu.com/en/papers/1ce4f126-66ec-4969-9dbe-f7e90f1e4e61-frontierphysics-evaluating-agents-for-end-to-end-physics.md)
- [Cooperative Multi-Agent Reinforcement Learning with Submodular Trajectory Rewards](https://refivu.com/en/papers/4a7e5a04-8712-4e37-b76c-97925c65d311-cooperative-multi-agent-reinforcement-learning-with.md)
- [ScamWorld: An Interactive Environment for Evaluating Web Agents Against Online Fraud](https://refivu.com/en/papers/1a76f7bb-3d3d-46af-8fe4-17d7f3c5fd37-scamworld-an-interactive-environment-for-evaluating-web.md)
- [Where Is the Truth When AI Agents Disagree? Dependence-Aware Belief Propagation for Unsupervised Truth Discovery (Extended Version)](https://refivu.com/en/papers/ff649851-9a14-4591-a094-59a064709a42-where-is-the-truth-when-ai-agents-disagree.md)
- [$τ$-Rec-Books: A Disclosure-Controlled Benchmark for Requirement Elicitation in Agentic Recommender Systems](https://refivu.com/en/papers/a203d096-8af2-4668-aef9-d3d9e4812a81-rec-books-a-disclosure-controlled-benchmark-for-requirement.md)
- [Delivered, Not Used: Evaluating Agent Memory at Its Point of Use](https://refivu.com/en/papers/a378f2e4-024f-47e2-bb60-3b62794d6749-delivered-not-used-evaluating-agent-memory-at-its.md)
- [CounterFactual Retrieval for Evidence-Aware Individual Animal Identification](https://refivu.com/en/papers/3cf8f3a0-3ddd-4d12-8317-757a81b8ce8e-counterfactual-retrieval-for-evidence-aware-individual.md)
- [CompressionBench: How can your coding agents compress LLMs?](https://refivu.com/en/papers/943d8a97-633d-4d07-9efd-15168ede4d74-compressionbench-how-can-your-coding-agents-compress-llms.md)
- [ServerBench: How can your coding agents design specialized LLM serving systems?](https://refivu.com/en/papers/08bfcdf2-e2ef-4a8a-a94e-0ae43f956fef-serverbench-how-can-your-coding-agents-design-specialized.md)
- [From Certified Pairs to a Certified Hub: Reasoner-Checked Crosswalks for the Information Exchange Standard](https://refivu.com/en/papers/2223debf-80ef-4fb4-9106-ea557331d908-from-certified-pairs-to-a-certified-hub-reasoner.md)
- [Learning to Track Cells from Sparse Annotations in 3D Time-Lapse Microscopy](https://refivu.com/en/papers/e77751e9-675b-4c55-a7c2-c29622d19d5d-learning-to-track-cells-from-sparse-annotations-in.md)
- [Dimension-Free Private Mean Estimation is Impossible Without the Covariance](https://refivu.com/en/papers/cf9843a6-a907-4014-971a-5c2ba187bba6-dimension-free-private-mean-estimation-is-impossible-without.md)

## Terms in this paper

- [LoRA](https://refivu.com/en/terms/bee764895c36-lora)
- [Supervised Fine-tuning](https://refivu.com/en/terms/1a2c1f079517-supervised-fine-tuning)
- [vLLM](https://refivu.com/en/terms/fe3c96648564-vllm)
- [speculative decoding](https://refivu.com/en/terms/2496d9bbec40-speculative-decoding)
- [AppWorld](https://refivu.com/en/terms/3d77af475ade-appworld)
- [openclaw](https://refivu.com/en/terms/f3be13989809-openclaw)
- [Qwen3.5-122B-A10B](https://refivu.com/en/terms/e98e897b8576-qwen3-5-122b-a10b)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/38ad4f22-a54a-4711-9220-a0310bb8cf15-speccompact-accelerating-llm-agent-context-compaction-with)
