Intro to Prompt Engineering

What's in this lesson: Core techniques and pitfalls of prompt engineering, plus a short assessment.
Why this matters: Better prompts mean better model outputs—essential for any AI application.

What Is Prompt Engineering?

Prompt engineering is the practice of designing inputs (prompts) to get the best possible output from a large language model (LLM).

  • A well-crafted prompt can turn a generic model into a domain expert.
  • Small wording changes can dramatically change the quality of the output.

Key takeaway: The model is only as good as the instructions you give it.

Core Techniques

There are three fundamental prompt techniques you should know:

  • Zero-shot: Ask the model directly with no examples.
  • Few-shot: Provide 2-3 examples before your actual question.
  • Chain-of-thought: Ask the model to "think step by step."

Few-shot prompting often works best when you need a specific output format.

Common Pitfalls

Avoid these mistakes when writing prompts:

  • Being too vague — "Write something about dogs" vs. "Write a 200-word blog intro about golden retriever training tips."
  • Overloading context — Dumping an entire document when a summary would suffice.
  • Ignoring output format — Always specify JSON, bullet points, etc. when you need structured output.

Rule of thumb: If a human couldn't follow your prompt, neither can the model.

Assessment — Question 1

Which prompting technique involves providing the model with 2-3 examples before the actual question?

Assessment — Question 2

What is the main benefit of asking a model to "think step by step"?

Assessment — Question 3

Which of the following is a common prompting pitfall?

Your Results