Back to AI Engineering Mind Map
中文·English
🤖 AI EngineeringID: few-shot-in-context-learning

Few-Shot In-Context Learning

Few-Shot 提示工程与样本挑选
🎯Core Definition
Few-Shot In-Context Learning (ICL) is a prompt engineering paradigm that guides a pre-trained LLM without updating model weights by supplying 3-5 curated input-output demonstrations (Exemplars) in context; these demonstrations allow the Transformer's attention layers to dynamically resolve task constraints and format patterns via in-context induction heads, substantially boosting few-shot task accuracy.
💡Use Cases
Complex multi-label classification, brand-specific style framing, non-standard field extraction, and cold-start domain adaptation.
Key Problems Solved
Zero-shot prompts suffer unpredictable output formatting and stylistic drift; providing explicit input-output exemplars establishes rigid demonstration templates, eliminating ambiguity and sharpening adherence.
🎯5 High-Frequency Exam Points
1
Explain the phenomena and causes of 'Ordering Sensitivity' and 'Majority Label Bias' in Few-Shot In-Context Learning?
2
How to implement Dynamic K-NN Exemplar Selection to pull the most semantically relevant demonstrations per query?
3
How does pairing Negative Exemplars (common mistakes + corrections) with Positive Exemplars improve error resilience?
4
Analyze the diminishing returns of scaling demonstration counts from 1 to 20+ against token cost and inference latency?
5
How to leverage OpenAI/Anthropic Prompt Caching on static Few-Shot exemplars to slash costs and TTFT by up to 90%?
Updated 2026-08-14
🎯
Test Your Knowledge: Practice Questions for "Few-Shot In-Context Learning"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardGraphRAG Knowledge Graph SearchNext CardChain-of-Thought Prompting

🔗 More AI Engineering Knowledge Cards

Vector Distance Metrics & L2 NormalizationScalar Quantization (SQ8/SQ4)Product Quantization (PQ)ADC Asymmetric Distance Computation