Cert++
Close

Choosing zero-shot, few-shot, or chain-of-thought prompting

Key Takeaway

Match the technique to what the task needs: use zero-shot for a direct task that needs little framing, few-shot when the output must match a format, tone, or style, and chain-of-thought when the task depends on reasoning through several factors.

Zero-shot, few-shot, and chain-of-thought are three ways to write a prompt for a large language model (LLM). They differ in how much guidance the prompt gives the model. A zero-shot prompt gives direct instructions only. A few-shot prompt adds a few examples of the output you want. A chain-of-thought prompt asks the model to reason step by step before it answers.

Zero-shot prompting

Zero-shot prompts, also called direct prompts, give the model direct instructions with no added context or examples. They suit tasks that need little framing to get a reliable output. Examples include generating new ideas for a creative project and summarizing a meeting transcript or a website.

A zero-shot prompt can give the model too wide a framework for specific, actionable tasks, so the output tends to be generic.

For example, imagine you write a zero-shot prompt that asks for an event invitation email. The model returns a fairly generic email. That email works only as a starting point.

Agentforce Specialist Study Guide

Checklist progress

0/204Learned

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Agentforce Specialist studiers. 757 members and growing.