atlas

Research map / Large language models / Language, safety and interpretability

Generative Caching for Structurally Similar Prompts and Responses

NeurIPS 2025 · Large language models › Language, safety and interpretability · approach: Uncertainty quantification for LLMs · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces GenCache, a generative client-side cache that clusters structurally similar prompt-response pairs, synthesizes a validated regex-based Python program per cluster, and executes it on cache hits to produce variation-aware responses.

Problem

Exact prompt matching misses structurally similar prompts with minor variations, while semantic caching returns incorrect cached responses that ignore critical differences, which is risky for agentic actions.

Approach

Instead of storing LLM responses verbatim, cache a program generated by an LLM from in-context exemplars of a prompt-response cluster; the program (with a stored regex for prompt structure) synthesizes customized responses for new prompts locally, validated by an LLM before caching and with feedback-driven regeneration.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use Generative Cache instead of GPTCachePrompt caching · Param-Onlypositive hit rate: 0 ($\pm$ 0.0) -> 98.03 ($\pm$ 0.05)Helped
Use Generative Cache instead of GPTCachePrompt caching · Param-w-Synonympositive hit rate: 0 ($\pm$ 0.0) -> 92.16 ($\pm$ 0.12)Helped
Use Generative Cache for structurally varied promptsPrompt caching · Structuralcache hit rate: 96.28 ($\pm$ 0.01) -> 4.23 ($\pm$ 0.21)Hurt
Add negative-hit feedback that deletes the corresponding cached programGenerative Cache · Param-Onlynegative hit rate: 1.97 ($\pm$ 0.05) -> 0.37 ($\pm$ 0.02)Helped
Add negative-hit feedback that deletes the corresponding cached programGenerative Cache · Param-Onlycache hit rate: 97.81 ($\pm$ 0.96) -> 82.35 ($\pm$ 1.57)Hurt
Add negative-hit feedback that deletes the corresponding cached programGenerative Cache · Param-w-Synonymnegative hit rate: 7.84 ($\pm$ 0.12) -> 4.4 ($\pm$ 0.08)Helped
Add negative-hit feedback that deletes the corresponding cached programGenerative Cache · Param-w-Synonymcache hit rate: 83.66 ($\pm$ 6.37) -> 68.32 ($\pm$ 4.85)Hurt
Integrate Generative Cache alongside exact cacheCloud-operations agent · Cloud incident diagnosiscache hit rate: 34.4% -> 54.7%Helped
Integrate Generative Cache alongside exact cacheCloud-operations agent · Cloud incident diagnosisexecution time: 53.45s -> 39.91sHelped
Integrate Generative Cache alongside exact cacheLaser WebShop agent · Laser WebShopcache hit rate: 5.7% -> 37.2%Helped
Integrate Generative Cache alongside exact cacheLaser WebShop agent · Laser WebShopexecution time: 5.16s -> 5.02sHelped
Set similarity thresholds to T^p=0.85 and T^r=0.85 (ablation)Generative Cache · Param-w-Synonymcache hit rate: 83.66 -> 60.02Hurt

Surprising findings

Limitations

Experimental setup

Datasets: WebShop Microsoft incident diagnosis data (298 incidents)

Benchmarks: WebShop-derived synthetic prompt sets (Param-Only, Param-w-Synonym, Structural) Laser web agent on WebShop (200 requests) Cloud-operations agent FLASH incidents

Metrics: cache hit rate positive hit rate negative hit rate LLM calls token usage execution time

Baselines: exact prompt matching GPTCache GenCache-feedback

Builds on: GPTCache ReAct SentenceTransformers in-context learning

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy