CacheSpec: Finding the Sweet Spot for Small Models in Large Language Models

Jingquan Chen, Jie Feng, Jinghua Piao, Shaogang Hu, Yong Li
7/3/2026
cs.AIcs.LG

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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$\times$ latency speedup; in parallel serving experiments, it improves throughput by about 2.8$\times$ 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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chen2026cachespec,
  title  = {CacheSpec: Finding the Sweet Spot for Small Models in Large Language Models},
  author = {Jingquan Chen and Jie Feng and Jinghua Piao and Shaogang Hu and Yong Li},
  year   = {2026},
  eprint = {2607.20507},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.20507v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.20507.svg)](https://codeofpaper.com/paper/2607.20507)

Discussion