Flatness-Aware Prompt Selection Improves Accuracy and Sample Efficiency

Lingfeng Shen, Weiting Tan, Boyuan Zheng, Daniel Khashabi
5/18/2023
cs.CLcs.LG

No official code found. Best implementation: shadowkiller33/flatness (9 stars, last commit 2023-08-16).

Abstract

With growing capabilities of large language models, prompting them has become the dominant way to access them. This has motivated the development of strategies for automatically selecting effective language prompts. In this paper, we introduce prompt flatness, a new metric to quantify the expected utility of a language prompt. This metric is inspired by flatness regularization in statistical learning that quantifies the robustness of the model towards its parameter perturbations. We provide theoretical foundations for this metric and its relationship with other prompt selection metrics, providing a comprehensive understanding of existing methods. Empirically, we show that combining prompt flatness with existing metrics improves both performance and sample efficiency. Our metric outperforms the previous prompt selection metrics with an average increase of 5% in accuracy and 10% in Pearson correlation across 6 classification benchmarks.

View on arXivView PDF

Code Implementations(1)

92Shell, PythonSep 30, 20223 years ago

Similar Papers

Cite this paper

@article{shen2023flatnessaware,
  title  = {Flatness-Aware Prompt Selection Improves Accuracy and Sample Efficiency},
  author = {Lingfeng Shen and Weiting Tan and Boyuan Zheng and Daniel Khashabi},
  year   = {2023},
  eprint = {2305.10713},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.10713v2}
}

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

Discussion