Contrastive Learning for Task-Independent SpeechLLM-Pretraining

Maike Züfle, Jan Niehues · OpenReview

Abstract

Large language models (LLMs) excel in natural language processing but adapting these LLMs to speech processing tasks efficiently is not straightforward. Direct task-specific fine-tuning is limited by overfitting risks, data requirements, and computational costs. To address these challenges, we propose a scalable, two-stage training approach: (1) A task-independent speech pretraining stage using contrastive learning to align text and speech representations over all layers, followed by (2) a task-specific fine-tuning stage requiring minimal data. This approach outperforms traditional ASR pretraining and enables the model to surpass models specialized on speech translation and question answering while being trained on only 10% of the task-specific data.

Introduction

Integrating speech into Large Language Models (LLMs) typically involves either cascaded systems or end-to-end architectures. Cascaded systems, where an Automatic Speech Recognition (ASR) model transcribes speech for an LLM, often suffer from error propagation and the loss of non-verbal cues like tone or emotion. End-to-end SpeechLLMs connect a speech encoder directly to an LLM via a projector, but they face significant data scarcity for downstream tasks like Speech Translation (ST) or Spoken Question Answering (SQA).

A common workaround is pretraining on ASR data. However, this often leads to the model overfitting to the transcription task, reducing its flexibility for other modalities. This research introduces a task-independent pretraining method that focuses on concept alignment rather than specific input-output formatting, teaching the model to map audio signals to conceptual representations within the LLM's latent space.

Methodology

The proposed pipeline consists of two distinct stages designed to maximize data efficiency and model flexibility.

Overview of the two-stage training approach: (1) Task-agnostic pretraining via contrastive alignment and (2) Task-specific fine-tuning.

Stage 1: Task-Agnostic Pretraining

In the first stage, a frozen speech encoder (HuBERT) is connected to a frozen LLM (Llama-3.1-8B) through a trainable Q-Former projector. Instead of training for a specific task, the authors apply a contrastive loss (InfoNCE) to align the representations of paired speech and text.

Crucially, this alignment is not restricted to the input layer. The contrastive loss is applied across multiple internal layers of the LLM, allowing the model to leverage its existing linguistic processing pathways for speech understanding. To handle the temporal mismatch between long audio sequences and shorter text tokens, the Wasserstein distance (Optimal Transport) is utilized, providing a more flexible mapping than standard cosine similarity.

Stage 2: Task-Specific Fine-tuning

Following pretraining, the model is fine-tuned on specific downstream tasks such as ASR, ST, and SQA. Because the first stage establishes a strong foundation of speech-text alignment, this stage requires significantly less labeled data—as little as 10% of the usual requirement.

Experimental Setup

The model was pretrained primarily on MustC-v1 (~400 hours of English speech) and scaled with GigaSpeech (an additional 1,000 hours). Evaluation was conducted across several benchmarks:

  • ASR & ST: MustC-v1 (English to German, French, Italian, and Spanish).
  • SQA: Spoken-SQuAD.
  • Paralinguistic Analysis: Tools like mls-eng-speaker-descriptions and MuST-SHE were used to evaluate the preservation of features like speaking rate, noise, and gender.

Results and Discussion

The experimental results demonstrate that contrastive pretraining significantly outperforms traditional ASR-based pretraining.

Performance comparison of different pretraining strategies across ASR, ST, and SQA tasks.

Data Efficiency and Performance

The proposed contr-wasser-all method achieved a normalized average score of 84.96 using only 10% of the fine-tuning data. This is a massive improvement over the baseline without pretraining (-51.13) and standard ASR pretraining (39.93). Notably, the model trained on 10% of the data outperformed specialized models and other SpeechLLMs trained on 100% of the data. When scaled to 1,400 hours of pretraining, it surpassed state-of-the-art specialized models like Whisper (ASR) and Seamless (ST).

Deep Alignment and Wasserstein Loss

Ablation studies confirmed that aligning only at the embedding layer is insufficient. Deep alignment across LLM layers is critical for performance. Furthermore, the Wasserstein distance consistently proved more effective than cosine similarity for contrastive loss, likely due to its superior ability to handle sequence length mismatches between audio and text.

Preservation of Paralinguistic Information

Contrary to fears that speech-text alignment might strip away non-verbal information, contrastive learning was found to preserve paralinguistic features (e.g., speaker gender, background noise) better than traditional methods. This suggests the model learns a richer representation than simple text-equivalent tokens.

Conclusion

This work presents a scalable and efficient framework for building SpeechLLMs. By shifting the focus from task-specific pretraining to multi-layer contrastive alignment, the authors achieve state-of-the-art results with a fraction of the fine-tuning data. Future work will explore fine-tuning the full model stack and applying this task-agnostic alignment to lower-resource languages.

Summary updated

BibTeX
@inproceedings{zufle2025contrastive,
  author = {Maike Züfle and Jan Niehues},
  title = {{Contrastive Learning for Task-Independent SpeechLLM-Pretraining}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure