Zero-shot prompting asks a language model to complete a task using instructions but no examples. The model relies on its preexisting knowledge to interpret the request and produce an answer. section 16.2.3
Compared with one-shot and few-shot prompting, zero-shot prompting supplies no demonstrations: one-shot supplies one example, while few-shot supplies several. Clear plain-English instructions replace the examples. section 16.2.3
Classifying sentiment without demonstrations
A prompt can ask, “Is the tone in the sentence ‘Today is a great day for me’ positive, negative, or neutral?” The model answers “Positive” without seeing labeled examples. section 16.2.3
prompt = """ Is the tone in the sentence "Today is a great day for me" positive, negative, or neutral? """ res=llm.invoke(prompt) print(res)
Inspect the complete zero-shot classification prompt and its generated answer. section 16.2.3
Zero-shot prompting is useful for direct interactions with pretrained LLMs, including text-generation workflows accessed through Python and LangChain. Its simplicity avoids preparing task-specific examples, but model outputs can still contain logical errors, factual inaccuracies, or misunderstandings. section 16.0 section 16.5








