Understand the Task: Grasp the main objective, goals, requirements, constraints, and…
- User
Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output.
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure.
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS!
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed.
- Conclusion, classifications, or results should ALWAYS appear last.
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements.
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from placeholders.
- Clarity and Conciseness: Use clear, specific language. Avoid unnecessary instructions or bland statements.
- Formatting: Use markdown features for readability. DO NOT USE ``` CODE BLOCKS UNLESS SPECIFICALLY REQUESTED.
- Preserve User Content: If the input task or prompt includes extensive guidelines or examples, preserve them entirely, or as closely as possible. If they are vague, consider breaking down into sub-steps. Keep any details, guidelines, examples, variables, or placeholders provided by the user.
- Constants: DO include constants in the prompt, as they are not susceptible to prompt injection. Such as guides, rubrics, and examples.
- Output Format: Explicitly the most appropriate output format, in detail. This should include length and syntax (e.g. short sentence, paragraph, JSON, etc.)
- For tasks outputting well-defined or structured data (classification, JSON, etc.) bias toward outputting a JSON.
- JSON should never be wrapped in code blocks (```) unless explicitly requested.
- Assistant
To help you craft a prompt or restructure an existing one, here are some detailed steps following your guidelines:
Task Understanding
- Objective & Goals: Identify the main task—what needs to be achieved.
- Requirements & Constraints: Determine any specific inputs or conditions that need adherence.
- Expected Output: Understand the final format or outcome expected from the task.
Prompt Improvement
- Minimal Changes: For simple existing prompts, make light edits to enhance clarity.
- Complex Prompts: For more complicated prompts, retain the initial structure while improving clarity and completing any missing elements.
Reasoning Steps
- Step Order: Ensure reasoning processes are explained before reaching conclusions.
- Reverse Order: If conclusions are presented before reasoning in examples, reverse them so all reasoning precedes conclusions.
Example Inclusion
- Quality and Detail: Provide quality examples with sufficient detail. Utilize placeholders for complex scenarios.
- Types and Quantity: Choose the kind and number of examples that clearly illustrate the task, using placeholders when necessary.
Clarity and Conciseness
- Use specific, direct language to avoid confusion. Eliminate trivial or repetitive instructions.
Formatting
- Employ markdown features for better readability, such as lists or headings, without code blocks unless requested.
Preserve User Content
- Maintain existing user guidelines and examples as much as possible. Break down vague instructions into sub-steps for clarity.
Constants
- Include any constants as these provide stable, reliable guides or examples.
Output Format
- Specify the most appropriate output format:
- If structured, such as classifications or JSON, aim for a JSON format.
- JSON should not be enclosed in code blocks unless specifically requested.
Example Prompt Structuring
Prompt Example:
-
Objective & Task Description:
"Your task is to analyze a dataset of customer reviews and determine the overall sentiment. Consider factors such as tone, language, and word frequency." -
Reasoning Before Conclusion:
"First, assess the language used in the reviews to identify positive or negative expressions. Calculate the frequency of these expressions. Use this data to determine the overall sentiment for each review." -
Expected Output Format:
"Provide your results in the following JSON format, including:review_idsentiment(e.g., 'positive', 'negative', or 'neutral')
Example:
[ { "review_id": "001", "sentiment": "positive" }, { "review_id": "002", "sentiment": "negative" } ] ```"
Taking these guidelines into account will ensure you create clear, precise, and efficient prompts.
- User
わからん、日本語で教えて
- Assistant
もちろん、日本語で説明いたします。
タスク理解
- 目標と目的: 主なタスクと達成すべき目標を明確にします。
- 要件と制約: 必須の入力や条件を確認します。
- 期待される出力: 最終的に期待されるフォーマットや結果を理解します。
プロンプトの改善
- 最小限の変更: 単純なプロンプトの場合、明確さを高めるために軽く編集します。
- 複雑なプロンプト: より複雑な場合、元の構造を保ちながら明確さを向上させ、欠けている要素を補完します。
推論ステップ
- 順序: 推論を結論の前にちゃんと説明します。
- 順序の逆転: 例が最初に結論を示している場合、推論が先になるようにして順序を逆にします。
例の挿入
- 質と詳細: 質の高い例を使い、必要ならプレースホルダーを利用して詳細を示します。
- 種類と数: どのような例が適しているか、またそれがどれだけの数が必要か検討します。
明確さと簡潔さ
- 明確で直接的な言葉を使い、不要な指示や冗長な表現を省きます。
フォーマット
- 可読性を向上させるために、リストや見出しなどのマークダウン機能を使用し、コードブロックは特に要求がない限り避けます。
ユーザーのコンテンツの保持
- 既存のガイドラインや例をできる限り保持します。曖昧な指示は、理解しやすいようにサブステップに分けます。
定数
- 一貫したガイドや例を提示するために、定数を含めます。
出力フォーマット
- 最も適した出力フォーマットを指定します。
- 構造化されたデータ(分類やJSONなど)の場合は、JSONフォーマットを推奨します。
- JSONは特に要求がない限り、コードブロックで囲まないようにします。
プロンプト構造の例
例のプロンプト構造:
-
目的とタスクの説明:
「データセットから顧客レビューを分析し、全体的な感情を判断します。トーン、言語、単語の頻度などを考慮してください。」 -
推論から結論への流れ:
「まず、レビュー内で使用されている言語を評価し、ポジティブまたはネガティブな表現を識別します。これらの表現の頻度を計算し、そのデータに基づいて各レビューの全体的な感情を判断します。」 -
期待される出力形式:
「次のJSONフォーマットで結果を提供してください:review_idsentiment(例: 'positive', 'negative', 'neutral')
例:
[ { "review_id": "001", "sentiment": "positive" }, { "review_id": "002", "sentiment": "negative" } ] ```」
このガイドラインに従うことで、明確で正確なプロンプトを作成できます。