Zubnet AIसीखेंWiki › Few-Shot सीखेंing
Using AI

Few-Shot सीखेंing

Few-Shot Prompting, One-Shot, In-Context सीखेंing
अपने prompt में कुछ input-output pairs provide करना model को एक pattern, format, या behavior सिखाने के लिए। “Zero-shot” का मतलब कोई examples नहीं (सिर्फ एक instruction)। “One-shot” एक example है। “Few-shot” typically 2–10 examples होते हैं। Model आपके examples से pattern सीखता है और actual input पर apply करता है, बिना किसी training या fine-tuning के।

यह क्यों matter करता है

Few-shot prompting model behavior customize करने का सबसे fastest, cheapest way है। Consistent JSON output चाहिए? तीन examples दिखाओ। Specific writing style चाहिए? दो samples include करो। ये इसलिए काम करता है क्योंकि LLMs extraordinary pattern matchers हैं — वो examples से rule infer करते हैं और generalize करते हैं। इसे अक्सर “in-context learning” कहा जाता है और ये scale से emerge होने वाली सबसे surprising capabilities में से एक है।

Deep Dive

The original GPT-3 paper (Brown et al., 2020) demonstrated that large language models could perform tasks they were never explicitly trained on, simply by being shown a few examples in the prompt. A model trained only to predict text could suddenly do translation, arithmetic, and classification with just 3–5 examples. This was the finding that launched the modern era of prompt engineering.

How Many Examples?

The optimal number of examples depends on the task complexity and the model. For simple formatting tasks (convert name to "Last, First"), 2–3 examples usually suffice. For nuanced classification with edge cases, 5–10 examples may be needed. Beyond ~10 examples, you're often better off fine-tuning. More examples also consume context window, so there's a practical trade-off between example quality and available space for the actual input.

Example Selection Matters

The examples you choose affect performance dramatically. Diverse examples that cover edge cases outperform repetitive ones. Examples that are similar to the target input outperform generic ones. The order of examples can matter too — models sometimes show recency bias, paying more attention to the last example. When building few-shot systems in production, dynamically selecting the most relevant examples for each input (using embedding similarity) outperforms static example sets.

संबंधित अवधारणाएँ

← सभी Terms
← Feedforward Network Fine-tuning →