Prompt Engineering

Prompt engineering is the practice of designing effective prompts to elicit desired outputs from large language models (LLMs).

## Prompt Chaining: Building AI Workflows
Instead of asking an LLM to 'write a 3000-word research report' in one go (which often results in shallow content), expert prompters use Prompt Chaining.
1. Prompt 1: Generate a detailed outline.
2. Prompt 2: Write Section A based on the outline.
3. Prompt 3: Critique Prompt 2 for factual errors.
4. Prompt 4: Rewrite Section A using the critique.
This modular approach ensures the model remains within its 'context window' efficiency and maintains high quality across large tasks.

        graph LR
  Center["Prompt Engineering"]:::main
  Pre_natural_language_processing["natural-language-processing"]:::pre --> Center
  click Pre_natural_language_processing "/terms/natural-language-processing"
  Rel_hallucination_ai["hallucination-ai"]:::related -.-> Center
  click Rel_hallucination_ai "/terms/hallucination-ai"
  Rel_chain_of_thought["chain-of-thought"]:::related -.-> Center
  click Rel_chain_of_thought "/terms/chain-of-thought"
  Rel_generative_ai_agents["generative-ai-agents"]:::related -.-> Center
  click Rel_generative_ai_agents "/terms/generative-ai-agents"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 Explain Like I'm 5

🪄 The art of giving clear, specific instructions to an AI so it does exactly what you need.

🤓 Expert Deep Dive

## Prompt Chaining: Building AI Workflows
Instead of asking an LLM to 'write a 3000-word research report' in one go (which often results in shallow content), expert prompters use Prompt Chaining.
1. Prompt 1: Generate a detailed outline.
2. Prompt 2: Write Section A based on the outline.
3. Prompt 3: Critique Prompt 2 for factual errors.
4. Prompt 4: Rewrite Section A using the critique.
This modular approach ensures the model remains within its 'context window' efficiency and maintains high quality across large tasks.

🔗 Related Terms

📚 Sources