On Speeding Up Language Model Evaluation
Jin Peng Zhou, Christian K. Belardi, Ruihan Wu, Travis Zhang, Carla P. Gomes, Wen Sun, Kilian Q. Weinberger
TL;DR
This work tackles the costly task of evaluating prompt and hyperparameter choices for large language models by casting it as a budgeted best-arm identification problem. It introduces two adaptive algorithms, UCB-E and UCB-E-LRF, where the former uses upper confidence bounds to select the next method-sample pair and the latter adds a low-rank factorization to exploit correlations across methods and samples for score imputation and uncertainty estimation. Empirical results on six benchmarks show substantial resource savings (5-15% of the full evaluation budget) with the two methods outperforming baselines, and a complementary analysis clarifies when each method excels. The work provides practical guidance for efficient LLM evaluation and software for reproducing results, with potential impact on rapid iteration in prompt engineering and hyperparameter tuning.
Abstract
Developing prompt-based methods with Large Language Models (LLMs) requires making numerous decisions, which give rise to a combinatorial search problem over hyper-parameters. This exhaustive evaluation can be time-consuming and costly. In this paper, we propose an $\textit{adaptive}$ approach to explore this space. We are exploiting the fact that often only few samples are needed to identify clearly superior or inferior settings, and that many evaluation tests are highly correlated. We lean on multi-armed bandits to sequentially identify the next (method, validation sample)-pair to evaluate and utilize low-rank matrix factorization to fill in missing evaluations. We carefully assess the efficacy of our approach on several competitive benchmark problems and show that it can identify the top-performing method using only 5-15% of the typical resources -- resulting in 85-95% LLM cost savings. Our code is available at https://github.com/kilian-group/banditeval.
