Few-Shot Learning: Definition, Funktionsweise und Anwendungsfälle
Few-Shot Learning: Definition, How it Works, and Use Cases
Few-Shot Learning (FSL) is a machine learning approach that enables models to learn new tasks or classes with only a few labeled examples. This approach is particularly relevant when training data is scarce, difficult to access, or expensive to acquire. Conceptually, FSL lies between traditional supervised learning – which requires large amounts of data – and zero-shot learning, where no examples are available for new classes.
What is Few-Shot Learning?
Few-Shot Learning refers to a model's ability to generalize based on typically one to ten labeled examples per class. The method builds upon a "solid foundation of general knowledge" acquired through extensive pre-training. The few examples then serve to adapt this prior knowledge to a new target task.
Adaptation can occur in two ways: through Fine-Tuning of the model with the few examples, or through prompt-based Few-Shot Learning, where examples and instructions are passed directly in the input text – without altering the internal model weights.
How Does Few-Shot Learning Work?
FSL combines transfer and data-efficient generalization. The model leverages prior knowledge from pre-training and adapts it with a "tiny fraction" of the data typically required. Technically, three distinct approaches can be identified:
- Meta-Learning ("learning to learn"): Models are trained across many different tasks to acquire new capabilities with few steps.
- Prototype Approach: Each class is represented by a mean feature vector (prototype). New inputs are assigned to these prototypes using distance metrics.
- Embedding and Similarity Comparisons: The similarity of a new input to known examples is estimated in the feature space.
In the prompt-based variant, the model receives instructions and examples as part of the input. A concrete example from natural language processing: A developer provides three example utterances for a customer service intent like "cancel my subscription". The model recognizes the pattern and classifies other similar requests – without retraining. FSL is also suitable in image processing for characterizing categories with very few labeled images.
Practical Examples and Use Cases
Documented application areas range from medical diagnostics to financial crime:
- Medical Imaging: A method for detecting rare disease patterns was trained with only a few hundred labeled COVID-positive X-ray images per class. New scans are then compared with known cases.
- Fraud Detection: FSL models – including graph-based approaches and fine-tuning with few examples – are used for detecting fraudulent transactions.
- Rare Genetic Syndromes: In medicine, FSL supports the identification of rare genetic diseases where training data is inherently limited.
Distinction from Related Methods
Few-Shot Learning can be clearly distinguished from related approaches:
- Traditional Supervised Learning requires large amounts of labeled data per class.
- Zero-Shot Learning works with zero examples and relies exclusively on semantic prior knowledge from pre-training.
- One-Shot Learning uses exactly one example per class; FSL typically includes two to ten examples.
The advantage over Zero-Shot Learning: The few examples "ground" the prior knowledge and often lead to better results in similar situations.
Conclusion
Few-Shot Learning is a data-efficient approach that combines strong pre-training with a small amount of labeled examples. Crucial for its performance are the quality of the few examples and the generalization capability of the base model. For use cases with scarce or expensive data – such as in medicine or fraud detection – FSL offers a practical way to adapt models quickly and precisely.