Language Model Cascades

David Dohan, Winnie Xu, Aitor Lewkowycz, Jacob Austin, David Bieber +7 more
7/21/2022
cs.CLcs.AI

No official code found. Best implementation: google-research/cascades (223 stars, Apache-2.0, last commit 2026-04-09).

Abstract

Prompted models have demonstrated impressive few-shot learning abilities. Repeated interactions at test-time with a single model, or the composition of multiple models together, further expands capabilities. These compositions are probabilistic models, and may be expressed in the language of graphical models with random variables whose values are complex data types such as strings. Cases with control flow and dynamic structure require techniques from probabilistic programming, which allow implementing disparate model structures and inference strategies in a unified language. We formalize several existing techniques from this perspective, including scratchpads / chain of thought, verifiers, STaR, selection-inference, and tool use. We refer to the resulting programs as language model cascades.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Python library which enables complex compositions of language models such as scratchpads, chain of thought, tool use, selection-inference, and more.

22317Python, Jupyter NotebookJul 13, 20226 months agoApache-2.0

Similar Papers

Cite this paper

@article{dohan2022language,
  title  = {Language Model Cascades},
  author = {David Dohan and Winnie Xu and Aitor Lewkowycz and Jacob Austin and David Bieber and Raphael Gontijo Lopes and Yuhuai Wu and Henryk Michalewski and Rif A. Saurous and Jascha Sohl-dickstein and Kevin Murphy and Charles Sutton},
  year   = {2022},
  eprint = {2207.10342},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.10342v2}
}

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

Discussion