Fly-Swat or Cannon? Cost-Effective Language Model Choice via Meta-Modeling

Marija Šakota, Maxime Peyrard, Robert West
8/11/2023
cs.CL

No official code found. Best implementation: epfl-dlab/forc (16 stars, MIT, last commit 2023-12-12).

Abstract

Generative language models (LMs) have become omnipresent across data science. For a wide variety of tasks, inputs can be phrased as natural language prompts for an LM, from whose output the solution can then be extracted. LM performance has consistently been increasing with model size - but so has the monetary cost of querying the ever larger models. Importantly, however, not all inputs are equally hard: some require larger LMs for obtaining a satisfactory solution, whereas for others smaller LMs suffice. Based on this fact, we design a framework for cost-effective language model choice, called "Fly-swat or cannon" (FORC). Given a set of inputs and a set of candidate LMs, FORC judiciously assigns each input to an LM predicted to do well on the input according to a so-called meta-model, aiming to achieve high overall performance at low cost. The cost-performance tradeoff can be flexibly tuned by the user. Options include, among others, maximizing total expected performance (or the number of processed inputs) while staying within a given cost budget, or minimizing total cost while processing all inputs. We evaluate FORC on 14 datasets covering five natural language tasks, using four candidate LMs of vastly different size and cost. With FORC, we match the performance of the largest available LM while achieving a cost reduction of 63%. Via our publicly available library, researchers as well as practitioners can thus save large amounts of money without sacrificing performance.

View on arXivView PDF

Code Implementations(1)

epfl-dlab/forcCommunity100%
MIT

Framework for Cost-Effective Language Model Choice

160PythonAug 10, 20232 years agoMIT

Similar Papers

Cite this paper

@article{akota2023flyswat,
  title  = {Fly-Swat or Cannon? Cost-Effective Language Model Choice via Meta-Modeling},
  author = {Marija Šakota and Maxime Peyrard and Robert West},
  year   = {2023},
  eprint = {2308.06077},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.06077v3}
}

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/2308.06077.svg)](https://codeofpaper.com/paper/2308.06077)

Discussion