Meta-Learning and Few-Shot Learning: Adapting Deep Learning Models to Learn from Limited Data

Deep learning has achieved success on complex tasks, but requires large labeled training data. Meta-learning and few-shot learning address this by rapidly adapting models to new tasks using minimal examples.

Neelank Sharma

12/16/20238 min read


Deep learning has achieved tremendous success in recent years, attaining state-of-the-art performance on complex tasks like image recognition, natural language processing, and speech recognition. However, deep neural networks typically require large amounts of labeled training data to learn effectively. This reliance on big data poses a challenge for tasks where labeled data is scarce or expensive to obtain.

Meta-learning and few-shot learning aim to address this limitation by developing methods that can rapidly adapt a model to new tasks using only a small number of examples. The key idea is to leverage prior experience gained by the model while training on other related tasks. This allows the model to learn new concepts and make accurate predictions using very few training examples for the new task, sometimes as few as 1-5 examples.

Looking Back to Lower-Level Information in Few-Shot Learning

In this article, we provide an overview of meta-learning and few-shot learning techniques for deep neural networks. We begin with background on how deep learning models are conventionally trained. We then introduce the core concepts and motivations behind meta-learning. Next, we survey prominent approaches for few-shot learning, including metric-based methods, optimization-based methods, and augmentation-based methods. We also discuss applications of few-shot learning in computer vision, natural language processing, and other domains. Finally, we examine current challenges and future research directions for this rapidly evolving field.

Background on Deep Learning

Deep learning has become the dominant approach for tackling complex machine learning problems across many domains, including computer vision, speech recognition, and natural language processing. Deep neural networks composed of multiple stacked layers can learn hierarchical feature representations directly from raw data. This alleviates the need for manual feature engineering, enabling end-to-end training of extremely powerful models.

However, deep neural networks are also notoriously data hungry. For example, popular image classification models like ResNet and VGG networks are trained on millions of labeled images from the ImageNet dataset [1]. The models learn to recognize thousands of objects and their subtle visual distinctions through extensive exposure to diverse training examples. Similarly, state-of-the-art natural language processing models like BERT and GPT-3 require training on massive text corpora encompassing billions of words [2].

This dependence on big data poses a challenge for learning new concepts from limited examples, as humans are capable of doing. Young children can recognize new objects after seeing just one or two examples, by building on prior knowledge. In contrast, deep learning models struggle to generalize when data is scarce. Meta-learning aims to address this limitation, as we discuss next.

Overview of Meta-Learning

The core idea behind meta-learning is to leverage experience gained by a model on some set of learning tasks, so that it can then rapidly learn new tasks using only a small number of examples [3]. This is achieved by training the model on two levels:

  1. The base-level, where the model is trained normally on individual tasks.

  2. The meta-level, where the model learns how to efficiently learn new tasks by extracting common patterns and principles from its experience on the base tasks.

Through this two-level training process, the model acquires meta-knowledge - knowledge about how to learn new tasks efficiently. This meta-knowledge acts as an inductive bias, guiding the model to quickly recognize and adapt to novel tasks using few examples.

As Yoshua Bengio and colleagues state, “The core challenge is to leverage information contained in previously learned tasks to better learn a new task of interest” [4]. Meta-learning systems aim to build such inductive transfer between tasks.

The key principles underlying meta-learning include [3]:

  • Extracting task-agnostic representations - The model should learn features that generalize across tasks instead of overfitting to peculiarities of individual tasks. This allows positive transfer to new tasks.

  • Learning to compare and contrast tasks - The model should learn relationships and variations between different tasks, so it can rapidly adapt to new tasks.

  • Learning to learn - The model should reflect on its own learning process to discover how to efficiently learn new tasks.

Through meta-learning, models can acquire abilities like rapid learning, generalizing from few examples, and quickly adapting to shifting distributions - qualities desired in human learners. Next, we survey concrete approaches for few-shot learning.

Approaches for Few-Shot Learning

Few-shot learning refers specifically to the challenging setting where models must learn to recognize new concepts from just a handful of examples, often 1-5 labeled examples per class. For example, a few-shot image classifier may need to learn to identify new objects like rhinoceros or escalator that it has never seen before, given only 5 sample images for each new class.

A number of innovative techniques have been proposed to achieve effective few-shot learning with deep neural networks:

Metric-Based Methods

A simple yet powerful approach is to learn a deep neural network embedding function that maps examples from the same class to similar locations in feature space, while mapping examples from different classes to more distant locations [5]. Examples can then be classified by computing distances or similarities to the few labeled prototype examples of each new class.

For instance, Matching Networks [6] and Prototypical Networks [7] compute distances between embeddings of query examples and prototype examples for each class. The query is classified to its nearest class prototype. These distance-based comparisons require no further training on the new classes, enabling few-shot generalization.

Illustration of metric-learning-based few-shot learning methods

Optimization-Based Methods

Rather than only computing distances, optimization-based meta-learners leverage gradients to rapidly adapt to new tasks [4]. For example, Model-Agnostic Meta-Learning (MAML)[8] trains models to quickly optimize to new tasks within a few gradient steps. During meta-training, model parameters are initialized, adapted to new tasks using a few examples, and updated to learn an initialization that facilitates fast adaptation.

Related techniques like LEO[9] and ANIL[10] also meta-learn neural network priors that enable efficient adaptation. These gradient-based meta-learners acquire inductive biases tailored for few-shot learning.

Augmentation-Based Methods

Data augmentation techniques can alleviate overfitting and improve generalization in limited data regimes. Meta-learning can optimize augmentations to maximally improve few-shot learning.

For example, Hallucination Networks[11] learn to generate informative synthetic examples for new classes that resemble real examples. These hallucinated examples augment the few-shot training set for better generalization. Other techniques like Meta-Learning with Differentiable Closed-Form Solvers[12] learn task-specific data augmentation policies through meta-learning.

Applications of Few-Shot Learning

Few-shot learning has unlocked new capabilities for deep learning systems across diverse applications:

Applications of Few-Shot Learning

Computer Vision

Few-shot image classifiers can learn to recognize new objects, foods, animals, characters, etc from just a few samples[5], [7]. This offers hope for more versatile computer vision systems that can expand their capabilities easily instead of requiring massive labeled datasets for each new class.

Drug Discovery

Discovering new medicines often relies on small datasets in the early stages. Few-shot learning shows promise for predicting drug candidate efficacy and toxicity using limited trials[13]. By leveraging prior experience, fewer animal trials may be required.

Natural Language Processing

Few-shot text classification can categorize documents into new classes given only a few labeled samples per class[14], by building on knowledge gained from related text classification tasks.

Reinforcement Learning

Meta-reinforcement learning agents can quickly adapt to new environments and tasks using limited experience[15]. This rapid transfer reduces the number of trials required for agents to master new skills.


Few-shot imitation learning can enable robots to learn new skills from just a handful of human demonstrations[16]. This allows efficiently training robots to perform diverse skills beyond what's hard-coded by programmers.

Overall, few-shot learning brings deep learning closer to the sample efficiency and rapid learning abilities of human learners. These techniques will help democratize AI by reducing reliance on massive curated datasets.

<iframe title="vimeo-player" src="" width="640" height="360" frameborder="0" allowfullscreen></iframe>

Challenges and Future Directions

While few-shot learning methods have demonstrated the potential to learn from limited data, there remain significant challenges and opportunities for further progress:

  • Achieving human-level generalization - Current few-shot learning algorithms still pale in comparison to human few-shot learning abilities, suggesting ample room for advancing the state of the art.

  • Integration of structured knowledge - Combining few-shot learning with structured knowledge representations and reasoning could further improve generalization, moving towards more human-like learning.

  • Effective combinations of diverse methods - Ensemble techniques combining metric-learning, optimization-based methods, data augmentation, etc could compound their strengths. Integrated architectures for few-shot learning remain under-explored.

  • Scaling up capacity - Recent progress in language modeling with transformers and computer vision with CLIP highlights the benefits of scaling up model size and data. Applying these successes to few-shot learning is an exciting direction.

  • Multi-modal and multi-task learning - Learning joint representations across diverse inputs like images, text, and sound could improve few-shot generalization, similar to human cross-modal learning.

  • Lifelong and continual learning - Developing systems that can sustain lifelong adaptation and learning continually from limited experience is an ambitious goal requiring meta-learning.

In summary, leveraging meta-learning to achieve human-like few-shot learning remains an open challenge with immense potential. Advances on this frontier could transform how AI systems develop broad, flexible intelligence.


In this article, we provided an overview of meta-learning techniques that enable deep learning models to adapt rapidly to new tasks and concepts given only a few examples. We examined key algorithms for few-shot learning based on distance metrics, optimization, and data augmentation. These methods can unlock deep learning for applications with limited data, advancing towards more human-like sample efficiency and generalization. While substantial progress has been made, few-shot learning for human-level generalization remains an open and exciting challenge at the cutting edge of artificial intelligence research.

Few-Shot Learning: Basic Concepts - YouTube


[1] Deng, J., Dong, W., Socher, R., Li, L.J., Li, K. and Fei-Fei, L., 2009. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition (pp. 248-255).

[2] Brown, T.B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A. and Agarwal, S., 2020. Language models are few-shot learners. Advances in neural information processing systems, 33, pp.1877-1901.

[3] Hospedales, T., Antoniou, A., Micaelli, P. and Storkey, A., 2020. Meta-learning in neural networks: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence.

[4] Bengio, Y., Bengio, S., Cloutier, J. and Gecsei, J., 1991. On the optimization of a synaptic learning rule. In Preprints Conf. Optimality in Artificial and Biological Neural Networks (pp. 6-8). Univ. of Texas.

[5] Koch, G., Zemel, R. and Salakhutdinov, R., 2015, June. Siamese neural networks for one-shot image recognition. In ICML deep learning workshop (Vol. 2).

[6] Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D. and et al., 2016, June. Matching networks for one shot learning. In Advances in neural information processing systems (pp. 3630-3638).

[7] Snell, J., Swersky, K. and Zemel, R., 2017. Prototypical networks for few-shot learning. Advances in neural information processing systems, 30.

[8] Finn, C., Abbeel, P. and Levine, S., 2017. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning (pp. 1126-1135). PMLR.

[9] Rusu, A.A., Rao, D., Sygnowski, J., Vinyals, O., Pascanu, R., Osindero, S. and Hadsell, R., 2018. Meta-learning with latent embedding optimization. arXiv preprint arXiv:1807.05960.

[10] Raghu, A., Raghu, M., Bengio, S. and Vinyals, O., 2019. Rapid learning or feature reuse? towards understanding the effectiveness of maml. arXiv preprint arXiv:1909.09157.

[11] Hariharan, B. and Girshick, R., 2017. Low-shot visual recognition by shrinking and hallucinating features. In Proceedings of the IEEE International Conference on Computer Vision (pp. 3018-3027).

[12] Antoniou, A., Edwards, H. and Storkey, A., 2019. How to train your maml. arXiv preprint arXiv:1810.09502.

[13] Altae-Tran, H., Ramsundar, B., Pappu, A.S. and Pande, V., 2017. Low data drug discovery with one-shot learning. ACS central science, 3(4), pp.283-293.

[14] Yu, M., Bi, W., Tao, D., Wang, M., Luo, J. and Xu, C., 2021. Few-shot text classification with pattern-matched training. In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 35, No. 5, pp. 4384-4392).

[15] Wang, J.X., Kurth-Nelson, Z., Tirumala, D., Soyer, H., Leibo, J.Z., Munos, R., Blundell, C., Kumaran, D. and Botvinick, M., 2016. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763.

[16] Yu, T., Quillen, D., He, Z., Julian, R., Hausman, K., Finn, C. and Levine, S., 2020. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Conference on Robot Learning (pp. 1094-1100). PMLR.

Applications of Few Shots Learning
Applications of Few Shots Learning