mlsanityData to 7 Oct 2026

Efficient Prompt Caching via Embedding Similarity

arXiv 2402.01173 ↗First posted 2 Feb 2024cs.CL cs.LGcited by 9

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) have achieved huge success in numerous natural language process (NLP) tasks. However, it faces the challenge of significant resource consumption during inference. In this paper, we aim to improve the inference efficiency of LLMs by prompt caching, i.e., if the current prompt can be answered by the same response of a previous prompt, one can directly utilize that previous response without calling the LLM. Specifically, we focus on the prediction accuracy of prompt caching for single-round question-answering tasks via embedding similarity. The existing embeddings of prompts mostly focus on whether two prompts are semantically similar, which is not necessarily equivalent to whether the same response can answer them. Therefore, we propose a distillation-based method to fine-tune the existing embeddings for better caching prediction. Theoretically, we provide finite-sample guarantees for the convergence of our method under different types of loss functions. Empirically, we carefully construct a hard dataset based on Kwiatkowski et al. (2019) where the existing embedding model (Wang et al., 2022) only achieves an AUC of 0.51. We then fine-tune the above embedding model, which significantly improves the AUC of caching prediction from 0.51 to 0.81. We also conduct simulations demonstrating that our trained models achieve better caching efficiency than the previous embedding model.

Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 26 of its 43 references that are in the map. First posted on arXiv 2 Feb 2024.

Builds on

26 of 43 references.

References · 26

  1. 2022Training language models to follow instructions with human feedbackcited by 15,712
  2. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  3. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
  4. 2022Emergent Abilities of Large Language Modelscited by 2,483
  5. 2017Billion-scale similarity search with GPUscited by 2,477
  6. 2019Fine-Tuning Language Models from Human Preferencescited by 2,124
  7. 2021Improving language models by retrieving from trillions of tokenscited by 1,278
  8. 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,216
  9. 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 940
  10. 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
  11. 2023Capabilities of GPT-4 on Medical Challenge Problemscited by 630
  12. 2021Carbon Emissions and Large Neural Network Trainingcited by 561
14 more
  1. 2020Pre-training Tasks for Embedding-based Large-scale Retrievalcited by 153
  2. 2022Offline Reinforcement Learning with Realizability and Single-policy Concentrabilitycited by 122
  3. 2022Training Language Models with Memory Augmentationcited by 112
  4. 2020The Cost of Training NLP Models: A Concise Overviewcited by 97
  5. 2016Improving Neural Language Models with a Continuous Cachecited by 81
  6. 2022Nonparametric Masked Language Modelingcited by 39
  7. 2017Unbounded cache model for online language modeling with open vocabularycited by 37
  8. 2023On Optimal Caching and Model Multiplexing for Large Model Inferencecited by 20
  9. 2021Online Caching with Optimal Switching Regretcited by 11
  10. 2023Evaluating Embedding APIs for Information Retrievalcited by 11
  11. 2022Regret-Optimal Online Caching for Adversarial and Stochastic Arrivalscited by 5
  12. 2023Provably Efficient Offline Goal-Conditioned Reinforcement Learning with General Function Approximation and Single-Policy Concentrabilitycited by 5
  13. 2020Learning to Cache and Caching to Learn: Regret Analysis of Caching Algorithmscited by 4
  14. 2023Provably Efficient Reinforcement Learning via Surprise Boundcited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 2; 2025: 4; 2026: 3.

9 papers.