Summarized by

しょーてぃー | Experience Designer (@shoty_k2) on X

大規模言語モデルの返答精度が向上する「プロンプト26の原則」

Here are the 26 prompt guidelines detailed in the paper, formatted as a table:

# 原則(JP ver) 事例 Principle(Eng ver)
1 LLMに対して丁寧語は不要である。つまり、「お願いします」、「もしよろしければ」、「ありがとう」、「私は〜したい」といったフレーズを省略し、直接的に要点を述べる。 「この文章を要約せよ。余計な丁寧語は不要だ」 No need to be polite with LLM so there is no need to add phrases like “please”, “if you don’t mind”, “thank you”, “I would like to”, etc., and get straight to the point.
2 プロンプトに意図した聴衆を組み込む。例えば、聴衆がその分野の専門家である場合など。 「この複雑なアルゴリズムを、データサイエンスの専門家に説明するように述べよ」 Integrate the intended audience in the prompt, e.g., the audience is an expert in the field.
3 複雑なタスクを、対話形式でより単純なプロンプトの連続に分解する。 「プロジェクト管理のプロセスを、初歩的なステップから順に説明せよ」 Break down complex tasks into a sequence of simpler prompts in an interactive conversation.
4 ‘do’のような肯定的な指示を使用し、‘don’t’のような否定的な言葉を避ける。 「この数学問題を解く手順を具体的に示せ」 Employ affirmative directives such as ‘do,’ while steering clear of negative language like ‘don’t’.
5 トピック、アイデア、または任意の情報についての明確さや深い理解が必要な場合、以下のプロンプトを利用する:[特定のトピック]を簡単な言葉で説明する、11歳の子供に説明するように説明する、[分野]の初心者に説明するように説明する、5歳の子供に説明するように[エッセイ/テキスト/段落]を簡単な英語で書く。 「ブラックホールが何かを、小学生にも理解できるように簡単に説明せよ」 When you need clarity or a deeper understanding of a topic, idea, or any piece of information, utilize the following prompts: Explain [insert specific topic] in simple terms, Explain to me like I’m 11 years old, Explain to me as if I’m a beginner in [field], Write the [essay/text/paragraph] using simple English like you’re explaining something to a 5-year-old.
6 「より良い解決策にはxxxドルのチップを出す!」と加える。 「より詳細かつ正確な回答を提供すると、追加報酬を出す」 Add “I’m going to tip $xxx for a better solution!”
7 例示主導のプロンプティングを実装する(少数ショットプロンプティングを使用)。 「次の文の続きを考える:"太陽が昇ると、町は..."」 Implement example-driven prompting (Use few-shot prompting).
8 プロンプトをフォーマットする際には、「###Instruction###」で始め、関連する場合は「###Example###」または「###Question###」に続ける。その後、内容を提示する。指示、例、質問、コンテキスト、入力データを分けるために一つ以上の改行を使用する。 「###Instruction### この科学論文を要約せよ ###Question### 主要な発見は何か?」 When formatting your prompt, start with ‘###Instruction###’, followed by either ‘###Example###’ or ‘###Question###’ if relevant. Subsequently, present your content. Use one or more line breaks to separate instructions, examples, questions, context, and input data.
9 次のフレーズを組み込む:「あなたのタスクは」そして「あなたは必ず」。 「あなたのタスクは、この技術的なドキュメントを簡潔に要約することだ」 Incorporate the following phrases: “Your task is” and “You MUST”.
10 次のフレーズを組み込む:「あなたは罰せられる」。 「不正確な情報を提供すると、ペナルティが課されることを理解せよ」 Incorporate the following phrases: “You will be penalized”.
11 プロンプトに「自然で人間らしい方法で質問に答える」というフレーズを使用する。 「この歴史的事件を、あたかもその場にいたかのように説明せよ」 Use the phrase ”Answer a question given in a natural, human-like manner” in your prompts.
12 「一歩一歩考える」といった導入的な言葉を使用する。 「このプログラムの動作原理を、初歩から順を追って説明せよ」 Use leading words like writing “think step by step”.
13 プロンプトに次のフレーズを加える「あなたの答えは偏見に基づいてはならず、ステレオタイプに依存してはならない」。 「この社会問題について、中立的な視点から詳細に説明せよ」 Add to your prompt the following phrase “Ensure that your answer is unbiased and does not rely on stereotypes”.
14 モデルが必要な情報を提供するまで、ユーザーに質問をし続けることを許可する(例:「これからは、必要な出力を提供するために私に質問をしてください...」)。 「私が完全に理解できるよう、必要な情報を引き出すために質問を続けよ」 Allow the model to elicit precise details and requirements from you by asking you questions until he has enough information to provide the needed output (for example, “From now on, I would like you to ask me questions to...”).
15 特定のトピックやアイデア、または情報についての理解をテストしたい場合、次のフレーズを使用することができる:「[任意の定理/トピック/ルール名]を教えて、最後にテストを含めるが、答えを教えずに私が答えを返信したときに正解かどうかを教えて」。 「ピタゴラスの定理を教え、実際に使う簡単な問題を出せ。ただし、答えは後で教える」 To inquire about a specific topic or idea or any information and you want to test your understanding, you can use the following phrase: “Teach me the [Any theorem/topic/rule name] and include a test at the end, but don’t give me the answers and then tell me if I got the answer right when I respond”.
16 大規模言語モデルに役割を割り当てる。 「このセッションでは、あなたは環境科学者としての役割を果たせ」 Assign a role to the large language models.
17 区切り文字を使用する。 「セクション1: 定義、セクション2: 方法、セクション3: 結果という形で情報を整理せよ」 Use Delimiters.
18 プロンプト内で特定の単語やフレーズを複数回繰り返す。 「"サステナビリティ"というキーワードを、文章中に複数回織り交ぜて説明せよ」 Repeat a specific word or phrase multiple times within a prompt.
19 チェーンオブソート(CoT)を少数ショットプロンプトと組み合わせる。 「問題解決のための思考過程を、論理的なステップとして展開せよ」 Combine Chain-of-thought (CoT) with few-Shot prompts.
20 出力プライマーを使用する。これは、望ましい出力の始まりでプロンプトを終了させることを含む。出力プライマーを使用するには、予想される応答の開始部分でプロンプトを終了させる。 「答えは"最も重要な要因は"から始まる。この続きを論理的に完成させよ」 Use output primers, which involve concluding your prompt with the beginning of the desired output. Utilize output primers by ending your prompt with the start of the anticipated response.
21 詳細なエッセイ/テキスト/段落/記事または任意のテキストを書くために:「[トピック]について、必要なすべての情報を加えて詳細に[エッセイ/テキスト/段落]を私のために書いてください」。 「気候変動の影響について、具体的なデータと事例を交えて詳細なレポートを作成せよ」 To write an essay /text /paragraph /article or any type of text that should be detailed: “Write a detailed [essay/text/paragraph] for me on [topic] in detail by adding all the information necessary”.
22 特定のテキストをスタイルを変えずに修正/変更するために:「ユーザーから送られた各段落を見直してください。文法と語彙を改善するだけでなく、自然に聞こえるようにしてください。ただし、公式な段落をカジュアルにするなど、執筆スタイルを変更してはならない」。 「この段落を、より親しみやすく、しかし意味を変えずにリライトせよ」 To correct/change specific text without changing its style: “Try to revise every paragraph sent by users. You should only improve the user’s grammar and vocabulary and make sure it sounds natural. You should not change the writing style, such as making a formal paragraph casual”.
23 複数のファイルにまたがる複雑なコーディングプロンプトがある場合:「これから、複数のファイルにまたがるコードを生成するたびに、指定されたファイルを自動的に作成するか、生成されたコードを挿入するために既存のファイルを変更するために実行できる[プログラミング言語]スクリプトを生成してください。[あなたの質問]」。 「複数のファイルにまたがるプログラムを作成する際、自動的にファイルを生成するスクリプトを書け」 When you have a complex coding prompt that may be in different files: “From now and on whenever you generate code that spans more than one file, generate a [programming language] script that can be run to automatically create the specified files or make changes to existing files to insert the generated code. [your question]”.
24 特定の単語、フレーズ、または文を使用してテキストを開始または続行したい場合、次のプロンプトを利用する:「[歌詞/物語/段落/エッセイ...]の始まりを提供しています:[歌詞/単語/文を挿入]。提供された言葉に基づいて完成させてください。流れを一貫させてください」。 「物語の始まりはこうだ:"昔々、あるところに..."。この続きを書いて、物語を完成させよ」 When you want to initiate or continue a text using specific words, phrases, or sentences, utilize the following prompt: I’m providing you with the beginning [song lyrics/story/paragraph/essay...]: [Insert lyrics/words/sentence]. Finish it based on the words provided. Keep the flow consistent.
25 モデルがコンテンツを生成するために従う必要がある要件を、キーワード、規則、ヒント、または指示の形で明確に述べる。 「この課題を解決するためには、以下のキーワードを使用してください:AI、持続可能性、イノベーション」 Clearly state the requirements that the model must follow in order to produce content, in the form of the keywords, regulations, hint, or instructions.
26 提供されたサンプルに似たエッセイや段落などのテキストを書くためには、次の指示を含める:「提供された段落[/タイトル/テキスト/エッセイ/回答]に基づいて同じ言語を使用してください」。 「この文体で書かれたエッセイを参考に、同じスタイルで新しいトピックについて書け」 To write any text, such as an essay or paragraph, that is intended to be similar to a provided sample, include the following instructions: Please use the same language based on the provided paragraph[/title/text /essay/answer].

About Paper

Principled Instructions Are All You Need for Questioning LLaMA-1/2, GPT-3.5/4

https://arxiv.org/pdf/2312.16171v1.pdf

The paper titled "Principled Instructions Are All You Need for Questioning LLaMA-1/2, GPT-3.5/4" by Sondos Mahmoud Bsharat, Aidar Myrzakhan, and Zhiqiang Shen introduces 26 guiding principles designed to streamline the process of querying and prompting large language models (LLMs). The authors aim to simplify the concepts of formulating questions for various scales of LLMs, examining their abilities, and enhancing user comprehension of the behaviors of different scales of LLMs when fed different prompts. The paper conducts extensive experiments on LLaMA-1/2 and GPT-3.5/4 to verify the effectiveness of these principles in instructions and prompts design.

Key Insights:

  1. Prompt Engineering as an Art: The paper emphasizes that prompt engineering is crucial in communicating effectively with generative LLMs. It involves crafting precise, task-specific instructions and selecting representative examples for inclusion in the prompt.
  2. Optimizing Prompts for Better Responses: The research highlights that directly fine-tuning LLMs for particular tasks is often impractical for most users and developers. Instead, optimizing prompts can significantly enhance the quality of responses from pre-trained LLMs.
  3. Principled Instructions for LLM Prompting: The paper presents a comprehensive set of principled instructions to improve the quality of prompts for LLMs. These principles are categorized into five groups: Prompt Structure and Clarity, Specificity and Information, User Interaction and Engagement, Content and Language Style, and Complex Tasks and Coding Prompts.

Experimentation and Findings:

Conclusion: