Learning Hub
← AI & Machine Learning

Intro to Prompt Engineering

8 min readΒ·Updated 2026-08-10

Core techniques for writing effective prompts for LLMs.

Prompt engineering is the practice of designing inputs that reliably steer a language model toward the output you want.

Give the model a role and a goal

State who the model should act as and what success looks like before asking the question:

You are a senior code reviewer. Review the diff below for correctness
bugs only. List each issue with the file and line number.

Use few-shot examples

Showing one or two example input/output pairs before the real request sharply improves consistency for structured tasks like classification or extraction.

Format the examples consistently

Keep the same structure across examples β€” the model picks up on the pattern, not just the content.

Common pitfalls

  • Vague instructions ("make it better") give vague results.
  • Burying the actual question under paragraphs of context.
  • Not specifying the output format when you need to parse the response.