Beyond the Prompt

Module 2 — Prompt Engineering

Lesson 4: Prompt Templates and Few-Shot Prompting

Last updated: 2026-10-09

Templates let you scale a good prompt across thousands of users. Few-shot examples let you align the model to your definitions without touching its weights.

Lesson 4: Prompt Templates and Few-Shot Prompting

Blackboard

Reusable prompts and learning by example

10 min
Concept 1

Prompt templates scale

A prompt template is a reusable prompt with placeholder variables. For example, a skills platform might insert a user's job title, level, and preferred language into the same template, personalising the output for each person without writing a new prompt every time.

Concept 2

Act as X

One of the most popular template patterns is 'act as [role]'. Open-source prompt repositories like the Awesome Prompts collection on GitHub contain thousands of these. They work because assigning a role narrows the model's behaviour to a relevant subset of its knowledge.

Concept 3

Zero-shot vs few-shot

Zero-shot prompting gives the model a task with no examples. Few-shot prompting includes examples of correct input-output pairs. Few-shot is especially powerful when your definitions differ from the general case — like telling the model that 'it is okay but I expected more' counts as negative, not neutral.

Concept 4

Few-shot as a living dataset

Some AI startups treat their few-shot examples like a growing dataset. When a user flags an error, a human labels the correct answer and adds it as a new example in the prompt. This is faster than fine-tuning because you never touch the model's weights — you just update text.

Pause and Think

If you had to classify 10,000 customer reviews using your own definitions of positive and negative, how would you teach the model your rules?

Flashcards

Key Terms

Click or press Enter to flip a card. Review these before the practice question.

Additional Resources
Practice Question

You want a model to classify reviews as positive, neutral, or negative using your company's definitions. What is the fastest way to align the model without fine-tuning?

Does not count for certificate
Choose one answer, use the hint if needed, then check your answer.
Use the hint before checking if you need a nudge.