CacheSpec: Finding the Sweet Spot for Small Models in Large Language Models
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Large language models (LLMs) are increasingly used for program-aided reasoning, agentic decision making, and structured task execution, but these settings often incur substantial inference cost. Many such requests share similar computational structures while differing in variables, constraints, or contexts, creating opportunities for program-level caching. Since program caches need to reapply reusable computation logic to new requests, their key steps often involve lightweight and structured operations such as variable extraction, program binding, and generation acceleration, which are well suited for small models. We propose CacheSpec, an inference optimization framework centered on reusable program caches. The framework converts Program-of-Thoughts (PoT)-style programs from one-time reasoning artifacts into reusable cache objects, and reuses the same small model for two roles: semantic variable extraction on the cache-hit path and speculative drafting during target-LLM generation. Experiments on shopping-style request datasets, WebShop, Formula, and CodeTAT-QA show that CacheSpec reduces inference latency and improves effective cache reuse while preserving comparable or better task quality than existing caching and generation baselines, achieving up to about 3.1× latency speedup; in parallel serving experiments, it improves throughput by about 2.8× over PoT-style methods. These results suggest that the sweet spot for small models in large-model inference systems lies not in solving complex tasks independently, but in performing lightweight, structured, and verifiable auxiliary operations.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 15 of its 26 references that are in the map. First posted on arXiv 3 Jul 2026.
Builds on
15 of 26 references.
References · 15
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2022Fast Inference from Transformers via Speculative Decodingcited by 1,653
- 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,463
- 2022WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agentscited by 1,251
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
- 2023Accelerating Large Language Model Decoding with Speculative Samplingcited by 1,006
- 2024Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Headscited by 843
- 2024EAGLE: Speculative Sampling Requires Rethinking Feature Uncertaintycited by 578
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025IC-Cache: Efficient Large Language Model Serving via In-context Caching
- 2026Asynchronous Verified Semantic Caching for Tiered LLM Architectures
- 2025Semantic Caching for Low-Cost LLM Serving: From Offline Learning to Online Adaptation
- 2026StepKV: Step-Aware KV Cache Compression for LLM Agents
- 2025Reasoning on a Budget: A Survey of Adaptive and Controllable Test-Time Compute in LLMs
- 2025KV Cache Steering for Controlling Frozen LLMs
- 2025Log-Augmented Generation: Scaling Test-Time Reasoning with Reusable Computation
- 2026Dynamic Model Routing and Cascading for Efficient LLM Inference: A Survey