arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.05176cs.LGcs.AIcs.CLcs.SE
收藏

FrugalGPT:如何在降低成本并提升性能的同时使用大型语言模型

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

Stanford University(斯坦福大学)

Lingjiao Chen, Matei Zaharia, James Zou

AI总结:

针对LLM查询成本高昂的问题,提出FrugalGPT,通过LLM级联策略学习查询与模型组合,实现高达98%成本削减或同成本下4%精度提升。

摘要:

可供用户付费查询的大型语言模型(LLM)数量正在迅速增长。我们回顾了查询流行LLM API(如GPT-4、ChatGPT、J1-Jumbo)的相关成本,发现这些模型具有异构的定价结构,费用可能相差两个数量级。特别是,在大量查询和文本上使用LLM可能成本高昂。基于此,我们概述并讨论了用户可利用的三类策略以降低使用LLM的推理成本:1)提示词适配(prompt adaptation),2)LLM近似(LLM approximation),以及3)LLM级联(LLM cascade)。作为示例,我们提出了FrugalGPT,一种简单而灵活的LLM级联实例化方法,它学习针对不同查询应使用哪些LLM组合,以降低成本并提高准确性。我们的实验表明,FrugalGPT能以高达98%的成本削减匹配最佳单个LLM(如GPT-4)的性能,或在相同成本下将准确性较GPT-4提升4%。本文提出的思路和发现为可持续且高效地使用LLM奠定了基础。

英文摘要:

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% cost reduction or improve the accuracy over GPT-4 by 4% with the same cost. The ideas and findings presented here lay a foundation for using LLMs sustainably and efficiently.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑