The Improviser · Lesson 4 — Play It Like This ← Course

Play it like this — few-shot prompting.

You can describe the sound you want. Or you can just play a couple of examples and let the model follow.

Last lesson you spelled out the job in words. There's a sharper way to get the phrasing you're after: play the model a few examples of the job already done, then ask. Asking cold, with no examples, is zero-shot; laying down a handful first is few-shot.

A phrase is a short, ready-made run of notes a player keeps handy and drops into a solo. Picture handing the player two you already like — "over C7, play it like this; over F7, like this" — both written the same way. Faced with a fresh chord, they answer in the same shape.

It works because the model is, underneath, a pattern-continuer — the idea from Lesson 1. Give it a pattern and it carries the pattern on; nothing is learned or stored, the examples just tilt what comes next. And a worked example fixes the shape, the note choices, even the feel far more exactly than a sentence of description can.

Show the player zero, then one, then two example phrases — and hear the new answer snap into the same bluesy shape.

No examples yet — zero-shot. The player answers in its own plain way.
example phrases shown first · few-shot
none yet — zero-shot
↓ then the real one ↓
the new chord · to play over
over G7 — your phrase?
the player's phrase
G B D
shape · plain major triad — no blues

A couple of examples, then the ask.

In code, few-shot is just a few worked pairs placed before your real request. The model reads the pattern and carries it on.

solo = model.play(
    system = brief,
    examples = [
        ("over C7", "C Eb E G"),   # root, b3, 3, 5 — bluesy
        ("over F7", "F Ab A C"),   # same shape, moved
    ],
    ask = "over G7",
)
# → "G Bb B D"   — the same shape, continued

Show, don't just tell.

Describing the phrasing you want is fine; playing it is better. A couple of worked examples settle the questions a sentence leaves open — the shape, the notes, the feel — and the model just continues the pattern it sees.

Reach for few-shot when the model nearly does what you want but not in the right shape. Show it two or three clear phrases — the tricky moves included — and let it copy.

Quick check · your ear
With no examples the phrase was a plain triad; after two it turned bluesy. Why did showing examples change the shape?
Next: how many? →
Go deeper — why demonstration beats description optional

It's still just next-token prediction

Few-shot isn't a separate mode — it's the same pattern-continuing from Lesson 1. Your examples become part of the sequence, and the most likely continuation of "here are two bluesy phrases, now do G7" is a third bluesy phrase. Nothing was learned or stored; the examples simply reshaped the odds for what comes next.

A demonstration carries more than a sentence

"Play it bluesy" leaves a lot open — how bluesy, which notes, how long. A worked example fixes all of that at once: the exact shape, the length, the feel, the level of detail. That's why two or three examples often beat a paragraph of instructions — they pin down things words gloss over.

Order matters

The model leans hardest on the most recent phrases, so put your clearest, most representative one last. If two example phrases disagree, the later one tends to win.

Cohesive in form, varied in cover

Two rules pull in different directions, and good phrases honour both. Keep them cohesive in form — same layout, same phrasing, correct labels — because that shape is what the player copies. But make them varied in cover — the same shape over C7 and F7, the tricky moves as well as the easy ones — because a phrase only teaches something if it rules a wrong reading out. One caveat: varied means different situations, not different labels for the same one. Phrases that contradict each other aren't range — they're just inconsistency, and the player copies that too.