Lune

EMNLP Findings2023

Cache me if you Can: an Online Cost-aware Teacher-Student framework to Reduce the Calls to Large Language Models

Ilias Stogiannidis, Stavros Vassos, Prodromos Malakasiotis, Ion Androutsopoulos

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Self-training Improves Pre-training for Few-shot Learning in Task-oriented Dialog Systems cites End-to-End Neural Pipeline for Goal-Oriented Dialogue Systems using GPT-2
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. MobileGPT: Augmenting LLM with Human-like App Memory for Mobile Task AutomationSunjae Lee, Junyoung Choi, Jungjae Lee, Munim Hasan Wasi et al.MobiCom 2024 · 21 citations
  2. Online Cascade Learning for Efficient Inference over StreamsLunyiu Nie, Zhimin Ding, Erdong Hu, Christopher M. Jermaine et al.ICML 2024 · 20 citations
  3. Semantic Caching for Low-Cost LLM Serving: From Offline Learning to Online AdaptationXutong Liu, Baran Atalar, Xiangxiang Dai, Jinhang Zuo et al.INFOCOM 2026 · 2 citations

Builds on5

  1. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
  2. MPNet: Masked and Permuted Pre-training for Language UnderstandingKaitao Song, Xu Tan, Tao Qin, Jianfeng Lu et al.NeurIPS 2020 · 1,957 citations
  3. End-to-End Neural Pipeline for Goal-Oriented Dialogue Systems using GPT-2DongHoon Ham, Jeong-Gwan Lee, Youngsoo Jang, Kee-Eung KimACL 2020 · 167 citations
  4. Self-training Improves Pre-training for Few-shot Learning in Task-oriented Dialog SystemsFei Mi, Wanhao Zhou, Lingjing Kong, Fengyu Cai et al.EMNLP 2021 · 18 citations
  5. Task-adaptive Pre-training and Self-training are Complementary for Natural Language UnderstandingShiyang Li, Semih Yavuz, Wenhu Chen, Xifeng YanEMNLP Findings 2021 · 9 citations

Related papers

  1. Selective Deferred Routing: Enabling Cost-Efficient Collaboration between Local SLMs and Remote LLMsQijun Miao, Zhixuan FangICML 2026
  2. AIMS: Cost-Efficient LLM-Based Agent Deployment in Hybrid Cloud-Edge EnvironmentsShiyi Liu, Haiying Shen, Shuai Che, Mahdi Ghandi et al.EuroSys 2026 · 1 citation
  3. Cache & Distil: Optimising API Calls to Large Language ModelsGuillem Ramírez, Matthias Lindemann, Alexandra Birch, Ivan TitovACL Findings 2024 · 4 citations
  4. Want To Reduce Labeling Cost? GPT-3 Can HelpShuohang Wang, Yang Liu, Yichong Xu, Chenguang Zhu et al.EMNLP Findings 2021 · 177 citations
  5. Generative Caching for Structurally Similar Prompts and ResponsesSarthak Chakraborty, Suman Nath, Xuchao Zhang, Chetan Bansal et al.NeurIPS 2025 · 5 citations
Dusk over the sea between two cliffs drawn in fine vertical lines