Benutzer:Rosemann/Reasoning language model
Reasoning language models are artificial intelligence systems that combine natural language processing with structured reasoning capabilities. These models are usually constructed by prompting, supervised finetuning (SFT), and reinforcement learning (RL) initialized with pretrained language models.
Prompting
A language model is a generative model of a training dataset of texts. Prompting means constructing a text prompt, such that, conditional on the text prompt, the language model generates a solution to the task. Prompting can be applied to a pretrained model ("base model"), a base model that has undergone SFT, or RL, or both.[1]
Chain of thought
Chain of Thought prompting (CoT) prompts the model to answer a question by first generating a "chain of thought", i.e. steps of reasoning that mimic a train of thought.[2] It was published in 2022 by the Brain team of Google on the PaLM-540B model.[3] In CoT prompting, the prompt is of the form "<Input> Let's think step by step", and the model would respond with a chain of reasoning steps, ended with an answer:Similarly, Tree of Thought prompting generalizes CoT by prompting the model to generate one or more "possible next steps", and then running the model on each of the possible next steps by breadth-first, beam, or some other method of tree search.[4] Similarly, Graph of Thought generalizes CoT so that the reasoning steps form a directed acyclic graph.[5]
Self-consistency decoding performs several chain-of-thought rollouts, then selects the most commonly reached conclusion out of all the rollouts.[6] If the rollouts disagree by a lot, a human can be queried for the correct chain of thought.[7]
Retrieval-augmented generation
Vorlage:Main article A language model may answer a query by first querying a database of documents using the query. The document retrieval can be via a vector database, summary index, tree index, or keyword table index.[8] Following document retrieval, the LLM generates an output that incorporates information from both the query and the retrieved documents.[9]
Tool use
Language models can perform long reasoning steps by calling external methods, such as numerical recipes, program interpreters, API calls, and so on. This can be prompt-engineered by describing the external methods in-context (an example of in-context learning) or finetuned into the model.[10]
Supervised finetuning
A base model can be finetuned on a dataset of reasoning tasks with example solutions and reasoning traces. The finetuned model would then be able to generate reasoning traces for a given problem.[11][12]
Reinforcement learning
A pretrained language model can be further trained by RL. In the RL formalism, a generative language model is a policy . A prompt specifying a task to solve is an environmental state , and the response of the language model to the prompt is an action . The probability that the language model responds with is .
Training a reasoning language model by RL then consists of constructing a reward model to guide the RL process. Intuitively, a reward model describes how desirable/appropriate/good the response is for the prompt. For reasoning language model, the prompt describes a reasoning task, and the reward would be high if the response solves the task, and low if the response fails to solve the task.
For reasoning language models, the model's response may be broken down into multiple steps, in which case it is written as .
Outcome Reward Model
Outcome reward model, or outcome-supervised RM (ORM),[11] is a reward model that computes the reward of a step determined by the final answer: . They are also called "verifiers".
For tasks with an answer that is easy to verify, such as word problems in math, the outcome reward can simply be binary: 1 if the final answer is correct, and 0 otherwise.[11] If the answer is not easy to verify programmatically, humans can manually label the answers as correct or not, then the labels can be used to finetune a base model that predicts the human label.[13] For other kinds of tasks, such as creative writing, where verification is difficult, one can train a reward model by finetuning a base model on human preference data, such as used in reinforcement learning from human feedback.[14] A base model can also be finetuned to predict, given a partial thinking trace , whether the final answer would be correct or not. This can then be used as a binary reward signal.[11]
Process Reward Model
Process reward model, or process-supervised RM (PRM),[11] is a reward model that computes the reward of a step determined by the steps so far: .
Given a partial thinking trace , a human can be queried as to whether the steps so far are correct, regardless of whether the ultimate answer would be correct. This can then be used as a binary reward signal. As human labels are expensive, a base model can be finetuned to predict the human labels.[11]
Applications
Prompt engineering was discovered in GPT-3 as "few-shot learning",[15] which began a period of research into "eliciting" capacities of pretrained language models. It was then found that a model could be prompted to perform CoT reasoning, which improves its performance on reasoning tasks.
See also
- Generative pre-trained transformer
- Neuro-symbolic AI
- Automated theorem proving
- Automated reasoning
- Large language model
References
External links
- ↑ Vorlage:Citation
- ↑ Jason Wei, Xuezhi Wang, Dale Wang, Maarten Bosma, Brian Ichter, Fei Xia, Ed H. Chi, Quoc V. Le, Denny Zhou: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. Advances in Neural Information Processing Systems (NeurIPS 2022). Band 35, 31. Oktober 2022, arxiv:2201.11903 (englisch).
- ↑ Sharan Narang and Aakanksha Chowdhery: Pathways Language Model (PaLM): Scaling to 540 Billion Parameters for Breakthrough Performance. 4. April 2022 .
- ↑ Vorlage:Cite arXiv
- ↑ Maciej Besta, Nils Blach, Ales Kubicek, Robert Gerstenberger, Michal Podstawski, Lukas Gianinazzi, Joanna Gajda, Tomasz Lehmann, Hubert Niewiadomski, Piotr Nyczyk, Torsten Hoefler: Graph of Thoughts: Solving Elaborate Problems with Large Language Models. In: Proceedings of the AAAI Conference on Artificial Intelligence. 38. Jahrgang, Nr. 16, 24. März 2024, ISSN 2374-3468, S. 17682–17690, doi:10.1609/aaai.v38i16.29720 (englisch, aaai.org).
- ↑ Vorlage:Cite arXiv
- ↑ Vorlage:Cite arXiv
- ↑ How Each Index Works - LlamaIndex 🦙 v0.10.17. In: docs.llamaindex.ai. Abgerufen am 8. April 2024.
- ↑ Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, Douwe Kiela: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. In: Advances in Neural Information Processing Systems. 33. Jahrgang. Curran Associates, Inc., 2020, S. 9459–9474, arxiv:2005.11401 (neurips.cc).
- ↑ Timo Schick, Jane Dwivedi-Yu, Roberto Dessi, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer, Nicola Cancedda, Thomas Scialom: Toolformer: Language Models Can Teach Themselves to Use Tools. In: Advances in Neural Information Processing Systems. 36. Jahrgang, 15. Dezember 2023, S. 68539–68551 (englisch, neurips.cc).
- ↑ a b c d e f Vorlage:Citation
- ↑ Vorlage:Citation
- ↑ Vorlage:Citation
- ↑ Vorlage:Citation
- ↑ Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child: Language models are few-shot learners. In: Proceedings of the 34th International Conference on Neural Information Processing Systems (= NIPS '20). Curran Associates Inc., Red Hook, NY, USA 6. Dezember 2020, S. 1877–1901, doi:10.5555/3495724.3495883 (acm.org).