n-way k-shot
**N-way K-shot** is the **standard notation** describing the structure of few-shot learning tasks, where **N** specifies the number of classes and **K** specifies the number of labeled examples per class.
**Notation Breakdown**
- **N-way**: The classification task has **N classes** to distinguish between. Higher N means more classes and harder discrimination.
- **K-shot**: Each class has **K labeled support examples** available. Higher K provides more information per class.
- **Example**: 5-way 5-shot = 5 classes, 5 examples each = 25 total support examples.
**Common Configurations**
| Configuration | Difficulty | Use Case |
|--------------|------------|----------|
| 5-way 1-shot | Very hard | Minimal data scenario, benchmark standard |
| 5-way 5-shot | Moderate | Standard benchmark, balanced difficulty |
| 10-way 1-shot | Hard | Many classes with minimal data |
| 20-way 5-shot | Hard | Larger classification tasks |
| 2-way 1-shot | Easier | Binary classification with one example |
**How Difficulty Scales**
- **Increasing N** (more classes): Harder — more classes to distinguish means higher chance of confusion between similar categories. Random baseline accuracy = $1/N$.
- **Increasing K** (more examples): Easier — more examples provide better class representations, capture intra-class variation, and reduce noise from atypical examples.
- **5-way 1-shot vs. 5-way 5-shot**: Typical accuracy gap of **10–20 percentage points** — more examples significantly help.
**Episode Structure**
- **Support Set**: $N \times K$ labeled examples total.
- **Query Set**: $N \times Q$ examples to classify (Q typically 10–20 per class).
- **Total Examples Per Episode**: $N \times (K + Q)$.
**Benchmark Results (miniImageNet)**
- **5-way 1-shot**: State-of-the-art ~65–75% accuracy.
- **5-way 5-shot**: State-of-the-art ~80–88% accuracy.
- **Random Baseline**: 20% for 5-way (1/N).
**Variations**
- **Variable-Way Variable-Shot**: N and K vary across episodes (used in **Meta-Dataset**). More realistic — real-world scenarios rarely have exactly 5 classes with exactly 5 examples each.
- **Class-Imbalanced**: Different classes have different numbers of examples within an episode — some classes have 2 examples, others have 10.
- **Transductive N-way K-shot**: The model can jointly reason about all query examples, exploiting test-set structure for better predictions.
- **Generalized Few-Shot**: Test episodes include both **seen base classes** AND **unseen novel classes** — the model must handle both simultaneously.
**Reporting Standards**
- **Average Accuracy**: Mean accuracy over 600–10,000 randomly sampled test episodes.
- **Confidence Interval**: 95% CI reported — typically ±0.2–0.5% for well-sampled evaluations.
- **Reproducibility**: Report random seed, episode sampling strategy, and exact train/val/test class splits.
The N-way K-shot framework provides a **standardized language** for comparing few-shot learning methods — ensuring fair comparison by specifying exactly how much data the model has access to for each task.