Efficient Transformer for Direct Speech Translation

Belen Alastruey, Gerard I. Gállego, Marta R. Costa-jussàarXiv 2021

TL;DR

Researchers have successfully applied the Longformer—an efficient Transformer variant—to direct speech translation, allowing the model to process long audio spectrograms without the usual information-leaking convolutional "shortcuts." While the results are slightly behind current baselines, this work proves that linear-complexity attention can handle the massive sequence lengths of audio, opening a new path for end-to-end speech processing.

What Problem Does This Paper Address?

The "Transformer revolution" that transformed Natural Language Processing (NLP) hit a major roadblock with speech. In NLP, a sentence might have 50 tokens; in speech, that same sentence represented as an audio spectrogram can have thousands of frames.

Because the standard Transformer’s attention mechanism has quadratic complexity ($O(n^2)$), doubling the input length quadruples the memory and computation required. To make this manageable, most current Speech Translation (ST) systems use "strided convolutional layers" at the very beginning to aggressively downsample the audio. While effective at shortening the sequence, these layers can discard fine-grained acoustic information before the Transformer even sees it.

The authors ask: Can we use an "efficient" Transformer to process the full-length spectrogram directly, bypassing the need for these early convolutional bottlenecks?

Methods

The team introduced the Speech-to-Text Longformer. The core innovation is replacing the standard self-attention in the encoder with the sliding window attention pattern used in the Longformer.

![Fig.

  1. Sliding window pattern, used by the Longformer self-attention.](/figures/art_f807b57a10b446d1a618bb72900d7ebd)

As shown in Figure 1, instead of every token attending to every other token, each token only attends to a small neighborhood (a "window") around it. This changes the computational complexity from quadratic to linear ($O(n)$), making it feasible to feed long, raw spectrograms into the model.

The overall architecture (Figure 2) consists of:

  1. Encoder: A 12-layer Longformer that processes the audio input.
  2. Decoder: A standard 6-layer Transformer decoder that produces the translated text.

![Fig.

  1. System overview. We replace the Transformer encoder self-attention by the Longformer’s.](/figures/art_76d2b964651247718a3d7e1c2f702416)

The authors also experimented with adding a convolutional layer after the encoder to see if reducing the sequence length before the cross-attention stage would help the decoder align speech with text.

Datasets

The models were trained and evaluated using the MuST-C dataset, a massive multilingual corpus built from TED talks. Specifically, they focused on the English-German split, which includes:

  • 408 hours of English speech.
  • 234,000 paired English-German sentences.

Key Insights and Ideas

  • Window Size is Critical: In NLP, Longformers often use a default window size of 512. The authors found this was disastrous for speech. A window of 512 frames covers roughly 5 seconds of audio—far too wide for the model to focus on specific acoustic features. Narrower windows (48, 60, or 76) proved much more stable and effective.
  • The "Alignment" Myth: The researchers hypothesized that the massive length mismatch between audio (input) and text (output) would break the encoder-decoder attention. Surprisingly, adding a convolutional layer after the encoder to "fix" this mismatch didn't significantly improve performance. The Transformer's cross-attention mechanism was robust enough to handle the discrepancy on its own.
  • Pre-training is Essential: Direct Speech Translation is a "hard" task because the model must learn acoustics and semantics simultaneously. The authors found that pre-training the encoder on an Automatic Speech Recognition (ASR) task was vital for getting the ST models to converge.

Key Results

The Longformer approach achieved results that are "promisingly close" to the standard baseline (Fairseq's S2T Transformer), though they haven't surpassed it yet.

Automatic Speech Recognition (WER): As seen in Table 1 (Figure 4), the best Longformer configuration achieved a Word Error Rate (WER) of 14.72, compared to the baseline's 13.31.

Table 1. ASR results on the MuST-C test subset.

Speech Translation (BLEU): In translation (Table 2 / Figure 5), the Longformer reached a BLEU score of 20.64, trailing the baseline's 22.41 by less than 2 points.

Table 2. ST results on the MuST-C test subset.

Figure 3 illustrates that while the Longformer models (various colored lines) are slightly less performant than the baseline (blue line), they follow a very similar learning trajectory, suggesting the architecture is fundamentally sound.

![Fig.

  1. ST results over epochs (BLEU).](/figures/art_e8859f4a16d748eb8fbd0305d2f500d4)

Limitations and Future Work

The main limitation is the performance gap; the baseline still holds a ~1.5-2 point lead in both ASR and ST. Additionally, the authors noted that large attention windows caused significant training instability.

For future work, the authors suggest:

  • Dilated Sliding Windows: To increase the receptive field without increasing computation.
  • Global/Random Attention: Incorporating "Big Bird" style attention patterns to help the model capture long-range dependencies that a simple sliding window might miss.
  • Variable Window Lengths: Adapting the window size dynamically based on the audio content.

Summary updated

Abstract

The advent of Transformer-based models has surpassed the barriers of text. When working with speech, we must face a problem: the sequence length of an audio input is not suitable for the Transformer. To bypass this problem, a usual approach is adding strided convolutional layers, to reduce the sequence length before using the Transformer. In this paper, we propose a new approach for direct Speech Translation, where thanks to an efficient Transformer we can work with a spectrogram without having to use convolutional layers before the Transformer. This allows the encoder to learn directly from the spectrogram and no information is lost. We have created an encoder-decoder model, where the encoder is an efficient Transformer -- the Longformer -- and the decoder is a traditional Transformer decoder. Our results, which are close to the ones obtained with the standard approach, show that this is a promising research direction.
BibTeX
@misc{alastruey2021efficient,
  author = {Belen Alastruey and Gerard I. Gállego and Marta R. Costa-jussà},
  title = {{Efficient Transformer for Direct Speech Translation}},
  year = {2021},
  eprint = {2107.03069},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.03069},
}

Loading related content...

Figure