Cache me if you Can: an Online Cost-aware Teacher-Student framework to Reduce the Calls to Large Language Models
On the map: Knowledge distillation → Knowledge distillation for LLMs
Abstract (arXiv)
Prompting Large Language Models (LLMs) performs impressively in zero- and few-shot settings. Hence, small and medium-sized enterprises (SMEs) that cannot afford the cost of creating large task-specific training datasets, but also the cost of pretraining their own LLMs, are increasingly turning to third-party services that allow them to prompt LLMs. However, such services currently require a payment per call, which becomes a significant operating expense (OpEx). Furthermore, customer inputs are often very similar over time, hence SMEs end-up prompting LLMs with very similar instances. We propose a framework that allows reducing the calls to LLMs by caching previous LLM responses and using them to train a local inexpensive model on the SME side. The framework includes criteria for deciding when to trust the local model or call the LLM, and a methodology to tune the criteria and measure the tradeoff between performance and cost. For experimental purposes, we instantiate our framework with two LLMs, GPT-3.5 or GPT-4, and two inexpensive students, a k-NN classifier or a Multi-Layer Perceptron, using two common business tasks, intent recognition and sentiment analysis. Experimental results indicate that significant OpEx savings can be obtained with only slightly lower performance.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Placed in Knowledge distillation for LLMs, one of 12 directions in Knowledge distillation. Builds on 8 of its 15 references that are in the map. First posted on arXiv 20 Oct 2023.
Builds on
8 of 15 references.
References · 8
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2015Distilling the Knowledge in a Neural Networkcited by 10,324
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2019Optuna: A Next-generation Hyperparameter Optimization Frameworkcited by 2,501
- 2020Knowledge Distillation: A Surveycited by 1,603
- 2020Efficient Intent Detection with Dual Sentence Encoderscited by 433
- 2021Self-training Improves Pre-training for Few-shot Learning in Task-oriented Dialog Systemscited by 18
- 2021Task-adaptive Pre-training and Self-training are Complementary for Natural Language Understandingcited by 12
Built on by
Citing papers per year: 2024: 3; 2025: 1.
4 papers.
- 2024Online Cascade Learning for Efficient Inference over Streamscited by 20
- 2024SCALM: Towards Semantic Caching for Automated Chat Services with Large Language Modelscited by 16
- 2025Semantic Caching for Low-Cost LLM Serving: From Offline Learning to Online Adaptationcited by 13
- 2024EACO-RAG: Towards Distributed Tiered LLM Deployment using Edge-Assisted and Collaborative RAG with Adaptive Knowledge Updatecited by 2
- 2025Semantic Caching for Low-Cost LLM Serving: From Offline Learning to Online Adaptation11 Aug 2025
- 2024EACO-RAG: Towards Distributed Tiered LLM Deployment using Edge-Assisted and Collaborative RAG with Adaptive Knowledge Update27 Oct 2024
- 2024SCALM: Towards Semantic Caching for Automated Chat Services with Large Language Models24 May 2024
- 2024Online Cascade Learning for Efficient Inference over Streams7 Feb 2024
Similar, not cited
Close in wording, no citation either way
- 2023The economic trade-offs of large language models: A case study
- 2025From Large to Super-Tiny: End-to-End Optimization for Cost-Efficient LLMs
- 2025It Helps to Take a Second Opinion: Teaching Smaller LLMs to Deliberate Mutually via Selective Rationale Optimisation
- 2024Leveraging Zero-Shot Prompting for Efficient Language Model Distillation
- 2024PLaD: Preference-based Large Language Model Distillation with Pseudo-Preference Pairs
- 2025Small Models, Big Support: A Local LLM Framework for Educator-Centric Content Creation and Assessment with RAG and CAG
- 2024Empirical Guidelines for Deploying LLMs onto Resource-constrained Edge Devices
- 2023Batch Prompting: Efficient Inference with Large Language Model APIs