Prompting zero-shot e few-shot
Guidare il comportamento con esempi
Prompting zero-shot e few-shot è una lezione NLP Academy gratuita su CoddyKit. Questa è la lezione 3 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento NLP Academy, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso NLP Academy include 4 lezioni in totale.
Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.
Prompting Is Programming
With LLMs, your main control is the words you send. The art of shaping those words is called prompting. ✍️
Zero-Shot Prompting
In zero-shot prompting you just describe the task in plain words, with no examples, and trust the model to figure it out.
prompt = "Classify this review as positive or negative: I loved it!"When Zero-Shot Works
Zero-shot is great for common tasks the model has seen often, like summarizing a paragraph or answering a simple question.
Show, Do Not Just Tell
When the task is unusual, examples help. Giving the model sample inputs and outputs is called few-shot prompting.
A Few-Shot Example
You list a couple of worked examples, then leave the final input blank so the model continues the same pattern.
Review: Great! -> positive
Review: Awful. -> negative
Review: I loved it! ->Examples Set the Format
Few-shot does more than teach the task; it also fixes the output format, so the model answers in exactly the shape you showed.
Pick Clear Examples
Choose examples that are correct, varied, and unambiguous. Sloppy or biased examples quietly teach the model the wrong pattern.
More Is Not Always Better
Each example eats into the context window and adds cost, so use the fewest examples that reliably get the job done.
Be Specific
Vague prompts give vague answers. Spell out the role, the task, the format, and any constraints you care about.
Think Step by Step
For tricky reasoning, ask the model to work it out step by step. This chain-of-thought hint often improves the final answer.
prompt = "Solve this and show your reasoning step by step: ..."Iterate and Test
Prompting is empirical. Try a version, check the outputs, then refine the wording until results are consistent.
Quick Check
What is the key difference between zero-shot and few-shot prompting?
Recap
Start zero-shot for common tasks. Add a few clear examples when you need a specific pattern or format, then iterate. ✅
Domande Frequenti
La lezione «Prompting zero-shot e few-shot» è gratuita?
Sì — il testo completo di «Prompting zero-shot e few-shot» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso NLP Academy, passa a CoddyKit PRO. Il corso NLP Academy include 4 lezioni in totale.
Cosa imparerò in «Prompting zero-shot e few-shot»?
Guidare il comportamento con esempi Eserciti NLP Academy con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.
Ho bisogno di esperienza per iniziare NLP Academy?
Non è richiesta alcuna esperienza precedente. NLP Academy su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 3 di 4.
Quanto tempo richiede la lezione «Prompting zero-shot e few-shot»?
La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.
Posso scrivere ed eseguire codice in questa lezione NLP Academy?
Sì. Ogni lezione NLP Academy include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.
Tutte le lezioni di questo corso
- Che cosa rende grande un modello
- Chiamare un LLM da Python
- Prompting zero-shot e few-shot
- Output strutturato e guardrail