Institute of Technology • Research Scientist at Megagon Labs Tokyo, Recruit Co., Ltd. Research Interest: Interpretability and controllability in natural language generation (NLG) and instruction uncertainty 2 @ayaniwa1213
LLMs Prompt is an input to a generative model and is used to guide its output 3 LLM • ChatGPT, Gemini, Claude, ... Designing prompts is crucial to maximizing the capabilities of LLMs and achieving the desired outputs. Prompt engineering is the strategy of designing and crafting better prompts 》Translate English to Japanese: 》sea otter => らっこ 》cheese => Instruction Example User input チーズ
growing body of knowledge on LLM prompting, making it increasingly difficult to keep up with the latest developments. The purpose of this talk is to provide a quick overview of prompting, helping the audience grasp key points when crafting prompts. If you are not very familiar with prompting… This talk will be a good start to systematically learn about prompting If you are already knowledgeable about prompting… Please use this to organize your thoughts 4
detailed explanations are omitted. • For more in-depth surveys, please refer to these papers. • The Prompt Report: A Systematic Survey of Prompting Techniques (2024/07) • A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applications (2024/02) • Reasoning with Language Model Prompting: A Survey (2023) • I will also introduce many studies. Please see the links to each paper for more information. The following topic is beyond the scope of this talk. 1. Soft prompt consisting of vectors 2. Tasks involving non-linguistic prompts, such as those for images or audio
can fully understand and execute. • Is the task definition clear enough? • Is there any ambiguity? • Can the LLM answer using its own knowledge? Importance: Transform prompts into ones that are "solvable." Instruction Clarification
• Providing concrete examples can help clarify instructions • Human-in-the-loop Prompting • Engaging in interactions with users can help clarify instructions • Additional Prompting • Providing extra context or details can help clarify the instructions Instruction Clarification Instruction Clarification
Instead of rewriting the instructions, offering examples of following the instructions can help clarify them. • This can include providing both positive and negative examples
ambiguous instructions. Ambiguities in user preferences (e.g., output length or topic) Interactive-Chain-Prompting: Ambiguity Resolution for Crosslingual Conditional Generation with Interaction Ambiguities in language (e.g., polysemy) … AmbigNLG: Addressing Task Ambiguity in Instruction for NLG
Models Enables Expert-level Prompt Optimization Incorporate relevant domain knowledge or other additional information into the instructions to make them more precise and easier to follow for the LLM.
of the challenges • Even simple instructions, such as specifying keywords or sequence lengths, are often not followed correctly (left image). • When prompts are lengthy, models may struggle to utilize information from the middle sections (right image). 13 Instruction-Following Evaluation for Large Language Models Lost in the Middle: How Language Models Use Long Contexts
process into multiple steps 2. Splitting the task into multiple subtasks 3. Iterating the refinement process Incremental Generation 16 Incremental Generation Input Output Thought Because A, B should be … Task Output Task A Task B Input Output Output 1 Refinement Thought Generation Decomposition Model-based criticism
encourage the LLM to express its thought process when solving a problem. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models 17 Automatic Chain of Thought Prompting in Large Language Models Chain-of-Thought Automatic Chain of Thought
sub-questions. • Thought Generation naturally breaks down problems into simpler components Least-to-Most Prompting Enables Complex Reasoning in Large Language Models 18
19 Decomposition strategies are becoming more complex, evolving into structures like trees and graphs, allowing to create more flexible reasoning processes Incremental Generation Decomposition • Generate multiple thought candidates • Abandon, refine, and aggregate thoughts
its output, and use that to refine the response • Several methods have been proposed, including iterative self-feedback and revision (left image) and generating related questions for verification (right image). Chain-of-Verification Reduces Hallucination in Large Language Models Self-Refine: Iterative Refinement with Self-Feedback 20
step, and output is the problem • CoT reasoning is possible even with invalid demonstrations (see below) • LLM might fail to identify what is the problem within the input, leading the wrong feedback and wrongly refined output (Are Large Language Models Good Prompt Optimizers? ) Towards Understanding Chain-of-Thought Prompting: An Empirical Study of What Matters
• Ensembling • Generate multiple outputs and aggregate them to generate the final output. • Prompt Optimizer • LLM generates multiple possible prompts, scores them, then creates variations of the best ones Prompt Exploration
obtain a better answer. 25 Making Language Models Better Reasoners with Step-Aware Verifier There are also studies on ensembles of multiple chains-of-thought and models for a single prompt. - Multiple chains of thought: Tree of Thoughts: Deliberate Problem Solving with Large Language Models - Multiple models: Getting MoRE out of Mixture of Language Model Reasoning Experts
LLMs as prompt optimizers to obtain suitable prompts within discrete natural language spaces. 26 Large Language Models Are Human-Level Prompt Engineers
the large and discrete prompt space • LLM is highly sensitive to prompts: Even when prompts have the same meaning, the results can vary significantly depending on the wording, format, and phrasing (see below) • The optimal prompt can be model-specific and task-specific (Large Language Models as Optimizers ) Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formatting Evaluating the Zero-shot Robustness of Instruction- Sensitivity to wording and format Sensitivity to phrasing
of animals. 》sea otter => らっこ 》mouse => 》Translate the following English animal names into Japanese: 》sea otter => らっこ 》mouse => 》Let’s think step by step: Instruction clarification Prompt exploration Incremental Generation Combining these strategies effectively can unlock the potential of LLMs. Stay informed and adaptive! Important prompting strategies: The word "mouse" can be translated into (1) マウス, a computer mouse (2) ねずみ, an animal. Therefore, the answer is: ねずみ