All models

speechbrain_transformer_asr

The plain Transformer encoder-decoder for speech recognition, as built by ESPnet2 and SpeechBrain.

Audio and speech · 1,148 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (18 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
66.3M
Operations
1,148
Framework
PyTorch
Recurrent
No
Published
ASRU 2019
Cited by
764 (as of 18 October 2026)
Authors
Shigeki Karita, Nanxin Chen, Tomoki Hayashi and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m10131
Graph hash
4012df86a582f4447c00d1576c64e3101ecd1b0cb5146e4e342cf18f05b05645
Skeleton hash
57f18e80a439f98c2f4bdfdd8b29654431622163d243f709114aaffe87f46df3
Architecture hash
3022af7178cf858d7021987396e19fef229ccb64dc7ff7fb04822f26405cc5a4
Diagram SHA-256
a198778feb7add3735f36a8ce748130cd3e55d4becb0f3eb69dc3c37c4311de3
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

The SpeechBrain TransformerASR build of the same encoder-decoder, from a toolkit that describes itself as an open-source PyTorch toolkit for Conversational AI.

This family holds the plain Transformer encoder-decoder as applied to speech recognition, the model that ESPnet's comparative study pitted against recurrent networks. That study compared Transformer and RNN on 15 ASR benchmarks, one multilingual ASR task, one speech translation task and two text-to-speech tasks, and found Transformer superior in 13 of the 15 ASR benchmarks.

For ASR the source is log-mel filterbank frames, first subsampled by a two-layer CNN with 256 channels, stride 2 and kernel size 3 before the self-attention encoder. The decoder's attention at each target frame is masked so it cannot see future frames, which needs no sequential operation and so runs faster than an RNN. Training combines the attention decoder's loss with a CTC loss as a weighted sum. Decoding runs beam search over a combination of S2S, CTC and RNN language model scores. The default architecture used 12 encoder layers, 6 decoder layers, a 2048-unit feed-forward, 4 heads and 256 attention dimensions, widened to 8 heads and 512 dimensions for LibriSpeech.

Among the training tips: a larger minibatch made Transformer more accurate while RNN did not benefit. Its acknowledged weakness is decoding speed, since naive self-attention costs O(n2) in the speech length. Two builds are traced here: ESPnet2's hybrid CTC/attention Transformer encoder-decoder, and SpeechBrain's TransformerASR, both with 12 encoder and 6 decoder layers.

Key idea. A reproducible recipe for the Transformer encoder-decoder in speech, trained with joint CTC and attention losses and shown to beat RNNs on most ASR benchmarks.

  • transformer asr
  • speech transformer
  • hybrid ctc/attention transformer
  • espnet transformer
  • speechbrain transformerasr
  • speech recognition
  • asr
  • transformer vs rnn

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{karita2019comparativestudytransformervs,
      title={A Comparative Study on Transformer vs RNN in Speech Applications}, 
      author={Shigeki Karita and Nanxin Chen and Tomoki Hayashi and Takaaki Hori and Hirofumi Inaguma and Ziyan Jiang and Masao Someki and Nelson Enrique Yalta Soplin and Ryuichi Yamamoto and Xiaofei Wang and Shinji Watanabe and Takenori Yoshimura and Wangyou Zhang},
      year={2019},
      eprint={1909.06317},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      doi={https://doi.org/10.1109/ASRU46091.2019.9003750},
      url={https://arxiv.org/abs/1909.06317}, 
}