思考の連鎖(CoT)プロンプティングとは? | IBM
原題: What is chain of thought (CoT) prompting? | IBM
分析結果
- カテゴリ
- AI
- 重要度
- 66
- トレンドスコア
- 30
- 要約
- 思考の連鎖(CoT)プロンプティングは、AIモデルが問題解決や意思決定を行う際に、思考過程を段階的に示す手法です。このアプローチにより、モデルはより論理的で透明性のある回答を生成し、ユーザーがその過程を理解しやすくなります。CoTプロンプティングは、特に複雑なタスクにおいて、AIのパフォーマンスを向上させることが期待されています。
- キーワード
What is chain of thought (CoT) prompting? | IBM What is chain of thought (CoT) prompting? Authors Vrunda Gadesha AI Advocate | Technical Content Author Eda Kavlakoglu Business Development + Partnerships IBM Research Vanna Winland AI Advocate & Technology Writer Chain of thought (CoT) is a prompt engineering technique that enhances the output of large language models ( LLMs ), particularly for complex tasks involving multistep reasoning. It facilitates problem-solving by guiding the model through a step-by-step reasoning process by using a coherent series of logical steps. Prompt engineering is used in artificial intelligence to refine inputs (prompts) to get the most accurate model outputs. In this study, the concept of chain of thought prompting is introduced which elicits reasoning in LLMs. 1 The paper argues that prompting models to generate intermediate reasoning steps significantly boosts their ability to accurately solve multistep problems like arithmetic, common sense and symbolic reasoning. Researchers were inspired by the LLMs’ ability to “think out loud” in natural language, noting that as parameter size increased, so did reasoning ability and accuracy. For this reason, CoT prompting is considered an emergent ability, or an ability that appears as model size or complexity scales up. Large LLMs tend to perform better because they’ve learned more nuanced reasoning patterns from training on massive datasets. However, increasing model size is not the only way to improve problem-solving accuracy across a variety of benchmarks. Advances in instruction tuning have enabled smaller models to perform CoT reasoning. The IBM® Granite® Instruct models, for instance, are fine-tuned by using specialized training datasets composed of instructional prompts and exemplars for CoT tasks. An exemplar is a prompt example that the model uses as the ideal way to respond. Why is CoT prompting effective? Chain of thought prompting simulates human-like reasoning processes by breaking down elaborate problems into manageable, intermediate steps that sequentially lead to a conclusive answer. 2 This step-by-step problem-solving structure aims to help ensure that the reasoning process is clear, logical and effective. In standard prompt formats, the model output is typically a direct response to the provided input. For example, one might provide an input prompt asking, “What color is the sky?", the AI would generate a simple and direct response, such as "The sky is blue." However, if asked to explain why the sky is blue using CoT prompting, the AI would first define what "blue" means (a primary color). The AI would then deduce that the sky appears blue due to the absorption of other colors by the atmosphere. This response demonstrates the AI's ability to construct a logical argument. To construct a prompt, a user typically appends an instruction to the end of their prompt. Users commonly add an instruction to their prompt such as “describe your reasoning steps” or “explain your answer step-by-step." In essence, this prompting technique asks the LLM to not only generate a result but also detail the series of intermediate steps that led to that answer. 3 Prompt chaining is another popular method used in gen AI applications to improve reliability by using multiple prompts that build on each other sequentially to break down complex tasks. Techniques such as prompt chaining and CoT guide the model to reason through a problem step-by-step rather than jumping to an answer that merely sounds correct. This method can also be helpful for observability and debugging, as it encourages the model to be more transparent in its reasoning. The main difference between these methods is that prompt chaining sequences multiple prompts to break down tasks step-by-step, while CoT prompting elicits the model’s reasoning process within a single prompt. Think beyond the prompts and get the full context Stay ahead of the latest in industry news, AI tools and emerging trends in prompt engineering with the Think Newsletter. Plus, get access to new explainers, tutorials and expert insights—delivered straight to your inbox, twice weekly. See the IBM Privacy Statement . Thank you! You are subscribed. How does chain of thought prompting work? Chain of thought prompting leverages large language models (LLMs) to articulate a succession of reasoning steps, guiding the model toward generating analogous reasoning chains for novel tasks. This is achieved through exemplar-based prompts that illustrate the reasoning process, thus enhancing the model’s capacity for addressing complex reasoning challenges. 4 Let’s understand the flow of this prompting technique by addressing the classic math word problem—solving a polynomial equation. Example: How does chain of thought prompting work for solving polynomial equations? Chain of thought (CoT) prompting can significantly aid in solving polynomial equations by guiding an LLM to follow a series of logical steps, breaking down the problem-solving process. 5 Let's examine how CoT prompting can tackle a polynomial equation. Consider the example of solving a quadratic equation. Input prompt: Solve the quadratic equation: x 2 - 5x + 6 = 0 When we give this prompt to IBM watsonx.ai® chat, we can see the following conversation between human question and AI assistance’s reply. To generate this type of output, the CoT fundamentals work as illustrated in the following image. The final answer of the chain of thought will be "The solutions to the equation x 2 − 5x + 6 = 0 are x = 3 and x = 2 " Chain of thought variants Chain of thought (CoT) prompting has evolved into various innovative variants, each tailored to address specific challenges and enhance the model's reasoning capabilities in unique ways. These adaptations not only extend the applicability of CoT across different domains but also refine the model's problem-solving process. 6 Zero-shot chain of thought The zero-shot chain of thought variant leverages the inherent knowledge within models to tackle problems without prior specific examples or fine-tuning for the task at hand. This approach is particularly valuable when dealing with novel or diverse problem types where tailored training data might not be available. 7 This approach can leverage the properties of standard prompting and few-shot prompting. For example, when addressing the question “What is the capital of a country that borders France and has a red and white flag?”, a model that uses zero-shot CoT would draw on its embedded geographic and flag knowledge to deduce steps leading to Switzerland as the answer, despite not being explicitly trained on such queries. Automatic chain of thought Automatic chain of thought (auto-CoT) aims to minimize the manual effort in crafting prompts by automating the generation and selection of effective reasoning paths. This variant enhances the scalability and accessibility of CoT prompting for a broader range of tasks and users. 8 , 9 For example, to solve a math problem like "If you buy 5 apples and already have 3, how many do you have in total?", an auto-CoT system could automatically generate intermediate steps. Those steps might include "Start with 3 apples" and "Add 5 apples to the existing 3," culminating in "Total apples = 8," streamlining the reasoning process without human intervention. Multimodal chain of thought Multimodal chain of thought extends the CoT framework to incorporate inputs from various modalities, such as text and images, enabling the model to process and integrate diverse types of information for complex reasoning tasks. 10 For example, when presented with a picture of a crowded beach scene and asked, "Is this beach likely to be popular in summer?", a model employing multimodal CoT can analyze visual cues. Cues such as beach occupancy, weather conditions and more along with its textual understanding of seasonal popularity help the model reason out a detailed response. A potential response might be, "The beach is crowded, indicating high popularity, likely increasing further in summer." These variants of chain of thought prompting not only showcase the flexibility and adaptability of the CoT approach but also hint at the vast potential for future developments in AI reasoning and problem-solving capabilities. AI Academy Become an AI expert Gain the knowledge to prioritize AI investments that drive business growth. Get started with our free AI Academy today and lead the future of AI in your organization. Watch the series Advantages and limitations CoT prompting is a powerful technique for enhancing the performance of large language models (LLMs) on complex reasoning tasks, offering significant benefits in various domains such as improved accuracy, transparency and multistep reasoning abilities. However, it is essential to consider its limitations, including the need for high-quality prompts, increased computational cost, susceptibility to adversarial attacks and challenges in evaluating qualitative improvements in reasoning or understanding. By addressing these limitations, researchers and practitioners can ensure responsible and effective deployment of CoT prompting in diverse applications. 11 Advantages of chain of thought prompting Users can benefit from several advantages within chain of thought prompting. Some of them include: Improved prompt outputs: CoT prompting improves LLMs' performance on complex reasoning tasks by breaking them down into simpler, logical steps. Transparency and understanding: The generation of intermediate reasoning steps offers transparency into how the model arrives at its conclusions, making the decision-making process more understandable for users. Multistep reasoning: By systematically tackling each component of a problem, CoT prompting often leads to more accurate and reliable answers, particularly in tasks requiring multistep reasoning. Multistep reasoning refers to the ability to perform complex logical operations by breaking them