Course contentsShow
← Machine Learning and Deep Learning
Lesson 1827 of 3,53839. Prompt Engineering FundamentalsFree lesson

What is Zero-Shot Prompting?

Understanding how LLMs respond to tasks without examples, relying solely on instruction and pretrained knowledge.

What is Zero-Shot Prompting?

What you'll learn: How large language models can perform tasks they've never been explicitly trained on, using only natural language instructions.

Core Concept

Zero-shot prompting is when you ask an LLM to complete a task by providing only an instruction—no examples, no demonstrations, just a clear description of what you want. The model relies entirely on its pretrained knowledge to understand and execute your request.

Think of it like asking a well-read friend to help you with something new. You don't show them how to do it first; you just describe what you need, and they use their general knowledge to figure it out.

How It Works

During pretraining, LLMs absorb patterns from vast amounts of text. When you give a zero-shot prompt like "Translate this to French: Hello, how are you?", the model draws on its learned understanding of:

  • What translation means
  • English and French language patterns
  • The structure of instruction-following

The model hasn't been explicitly trained on this exact translation task, but it can generalize from its pretraining experience.

Why It Matters in Prompt Engineering

Zero-shot prompting is your first tool when working with instruction-tuned models (like those from lesson 1749). It's the simplest approach: no need to craft examples or format demonstrations. You're testing whether the model's pretrained knowledge alone is sufficient for your task.

This connects to everything you've learned about alignment: models that have undergone instruction tuning (lesson 1749-1760) and RLHF/DPO (lessons 1761-1816) are specifically optimized to follow zero-shot instructions effectively.

Key Takeaway: Zero-shot prompting leverages an LLM's pretrained knowledge to perform tasks using only natural language instructions, without providing any task-specific examples—making it the foundational technique in prompt engineering.