BiTree
  • Search For Lessons
  • Curriculum
  • Pricing
  • For Educators
  • Become a Tutor
  • About
  • Contact
Log InGet Started

Questions, concerns, bug reports, or suggestions? We read every message, write to us at [email protected].

More ways to reach us →
BiTree

Live coding lessons for aspiring developers and security professionals.

[email protected]

(201) 785-7951

Mon–Fri, 9 AM–5 PM EST

Learn

  • Search For Lessons
  • Curriculum
  • Pricing

Company

  • About
  • For Educators & Schools
  • Become a Tutor
  • Contact Us

Legal

  • Terms of Service
  • Privacy Policy
© 2026 BiTree. All rights reserved.
Curriculum/Artificial Intelligence/Prompt Engineering
50 minIntermediate

Prompt Engineering

After this lesson, you will be able to: Communicate effectively with LLMs using zero-shot, few-shot, chain-of-thought, and structure techniques.

Prompt engineering is the highest-impact AI skill. Tiny prompt changes can 10x output quality. This lesson covers the patterns that work in production.

Prerequisites:Training and Fine-Tuning LLMs

Anatomy of a good prompt

Role, 'You are an expert SQL analyst'. Task, clear instruction. Context, relevant data, constraints. Format, desired output structure. Examples (few-shot), show 2-3 input/output pairs.

Few-shot vs zero-shot

Zero-shot = describe the task. Few-shot = show examples:

tsx
# Zero-shot
Classify the sentiment: 'The food was cold.'
# Few-shot (often dramatically better)
Examples:
"Loved every bite!" → positive
"Burnt and bland." → negative
"It was fine." → neutral
Now classify: "The food was cold."

💡 Chain-of-thought (CoT)

For reasoning tasks, ask: 'Think step by step before answering.' Or show step-by-step examples in few-shot. Modern models (Claude, GPT-4) often do this implicitly. Reasoning models (o1, o3) do it heavily by default.

Production techniques

  1. 1

    1. Use XML/JSON structure for inputs and outputs.

  2. 2

    2. Specify what to do AND what not to do.

  3. 3

    3. Add output schema with examples.

  4. 4

    4. For long context: put critical instructions FIRST and LAST.

  5. 5

    5. Iterate, keep an eval set, measure prompt changes.

Anti-patterns

Don't say 'Don't hallucinate', meaningless. Don't pile on adjectives ('be very accurate and thorough'). Don't bury the task at the bottom of a 5000-token prompt. Be specific, structured, exemplified.

Sign in and purchase access to unlock this lesson.

Sign in to purchase
←Training and Fine-Tuning LLMs
Back to Artificial Intelligence
Building with AI APIs→