Lesson 5 of 25

The Secret of Silent Suggestion (Few-Shot Prompting)

Instead of describing the output you want, show two or three finished examples and let the model infer the pattern. This works because a worked example carries decisions that adjectives cannot - exactly where the line falls between two categories, how an edge case is handled, how long a sentence should be. It is the difference between telling someone to write concisely and handing them a paragraph you consider concise.

Reach for it whenWhen you need the same treatment applied consistently to many items, or when you keep failing to describe the style or judgement you want.

Lay the examples out as a plain repeated pattern - the same labels in the same order each time - and leave the final label empty so the model's only job is to complete it. Include at least one example of the edge case you expect to be mishandled; that is what the extra examples are really buying you. For a classification or extraction job you will do repeatedly, the examples belong in a Custom GPT's instructions so the pattern is permanent and you only paste the new item.

Worth knowingFew-shot examples that all lean one way will tilt every answer that way - three positive examples and one negative, and ambiguous reviews come back positive. Balance the set, and put the awkward case in deliberately.
  • Keep label order identical in every example.
  • Include the edge case you expect it to get wrong.
  • Balance your examples or you bias the output.
  • Move a recurring pattern into a Custom GPT's instructions.
  • Ask for JSON output when results feed a sheet.
Example 1: The Instruction vs. The Silent Suggestion (Classification)

Instead of

Look at this customer review and tell me if it's positive, negative, or neutral. The review is: 'The product arrived on time, but the quality wasn't what I expected.'

Perplexity version

Classify customer reviews as Positive, Negative or Mixed. Follow the pattern below exactly - output the label and nothing else.

Review: 'I absolutely love this product. It has changed my daily routine.'
Sentiment: Positive

Review: 'Complete waste of money. Broke after one day.'
Sentiment: Negative

Review: 'Delivery was fast and the item matched the description, but it is overpriced for what it is.'
Sentiment: Mixed

Review: 'Received the order.'
Sentiment: Neutral

Review: 'The kurta fit perfectly but the colour had faded by the second wash.'
Sentiment: Mixed

Review: 'Delivery to Hyderabad took eleven days. Product itself is fine.'
Sentiment: Mixed

---

Note the rule the examples establish: praise and complaint together is Mixed, not Neutral. Neutral is only for reviews that express no opinion at all. A complaint about delivery with a fine product is still Mixed.

Now classify:
Review: 'The product arrived on time, but the quality wasn't what I expected.'
Sentiment:

After the label, I will paste a batch of 50 reviews. For those, return a markdown table with columns Review | Sentiment | Confidence (High/Low), and flag anything the pattern above does not cleanly cover rather than forcing it into a category.
Open Perplexity 1,230 characters
Example 2: The Description vs. The Demonstration (Data Extraction)

Instead of

Please extract the person's name, the company they work for, and their job title from this sentence: 'We are pleased to announce that Priya Sharma will be joining our team as the new Head of Marketing at Innovate Corp.'

Perplexity version

Extract Name, Company and Title from text snippets and return JSON. Match the pattern below exactly, including how missing values are handled.

Text: 'The keynote will be given by Raj Patel, CEO of FutureTech Solutions.'
JSON: {"name": "Raj Patel", "company": "FutureTech Solutions", "title": "CEO"}

Text: 'Our quarterly review will be led by Anita Desai, our firm's Managing Director.'
JSON: {"name": "Anita Desai", "company": null, "title": "Managing Director"}

Text: 'Welcome to Vikram Reddy and Sneha Kulkarni, who join Zephyr Labs as Design Lead and Head of Product respectively.'
JSON: [{"name": "Vikram Reddy", "company": "Zephyr Labs", "title": "Design Lead"}, {"name": "Sneha Kulkarni", "company": "Zephyr Labs", "title": "Head of Product"}]

Text: 'Dr. S. Ramanathan has been appointed to the board.'
JSON: {"name": "Dr. S. Ramanathan", "company": null, "title": "Board Member"}

Text: 'The event was a great success and we thank everyone who attended.'
JSON: null

---

Rules the examples set: company is JSON null - unquoted - when the text does not name it, not the string "null". Multiple people produce an array. No person at all returns null. Never infer a company from context that does not state it.

Now extract:
Text: 'We are pleased to announce that Priya Sharma will be joining our team as the new Head of Marketing at Innovate Corp.'
JSON:

Then: I run this on press releases weekly. Tell me exactly what to put into a Custom GPT's instructions so I can paste raw text and get back valid JSON every time, and give me the output as a single JSON array when I paste a batch.
Open Perplexity 1,597 characters
Example 3: Defining Style by Example, Not Adjectives

Instead of

Rewrite the following sentence in a very short, simple, and powerful style, like Ernest Hemingway. The sentence is: 'Despite the fact that he was feeling quite tired, he knew that he had to continue on his journey if he wanted to reach his destination by morning.'

Perplexity version

You are matching a prose style defined by example, not by adjectives. Study the samples, infer the rules, then rewrite the target.

Style samples:
1. The sun was hot. The road was long. He walked on.
2. The coffee was bitter. Rain beat the window. The phone did not ring.
3. She did not look back. The train left. That was all.

Anti-samples - this is what I do not want, so you can see where the line is:
1. Overwrought: The scorching, merciless sun beat down relentlessly upon the endless, winding road that stretched before him.
2. Too flat: It was hot. He walked. He was tired.

The second anti-sample matters: terse is not the same as empty. The style keeps concrete detail, it just refuses to decorate it.

Before rewriting, state the three rules you have inferred from the samples - sentence length, what gets cut, what is kept. I want to check your reading of the style before you apply it.

Then rewrite this:
Target: 'Despite the fact that he was feeling quite tired, he knew that he had to continue on his journey if he wanted to reach his destination by morning.'

Give three versions at different lengths - roughly 8 words, 15 words, 25 words - so I can see how the style holds as it loosens. Then open the best one in Canvas so I can keep working on it.
Open Perplexity 1,267 characters