AI

Learn Prompt engineering: what to know and where to start

Prompt engineering is writing the instructions and context you give an AI model so it returns useful, reliable output. It covers clear instructions, examples, structure and testing what works.

Outcomes

What you will be able to do with Prompt engineering

  • State a task, context and output format clearly
  • Improve a prompt when the answer is off
  • Give examples to steer the answer
  • Check outputs for mistakes
  • Test a prompt on a fixed set of cases

Learning path

How to learn Prompt engineering, in order

  1. Beginner

    Write clear prompts

    Learn to state the task, context, format and examples, and to iterate when the answer is off. You are ready when you can get a useful result on a new task within a few tries.

  2. Intermediate

    Use structure and checks

    Practise step-by-step instructions, role and format control, and checking outputs for errors. You are ready when you can build a reusable prompt that works across many inputs.

  3. Advanced

    Test and ship prompts

    Learn test sets, versioning and cost control for prompts used in products. You are ready when you can show a prompt change improved results on a fixed test set.

The core techniques

Model providers publish guidance on prompting, and the main ideas are consistent. The list below follows the prompting best practices in Anthropic's Claude documentation.

  • Be clear and direct. If a colleague with no context would be confused by your instructions, the model will be too.
  • Add context and say why something matters, so the model can apply the idea to cases you did not spell out.
  • Show examples. The guidance suggests three to five that are relevant and varied.
  • Structure the prompt. Separate instructions, context, examples and inputs, for example with consistent tags.
  • Give the model a role in one sentence to focus its tone and behaviour.
  • Say what to do rather than what to avoid.
  • Ask the model to check its answer against criteria you name, especially for code and maths.

What to look for in a course

Prompting advice is specific to the model and changes as models change, so a good course teaches a method for testing prompts and not only a list of tricks. Look for hands-on exercises, comparisons across more than one model, and some coverage of where prompting stops being enough, such as retrieval or fine-tuning.

Best-of lists

Ranked lists with Prompt engineering courses

Our category rankings that include a course teaching Prompt engineering.

Keep going

Where to go next

The first is the natural next step from this page. The rest follow what you have been reading.

FAQs

Prompt engineering: common questions

Do I need to code to learn prompt engineering?

Not for everyday prompting in a chat tool. If you want to build applications that call a model through an API, Python helps, and many courses on this page include it.

How is prompt engineering different from RAG and fine-tuning?

Prompting changes the instructions you send. Retrieval-augmented generation (RAG) adds documents to the prompt at run time. Fine-tuning changes the model itself with extra training. Most people try prompting first because it is the cheapest to test.

Will the techniques in a course go out of date?

Some will. Provider guidance is updated as models change, so treat a course as a foundation and check the current documentation of the model you use.