Multi-View Self-Attention Based Transformer for Speaker Recognition

Rui Wang, Junyi Ao, Long Zhou, Shujie Liu, Zhihua Wei, Tom Ko, Qing Li, Yu Zhang

TL;DR

Researchers have developed a "Multi-View" self-attention mechanism that allows Transformer models to better handle the unique characteristics of speech. By assigning different receptive field sizes to individual attention heads, the model balances local acoustic details with global speaker characteristics, achieving state-of-the-art performance on the VoxCeleb benchmarks.

What Problem Does This Paper Address?

While Transformer models have revolutionized Natural Language Processing (NLP), their transition to speaker recognition has been rocky. Two main hurdles exist:

  1. Sequence Length: Acoustic feature sequences are significantly longer than text sentences, making standard global self-attention computationally expensive and difficult to scale.
  2. Inductive Bias: Unlike Convolutional Neural Networks (CNNs), standard Transformers lack "locality"—the inherent understanding that neighboring frames in a speech signal are highly correlated.

In speaker recognition, the model needs to capture both fine-grained local patterns (like phonemes or spectral textures) and long-term global patterns (the overall "voice" of the speaker). Standard Transformers often struggle to find this balance.

Methods

The authors introduce two primary innovations:

1. Multi-View (MV) Self-Attention

Instead of every attention head looking at the entire sequence, the authors implement sliding windows of varying sizes.

  • Each head $i$ at layer $l$ is assigned a specific window size $w$.
  • The window sizes follow a specific growth pattern ($w_i^l = 2^i + 1$), meaning some heads focus on a very narrow local context (3 frames), while others look at much wider spans.
  • By stacking these layers, the model builds a "multi-view" representation, similar to how a CNN uses layers to increase its receptive field, but while maintaining the flexible weighting of attention.

2. Exploration of Transformer Variants

The paper systematically compares five different ways to extract a single "speaker embedding" from a sequence of Transformer outputs:

  • (a) First Decoder Token: Using a decoder with a [CLS] token.
  • (b) Last Decoder Token: A variation of sequence classification.
  • (c) Average Encoder Token: Simple temporal averaging of all encoder outputs.
  • (d) First Encoder Token: Using a prepended [CLS] token in the encoder.
  • (e) Pooling Encoder Tokens: A hybrid approach using a Transformer encoder followed by a linear layer and attentive statistics pooling (similar to the popular x-vector architecture).

Datasets

The models were evaluated on the industry-standard VoxCeleb datasets:

  • VoxCeleb1: Over 100,000 utterances from 1,251 celebrities.
  • VoxCeleb2: A massive set with over 1 million utterances from 6,112 celebrities. Evaluation focused on both Speaker Identification (Who is speaking?) and Speaker Verification (Is this person who they say they are?).

Key Insights and Ideas

  • Locality is Essential: The Multi-View mechanism improved performance across almost all variants. This confirms that forcing some attention heads to focus locally helps the model learn better acoustic features.
  • The "First Token" Failure: Interestingly, Variant (d)—which uses a single [CLS] token at the start of the encoder—performed significantly worse with Multi-View attention. The authors hypothesize that because the windowed attention restricts what that single token can "see" in early layers, it loses critical temporal information.
  • Hybrid Wins: Variant (e), which combines the Transformer encoder with attentive statistics pooling, emerged as the strongest performer. This suggests that the Transformer is excellent at feature extraction, but specialized pooling layers are still superior to simple averaging for creating speaker embeddings.

Key Results

The proposed "Our work (e)" model achieved impressive results compared to traditional CNN and TDNN-based models:

  • Speaker Identification (VoxCeleb1): Achieved 96.38% Top-1 Accuracy, a significant jump over previous Transformer-based attempts (like S-vectors at 89.9%).
  • Speaker Verification (VoxCeleb2 development): Achieved an Equal Error Rate (EER) of 2.56%, outperforming several ResNet and TDNN baselines.
  • Efficiency: By using a "sub-sample prenet" (1D-CNNs) before the Transformer, the authors reduced the sequence length by 4x, making the Transformer much more efficient to train on long audio files.

Limitations and Future Work

  • Data Augmentation: The authors noted that their results, while strong, were slightly behind the very best TDNN models that utilize heavy data augmentation. They suggest that incorporating more robust augmentation techniques is a necessary next step.
  • Scaling: While the sub-sampling helps, Transformers still face scaling challenges with extremely long recordings compared to pure CNN architectures.
  • Pre-training: The authors aim to explore large-scale self-supervised pre-training (like Wav2Vec 2.0 or HuBERT) combined with their Multi-View architecture to further boost performance.

Summary updated

BibTeX
@inproceedings{wang2022multi,
  author = {Rui Wang and Junyi Ao and Long Zhou and Shujie Liu and Zhihua Wei and Tom Ko and Qing Li and Yu Zhang},
  title = {{Multi-View Self-Attention Based Transformer for Speaker Recognition}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2022},
  doi = {10.1109/icassp43922.2022.9746639},
}
Figure