Learn AI. Do. Grow.
← All modules

Deep dive · module 47 of 100

Providing examples in your prompt (few-shot)

Show what you want by providing one or two examples.

After this lesson

You use an example to clarify tone, format, or style.

In view · How it connects

Show what you mean

  1. Show one or two fictitious examples of input and desired output.

  2. Clearly indicate which new case should be elaborated.

  3. Check whether form and approach have been followed without adopting example facts.

Remember: Examples guide the pattern; the new content remains separate. Open het volledige schema ↗

What is few-shot?

You provide one or more examples of the desired output.

When is it useful?

For specific tone, format, or style that is difficult to capture in words.

Keep it short

One good example is often enough. Too many examples make the prompt long.

New practice example

From explanation to a usable result.

Examples show a desired pattern. They must not inadvertently serve as facts for a new task.

Fictional practice situation

A fictitious desk shows as a style example a confirmation for a sports hall with a deposit of 20 euro. The new task concerns a reading club; no deposit has been agreed.

View a possible solution

This is how it can be done

Specify: “Use only the short, friendly style of the example. The facts for this task are: reading club on Saturday, location unknown. Do not carry over any amounts or hall arrangements from the example.”

Why this works

The model receives a format example without an incorrect factual source. Pay particular attention to details that seem obvious in the example.

Make it slightly more difficult

Add two style examples with different amounts and check whether your new assignment requires neither of those amounts.

Extra practice, at your own pace. You do not need to submit anything. This does not count towards an automatic assessment.

Your workplace · learning by doing

Make something. See what changes.

Ende, your light pink practice buddy

The fictitious source is included. Only when selecting ‘Let Ende answer’ do you send your assignment to the AI service. Do not use private data.

Checking the AI connection… You can already view the written example.

Your result

No answer yet

Present your assignment to Ende.
Read the answer, change one thing, and compare.

You remain in control

What do you want to improve in your next attempt?

My own check

On this device only. AI answers remain only in this page memory. This is self-review, not a grade.

Why this approach works

The model receives a format example without an incorrect factual source. Pay particular attention to details that seem obvious in the example.

A step further

Add two style examples with different amounts and check whether your new assignment requires neither of those amounts.

Try & discover · no obligation

Rewrite without changing the facts

Save a version and then change én choice. Which differences are style and which change the content?

Fictitious source: from Wednesday the workshop is open from 9 to 16 o'clock. The precise calendar date is not yet known. No discount has been announced.

Two written style examples: “Hi!” is friendly, “Dear visitor,” is businesslike. You change fixed text elements, not a generated AI response.

Choose one change at a time
The facts are preserved in this written variant. Save a version to compare further.

Source text

Fictitious source: from Wednesday the workshop is open from 9 to 16 o'clock. The precise calendar date is not yet known. No discount has been announced.

Your compiled version

Hi! From Wednesday, the workshop is open from 9 am to 4 pm. The exact date is not yet known.

20 words · English

The known hours remain preserved and the unknown date remains visibly open.

All variants are pre-written. The check responds to your choices and does not assess free text. In a real translation or rewrite, you also check nuance, tone and agreements.

This trial works locally with fictitious data and does not count towards your lesson completion. It starts anew with a new lesson or reload.

A prompt to get you started

Write a short update in the same style as this example: “Team, the schedule is set. Next step is the review on Friday.” New situation: [situation].

Apply it

An example email shows the desired tone, but contains a name and price that do not belong to the new fictional assignment.

Which approach best fits this situation?

  • Copy the example price into the new email.
  • Assume that the model knows itself which data needs to be replaced.
  • Mark the example as a style aid and provide new facts separately.

With JavaScript, you can check your approach and receive immediate feedback.

Test your insight

When is an example in your prompt most useful?

  • Always, the more the better.
  • If the desired tone or format is difficult to explain.
  • Never, AI understands it anyway.
Extra practice

Write a prompt in which you provide one example of the desired style or format.

Example of a friendly but short customer email, followed by the new situation.

A question? I'll help you on your way.

Drag Aldo to move it. Use the arrow keys on Aldo with the keyboard, Enter to save the position and Escape to cancel.