# Towards End-To-End Speech Recognition with Recurrent Neural Networks

End-to-end speech recognition works with a single recurrent network

Alex Graves, Navdeep Jaitly · International Conference on Machine Learning · 2014-6-18

- **Problem** Hybrid recognisers train frame-level targets that optimise a different score than the one measured. Better frame accuracy often gives little or worse transcription accuracy.
- **Method** The authors train a deep bidirectional LSTM with CTC on raw transcripts without phonetic targets. They then retrain it to minimise expected word error rate.
- **Results** With a trigram model, combining RNN-WER with the baseline scored 6.7 word error rate, against 7.8 for the baseline.

## Why frame-level training falls short

Hybrid recognisers train a network to classify single frames, then feed its outputs into an HMM as emission probabilities. That frame-level objective differs from sequence-level transcription accuracy, which is the measure the system is actually judged on. Researchers often see a large gain in frame accuracy bring only a negligible improvement, or even worse transcription accuracy.

Frame-level training targets also have to be inferred from the alignments that the HMM determines. This produces an awkward iterative loop, in which network retraining alternates with HMM re-alignments to generate more accurate targets. Full-sequence methods such as Maximum Mutual Information avoid frame targets by maximising the probability of the correct transcription.

That tuning is typically even heavier than the tuning deep neural networks already require.

The transcriptions are lexical, but the network targets are usually phonetic, so a pronunciation dictionary must map words to phoneme sequences. Graphemes and characters were tried for HMM recognisers to handle out-of-vocabulary words, but only to augment phonetic models.

The authors call separate language modelling the most justifiable departure from end-to-end learning, because linguistic dependencies are easier to learn from text. With tens of thousands of hours of labelled speech, they suggest the language model might instead be learned directly from the transcripts. The authors therefore aim to replace as much of the speech pipeline as possible with a single recurrent network.

## Replacing the pipeline with one recurrent network

The authors replace most of the speech pipeline with one network that reads spectrogram frames and emits characters. The network is a deep bidirectional LSTM trained with CTC directly on the text transcripts, so no phonetic representation, pronunciation dictionary or state tying is used. CTC integrates out over all possible input-output alignments, so the training targets never need a forced alignment to the audio.

The earlier frame-level setup needed the HMM to supply those alignments, which is the circular dependency this design avoids.

Spectrograms are the only preprocessing, computed from the raw audio with the matplotlib specgram function. Earlier work combined bidirectional LSTM with CTC for characters, but its relatively shallow architecture reached a best character error rate of almost 20%. Deep stacking lets each level build progressively higher-level representations of the acoustic data, and the network uses five levels of bidirectional LSTM with 500 cells each.

Each LSTM cell uses input, forget and output gates to steer its memory, and the input gate reads the current input, the previous output and the previous cell state. The input gate is computed as i\_t = σ(W\_xi x\_t + W\_hi h\_{t-1} + W\_ci c\_{t-1} + b\_i), following the version of LSTM from Gers et al. (2002). Since the whole utterance is available before decoding, a bidirectional layer runs forward and backward, so each output sees past and future context.

The forward and backward sequences feed the same output layer, which gives bidirectional LSTM its access to long-range context in both directions.

## How CTC scores a transcription

CTC turns per-frame outputs into a transcription probability by first treating each output vector as a distribution over labels and blank. The softmax normalises each output vector, so Pr(k,t\|x) gives the probability of emitting label k, or blank, at time t. Many alignments can describe the same label sequence, because labels can be separated by blanks in different ways.

The operator B removes repeated labels first and then the blanks, so an alignment such as (a,−,b,c,−,−) maps to (a,b,c). Repeats are removed too, so (a,b,b,b,c,c) also maps to (a,b,c), which lets the network emit a label across several frames. The probability of a transcription y is the sum of the probabilities of all alignments that B maps to y.

Summing over every place a label could occur is what lets the network train on unsegmented data, because the exact label positions never need to be known.

Training minimises the CTC objective, which is the negative log of the probability of the target transcription y\*. A dynamic programming algorithm evaluates and differentiates this sum, so the paper doesn't need to list every alignment. The CTC objective only rewards getting the whole transcription right, so all incorrect transcriptions count as equally bad.

Word error rate, by contrast, measures the edit distance between the true and the most probable word sequences, so it grades wrong outputs differently.

The authors want transcriptions with high WER to be less probable than those with low WER, which CTC alone doesn't capture. The next step therefore trains the RNN on the expected value of an arbitrary loss function over output transcriptions. That method keeps the same network structure and the same per-time-step label probabilities as CTC.

## Training toward word error rate

CTC raises the probability of the correct transcription only, so every wrong transcription counts as equally bad. The expected transcription loss averages an arbitrary loss function over the distribution that CTC defines over transcriptions.

The exact expectation is hard to compute in general, so the authors approximate both the loss and its gradient with Monte-Carlo sampling. Every sample a^i then provides a gradient estimate for every Pr(k,t\|x), by setting the label at time t to k and keeping the rest of the alignment. Because the outputs are independent, an unbiased sample from Pr(a\|x) converts to an unbiased sample from Pr(a\|x, a\_t=k).

Reusing the samples lets the loss noise largely cancel, so only the change caused by altering one label stays in the gradient. Passing these derivatives through the softmax gives each output an error term equal to the loss with the sampled label minus the expected loss at that step. The network therefore gets an error signal only where a changed label would change the loss.

Sampling is cheap, so the main cost is recalculating the loss for each alignment variant. For many loss functions, including word error rate, that recalculation can be limited to the part of the loss that the alignment change affects. The authors use five samples per sequence, which gave gradient estimates with low enough variance for effective training.

Word error rate needs an end-of-word label as a delimiter. A randomly initialised network gives almost entirely wrong alignments, so there is little chance that a single output change alters the loss. The authors therefore apply expected loss minimisation to a network already trained with CTC, rather than from the start.

## Decoding with a beam search

The simplest decoder picks the most probable output at every timestep and collapses the result with B. Beam search does better than this first approximation and also makes it possible to add a language model. CTC outputs act as transition probabilities, so the beam must track alignments ending in a blank separately from those ending in a label.

The blank activation is the probability of staying in the current state, while label activations are probabilities of moving into other states.

The beam keeps the W most probable partial transcriptions, and tracks blank and non-blank probabilities for each one. The extension probability of a prefix by a label multiplies the CTC emission probability by the transition probability Pr(k\|y). When the extended prefix is in the dictionary, Pr(k\|y) is set to 1, and otherwise it is set to 0.

This setting constrains the search to dictionary words, so the search only extends prefixes that form valid words.

For a statistical language model, the authors convert word-level transitions into label-level transition probabilities. Any label sequence is split into a complete-word prefix w and a remaining word prefix p, and the weights use the factor γ. The final length normalisation stops sequences with fewer transitions from being unfairly favoured.

The normalisation has little impact when no language model is used.

For the RNN experiments with a language model, they used N-best rescoring of up to 300 candidates from the baseline DNN-HMM instead. They didn't use beam search with the language model because of implementation difficulties and to match the baseline.

## Data, network and baseline setup

The RNN trains on two Wall Street Journal sets, the 14 hour train-si84 subset and the full 81 hour set. A development set, test-dev93, guides validation for both training sets. The targets are the characters of each transcript, 43 in total, including upper case letters, punctuation and a word-separating space. Spectrograms from matplotlib's specgram function form the inputs, using windows of width 254 and an overlap of 127 frames.

Each frame therefore yields 128 input values.

The network stacks five levels of bidirectional LSTM, with 500 cells in each layer and about 26.5M weights in total. Stochastic gradient descent updates the weights once per utterance, with a learning rate of 10−4 and momentum 0.9. The RNN is first trained with CTC on the characters, then retrained to minimise the expected word error rate.

That retraining draws five alignment samples per sequence.

The baseline is a DNN-HMM hybrid whose alignments come from an SGMM-HMM system built with Kaldi recipe s5, model tri4b. A Deep Belief Network with six hidden layers of 2000 units each, trained on the 14 hour subset, initialises the DNN. The DBN input is 15 frames of Mel-scale log filterbanks, with 40 coefficients, deltas and accelerations.

The context is one centre frame with ±7 frames on each side. Training starts at a learning rate of 0.1 with momentum 0.9, and the rate is halved after each epoch that fails to reduce frame error on the development set.

The RNN is first decoded with no dictionary, using the space character to split output characters into words and compute WER. A 146K word dictionary then supports monogram, bigram and trigram language models. That dictionary extends the default WSJ dictionary with 125K words. For language-model runs, the RNN rescores an N-best list of at most 300 candidates from the DNN-HMM, instead of running the beam search.

## Results without linguistic information

On the 81 hour set, RNN-CTC scores 30.1 word error rate and 9.2 character error rate with no language model. Retraining with expected word error rate lowers both scores, giving 27.3 and 8.4 for RNN-WER. So the extra training step pays off on this data, because the retrained network beats its CTC-only version on both measures. On the 14 hour set the two variants are close, with RNN-CTC at 74.2 and RNN-WER at 74.5.

The authors suggest the gap is small at this data size, so retraining shows little benefit there.

The text says the character-level RNN beats the baseline when no language model is present. Table 1 has no baseline score for that condition, since the BASELINE NONE row is empty, so the comparison can't be checked from the table. With a dictionary on the 81 hour set, RNN-WER scores 21.9 word error rate, compared to 24.0 for RNN-CTC. The authors attribute the RNN's strength to a more powerful acoustic model with more acoustic context.

They also credit an implicit language model learned from the training transcriptions for that strength.

The RNN's error rate falls sharply from 14 to 81 hours, while the baseline improves only incrementally. The authors suggest 14 hours of transcribed speech is too little for the network to learn how to spell. They argue that 14 hours is still enough for the network to learn to identify phonemes.

## Results with a language model and the combination

With a trigram language model on the 81 hour set, RNN-WER reaches a word error rate of 8.2, while the baseline reaches 7.8. The baseline therefore overtakes the RNN as the language model gets stronger. The authors suggest that the RNN's implicit language model may work against the explicit model in this case. At the trigram level, RNN-CTC scores 8.7, so retraining with word error rate still helps.

The gap between RNN-CTC and RNN-WER also narrows as the language model becomes more dominant. Even so, the difference stays small, given that the baseline already encodes audio pre-processing, a pronunciation dictionary, state tying and forced alignment.

Blending RNN-WER scores with the DNN acoustic model scores and reranking the candidates gives a word error rate of 6.7. The best combination used a language model weight of 11, an RNN weight of 1 and a DNN weight of 1. The combined model is more than 1% absolute better than the baseline, a larger gain than model averaging usually gives. The authors presume this comes from the greater difference between the two systems.

The N-best lists held at most 300 candidate transcriptions taken from the baseline DNN-HMM. On the 81 hour set, oracle error rates were 8.9% for monograms, 2% for bigrams and 1.4% for trigrams. Using N-best lists up to N=1000 did not give significant performance gains over the 300-candidate list.

## What the network gets right and wrong in spelling

Spelling is the hard part for this network, because it must turn sounds into letters rather than phonemes into words. The authors note that this is challenging in an orthographically irregular language like English. Its errors include phonetic slips such as 'shingle' for 'single', which the authors describe as the kind every speech system makes.

It also confuses homophones, such as 'two' and 'to', in the same way. Some errors combine both problems, such as 'alstrait' for 'illustrate'.

The network transcribes words such as 'campaign', 'analyst' and 'equity' correctly, and these words appear frequently in financial texts. The authors suggest it may learn these words as special cases rather than by spelling them out. Phonetic errors of this kind may be harder to fix with a language model, because words close in sound can be far apart in spelling.

The network struggles with both the sound and the spelling of unfamiliar words, especially proper names such as 'Milan' and 'Dukakis'. The example outputs show 'MULONG' for 'MILAN' and 'DEKAKIS' for 'DUKAKIS'.

The authors argue that the fact the network can spell at all shows it infers significant linguistic information from the training transcripts. The 14 hour results point the same way: the RNN error rate dropped dramatically from 14 to 81 hours. The baseline improved only incrementally over the same change in training data.

## Limitations of the method and the experiments

The experiments use only the Wall Street Journal corpus, and the authors didn't test spontaneous speech. The network makes lexical errors and struggles with proper names such as 'Milan' and 'Dukakis'. So out-of-vocabulary words may remain a problem for character-level recognition, even without a dictionary. The text says the RNN outperforms the baseline when no language model is present.

Table 1 has no baseline score in the NONE row, so that comparison isn't backed by a number.

Training with WER loss gives very sharp output decisions, so most output probabilities sit near 1. The vast majority of alignments drawn from a randomly initialised network give completely wrong transcriptions. The authors therefore recommend that expected loss minimisation retrains a network already trained with CTC, rather than starting from scratch.

The authors list integrating a language model into the CTC or expected transcription loss objectives as future work. They also list applying the system to spontaneous speech as a future direction. Gains from combining the RNN with the DNN baseline were measured only on the 81 hour set. The baseline improved only incrementally from 14 hours to 81 hours, while the RNN error rate dropped dramatically.

## Paper info

- **Authors**: Alex Graves, Navdeep Jaitly
- **Venue**: International Conference on Machine Learning · Published
- **First published**: 2014-6-18
- **Added**: 2026-11-12
- **Original paper terms**: [Check in the original ↗](https://proceedings.mlr.press/v32/graves14.html)
- **What we show**: Paper info and commentary

[Original paper ↗](https://proceedings.mlr.press/v32/graves14.html) · [PDF ↗](https://proceedings.mlr.press/v32/graves14.pdf)

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

Alex Graves, Navdeep Jaitly (2014). Towards End-To-End Speech Recognition with Recurrent Neural Networks. International Conference on Machine Learning. https://proceedings.mlr.press/v32/graves14.html

**BibTeX**

```
@article{graves2014towards,
  title = {{Towards End-To-End Speech Recognition with Recurrent Neural Networks}},
  author = {Alex Graves and Navdeep Jaitly},
  year = {2014},
  journal = {International Conference on Machine Learning},
  url = {https://proceedings.mlr.press/v32/graves14.html}
}
```

## Other paper commentary

- [Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition](https://refivu.com/en/papers/4809d645-7dd0-42ce-ba15-4c5208cfa877-speech-commands-a-dataset-for-limited-vocabulary-speech.md)
- [Attention-Based Models for Speech Recognition](https://refivu.com/en/papers/3c2117c0-4216-4c2d-8001-0377fd293004-attention-based-models-for-speech-recognition.md)
- [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)
- [Beyond Correlation Filters: Learning Continuous Convolution Operators for Visual Tracking](https://refivu.com/en/papers/cc3e5d8d-4cc2-494c-bc24-c9b0fd010736-beyond-correlation-filters-learning-continuous-convolution.md)
- [Representation Engineering: A Top-Down Approach to AI Transparency](https://refivu.com/en/papers/f6b6fa1e-01cf-4bad-a9dc-8b83f1107927-representation-engineering-a-top-down-approach-to-ai.md)
- [ZOO: Zeroth Order Optimization based Black-box Attacks to Deep Neural Networks without Training Substitute Models](https://refivu.com/en/papers/5b5ce3e2-3dd3-4814-b5fc-ab7233717cda-zoo-zeroth-order-optimization-based-black-box-attacks.md)
- [3D Semantic Segmentation with Submanifold Sparse Convolutional Networks](https://refivu.com/en/papers/03d04653-f014-489b-8502-00fe22ca0646-3d-semantic-segmentation-with-submanifold-sparse.md)
- [ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools](https://refivu.com/en/papers/9637d904-3e6d-4047-bd71-6ae5b68f90d8-chatglm-a-family-of-large-language-models-from.md)
- [Text Classification Algorithms: A Survey](https://refivu.com/en/papers/5134d426-2cd3-4691-aeff-cf1fc4cb8d39-text-classification-algorithms-a-survey.md)

## Terms in this paper

- [LSTM](https://refivu.com/en/terms/ba10547646d9-lstm)
- [recurrent neural network](https://refivu.com/en/terms/7df8352fc823-recurrent-neural-network)
- [CTC](https://refivu.com/en/terms/45fa7736b849-ctc)
- [language model](https://refivu.com/en/terms/ebf13a974a16-language-model)
- [bidirectional LSTM](https://refivu.com/en/terms/d29b8fa18f91-bidirectional-lstm)
- [BRNN](https://refivu.com/en/terms/622aa8cf424d-brnn)
- [spectrograms](https://refivu.com/en/terms/3a870d770507-spectrograms)
- [deep bidirectional LSTM](https://refivu.com/en/terms/eb1c0f59b285-deep-bidirectional-lstm)
- [N-best list](https://refivu.com/en/terms/a452f3344993-n-best-list)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/3e89c73b-6188-44bf-baa5-5eb422d67ae5-towards-end-to-end-speech-recognition-with-recurrent)
