FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance

05/09/2023
by   Lingjiao Chen, et al.
0

There is a rapidly growing number of large language models (LLMs) that users can query for a fee. We review the cost associated with querying popular LLM APIs, e.g. GPT-4, ChatGPT, J1-Jumbo, and find that these models have heterogeneous pricing structures, with fees that can differ by two orders of magnitude. In particular, using LLMs on large collections of queries and text can be expensive. Motivated by this, we outline and discuss three types of strategies that users can exploit to reduce the inference cost associated with using LLMs: 1) prompt adaptation, 2) LLM approximation, and 3) LLM cascade. As an example, we propose FrugalGPT, a simple yet flexible instantiation of LLM cascade which learns which combinations of LLMs to use for different queries in order to reduce cost and improve accuracy. Our experiments show that FrugalGPT can match the performance of the best individual LLM (e.g. GPT-4) with up to 98 The ideas and findings presented here lay a foundation for using LLMs sustainably and efficiently.

READ FULL TEXT

page 4

page 8

page 9

research
08/30/2023

Text-to-OverpassQL: A Natural Language Interface for Complex Geodata Querying of OpenStreetMap

We present Text-to-OverpassQL, a task designed to facilitate a natural l...
research
10/26/2020

Word Frequency Does Not Predict Grammatical Knowledge in Language Models

Neural language models learn, to varying degrees of accuracy, the gramma...
research
08/07/2023

CAESURA: Language Models as Multi-Modal Query Planners

Traditional query planners translate SQL queries into query plans to be ...
research
05/24/2022

BabyBear: Cheap inference triage for expensive language models

Transformer language models provide superior accuracy over previous mode...
research
05/08/2023

Enhancing Knowledge Graph Construction Using Large Language Models

The growing trend of Large Language Models (LLM) development has attract...
research
07/05/2022

Machine Learning Model Sizes and the Parameter Gap

We study trends in model size of notable machine learning systems over t...
research
09/19/2023

Large language models can accurately predict searcher preferences

Relevance labels, which indicate whether a search result is valuable to ...

Please sign up or login with your details

Forgot password? Click here to reset