Paper commentary
Conformer: Convolution-augmented Transformer for Speech Recognition
Conformer combines convolution and self-attention to model speech at both scales
- Problem Transformers capture long-range context but pick out fine-grained local patterns poorly. CNNs catch local features well but need many layers or parameters to reach global context.
- Method Conformer puts a convolution module and multi-headed self-attention in one encoder block. It sandwiches them between two half-step feed-forward modules.
- Results On LibriSpeech test-clean and test-other, Conformer(L) reaches 2.1 and 4.3 without a language model. It beats earlier Transformer and CNN models.
Why pair convolution with self-attention
Recurrent networks were the default choice for ASR, but Transformers built on self-attention have become widely used for sequence modeling because they reach long-distance interactions and train efficiently. Convolutions have also worked for ASR, building context layer by layer through a local receptive field.
Transformers handle long-range context well, yet they extract fine-grained local feature patterns less effectively. CNNs capture local information through shared kernels over a local window, and they keep translation equivariance, but reaching global information requires many more layers or parameters. ContextNet adds a squeeze-and-excitation module to each residual block for longer context.
The authors argue that its global averaging over the whole sequence does not capture dynamic global context.
The authors aim to get both kinds of interaction from one block: self-attention supplies global, content-based interactions, and the convolution supplies local correlations that depend on relative offset. The convolution module sits between two feed-forward modules, following the sandwich idea of Macaron-Net.
Inside one Conformer block
The encoder starts with a convolution subsampling layer and then stacks Conformer blocks in place of Transformer blocks. Each block runs a feed-forward module, a multi-headed self-attention module, a convolution module and a second feed-forward module, in that order.
The paper gives the block update for an input x_i and output y_i as follows. \[ x^{\prime}_i = \tilde{x}_i + \mathrm{MHSA}(\tilde{x}_i) \] \[ x^{\prime\prime}_i = x^{\prime}_i + \mathrm{Conv}(x^{\prime}_i) \] In these terms, the first feed-forward output is scaled by one half before its residual addition, and the second feed-forward module is scaled by one half in the same way before the final layer normalization.
The multi-headed self-attention module uses the relative sinusoidal positional encoding from Transformer-XL, with pre-norm residual units and dropout. The authors argue that relative positional encoding lets the module generalize better across input lengths and makes the encoder more robust to utterance length. This argument is not tested by a length-based experiment in the reported text.
The convolution module starts with a pointwise convolution with an expansion factor of 2 and a GLU activation, which gates the channels. A single 1-D depthwise convolution follows, then Batchnorm and a Swish activation, and a final pointwise convolution with dropout closes the module.
The feed-forward module uses layer normalization before its first linear layer, an expansion factor of 4 in the first linear layer and a projection back to the model dimension in the second, with Swish and dropout between them.
Training and decoding setup
The models are trained and evaluated on LibriSpeech, which has 970 hours of labeled speech, and an additional 800M-word text corpus is used for the language model. The input is 80-channel filterbank features computed from a 25 ms window with a 10 ms stride. SpecAugment uses a mask parameter F = 27 and ten time masks, with a maximum time-mask ratio of pS = 0.05.
Three sizes, small, medium and large, come from sweeping network depth, model dimension and attention head count under parameter limits of 10M, 30M and 118M, and each uses a single-LSTM-layer decoder.
The Adam optimizer uses β1 = 0.9, β2 = 0.98 and ϵ = 10−9, with a transformer learning rate schedule of 10k warm-up steps and a peak learning rate of \( 0.05/\sqrt{d} \), where d is the model dimension of the Conformer encoder.
The external language model is a 3-layer LSTM of width 4096, trained on the LibriSpeech language model corpus with the LibriSpeech 960h transcripts added, and tokenized with a 1k WPM built from LibriSpeech 960h.
LibriSpeech results against published baselines
Depth, dimension and head count change together across these sizes, so the table does not isolate the effect of any one of them.
Without an external language model, Conformer(L) reaches 2.1 on test-clean and 4.3 on test-other, Conformer(M) reaches 2.3 and 5.0, and Conformer(S) reaches 2.7 and 6.3. With the external language model, Conformer(L) reaches 1.9 and 3.9, Conformer(M) reaches 2.0 and 4.3, and Conformer(S) reaches 2.1 and 5.0.
The baseline rows are taken as printed in the comparison table, so they are not controlled reruns under the Conformer setup.
With an external language model, the authors report a relative 15% improvement over the Transformer transducer on test-other. The authors read the comparison as showing that combining Transformer and convolution in one network is effective.
Conformer block against a Transformer block
The ablation moves a Conformer block toward a Transformer block while keeping the total parameter count unchanged, and the four changes are replacing Swish with ReLU, removing the convolution sub-block, replacing the Macaron-style pair with one feed-forward module, and replacing relative positional embedding with vanilla self-attention. These variants are evaluated without the external language model.
The full Conformer model reaches 1.9 and 4.4 on dev-clean and dev-other and 2.1 and 4.3 on test-clean and test-other. With ReLU in place of Swish, test-other becomes 4.5, and removing the convolution block raises it to 4.9. Replacing the Macaron-style pair with a single feed-forward module raises test-other to 5.0, and replacing relative positional embedding with vanilla self-attention raises it to 5.6.
The authors identify the convolution sub-block as the most important feature, and they report that Swish led to faster convergence in the Conformer models.
Two half-step feed-forward modules against one
The Conformer uses two feed-forward modules with half-step residual weights, and this ablation compares that setup with one feed-forward module and with full-step residuals.
The Conformer row reaches 1.9 and 4.4 on dev-clean and dev-other and 2.1 and 4.3 on test-clean and test-other. The single feed-forward variant reaches 1.9, 4.5, 2.1 and 4.5, and the full-step residual variant reaches 1.9, 4.5, 2.1 and 4.5. The single feed-forward value of 5.0 on test-other in the block ablation comes from a different table, so the two numbers are reported separately here and not combined.
Where the convolution module sits
Three alternatives are tested against the Conformer order: placing the convolution module before the multi-headed self-attention module, running the two in parallel branches with their outputs concatenated as in Wu et al., and replacing the depthwise convolution with a lightweight convolution. The authors found that the convolution module stacked after self-attention works best for speech recognition.
The Conformer reaches 1.9 and 4.4 on dev-clean and dev-other. Lightweight convolution reaches 2.0 and 4.8, the convolution block placed before the self-attention reaches 1.9 and 4.5, and the parallel design reaches 2.0 and 4.9. Placing the convolution before self-attention degrades dev-other by 0.1 relative to the Conformer order, and the paper reports no seed count or variance for these comparisons.
Attention head count
Each attention head can focus on different parts of the input, and the study varies the head count from 4 to 32 in the large model with the same count in every layer.
Dev-other falls from 4.6 with 4 heads to 4.3 with 16 heads and rises to 4.4 with 32 heads. On test-other, 8 heads give 4.3, 16 heads give 4.4 and 4 heads give 4.5, so the gain from more heads is clearest on dev-other. Table 1 lists 8 heads for the large model, which matches the 8-head row of the ablation.
Depthwise kernel size
The kernel size is swept over 3, 7, 17, 32 and 65 in the large model, with the same kernel size in every layer. The authors find that performance improves as the kernel grows up to 17 and 32 and worsens at 65, and on the second decimal of dev WER they find kernel size 32 best.
Kernel size 32 gives 1.83 and 4.30 on dev-clean and dev-other and 2.03 and 4.29 on test-clean and test-other. Kernel size 65 gives 1.89 and 4.47 on dev-clean and dev-other, and kernel size 3 gives 4.39 on test-other. Table 1 lists a kernel size of 32 for all three sizes.
Limitations
All reported experiments are speech recognition on LibriSpeech, so the paper does not test other tasks or corpora.
The ablations are evaluated without the external language model, and the head and kernel sweeps use the large model only.
The three sizes differ in depth, dimension and head count together, and the baseline rows are published numbers rather than controlled reruns.
The length-generalization benefit of relative positional encoding is argued by the authors, and its only measured test is the relative positional embedding row of the block ablation.
Paper info
- Authors
- Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, Ruoming Pang
- Venue
- arXiv · Preprint
- First published
- 2020-5-16
- Added
- 2026-11-12
- Updated
- 2020-5-16
- Version
- v1
- arXiv
- 2005.08100
- Category
- eess.AS · cs.LG · cs.SD
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, Ruoming Pang (2020). Conformer: Convolution-augmented Transformer for Speech Recognition. arXiv:2005.08100v1. https://arxiv.org/abs/2005.08100v1
BibTeX
@misc{gulati2020conformer,
title = {{Conformer: Convolution-augmented Transformer for Speech Recognition}},
author = {Anmol Gulati and James Qin and Chung-Cheng Chiu and Niki Parmar and Yu Zhang and Jiahui Yu and Wei Han and Shibo Wang and Zhengdong Zhang and Yonghui Wu and Ruoming Pang},
year = {2020},
eprint = {2005.08100},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2005.08100v1}
}