Skip to content

[Proposal] Whisper adapter for TransformerBridge #1938

Description

@dipo101

Proposal

Add a WhisperArchitectureAdapter so that WhisperForConditionalGeneration checkpoints load
through TransformerBridge.boot_transformers, with hooks throughout the audio encoder and the
text decoder. That covers openai/whisper-tiny to large-v3, large-v3-turbo and
distil-whisper.

Motivation

#710 asked for Whisper, and its last comment asks for one issue per model. This is that issue.
Today the bridge covers audio in two ways:

  • encoder-only models (HuBERT, wav2vec2, AST);
  • audio-text LMs (Qwen2-Audio, GLM-ASR, Audio Flamingo 3), whose Whisper-style encoders are wrapped opaquely, with hook_in and hook_out only.

No audio encoder-decoder is supported, and nothing exposes the inside of a Whisper encoder. Yet
Whisper is one of the most-studied speech model.

Pitch

The adapter is a BART-family member. Whisper's layers have exactly BART's module names
(self_attn, self_attn_layer_norm, fc1, fc2, final_layer_norm, plus encoder_attn and
encoder_attn_layer_norm in the decoder), with pre-LN and a final layer_norm per stack. So the
adapter subclasses BartFamilyArchitectureAdapter, with these differences:

  • Encoder front end. Hooks on conv1, conv2 and the fixed sinusoidal embed_positions,
    in place of token embeddings. encoder_blocks.{i}.hook_out is then [batch, 1500, d_model],
    one frame per 20 ms of a 30 s window.
  • Unembedding. proj_out, tied to the decoder's embed_tokens, with no final_logits_bias.
  • Asymmetric stacks. large-v3-turbo has 32 encoder and 4 decoder layers, and
    distil-large-v3 has 2 decoder layers, so n_layers follows the decoder, as in Blenderbot.

Changes outside the adapter (the part to agree on first):

  1. Route Whisper to AutoModelForSpeechSeq2Seq in utilities/architectures.py.
  2. Keep the tokenizer for audio encoder-decoders. skip_tokenizer_for_modality drops it for
    audio models, but the decoder reads text. Load WhisperProcessor as bridge.processor.
  3. In forward, the audio branch passes input as input_values, but Whisper takes
    input_features (log-mel, [batch, n_mels, 3000]) plus a decoder input. The adapter would
    declare its audio input name, and an audio encoder-decoder would require decoder_input. The
    automatic shift from input_ids doesn't apply to audio.

Usage: bridge(features, decoder_input=prompt) returns decoder logits under teacher forcing,
and run_with_cache returns encoder and decoder hooks.

Out of scope for the first PR:

  • generate. Whisper's generation adds language detection, timestamps and long-form decoding,
    while patching and probing only need the forward pass.
  • Weight processing such as fold_ln, which is off for the BART family.

Tests: unit tests on a tiny random config; an integration test of logit parity with HF on
openai/whisper-tiny (39M) on synthetic audio; and a verify_models run.

Alternatives

Additional context

With my multi-position proposal, interchange interventions will work on encoder frames. A
word spans many frames and the number differs by speaker, so frame-level causal work needs either
aligned positions or pooled spans. Once this lands, the same encoder mapping could also give
Qwen2-Audio's audio tower full hooks, in a later PR.

References:
Glazer, Segal-Feldman, Segev, Shamsian, Buchnick, Hetz, Fetaya, Keshet and Navon (2025), "Beyond Transcription: Mechanistic Interpretability in ASR", arXiv:2508.15882;
Radford, Kim, Xu, Brockman, McLeavey and Sutskever (2023), "Robust Speech Recognition via Large-Scale Weak Supervision", ICML.

Checklist

  • I have checked that there is no similar issue in the repo (required)

Activity

  1. jlarson4 commented on Oct 22, 2026

    @jlarson4
    Collaborator

    This is approved for development @dipo101! The BART-family mapping is the right base (Blenderbot already sets the asymmetric-stack precedent you'll need for turbo/distil). One note: Whisper's k_proj has no bias while q/v/out do, so please note that in the adapter docstring and let the whisper-tiny parity test pin it. On the three shared changes, which you identified as the first items to settle:

    • Route through a new architecture set alongside AUDIO_TEXT_ARCHITECTURES
    • Make the tokenizer carve-out an explicit config flag for "audio encoder, text decoder" rather than a Whisper check, so audio-text LMs are unaffected
    • Have the adapter declare input_features as its input name with decoder_input required, rather than reusing the input_values branch.

    Leaving generate and weight processing out of the first PR is fine, we will want this as the next follow up.

  2. added
    new-architecture
    complexity-moderate
    TransformerBridge
    on Oct 22, 2026
  3. added theissue type on Oct 22, 2026
  4. added a commit that references this issue on Oct 23, 2026
  5. linked a pull request that will close this issueWhisper adapter #1944on Oct 26, 2026
  6. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

TransformerBridgecomplexity-moderatenew-architecture

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions