Connecting Speech Encoder and Large Language Model for ASR

Wenyi Yu, Changli Tang, Guangzhi Sun, Xianzhao Chen, Tian Tan, Wei Li, Lu Lu, Zejun Ma, Chao Zhang

TL;DR

This paper investigates the best way to bridge the gap between speech encoders and Large Language Models (LLMs) for automatic speech recognition. By comparing different "connector" modules, the authors find that the Q-Former structure offers the best balance of information compression and accuracy, and they introduce a novel segment-level Q-Former that allows LLMs to process audio far beyond the standard 30-second limit of models like Whisper.

What Problem Does This Paper Address?

While LLMs like LLaMA and Vicuna are masters of text, they don't natively "hear" audio. To build an integrated ASR system, researchers typically connect a pre-trained speech encoder (which turns audio into features) to an LLM (which turns features into text).

However, two major challenges remain:

  1. The Connector Gap: What is the most efficient mathematical "bridge" to translate speech features into the LLM's token space? A poor connector might lose vital acoustic information or overwhelm the LLM with too much data.
  2. The Duration Limit: Most high-performing speech encoders, such as OpenAI’s Whisper, are trained on fixed-length windows (usually 30 seconds). Processing long-form audio (e.g., a 2-minute lecture) requires a way to stitch these windows together without losing context or causing the LLM to "hallucinate" or repeat itself.

Methods

The researchers conducted a comparative study using a frozen Whisper encoder and a frozen Vicuna LLM. They tested three types of trainable connectors:

  • Fully Connected (FC) layers: A simple linear mapping that stacks adjacent frames.
  • Multi-Head Cross-Attention (MHCA): A mechanism that uses textual embeddings to "attend" to relevant speech features.
  • Q-Former: A Transformer-based module that uses a fixed set of trainable "query" tokens to extract specific information from the speech encoder's output.
Illustration of the three connector types: (a) FC, (b) MHCA, and (c) Q-Former.

To solve the duration problem, they proposed the Segment-level Q-Former (seg-QF). Instead of trying to feed a massive audio file into the encoder at once, they split the audio into segments. Each segment is processed by the encoder and a shared Q-Former. Crucially, they added segment-level positional encodings so the LLM knows the chronological order of the audio chunks.

The proposed segment-level Q-Former architecture for handling long-form audio.

Datasets

The models were trained and evaluated on several industry-standard benchmarks:

  • LibriSpeech (960h): The primary training and in-domain evaluation set.
  • Common Voice 7.0 & GigaSpeech: Used for large-scale training (totaling ~4,000 hours).
  • Eval2000 (Switchboard/CallHome): Used to test "out-of-domain" generalization (how well the model performs on conversational data it wasn't specifically trained on).

Key Insights and Ideas

  • Q-Former is the "Goldilocks" Connector: It achieved the lowest Word Error Rate (WER) while using significantly fewer output tokens than simple linear layers. This is vital because fewer tokens mean lower computational costs for the LLM.
  • Encoder Quality > LLM Size: The authors found that doubling the size of the speech encoder (e.g., moving from Whisper Medium to Large) improved ASR performance much more than doubling the size of the LLM. For pure transcription, the "ear" matters more than the "brain."
  • The 80-Token Sweet Spot: The study found that just 80 trainable queries in the Q-Former are enough to capture the necessary information from a 30-second audio clip. Adding more queries (up to 300) provided diminishing returns.
  • Context is a Double-Edged Sword: For long-form audio, having more context can actually reduce errors if the model decodes successfully. However, as audio gets longer, the risk of "catastrophic" failures (like the LLM getting stuck in a loop) increases.

Key Results

  • Superior Accuracy: The Q-Former-based LLM achieved a 12% relative WER reduction over the standard Whisper baseline on the out-of-domain Eval2000 test set.
  • Long-Form Mastery: On 90-second audio sequences, the proposed segment-level Q-Former resulted in a 17% relative WER reduction compared to other connector structures.
  • Efficiency: The Q-Former outperformed a Multi-Head Cross-Attention connector despite having 6x fewer parameters (24.5M vs 133.4M).
WER trends for long-form audio. While overall WER increases with duration, successfully decoded segments actually benefit from the longer context.

Limitations and Future Work

The authors noted that while their segment-level approach helps with long audio, the system still struggles with hallucinations when sequences become extremely long (e.g., 120 seconds). The LLM sometimes generates repeated text or skips large chunks of audio.

Future work could involve fine-tuning the LLM itself (rather than keeping it frozen) to better handle these long-form acoustic sequences, or developing more robust decoding strategies to mitigate the hallucination problem inherent in autoregressive models.

Summary updated

BibTeX
@inproceedings{yu2024connecting,
  author = {Wenyi Yu and Changli Tang and Guangzhi Sun and Xianzhao Chen and Tian Tan and Wei Li and Lu Lu and Zejun Ma and Chao Zhang},
  title = {{Connecting Speech Encoder and Large Language Model for ASR}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=2qtD1EeGRc},
}
Figure