Last updated:
Large Language Models are Zero-Shot Reasoners
Takeshi Kojima et al.
In collections: Reasoning
Pretrained large language models (LLMs) are widely used across many areas of natural language processing (NLP) and are generally regarded as excellent learners from a small number of examples (few-shot learners). Notably, chain of thought (CoT) prompting – a novel technique for eliciting complex, multi-step reasoning through "step by step" answer examples – achieved record-setting results in arithmetic and symbolic reasoning. These are difficult "system-2" tasks that do not follow the standard scaling laws of LLMs. Although these successes are usually attributed to the models' ability to learn from examples (few-shot learning), we show that LLMs are decent zero-shot reasoners. All it takes is adding the phrase "Let's think step by step" before each answer.
Experimental results show that our Zero-shot-CoT, which uses the same single prompt template, significantly outperforms standard zero-shot results across a wide variety of tasks: from arithmetic (MultiArith, GSM8K, AQUA-RAT, SVAMP), through symbolic reasoning (Last Letter, Coin Flip), to other logical tasks. Without any hand-crafted examples, accuracy of InstructGPT (text-davinci-002) rose from 17.7% to 78.7% on MultiArith and from 10.4% to 40.7% on GSM8K. A similar scale of improvement was observed with PaLM 540B. The versatility of this single prompt suggests that there are untapped and little-studied fundamental zero-shot capabilities, which indicates that simple prompting can bring out broad cognitive abilities from models. We hope that our work will serve not only as the strongest baseline for difficult reasoning benchmarks, but also highlight the importance of analyzing the vast knowledge hidden inside models before building finetuning datasets or sets of examples.
An analysis of the paper "Large Language Models are Zero-Shot Reasoners" (which introduced the famous Zero-Shot-CoT method) yielded key takeaways for reporting strategies and prompt engineering:
Strategies from the report
Zero-Shot Chain of Thought (Zero-Shot-CoT): A strategy showing that the model does not need ready-made examples of how to solve a task (few-shot). To activate logical reasoning and avoid mistakes in complex tasks, it is enough to encourage the model to break the process into steps using a so-called trigger phrase.
Two-Stage Prompting: A process that logically separates the thinking stage from the stage of producing the result. In the first stage the model generates an analysis, and in the second the system makes it extract just the answer, which is crucial for automating tasks.
Latent Knowledge Extraction: The report shows that giant language models have deep knowledge and reasoning abilities. The strategy is to test unlocking them with zero-shot mode before a developer resorts to costly "retraining" of the model (fine-tuning).
Best practices
Use a single, universal template (Single Prompt Template): The report shows that using one general trigger phrase, "Let's think step by step," for different types of tasks (math, logic, word games) gives great results without having to tailor the prompt to a specific problem.
Build a simple baseline (Minimal Baseline): Always start testing a model's performance with the Zero-Shot-CoT technique. It often gives very strong, satisfying results, so you avoid unnecessary, manual crafting of many examples in the prompt.
Separate the line of reasoning from the answer: Always make the model show its path of deduction. This not only improves the correctness of the model's answer, but also makes debugging easier and helps you pinpoint where the AI went wrong.
What to avoid
Forcing direct answers to complex problems (Direct Answer Prompting): Avoid giving hard tasks while demanding the result immediately. Without a built-in thinking process, the model often produces wrong guesses.
Relying too quickly on "Few-Shot Prompting": Avoid investing time in crafting special examples inside prompts before you have tried Zero-Shot-CoT mode. Research shows that models do worse with a few poorly chosen examples than with a single "step by step" instruction.
Overloading the instructions that trigger reasoning: Overly detailed instructions about how the model should think can make the AI get lost in following them instead of actually solving the task.
Support this project by buying me a coffee ;)