[Proposal] Whisper adapter for TransformerBridge
Los mantenedores suelen responder en 1 día
@dipo101 ya está trabajando en esto.
Desde el 22/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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_inandhook_outonly.
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,conv2and the fixed sinusoidalembed_positions,
in place of token embeddings.encoder_blocks.{i}.hook_outis then[batch, 1500, d_model],
one frame per 20 ms of a 30 s window. - Unembedding.
proj_out, tied to the decoder'sembed_tokens, with nofinal_logits_bias. - Asymmetric stacks.
large-v3-turbohas 32 encoder and 4 decoder layers, and
distil-large-v3 has 2 decoder layers, son_layersfollows the decoder, as in Blenderbot.
Changes outside the adapter (the part to agree on first):
- Route Whisper to
AutoModelForSpeechSeq2Seqinutilities/architectures.py. - Keep the tokenizer for audio encoder-decoders.
skip_tokenizer_for_modalitydrops it for
audio models, but the decoder reads text. LoadWhisperProcessorasbridge.processor. - In
forward, the audio branch passesinputasinput_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 requiredecoder_input. The
automatic shift frominput_idsdoesn'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
- Keep Whisper opaque, as in the Qwen2-Audio adapter. That gives no hooks inside the encoder.
- Use separate tooling, such as WhisperLens, linked in #710. That leaves out the bridge's
analysis tools (patching, interchange, probes, logit lens).
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)
- Lenguaje dominante
- Python
- Estrellas
- 3.9k
- Forks
- 708
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 88
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TransformerLensOrg/TransformerLens
-
[Bug Report] `boot_transformers(hf_model=...)` without `device=` can record the wrong `cfg.device`Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 56/100
TransformerLensOrg/TransformerLens#1945 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
TransformerLensOrg/TransformerLens#1939 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug Report] Granite MoE Hybrid grouped experts produce incorrect or unstable outputs on MPSPosiblemente ocupada @janmenjayap la tomó hace 12 días. Abiertobug complexity-simple TransformerBridge
TransformerLensOrg/TransformerLens#1886 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Community Feedback Requested Research Reproduction seen_by_maintainers TransformerBridge
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
TransformerLensOrg/TransformerLens#1884 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Proposal] Contextual Decomposition: Nonlinear Source Attribution and Dataset-Wide Ranking on GPT-2AbiertoCommunity Feedback Requested Research Reproduction seen_by_maintainers
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
TransformerLensOrg/TransformerLens#1883 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de TransformerLensOrg/TransformerLens
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
conda-forge/conda-forge-bot#7025 ·
Los mantenedores suelen responder en 1 día
-
chore(ci): publish.yml's release-job comment counts the hand-created Releases as all of themAbiertoarea:ci
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
catincloud-labs/dagster-dex#149 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
home-assistant/core#188424 ·
Los mantenedores suelen responder en 1 día
-
Review backlog (docs-currency): README 'CI run' link lands on a run whose overall badge is cancelledAbiertoagent/reviewer needs-kind needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
projectbluefin/utah#880 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
redis/memtier_benchmark#850 ·
Los mantenedores suelen responder en 1 día