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.

Few-shot prompting is about enforcing a pattern on text you already have, and Perplexity's job is finding text you do not have - so the technique largely does not transfer. Classification and extraction over your own data belong in another tool. Where Perplexity is genuinely useful is finding the raw material and the standards: real examples of the pattern you are trying to teach, the recognised taxonomy for a classification scheme, or what the actual published style of a writer is rather than the cliche of it.

Worth knowingYou can paste examples here and it will loosely follow them, but it will also search the web, cite things and ignore a strict output format - so JSON extraction in particular will come back unreliable. Do the extraction in a tool that will obey the format.
  • Use it to find real examples, not to apply a pattern.
  • Ask for the recognised taxonomy before inventing categories.
  • Do not expect strict output formats like JSON here.
  • Ask what a writer's actual style is, with passages cited.
  • Collect examples in a Space, then build the prompt elsewhere.
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

Classifying your own reviews is not a Perplexity job - do that in a tool that will follow a strict output format. Use Perplexity for the step before: deciding what your categories should be in the first place.

1. What classification schemes do established approaches to customer-review and sentiment analysis actually use? Cover the standard polarity sets, aspect-based sentiment analysis, and anything beyond positive/negative/neutral. Cite the sources and say where each scheme came from - academic, industry or vendor.
2. Where does published work say simple three-way sentiment classification breaks down - sarcasm, mixed reviews, review bombing, incentivised reviews? Cite the research.
3. What is documented about handling code-mixed Hinglish and Indian-language reviews in sentiment analysis? Which approaches are reported to work, and what is the known error rate? This matters for Indian e-commerce reviews and I do not want to assume English-only methods carry over.
4. What review categories do Indian e-commerce platforms and sellers report as the most common complaint themes - sizing, delivery time, quality against photos, returns? Cite what you find, with dates.
5. Point me to publicly available labelled review datasets I could use to check whether my own labelling is consistent.

Cite everything. Save to a Space called 'Review classification'. I will build the actual few-shot classifier in another tool, using the taxonomy from answer 1 and the edge cases from answer 2 as my examples.
Open Perplexity 1,508 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

Do not run extraction here. Perplexity will search, cite and paraphrase rather than return clean JSON, which defeats the purpose - use ChatGPT, Claude or Gemini for the extraction itself.

What Perplexity can do is find the announcements worth extracting from, and tell you what the fields should be.

1. Find recent senior appointment announcements at Indian technology and startup companies - CXO, VP and Head-of-function hires. For each: the person, the company, the title, the date and the source link. Give me as many as you can find from the last quarter.
2. Where are these announcements published - which Indian business publications, newsletters and company newsroom pages carry them consistently? List the specific sources so I know where to look each month.
3. What fields do recognised people-data and CRM schemas use for a person record - and what is the standard way to represent a missing or unknown employer? I want my JSON structure to match an existing convention rather than one I invented.
4. Is there any publicly available, properly licensed dataset of Indian corporate appointments? Name it and its licence terms.
5. What are the legal constraints in India on scraping and storing personal professional data - what does the data protection framework currently require? Name the law and the relevant provision, with a date.

Cite everything with dates. Answer 5 matters most: tell me plainly if what I am planning needs consent or a stated purpose. I will take answers 1 and 3 to another tool to build the extraction prompt.
Open Perplexity 1,546 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

Style imitation is not a Perplexity task - it cannot hold a voice and it will cite sources mid-sentence. But teaching by example only works if your examples are real, and this is where the usual version of this exercise goes wrong: 'write like Hemingway' is normally taught with sentences nobody has checked against Hemingway.

So research the style, then build the few-shot prompt elsewhere using what you find.

1. What do literary scholars and critics actually say characterises Hemingway's prose? The iceberg theory, the influence of newspaper work, his sentence construction and use of dialogue. Cite the criticism rather than summarising a general impression.
2. Quote three or four short passages genuinely from his work, with the book and chapter, that show the style at its most characteristic. I want real examples for my prompt, not pastiche.
3. What do critics say is commonly misunderstood about his style - where does the popular version ('short, simple sentences') diverge from what he actually wrote? Cite the argument.
4. Which other writers are associated with the same terse declarative mode - name them with a representative work each, so I can widen my example set.
5. Find reliable sources on the difference between imitating a style and plagiarising a voice, and on whether and how a published writer should credit a deliberate stylistic imitation.

Cite everything, with book and page where you can. Save to a Space called 'Prose style research'. I will take the real passages from answer 2 into a writing tool as my style examples - which is exactly what makes the few-shot prompt work: verified examples instead of adjectives.
Open Perplexity 1,652 characters