Few-shot learning is a machine learning approach where an AI system learns to recognize or predict something from only a small number of examples. This matters because humans can often learn a new idea after seeing just a few samples, while many traditional AI models need thousands or millions. Few-shot learning is useful when data is rare, expensive, or hard to label, such as medical images, unusual animal species, or new product categories.
It helps make AI more flexible and practical for real-world problems.
Key Facts
- Few-shot learning means learning a new task from a small number of labeled examples.
- A k-shot task gives the model k examples per class, such as 3-shot learning with 3 examples of each category.
- Accuracy = correct predictions / total predictions.
- Similarity-based models often compare a new input to example inputs using distance or matching scores.
- Smaller distance often means higher similarity, such as distance = sqrt((x2 - x1)^2 + (y2 - y1)^2).
- Few-shot learning works best when the model already learned useful patterns from a larger related dataset.
Vocabulary
- Few-shot learning
- Few-shot learning is a machine learning method where a model learns a new task using only a few labeled examples.
- Training example
- A training example is a data item, such as an image or sentence, paired with the correct label used to teach a model.
- Label
- A label is the correct category or answer assigned to a training example.
- Feature
- A feature is a measurable pattern or property in data that helps a model make a prediction.
- Prediction
- A prediction is the output or best guess made by an AI model for a new input.
Common Mistakes to Avoid
- Thinking few-shot learning means no examples are needed. It still needs a small set of examples, and often it also depends on knowledge learned from earlier training.
- Assuming more complex models always perform better. A large model can still fail if the few examples are unclear, biased, or not representative of the new task.
- Confusing few-shot learning with ordinary supervised learning. Ordinary supervised learning usually trains on many labeled examples, while few-shot learning is designed for very limited labeled data.
- Using examples that are too similar to each other. If all examples show only one narrow version of a category, the model may not recognize new cases that look different.
Practice Questions
- 1 A model is given 4 labeled examples of cats and 4 labeled examples of dogs, then it must classify new images. What shot number is this task, and how many total labeled examples are used?
- 2 A few-shot model makes 18 correct predictions out of 24 test images. Calculate its accuracy as a fraction and as a percent.
- 3 A model sees three example cards labeled bird, but all three show small blue birds facing left. Explain why this may cause problems when the model sees a large red bird facing right.