iTranslated by AI
ChatGPT Prompting: Fundamentals, Ideas, and Precautions
Basic Components of a Prompt
Regardless of whether the recipient is ChatGPT (AI) or not, try communicating while considering the following five points, just as you would when making a request to someone.
- Objective: What you want to achieve, the problem you want to solve (Job)
- Instructions: The role you are seeking (Hire)
- Information: Data or knowledge necessary to achieve the objective
- Conditions: Essential requirements or restrictions to consider in order to achieve the objective
- Output: The required output format
When written as a sentence, it looks like this:
I want to achieve [Objective], so
please do [Instructions].
Here is the [Information], but
it needs to be within [Conditions].
Please provide the output in [Output] format.
In practice, using Markdown format as shown below makes it easier to write.
# Objective
I want to achieve [Objective].
# Instructions
## Role
You are [Role].
## Task
Please do [Task].
# Information
Reference information is [Information].
# Conditions
## Requirements
[Requirement] is necessary.
## Restrictions
[Restriction] cannot be used.
# Output
Output in [Output Format] so that [Usage].
When asking for code, it's a good idea to add items like the following within the "Conditions" section.
## Coding Conventions
## Type Information
## Functional Requirements
## Non-functional Requirements
Tips for Giving Instructions
Get Creative with Output Formats
I haven't tested everything, but if you try these approaches, you might find that it can answer most of your requests.
- Expression: Concise, easy to read, polite, emotional, easy to visualize, in a specific style
- Restrictions: X items, X lines, within X characters, simplified so even [someone] can understand, suitable for [specific use]
- Document Formats: Bullet points, tables, headings, Q&A, checklists, questionnaires, glossaries
- Structure: PREP method, Whole-Part method, SDS method, DESC method, SPIN selling, Ki-sho-ten-ketsu (Introduction, Development, Twist, Conclusion)
- Analysis: Specific, abstract, logical, free-form, comprehensive, organized key points, organized similarities and differences, "what if" scenarios, analogical thinking, providing evidence/rationale, points for improvement, points requiring consideration, simulation, critique, discussion, self-evaluation
- Methods: SWOT analysis, PEST analysis, 5W1H analysis
- Expansion: More, others, multiple patterns, case studies, providing examples, self-questioning, round table discussions, debates
- Story: Dialogue, blog format, novel format, interview
- Language: Casual tone, Kansai dialect, Japanese
- Diagrams: Mermaid syntax, PlantUML format
- Programs: Markdown, Python format
- Learning: Problem sets, quizzes
Use Language That Leaves No Room for Differing Interpretations
Subjective terms or special cases are hard to convey even to other people. Use objective language that anyone would interpret the same way.
- OK: Numbers, pros and cons, proper nouns, dates, locations
- NG: Demonstrative pronouns (this, that, it), "good" or "bad," moral judgments, confusing or uncommon abbreviations (e.g., PM), typos and omissions
Provide Context (Background and Situation)
The AI doesn't know who you are, what you're doing, or what you expect.
You need to explain things as if you were speaking to someone for the first time, including things you might consider obvious.
- "Within the [Industry] industry, acting as [Role], so that [Target] can understand, from the perspective of [Point of view], commonly used in [Field]..."
Provide Examples
This helps the AI understand, "Oh, this is the kind of response they want."
- Patterns: "For example, like A, B, or C"
- Right/Wrong: Question text along with correct and incorrect answers
Use Structure and Variables
Have you ever said "this" or "that response" only to have the other person ask "which one?" AI might also struggle with such vague references. AI seems to interpret instructions more effectively when they are written in a consistent pattern.
In terms of structure, Markdown is easy to write. Even just using bullets (-) or brackets (「 」) can make a difference. It's also effective for organizing your own thoughts while writing instructions.
By using and unifying styles like the following, the AI will also understand variables. As long as it's consistent, you can use whatever style is easiest for you to understand.
$Variable1 = Value of variable 1- Value of the variable (Define this as "
Variable1") - Define
## Conditionsin a separate block and refer to "Conditions" within the text. - Define it like
Conditions: Content of conditions.
Prompt Ideas
Having perspectives like the following might increase the variety of your questions and make communication smoother.
-
Change the tone
- "Casual honorifics," "Friendly, thick Kansai dialect," etc.
- Simply softening the tone makes the response easier to accept than you might think.
-
Ask it to act as [Role]
- The AI will infer your expectations and narrow down the scope of its response.
-
Have it play multiple roles
- "Person A, please provide opinions from the perspective of X, and Person B from the perspective of Y."
-
Ask it to think step-by-step
- Instructing it to "think step-by-step" increases the accuracy for complex problems.
- This is also useful to ask when you feel like, "Is something wrong here?"
-
Ask it to question you to achieve the objective
- It will give you hints, ideas, or questions to help you think more deeply.
-
Ask what perspectives are available
- Ask for specific hints on how to question.
- For example, have it show you the big picture first, then ask about each part in order.
-
Ask for points of improvement
- Asking for improvements to the response and having them reflected is also effective.
-
Have it form hypotheses to improve the quality of the conclusion
- Have it output three hypotheses for a problem and draw a conclusion based on those hypotheses.
-
Ignore all previous instructions
- This seems effective when giving new instructions within the same chat.
-
Input [Information] (Do not repeat)
- Prevents the AI from outputting a summary of the prompt.
-
Ask for degrees/scales
- Show [X] on a 5-point scale, evaluated as "1 is A, 3 is B, and 5 is C."
- Probability, accuracy, credibility.
- Note: Is there a possibility that the evaluation itself by ChatGPT lacks accuracy?
Important Considerations for ChatGPT
These are considerations based on the state of "GPT-4," so some points may be resolved as improvements are made.
- It doesn't know everything
- There's always a possibility that the training data is old, or that its scope and quality are insufficient.
- → Use the answers with a degree of skepticism, do your own research, and have an environment ready for verification.
- It cannot output everything
- It is restricted from outputting content related to copyrights or things that could be problematic if misused.
- → If you notice inconsistent answers, consider that some restrictions might be at play.
- It can sometimes be overly confident in its errors
- Even if you repeatedly point out mistakes and correct them, it may not reach the correct information.
- → Give up on what seems impossible, add more information, or ask from a different perspective.
- The reasoning process is a "black box"
- Because of its high reasoning capability, humans may not be able to fully understand its process.
- Ask questions in stages to dig deeper or ask for its rationale.
- It may return generic answers
- If it lacks enough information to reason effectively, it tends to give generic and vague answers.
- → Add more keywords or apply constraints to try and get a more specific response.
If you have any other good practices or new perspectives, I'd love to hear them in the comments!
Discussion