{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/language-model-cascades","title":"Language Model Cascades","arxiv_id":"2207.10342","date":"2022-07-21","proceeding":null,"authors":["David Dohan","Winnie Xu","Aitor Lewkowycz","Jacob Austin","David Bieber","Raphael Gontijo Lopes","Yuhuai Wu","Henryk Michalewski","Rif A. Saurous","Jascha Sohl-Dickstein","Kevin Murphy","Charles Sutton"],"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.","url_abs":"https://arxiv.org/abs/2207.10342v2","url_pdf":"https://arxiv.org/pdf/2207.10342v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"language-model-cascades","repo_url":"https://github.com/google-research/cascades","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":null}],"tasks":[{"task_slug":"few-shot-learning","task_name":"Few-Shot Learning"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"probabilistic-programming","task_name":"Probabilistic Programming"},{"task_slug":"model","task_name":"model"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.10342","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.10342"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/google-research/cascades","reach":null}],"summary":{"ran_draft_wrong":3},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"e877875ad0510c06","entry":"fewshot_prompt","repo":"google-research/cascades","repo_kind":"official","path":"cascades/examples/scratchpad.py","file_url":"https://github.com/google-research/cascades/blob/HEAD/cascades/examples/scratchpad.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e877875ad0510c06"}},{"code_sha256_prefix":"45fbdf255c58060f","entry":"load_dataset","repo":"google-research/cascades","repo_kind":"official","path":"cascades/examples/tasks/gsm8k.py","file_url":"https://github.com/google-research/cascades/blob/HEAD/cascades/examples/tasks/gsm8k.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"45fbdf255c58060f"}},{"code_sha256_prefix":"f00b008c48fbe442","entry":"process_gsm8k_example","repo":"google-research/cascades","repo_kind":"official","path":"cascades/examples/scratchpad.py","file_url":"https://github.com/google-research/cascades/blob/HEAD/cascades/examples/scratchpad.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f00b008c48fbe442"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}