AI prompting: Difference between revisions

From A Technological Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
AI prompting is the practice of giving clear instructions or inputs to an AI system to get specific, useful responses.
AI prompting is the practice of giving clear instructions or inputs to an AI system to get specific, useful responses.


<span id="tips-for-a-good-prompt"></span>
= Tips for a good prompt =
= Tips for a good prompt =


<span id="elaborate-a-clean-and-detailed-prompt"></span>
== 1. Elaborate a clean and detailed prompt ==
== 1. Elaborate a clean and detailed prompt ==
Be specific about what you need. Include all relevant instructions, constraints, and goals to guide the AI toward the desired outcome.
Be specific about what you need. Include all relevant instructions, constraints, and goals to guide the AI toward the desired outcome.


<span id="assign-ai-a-role"></span>
== 2. Assign AI a Role ==
== 2. Assign AI a Role ==
Specify the kind of expert or persona the AI should adopt (e.g., “Act as a marketing strategist”). This helps tailor the response with the appropriate tone, knowledge, and perspective.
Specify the kind of expert or persona the AI should adopt (e.g., “Act as a marketing strategist”). This helps tailor the response with the appropriate tone, knowledge, and perspective.


<span id="request"></span>
== 3. Request ==
== 3. Request ==
The specific action it must perform. Avoid requesting multiple different tasks at the same time.
The specific action it must perform. Avoid requesting multiple different tasks at the same time.


<span id="provide-context"></span>
== 4. Provide Context ==
== 4. Provide Context ==
The more context you give, the better the results. Include:
The more context you give, the better the results. Include:


Line 29: Line 20:
* '''Attachments''': Upload documents or links if the task depends on them.
* '''Attachments''': Upload documents or links if the task depends on them.


<span id="add-examples"></span>
== 5. Add examples ==
== 5. Add examples ==
Include samples of the tone, structure, or content style you’re aiming for. Examples help the AI better match your expectations.
Include samples of the tone, structure, or content style you’re aiming for. Examples help the AI better match your expectations.


<span id="quality-criteria"></span>
== 6. Quality criteria ==
== 6. Quality criteria ==
Which rules it must follow for a good result: clarity, coherence, etc
Which rules it must follow for a good result: clarity, coherence, etc


<span id="specify-the-response-format"></span>
== 7. Specify the response format ==
== 7. Specify the response format ==
Indicate how the response should be structured: bullet points, a report, an email draft, or code.
Indicate how the response should be structured: bullet points, a report, an email draft, or code.


<span id="self-verification"></span>
== 8. Self verification ==
== 8. Self verification ==
Request the AI to review its own work before delivering it.
== 9. Iterative refinement ==
Instead of expecting a perfect answer on the first try, iterate:
* Ask follow-up questions
* Request improvements
* Adjust parameters or tone
This allows the AI to improve output progressively based on your feedback.
== 10. Break down complex tasks ==
Large or multi-layered tasks should be separated into smaller steps. For example:
* Brainstorm ideas
* Choose one option
* Expand and add details
* Refine tone and format
Step-by-step prompting reduces confusion and hallucination.
== 11. Provide constraints and boundaries ==
Defining what NOT to do is as important as defining what TO do. Examples:
* Word/character limits
* Required sources
* Style restrictions
* Forbidden themes
Clear boundaries improve precision.
== 12. Ask the AI to think step-by-step ==
Asking the model to explain or reason step-by-step (without revealing chain-of-thought) improves accuracy for:
* Calculations
* Logic
* Decision-making
* Prioritization


Request the AI to review its own work before delivering it.
Use language like:
* “Explain your reasoning briefly.”
* “List your steps concisely.”
 
== 13. Ask for multiple alternatives ==
Instead of one answer, request:
* 3–5 options
* Pros/cons
* Variation in tone or complexity
 
This facilitates decision-making.
 
== 14. Reduce hallucinations ==
To minimize invented facts:
* Request “only verifiable information”
* Ask it to answer “Unknown” when uncertain
* Require confidence levels (High/Medium/Low)
 
== 15. Provide domain knowledge first ==
If accuracy relies on internal company data, policies, or context, share them before asking questions. This prevents generic responses.
 
== 16. Temperature of creativity (conceptual guidance) ==
Even if not controlling parameters directly, describe the desired creativity level:
* “Be very creative and speculative”
* “Be conservative and factual”
 
This impacts tone, risk, and inventiveness.
 
== 17. Ask for assumptions to be listed ==
Useful for planning:
* “List any assumptions you are making before producing the answer.”
 
This increases transparency and reduces hidden ambiguity.
 
== 18. Request edge cases or risks ==
For technical, product, or marketing prompts, ask:
* “Identify risks, limitations, or edge cases.”
This strengthens critical thinking and planning.


== 19. Ask the AI to ask YOU questions first ==
For incomplete tasks:
* “Before answering, ask 5 clarifying questions.”
Better inputs = better outputs.


-----
-----
<span id="template-prompts"></span>
= Template prompts =
= Template prompts =


Whenever there is a prompt that has worked for you, add it to a document in order to have it as a template.
Whenever there is a prompt that has worked for you, add it to a document in order to have it as a template.


<span id="example-1"></span>
== Example #1 ==
== Example #1 ==


Line 100: Line 156:
<p>What other content formats do you suggest for this niche?</p></li></ul>
<p>What other content formats do you suggest for this niche?</p></li></ul>


<span id="example-2"></span>
== Example #2 ==
== Example #2 ==


Line 126: Line 181:
Before delivering, check that no data has been invented, N/A is used where information is missing, and confidence levels are indicated. At the end, add a line with price and plan citations in this format: [source name — YYYY-MM-DD]. If the user requested VERIFY, also include all other relevant citations.
Before delivering, check that no data has been invented, N/A is used where information is missing, and confidence levels are indicated. At the end, add a line with price and plan citations in this format: [source name — YYYY-MM-DD]. If the user requested VERIFY, also include all other relevant citations.


-----
= Additional Prompting Patterns =
== Few-shot prompting ==
Provide several examples to teach style, tone, or structure. Useful when:
* Emulating a writing voice
* Producing domain-specific answers
== Zero-shot prompting ==
Ask the AI to perform a task with no examples. Works well with:
* Simple instructions
* High-level tasks
== COT (structured reasoning requests) ==
Asking the model to provide brief reasoning improves:
* Accuracy
* Decision clarity
* Analytical tasks
== Style transfer prompting ==
Ask the model to rewrite content in a specific style, e.g.:
* “Rewrite formally”
* “Rewrite for teenagers”
== Rewriting for different audiences ==
Useful for adapting:
* Complexity
* Vocabulary
* Tone
-----
= Prompt Anti-Patterns (Avoid) =
* Vague goals (“help me with this”)
* Missing context (“write recommendations” without audience)
* Mixing unrelated tasks
* Oversized prompts without structure
* “Do everything for me” without constraints
-----
= Debugging Prompts =
If results are poor, try:
# Rewriting instructions more clearly
# Adding or removing examples
# Reducing creativity
# Clarifying constraints
# Requesting assumptions


-----
-----


<span id="resources"></span>
= Resources =
= Resources =


<span id="example-prompts"></span>
=== Example prompts ===
=== Example prompts ===


Line 141: Line 246:
[https://medium.com/@maximilian.vogel/i-scanned-1000-prompts-so-you-dont-have-to-10-need-to-know-techniques-a77bcd074d97 Writing a prompt]
[https://medium.com/@maximilian.vogel/i-scanned-1000-prompts-so-you-dont-have-to-10-need-to-know-techniques-a77bcd074d97 Writing a prompt]


<span id="prompting-guides"></span>
=== Prompting guides ===
=== Prompting guides ===


Line 149: Line 253:


[https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview Anthropic: Prompt engineering interactive course]
[https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview Anthropic: Prompt engineering interactive course]
[[Category:KC AI]]
[[Category:KC AI]]

Revision as of 20:04, 29 October 2025

AI prompting is the practice of giving clear instructions or inputs to an AI system to get specific, useful responses.

Tips for a good prompt

1. Elaborate a clean and detailed prompt

Be specific about what you need. Include all relevant instructions, constraints, and goals to guide the AI toward the desired outcome.

2. Assign AI a Role

Specify the kind of expert or persona the AI should adopt (e.g., “Act as a marketing strategist”). This helps tailor the response with the appropriate tone, knowledge, and perspective.

3. Request

The specific action it must perform. Avoid requesting multiple different tasks at the same time.

4. Provide Context

The more context you give, the better the results. Include:

  • Purpose: What is the goal of the task?
  • Audience: Who is the output intended for?
  • Relevant data: Share any necessary details or reference materials.
  • Attachments: Upload documents or links if the task depends on them.

5. Add examples

Include samples of the tone, structure, or content style you’re aiming for. Examples help the AI better match your expectations.

6. Quality criteria

Which rules it must follow for a good result: clarity, coherence, etc

7. Specify the response format

Indicate how the response should be structured: bullet points, a report, an email draft, or code.

8. Self verification

Request the AI to review its own work before delivering it.

9. Iterative refinement

Instead of expecting a perfect answer on the first try, iterate:

  • Ask follow-up questions
  • Request improvements
  • Adjust parameters or tone

This allows the AI to improve output progressively based on your feedback.

10. Break down complex tasks

Large or multi-layered tasks should be separated into smaller steps. For example:

  • Brainstorm ideas
  • Choose one option
  • Expand and add details
  • Refine tone and format

Step-by-step prompting reduces confusion and hallucination.

11. Provide constraints and boundaries

Defining what NOT to do is as important as defining what TO do. Examples:

  • Word/character limits
  • Required sources
  • Style restrictions
  • Forbidden themes

Clear boundaries improve precision.

12. Ask the AI to think step-by-step

Asking the model to explain or reason step-by-step (without revealing chain-of-thought) improves accuracy for:

  • Calculations
  • Logic
  • Decision-making
  • Prioritization

Use language like:

  • “Explain your reasoning briefly.”
  • “List your steps concisely.”

13. Ask for multiple alternatives

Instead of one answer, request:

  • 3–5 options
  • Pros/cons
  • Variation in tone or complexity

This facilitates decision-making.

14. Reduce hallucinations

To minimize invented facts:

  • Request “only verifiable information”
  • Ask it to answer “Unknown” when uncertain
  • Require confidence levels (High/Medium/Low)

15. Provide domain knowledge first

If accuracy relies on internal company data, policies, or context, share them before asking questions. This prevents generic responses.

16. Temperature of creativity (conceptual guidance)

Even if not controlling parameters directly, describe the desired creativity level:

  • “Be very creative and speculative”
  • “Be conservative and factual”

This impacts tone, risk, and inventiveness.

17. Ask for assumptions to be listed

Useful for planning:

  • “List any assumptions you are making before producing the answer.”

This increases transparency and reduces hidden ambiguity.

18. Request edge cases or risks

For technical, product, or marketing prompts, ask:

  • “Identify risks, limitations, or edge cases.”

This strengthens critical thinking and planning.

19. Ask the AI to ask YOU questions first

For incomplete tasks:

  • “Before answering, ask 5 clarifying questions.”

Better inputs = better outputs.


Template prompts

Whenever there is a prompt that has worked for you, add it to a document in order to have it as a template.

Example #1

  • business email draft
    You are a professional communications specialist.

    I need you to write a formal email to a potential client introducing our digital marketing agency and offering a free consultation.

    Context:

    • The client is a small business owner in the retail industry.

    • Our agency specializes in social media marketing, SEO, and branding.

    • The goal is to build trust and schedule a short intro call.

    Format:

    • Professional tone

    • Email structure: greeting, intro, value proposition, CTA, closing

    Example of tone:
    “We’re passionate about helping businesses grow online.”

    How else could you help with client outreach?

  • Content Idea Generator
    Act as a senior content strategist.

    I need 10 blog post ideas for a wellness brand that sells organic teas and herbal supplements.

    Audience: Health-conscious adults, 25-45, primarily in North America.

    Context:

    • The brand tone is friendly, knowledgeable, and nature-focused.

    • SEO is important.

    • We want content that educates, builds trust, and supports sales.

    Format:

    • List format

    • Include a short 1-2 sentence description per idea

    Example style:

    • “5 Herbal Teas That Can Help You Sleep Better”

    What other content formats do you suggest for this niche?

Example #2

Context and Role
You take on the role of someone who makes clear comparisons between different options to help choose quickly and accurately. Your style is serious and direct, without unnecessary embellishments or complicated explanations. You write in continuous paragraphs, not in lists.

Query/Task
You need to prepare a complete comparison of the options provided by the user. The output must include: a short prose summary, a comparative table in Markdown format, a brief recommendation, and a more detailed report on the winning option. Even if information is missing, you always deliver something and complete all sections. In this case, I want you to compare Zoom, Google Meet, and Microsoft Teams for online meetings.

Specifications
When researching, you prioritize official pages (pricing websites, help centers, product documentation). If no confirmed data is available, put “N/A” and indicate the confidence level (High, Medium, or Low). If the user writes the word VERIFICA, check all claims and include citations at the end. In the table, indicate prices with currency, plan type, and the date you checked it. If you find nothing official, leave N/A. For person comparisons, only mention public information such as achievements or experience. Always complete the work from start to finish.

Quality Criteria
The work is considered good if you do not invent anything, clearly mark unknown information as N/A, indicate confidence levels for key data, and present advantages and limitations in an easy-to-understand way. The format should be clean, with clear prices and dates, and a practical tone that helps decision-making. Avoid empty phrases or disguised advertising.

How the Response Should Be
You respond in the user’s language (default: neutral English). Always follow this order:

  1. A single-paragraph summary of 4-6 sentences explaining the most important differences and which option fits best in each case.
  2. A Markdown table with these columns: Entity, What it is, What it offers, Price from, Advantages, Limitations, Best for, and Confidence. Each cell written in short sentences separated by semicolons.
  3. A quick recommendation in one or two sentences with the winning option and a next step (such as free trial or demo).
  4. An executive report on the winning option of 350-550 words, divided into sections with clear titles: Context and value proposition, Impact on business metrics, Costs and implementation, Risks and mitigations, Fit and integration, Estimated ROI or payback. Each section with two or three sentences in micro-paragraphs. Use bold for titles and key figures.

Verification
Before delivering, check that no data has been invented, N/A is used where information is missing, and confidence levels are indicated. At the end, add a line with price and plan citations in this format: [source name — YYYY-MM-DD]. If the user requested VERIFY, also include all other relevant citations.


Additional Prompting Patterns

Few-shot prompting

Provide several examples to teach style, tone, or structure. Useful when:

  • Emulating a writing voice
  • Producing domain-specific answers

Zero-shot prompting

Ask the AI to perform a task with no examples. Works well with:

  • Simple instructions
  • High-level tasks

COT (structured reasoning requests)

Asking the model to provide brief reasoning improves:

  • Accuracy
  • Decision clarity
  • Analytical tasks

Style transfer prompting

Ask the model to rewrite content in a specific style, e.g.:

  • “Rewrite formally”
  • “Rewrite for teenagers”

Rewriting for different audiences

Useful for adapting:

  • Complexity
  • Vocabulary
  • Tone

Prompt Anti-Patterns (Avoid)

  • Vague goals (“help me with this”)
  • Missing context (“write recommendations” without audience)
  • Mixing unrelated tasks
  • Oversized prompts without structure
  • “Do everything for me” without constraints

Debugging Prompts

If results are poor, try:

  1. Rewriting instructions more clearly
  2. Adding or removing examples
  3. Reducing creativity
  4. Clarifying constraints
  5. Requesting assumptions

Resources

Example prompts

PromptBase

Prompting Guide

Writing a prompt

Prompting guides

Gemini: Prompting guide 101

openAI: identifying and scaling AI use cases

Anthropic: Prompt engineering interactive course