Day 6 - Jan 26 2026

Prompt Engineering Basics

1. The Hierarchy of Prompts

Most people only use the "User Prompt." To build apps, we need the full stack.

  • System Prompt: The "God Mode" instruction. It sets the AI's persona, constraints, and format (e.g., "You are a JSON machine. Never explain.").

  • User Prompt: The actual task or query (e.g., "Summarize this email.").

2. Zero-Shot vs. Few-Shot

  • Zero-Shot: Asking the AI to do something without examples.

    • Input: "Translate this to Spanish: Hello."

    • Risk: The AI might say "Sure! The translation is 'Hola'." (We don't want the conversational filler).

  • Few-Shot: Giving the AI examples of what you want before asking the question. This is the secret weapon for reliability.

    • Input:

      • "English: One -> Spanish: Uno"

      • "English: Two -> Spanish: Dos"

      • "English: Hello -> Spanish: ?"

    • Result: "Hola" (Clean, predictable output).

3. The "Chain of Thought" Trick

For complex logic (math or reasoning), telling the AI to "Think step-by-step" improves accuracy by ~50%.

  • Why? It forces the model to generate reasoning tokens before the final answer, effectively giving it "time to think."

Status:

Last updated