# Attention-Based Models for Speech Recognition

Location-aware attention lets sequence models recognize long speech utterances

Jan Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, Yoshua Bengio · arXiv · 2015-6-24

- **Problem** Attention-based models that worked for machine translation reach 18.7% phoneme error on short TIMIT utterances but fail on inputs longer than the training ones. The model appears to track absolute position, which does not scale to longer inputs.
- **Method** Location-aware attention adds previous-alignment features and smoother normalization.
- **Results** The location-aware model reaches 18.0% test phoneme error with convolutional features and 17.6% with Smooth Focus on TIMIT. It also decodes concatenations of up to 11 test utterances.

## Why long speech inputs break a content-only attention model

Speech recognition is framed here as generating a phoneme sequence from a feature sequence that is far longer than the word sequences used in machine translation, with thousands of frames in place of dozens of words. Repeated frames of similar sounds then have to be told apart within a single utterance, which content alone cannot always do.

The starting point is a model adapted from machine translation, which reaches 18.7% PER on the TIMIT core test set and is therefore competitive on short utterances. When the same model decodes concatenated utterances, its error climbs quickly, which points to a shortcut that works only for lengths seen in training. The authors read this as the model learning to track the absolute position of the content it is recognizing, a strategy that cannot scale to longer inputs.

## Adding location information to the attention score

At every decoding step the attention scores each encoder element from the generator state and the element's content, then normalizes the scores with a softmax over all positions. In the content-only baseline the score is \\( e\_{i,j} = w^\\top \\tanh(W s\_{i-1} + V h\_j + b) \\), so frames with similar content receive the same score wherever they sit in the sequence.

The location-aware variant convolves the previous alignment \\( \\alpha\_{i-1} \\) with a matrix \\( F \\) of size \\( k \\times r \\), giving a vector \\( f\_{i,j} \\) for each position \\( j \\). In the experiments \\( k = 10 \\) and \\( r = 201 \\) were used, and the filters are trainable. These vectors enter the score as \\( e\_{i,j} = w^\\top \\tanh(W s\_{i-1} + V h\_j + U f\_{i,j} + b) \\), so the learned function decides how the content term and the location term are combined.

Because the convolved previous alignment shows where the model looked one step earlier, the score can favour frames near that focus while the content term still picks the matching frame. Unlike the shift distribution used in neural Turing machines, this combination is not fixed in advance and is trained with the rest of the model.

## Sharpening and smoothing the attention normalization

Softmax normalization spreads weight over all frames when the input is long, so the glimpse picks up noise from many irrelevant frames. The same normalization also tends to put almost all weight on a single frame, which blocks the model from pooling several well-scored frames.

Sharpening multiplies the scores by an inverse temperature \\( \\beta \> 1 \\) before the softmax, \\( a\_{i,j} = \\exp(\\beta e\_{i,j}) / \\sum\_{j=1}^{L} \\exp(\\beta e\_{i,j}) \\), or keeps only the top-scoring frames and renormalizes them. Windowing restricts scoring to frames \\( h\_{p\_i-w}, \\ldots, h\_{p\_i+w-1} \\), where \\( p\_i \\) is the median of the previous alignment and \\( w \\ll L \\), so the cost drops from \\( O(LT) \\) to \\( O(L+T) \\).

Smooth Focus replaces the exponential in the softmax with the bounded logistic sigmoid, giving \\( a\_{i,j} = \\sigma(e\_{i,j}) / \\sum\_{j=1}^{L} \\sigma(e\_{i,j}) \\). The authors aim for this to let several top-scored frames contribute to the glimpse, which smooths the focus instead of concentrating it. Selecting only the highest-scoring frame helped long utterances but hurt the short-utterance development set, which motivated the smoother normalization.

## Phoneme recognition results on TIMIT

Models were trained on the standard 462 speaker training set with the SA utterances removed, used the 50 speaker development set for early stopping and were tested on the 24 speaker core test set. Each frame carries 123 features, and the encoder is a 3-layer BiRNN with 256 GRU units in each direction, with the top-layer activations forming the 512 dimensional representation.

The baseline reaches 15.9% PER on development and 18.7% on test. Adding convolutional features gives 16.1% on development and 18.0% on test, a 3.7% relative improvement on test over the baseline. Adding Smooth Focus to the convolutional-feature model gives 15.8% on development and 17.6% on test, and the relative gain on test over the convolutional-feature model is 5.9% in the paper's own accounting.

The cited RNN Transducer reports 17.7% on test, and the HMM over Time and Frequency Convolutional Net reports 13.9% on development and 16.7% on test; these come from prior work and were not run in the authors' setup. Decoding uses a left-to-right beam search that starts with a width of 10 and widens to 40 only when the network fails to emit the end-of-sequence token.

Beam widths from 1 to 100 were compared, and the models, especially with Smooth Focus, perform well even at width 1.

## Forced alignment and decoding of long utterances

Long test inputs were built either by repeating one test utterance or by concatenating randomly chosen utterances, with 0.05 s of silence inserted between them, up to 15 utterances in total. An alignment counts as correct when 90% of its weight falls inside the ground-truth phone window extended by 20 frames on each side.

The baseline correctly aligned sequences up to about 120 phones for a repeated utterance and up to about 150 phones for concatenated different utterances, and even when it failed it still aligned about 50 phones. The location-aware model with convolutional features aligned sequences up to about 200 phones long, but after it began to fail it aligned almost no phones, and the smoothing variant behaved similarly.

The location-aware model stops selecting particular frames for each phone when it fails, which the authors attribute to the noisy glimpse problem. The location-aware model does somewhat better on repeated copies of one utterance than on concatenations of different utterances, consistent with the idea that misaligned irrelevant frames weaken the correct ones.

Sharpening had little effect on the baseline but helped the location-aware network find proper alignments, and windowing helped both networks, with the location-aware network aligning nearly all sequences. When decoding long utterances with these sharpening schemes, the baseline still fails even with a narrow window, whereas the two location-aware networks decode concatenations of up to 11 test utterances.

A wider window gave better results than a narrow one, and both location-aware and baseline networks reached about 20% PER on the long utterances in the wide-window setting.

## Limitations

The experiments cover phoneme recognition on TIMIT only, and the authors expect the model to be applied to direct text recognition with a monolingual language model as future work. Sharpening by top-frame selection hurt the short-utterance development set, so the sharpening schemes are applied at evaluation only in the reported experiments.

Long-utterance datasets were built from at most 15 concatenated utterances, and decoding was reported for up to 11 concatenated test utterances. The location-aware model's alignment fails almost completely beyond about 200 phones, so the length range tested ends there.

## Attention compared with CTC and RNN Transducer

CTC and RNN Transducer treat the alignment as a latent variable and perform MAP inference over it, while the attention mechanism aligns input and output deterministically. Because the alignment is deterministic, beam search can be simpler, and a much smaller beam width suffices, which speeds up decoding. Unlike CTC and RNN Transducer, the attention alignment is not constrained to be monotonic, which the authors see as a route to tasks beyond speech recognition.

## Paper info

- **Authors**: Jan Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, Yoshua Bengio
- **Venue**: arXiv · Preprint
- **First published**: 2015-6-24
- **Added**: 2026-11-12
- **Updated**: 2015-6-24
- **Version**: v1
- **arXiv**: 1506.07503
- **Category**: cs.CL · cs.LG · cs.NE · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1506.07503v1) · [PDF ↗](https://arxiv.org/pdf/1506.07503v1)

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

Jan Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, Yoshua Bengio (2015). Attention-Based Models for Speech Recognition. arXiv:1506.07503v1. https://arxiv.org/abs/1506.07503v1

**BibTeX**

```
@misc{chorowski2015attention,
  title = {{Attention-Based Models for Speech Recognition}},
  author = {Jan Chorowski and Dzmitry Bahdanau and Dmitriy Serdyuk and Kyunghyun Cho and Yoshua Bengio},
  year = {2015},
  eprint = {1506.07503},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1506.07503v1}
}
```

## Other paper commentary

- [Tacotron: Towards End-to-End Speech Synthesis](https://refivu.com/en/papers/6c1ac20e-aefe-488b-af41-213ae484f317-tacotron-towards-end-to-end-speech-synthesis.md)
- [Deep Speech 2: End-to-End Speech Recognition in English and Mandarin](https://refivu.com/en/papers/a706b06b-386b-46f0-b3bc-637c9d25b331-deep-speech-2-end-to-end-speech-recognition.md)
- [Deep Speech: Scaling up end-to-end speech recognition](https://refivu.com/en/papers/ace0f457-6253-437c-903d-54b5979d9074-deep-speech-scaling-up-end-to-end-speech.md)
- [VoxCeleb: a large-scale speaker identification dataset](https://refivu.com/en/papers/4f6bddda-2d26-4b56-93a3-d11745f2af0d-voxceleb-a-large-scale-speaker-identification-dataset.md)
- [Conformer: Convolution-augmented Transformer for Speech Recognition](https://refivu.com/en/papers/ca253d3a-da87-4fd6-a1f7-53fed7bcc781-conformer-convolution-augmented-transformer-for-speech.md)
- [Learning Problem-agnostic Speech Representations from Multiple Self-supervised Tasks](https://refivu.com/en/papers/a1a919cd-efff-487c-86c6-982c7afc65eb-learning-problem-agnostic-speech-representations-from.md)
- [A Comprehensive Survey of Graph Embedding: Problems, Techniques and Applications](https://refivu.com/en/papers/ec23e11b-6984-4611-aa20-93a65865b536-a-comprehensive-survey-of-graph-embedding-problems.md)
- [Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware](https://refivu.com/en/papers/8d8af879-da03-4506-b5c4-b0f829b285cf-learning-fine-grained-bimanual-manipulation-with-low-cost.md)
- [ResNeSt: Split-Attention Networks](https://refivu.com/en/papers/7bce75cd-ce67-4d10-8c3b-89c0b6a895bd-resnest-split-attention-networks.md)
- [Deep Learning for Image Super-resolution: A Survey](https://refivu.com/en/papers/32a6ff3a-537c-439a-86c3-7db381a355bd-deep-learning-for-image-super-resolution-a-survey.md)
- [NIPS 2016 Tutorial: Generative Adversarial Networks](https://refivu.com/en/papers/3bddac01-a39c-4985-8cda-7d40f3279d07-nips-2016-tutorial-generative-adversarial-networks.md)
- [PaLM 2 Technical Report](https://refivu.com/en/papers/9930c339-e7c2-4330-9ea3-867aad7f3368-palm-2-technical-report.md)

## Terms in this paper

- [beam search](https://refivu.com/en/terms/3e449f8f713b-beam-search)
- [attention mechanism](https://refivu.com/en/terms/977ee0201459-attention-mechanism)
- [TIMIT](https://refivu.com/en/terms/c71be04999c4-timit)
- [CTC](https://refivu.com/en/terms/45fa7736b849-ctc)
- [sharpening](https://refivu.com/en/terms/408e83eb058e-sharpening)
- [alignment](https://refivu.com/en/terms/03481008b426-alignment)
- [baseline model](https://refivu.com/en/terms/c86edbf4762a-baseline-model)
- [glimpse](https://refivu.com/en/terms/38868ea21e41-glimpse)
- [RNN transducer](https://refivu.com/en/terms/7076b2c6828b-rnn-transducer)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/3c2117c0-4216-4c2d-8001-0377fd293004-attention-based-models-for-speech-recognition)
