ElemedexA pocket encyclopedia of AI architectures

Glossary (TM) › Use: prompts, sampling, systems

TM166

Zero-shot

Also: zero-shot prompting, zero-shot learning

In Spanish: Zero-shot (sin ejemplos)

Asking a model to perform a task from a natural-language description alone, without showing it any solved example.

In the scheme of Brown et al. (2020), zero-shot is the far end of the in-context learning spectrum: the model receives only an instruction (for example, "Translate English to French:") and the case to solve, with no demonstrations (2020, sec. 2). It is the most convenient setting and the closest to how a task is assigned to a person, but also the hardest: sometimes even a human would not understand the expected format without an example. The authors give one: "make a table of world records for the 200m dash" leaves open which columns to include.

The term is misleading, and the authors themselves say so: it is called "zero-shot" because there are no weight updates, but the model is not learning "from zero examples"; it may have seen thousands of similar tasks during pretraining (Brown et al., 2020, sec. 1). The expression also has a prior history in machine learning: classifying into categories never seen during training. This is the sense in which CLIP uses it, classifying an image by comparing its embedding with those of descriptions of the candidate classes (Alammar & Grootendorst, 2024, pp. 123, 265).

Two findings show how much zero-shot performance depends on apparently minor details. Instruction tuning improves it greatly: FLAN outperformed zero-shot GPT-3 on 20 of 25 datasets (Wei, Bosma, et al., 2022). And a single phrase can change everything: adding "Let's think step by step" took a GPT-3 model from 17.7% to 78.7% on arithmetic word problems (Kojima et al., 2022; Buckner, 2024, p. 280). If a magic formula quadruples performance, what was the test measuring without it: the model's ability, or our skill at asking for it?

Sources

  • Alammar, J., & Grootendorst, M. (2024). Hands-on large language models: Language understanding and generation. O’Reilly Media. §
  • Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., . . . Amodei, D. (2020). Language models are few-shot learners. In Advances in Neural Information Processing Systems (Vol. 33, pp. 1877–1901). Curran Associates. https://proceedings.neurips.cc/paper_files/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html §
  • Buckner, C. J. (2024). From deep learning to rational machines: What the history of philosophy can teach us about the future of artificial intelligence. Oxford University Press. https://doi.org/10.1093/oso/9780197653302.001.0001 §
  • Kojima, T., Gu, S. S., Reid, M., Matsuo, Y., & Iwasawa, Y. (2022). Large language models are zero-shot reasoners. In Advances in Neural Information Processing Systems (Vol. 35, pp. 22199–22213). Curran Associates. https://doi.org/10.52202/068431-1613 §
  • Wei, J., Bosma, M., Zhao, V. Y., Guu, K., Yu, A. W., Lester, B., Du, N., Dai, A. M., & Le, Q. V. (2022). Finetuned language models are zero-shot learners. In 10th International Conference on Learning Representations (ICLR 2022). https://openreview.net/forum?id=gEZrGCozdqR §