Strings from the Library of Babel: Random Sampling as a Strong Baseline for Prompt Optimisation

Yao Lu, Jiayi Wang, Raphael Tang, Sebastian Riedel, Pontus Stenetorp
11/16/2023
cs.CLcs.AI

No official code found. Best implementation: yaolu/random-prompt (8 stars, MIT, last commit 2024-07-08).

Abstract

Recent prompt optimisation approaches use the generative nature of language models to produce prompts -- even rivaling the performance of human-curated prompts. In this paper, we demonstrate that randomly sampling tokens from the model vocabulary as ``separators'' can be as effective as language models for prompt-style text classification. Our experiments show that random separators are competitive baselines, having less than a 1% difference compared to previous self-optimisation methods and showing a 12% average relative improvement over strong human baselines across nine text classification tasks and eight language models. We further analyse this phenomenon in detail using three different random generation strategies, establishing that the language space is rich with potentially good separators, with a greater than 40% average chance that a randomly drawn separator performs better than human-curated separators. These observations challenge the common assumption that an effective prompt should be human readable or task relevant and establish a strong baseline for prompt optimisation research.

View on arXivView PDF

Code Implementations(1)

yaolu/random-promptCommunity100%
MIT

Code and supplementary document

81Shell, PythonNov 15, 20232 years agoMIT

Similar Papers

Cite this paper

@article{lu2023strings,
  title  = {Strings from the Library of Babel: Random Sampling as a Strong Baseline for Prompt Optimisation},
  author = {Yao Lu and Jiayi Wang and Raphael Tang and Sebastian Riedel and Pontus Stenetorp},
  year   = {2023},
  eprint = {2311.09569},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.09569v2}
}

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

Discussion