Few-shot learning with attention-based sequence-to-sequence models

Bertrand Higy, Peter BellarXiv 2018 · OpenReview

Abstract

End-to-end approaches have recently become popular as a means of simplifying the training and deployment of speech recognition systems. However, they often require large amounts of data to perform well on large vocabulary tasks. With the aim of making end-to-end approaches usable by a broader range of researchers, we explore the potential to use end-to-end methods in small vocabulary contexts where smaller datasets may be used. A significant drawback of small-vocabulary systems is the difficulty of expanding the vocabulary beyond the original training samples -- therefore we also study strategies to extend the vocabulary with only few examples per new class (few-shot learning). Our results show that an attention-based encoder-decoder can be competitive against a strong baseline on a small vocabulary keyword classification task, reaching 97.5% of accuracy on Tensorflow's Speech Commands dataset. It also shows promising results on the few-shot learning problem where a simple strategy achieved 68.8% of accuracy on new keywords with only 10 examples for each new class. This score goes up to 88.4% with a larger set of 100 examples.

Introduction

Building custom voice interfaces for smart home devices or specialized applications is traditionally a resource-intensive task. Conventional Automatic Speech Recognition (ASR) systems typically rely on complex Hidden Markov Models (HMMs) paired with Deep Neural Networks (DNNs), requiring significant expertise and rigid constraints. While "End-to-End" (E2E) models have simplified this pipeline by mapping audio directly to text, the prevailing assumption has been that they require massive datasets. This paper challenges that assumption, investigating whether E2E models can excel in small-vocabulary tasks and how effectively they can adapt to new words using only a handful of samples—a challenge known as few-shot learning.

Methodology

The study utilizes a hybrid CTC/Attention architecture. This model integrates Connectionist Temporal Classification (CTC) to maintain strict left-to-right alignment with an Attention Mechanism that allows the decoder to focus on specific audio segments. The architecture consists of a CNN-based encoder for feature extraction followed by Bidirectional Long Short-Term Memory (BiLSTM) layers.

For few-shot learning, two primary strategies were evaluated:

  1. Retraining: Incorporating new keyword examples into the original dataset and training from scratch using oversampling to prevent the model from ignoring sparse new data.
  2. Adaptation: Fine-tuning a pre-trained model (trained on 12 categories) using only the new keyword examples and a small subset of original data to mitigate forgetting.

The experiments were conducted on the Google Speech Commands (SC) dataset, partitioned into standard keywords (org_kwd), unknown speech for training (org_unk), and reserved keywords for few-shot evaluation (new_kwd).

Results and Discussion

Performance on Small Vocabulary

Contrary to the "big data" requirement myth, the sequence-to-sequence (S2S) model significantly outperformed the strong CNN-HMM baseline, achieving a 2.5% error rate compared to the baseline's 4.2%—a 40% relative improvement.

The "Single Glance" Phenomenon

Analysis of the attention maps revealed a unique behavior in small-vocabulary tasks. Unlike large-scale ASR where attention moves progressively across the audio, the model here tends to focus on a single, highly informative portion of the one-second audio clip. This suggests the model treats the task more as holistic "word modeling" rather than sequential sub-word modeling.

Attention maps for "STOP" and "YES" keywords showing the model focusing on specific informative frames.

Few-Shot Learning and Adaptation

Adaptation proved to be more efficient than retraining. With just 10 examples per new word, the model reached 68.8% accuracy on new keywords, which increased to 88.4% with 100 examples. However, a critical trade-off was observed: while higher learning rates improved accuracy on new keywords, they also impacted the retention of original keywords, highlighting the challenge of catastrophic forgetting.

Accuracy vs. Learning rate for the adaptation strategy, illustrating the performance on new keywords and original keywords.

Conclusion

This research demonstrates that attention-based S2S models are not only viable but highly effective for small-vocabulary speech recognition. They offer superior performance and better generalization to "unknown" words than traditional baselines. While adaptation is a powerful tool for few-shot learning, future work must address the balance between acquiring new information and preserving existing knowledge to prevent catastrophic forgetting as models scale to more complex tasks.

Summary updated

Abstract

End-to-end approaches have recently become popular as a means of simplifying the training and deployment of speech recognition systems. However, they often require large amounts of data to perform well on large vocabulary tasks. With the aim of making end-to-end approaches usable by a broader range of researchers, we explore the potential to use end-to-end methods in small vocabulary contexts where smaller datasets may be used. A significant drawback of small-vocabulary systems is the difficulty of expanding the vocabulary beyond the original training samples -- therefore we also study strategies to extend the vocabulary with only few examples per new class (few-shot learning). Our results show that an attention-based encoder-decoder can be competitive against a strong baseline on a small vocabulary keyword classification task, reaching 97.5% of accuracy on Tensorflow's Speech Commands dataset. It also shows promising results on the few-shot learning problem where a simple strategy achieved 68.8\% of accuracy on new keywords with only 10 examples for each new class. This score goes up to 88.4\% with a larger set of 100 examples.
BibTeX
@misc{higy2018few,
  author = {Bertrand Higy and Peter Bell},
  title = {{Few-shot learning with attention-based sequence-to-sequence models}},
  year = {2018},
  eprint = {1811.03519},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.03519},
}
Figure