Practical AI: Few-Shot Prompting

Few-shot prompting is a technique where you give AI a few examples of the results you want before asking it to perform a similar task.

Unlike zero-shot prompting, which provides instructions without examples, few-shot prompting helps AI understand your preferred format, categories, and decision rules.

How it works

Give examples=>AI identifies pattern=>Apply to new tasks

Apply it today: Organize your daily to-do list

You can teach AI your task-prioritization preferences using three examples.

Classify my tasks using these examples:

Example 1: “Submit a report due today” → Urgent
Example 2: “Learn AI for 20 minutes” → Learning
Example 3: “Await vendor response” → Waiting

Now classify my remaining tasks using the same categories. Explain each classification briefly. Do not assume missing deadlines.

Key takeaway

Few-shot prompting = Instructions + Examples + New Task.

The AI uses your examples as temporary context; it does not permanently retrain itself. Good examples can improve consistency, but you should still verify the output

Challenge: Compare the AI’s classifications with your own and see whether providing examples improves accuracy.

Prompt Response example

From the Snella Task Log, I found one task with a specific overdue deadline and two explicitly waiting on others:

  • Urgent: T085
  • Waiting: T096
  • Waiting: T114

The other logged tasks are open, active, planned, or under investigation, but the log doesn’t identify them as learning tasks or give them a deadline that would make them Urgent. I’ve left them unclassified rather than infer a category.

About the Author

Yogi

24 years of experience in various layers of software. Primarily experienced in system side software design and development on server management software. Interested in linux development in x86 and arm architecture.