AlignFormer: Modality Matching Can Achieve Better Zero-Shot Instruction-Following Speech-LLM

Ruchao Fan, Bo Ren, Yuxuan Hu, Rui Zhao, Shujie Liu, Jinyu Li

TL;DR

Integrating speech into Large Language Models (LLMs) often struggles with length mismatches between audio and text tokens, hindering the model's ability to follow instructions zero-shot. This paper introduces AlignFormer, a novel adapter that uses CTC alignment to dynamically compress speech tokens to perfectly match text token lengths while keeping the LLM frozen. Trained exclusively on standard speech recognition (ASR) data, AlignFormer unlocks impressive zero-shot capabilities for speech translation and QA, achieving near 100% Instruction Following Rate (IFR).

What Problem Does This Paper Address?

To build a "speech-LLM," researchers typically connect a speech encoder to an LLM using a neural adapter (like a linear layer or a QFormer). However, speech sequences are inherently much longer than text sequences. Standard adapters don't fully resolve this length mismatch, leading to imperfect modality alignment in the LLM's latent space.

Furthermore, to get these models to perform various tasks (translation, QA), researchers usually fine-tune the LLM on speech-specific instruction datasets. This is expensive and often causes "catastrophic forgetting," destroying the LLM's original, highly capable text-based instruction-following skills. The authors want to know: can we perfectly align speech and text in the latent space so that a frozen LLM can apply its existing text reasoning skills to audio, without needing task-specific speech training data?

Methods

The authors propose AlignFormer, a novel adapter that replaces standard linear or convolutional layers.

  • CTC + Dynamic-Window QFormer: AlignFormer combines a Connectionist Temporal Classification (CTC) layer with a QFormer. The CTC layer predicts the alignment between speech frames and non-blank text tokens. This alignment dictates the "dynamic window" size for the QFormer. Essentially, it intelligently compresses the continuous speech sequence to match the exact discrete length of the corresponding text sequence.
  • Frozen LLM: The LLM backbone (Phi-3.1-mini-instruct) is kept completely frozen. Only the speech encoder and the AlignFormer are trained, and they are trained only on standard ASR (transcription) data.
  • Instruction Following Rate (IFR): To rigorously evaluate if the model is actually obeying prompts (e.g., "Translate this to German" or "Answer with A, B, or C"), the authors introduce IFR as a core metric, moving beyond standard accuracy metrics like WER or BLEU.
  • Prompt Ordering: The authors systematically test the position of the audio in the prompt: "Audio-first" (Audio + Text Prompt) versus "Instruction-first" (Text Prompt + Audio).

Datasets

  • Training: 38,000 hours of anonymized, in-house English ASR data.
  • Evaluation (Zero-shot): The WavLLM benchmark dataset, which includes Librispeech (ASR), CoVoST2 & MuST-C (Speech Translation), IEMOCAP (Emotion Recognition), Voxceleb (Speaker Verification), and Chinese Gaokao (Listening Comprehension QA). FLEURS was also used for additional speech translation evaluation.

Key Insights and Ideas

  • Modality matching unlocks zero-shot generalization: By strictly aligning the length and latent space of speech tokens to text tokens, the frozen LLM is "tricked" into treating audio like text. This allows it to perform complex tasks like translation and QA on audio inputs despite only ever being trained to transcribe them.
  • Prompt order matters immensely: "Audio-first" inputs drastically outperform "Instruction-first" inputs for zero-shot generalization. The authors hypothesize that if the text instruction comes first during training, the model overfits to the single specific ASR prompt used ("Transcribe this audio"). When audio comes first, the subsequent text acts as a diverse set of continuations, preserving the LLM's flexibility to accept new zero-shot prompts later.
  • IFR isolates model behavior: Standard metrics can be misleading. If a model gets a low BLEU score, is it bad at translating, or did it just hallucinate a conversational response instead of translating? IFR proves that AlignFormer actually listens to the constraints of the prompt.

Key Results

  • Near-Perfect Instruction Following: In the audio-first setting, AlignFormer achieved an average 0.99 (99%) IFR across zero-shot Speech Translation and QA tasks, compared to 86% for a standard adapter and 25% for a standard QFormer.
  • Rescuing Instruction-First: Even in the suboptimal instruction-first setting, AlignFormer boosted average IFR from 15% to 49%, notably turning a 0% IFR on the difficult Gaokao QA task into a non-zero success rate.
  • Task Performance: On the MuST-C (English-to-German) translation task, the zero-shot AlignFormer achieved a BLEU score of 15.44, outperforming a cascaded Whisper + LLM baseline (11.5 BLEU).
  • Alignment Strategy: A "mixed-alignment" training strategy—starting with forced-alignment from ground truth text, then mixing in greedy CTC alignment—yielded the most stable and performant modality matching.

Limitations and Future Work

  • Loss of Paralinguistic Info: Aggressive downsampling to match text lengths loses fine-grained acoustic details. For example, zero-shot speaker verification accuracy was near random guessing, indicating speaker identity is lost during semantic alignment.
  • Performance Ceiling: While zero-shot translation is impressive, BLEU scores still lag behind theoretical upper bounds (which were calculated by feeding ground-truth text transcripts directly to the LLM).
  • Future Work: The authors suggest incorporating explicit speaker embeddings into the AlignFormer design to retain paralinguistic information. They also plan to explore adding explicit distance losses between speech and text embeddings during training to force even tighter modality matching.

Summary updated

BibTeX
@article{fan2025alignformer,
  author = {Ruchao Fan and Bo Ren and Yuxuan Hu and Rui Zhao and Shujie Liu and Jinyu Li},
  title = {{AlignFormer: Modality Matching Can Achieve Better Zero-Shot Instruction-Following Speech-LLM}},
  journal = {IEEE J. Sel. Top. Signal Process.},
  year = {2025},
  doi = {10.1109/jstsp.2025.3588378},
}
Figure