TL;DR
Listen, Attend and Spell (LAS) is a neural network that turns a recording of speech into text one character at a time. It has two parts: a listener that compresses the audio into a shorter sequence of features, and a speller that uses attention to look back at those features while it writes. Both parts are trained together from audio and transcripts alone. On a subset of Google voice search, LAS reached a word error rate of 14.1% without a dictionary or language model, and 10.3% after rescoring with a language model.
Builds on: Attention Mechanism, Encoder-Decoder Architecture, Bidirectional Recurrent Neural Network, Long Short-Term Memory · Leads to: attention-based end-to-end speech recognition
Why it mattered
Before this work, speech recognizers were built from parts. An acoustic model, a pronunciation dictionary and a language model were each trained separately and then glued together, usually with an Hidden Markov Model tying them. The end-to-end attempts of the time, such as connectionist temporal classification (CTC), trained a single network but assumed that each output was independent of the others.
LAS showed that a single attention-based encoder-decoder could be trained directly from audio to characters and be competitive with the best hybrid system of its day. Its design, in which an attention-based decoder writes characters while looking back over encoded audio, became a template for later end-to-end speech recognizers. The paper also established two practical tricks that people reused: compressing the time axis of the audio before attention, and training the decoder partly on its own predictions.
The problem
Speech is a long input. A few seconds of audio can be hundreds or thousands of frames, while the transcript is a few dozen characters. An encoder-decoder must squeeze that long input into something the decoder can use, and the authors found that a plain stacked recurrent listener converged so slowly that after a month of training its error was still well above the final result. Attention over a very long sequence is also expensive and hard to focus.
The second problem is the mismatch between training and use. During training the decoder is fed the correct previous character, but during decoding it is fed its own guesses, and one early mistake can corrupt everything after it. The third problem is the independence assumption in CTC, which the authors wanted to avoid: the model should be able to choose among spellings such as "triple a" and "aaa" for the same sound.
How it works
Here is one tiny trace through the pipeline. The numbers are illustrative, chosen to make the steps easy to follow; they are not from the paper.
- The input is a sequence of 40-dimensional log-mel filter bank features, one vector every 10 milliseconds. Take a short utterance of 16 frames.
- The listener's bottom layer is a bidirectional LSTM that reads all 16 frames and produces 16 feature vectors, one per frame.
- The first pyramid layer runs a bidirectional LSTM over the features but concatenates each pair of neighbouring outputs before passing them up. Sixteen frames become eight.
- Two more pyramid layers each halve the length again: eight becomes four, and four becomes two. The listener now holds two high-level vectors in place of sixteen frames, a reduction by a factor of .
- The speller starts with the start-of-sentence token. At each output step its decoder state asks the listener's vectors "which parts matter for the next character?". A Softmax over scores turns this into weights that sum to one.
- The context vector is the weighted sum of the listener vectors. The decoder combines its state and the context to give a probability for each character. The most likely character is written.
- The chosen character is fed back to the decoder, and steps 5 and 6 repeat until the end-of-sentence token. During training, the correct character is fed back most of the time, and a sampled character is fed back 10% of the time.
- At test time, a beam of 32 partial transcripts is kept at each step. If a language model is used, complete transcripts are rescored by a combination of their probability and the language model's probability.
flowchart LR A[Filter bank frames] --> B[BLSTM bottom layer] B --> C[Pyramid layer 1: half the frames] C --> D[Pyramid layers 2 and 3: half again each] D --> E[Listener features h] E --> F[Attention weights alpha] G[Decoder state] --> F F --> H[Context c] H --> I[Character distribution] G --> I I --> J[Next character] J --> G
The math
The chain rule writes the probability of a transcript given audio as a product of next-character probabilities:
Here means all the characters before position . No independence is assumed between characters, which is the difference from CTC.
Step 2 in symbols: the listener
The listener turns the input into with . The pyramid layer at time reads two neighbouring outputs from the layer below:
Each pyramid layer halves , so three layers give .
Step 5 in symbols: attention
For decoder state and each listener vector , the energy is a dot product of two learned transforms, , where and are small networks. A softmax gives the weights, and the context is their weighted sum:
Each decoder step costs about dot products, so the attention step over a whole transcript of characters costs about . Halving halves that cost.
Step 7 in symbols: training with sampled inputs
The plain training objective maximises , where is the correct transcript. The paper's variant feeds the decoder a sampled character with probability 0.1, and otherwise the true one, so the training inputs look more like the model's own outputs.
Step 8 in symbols: rescoring
Each complete hypothesis is scored by
where is the number of characters, which corrects the model's small bias towards short utterances, and is the language model weight. The paper used .
Worked examples
Take a 16-frame input and a 10-character output.
- Without pyramid layers, the attention sees frames. Its cost is about dot products.
- With three pyramid layers, goes , so .
- The attention cost becomes about dot products.
- The ratio is , which matches the reduction factor .
The listener made the attention eight times cheaper, and gave it fewer places to search.
The decoder scores four listener vectors with energies . The listener vectors are the scalars , to keep the arithmetic visible.
- Exponentiate each energy: , , , .
- Sum them: .
- Divide each by the sum to get the weights: . Check: they add to 1.000, up to rounding.
- Weight the listener vectors: , , , .
- Add the four products: .
- The context is about 16.57. The largest weight, , sits on the vector , which keeps the blend low, while the weight on pulls it up. A plain average of the four vectors would be , so the weights clearly favour the first vector.
Attention is a soft lookup: the answer is a blend, and the blend is sharp when one energy is much larger than the rest.
These numbers are made up to show the arithmetic of rescoring; they are not results from the paper. Suppose the beam holds two complete hypotheses for one utterance, with .
- Hypothesis A has , 20 characters, and language model log probability .
- Its acoustic part is .
- Its language model part is .
- Its score is .
- Hypothesis B has , 30 characters, and language model log probability .
- Its acoustic part is .
- Its language model part is .
- Its score is , which is higher than A's , so B is chosen.
Normalising by length is what lets the longer and more complete transcript win here, even though its raw acoustic log probability is higher than A's.
Try it: Hypothesis C has , 10 characters, and language model log probability . Compare C with B. Answer: C scores , which is lower than B's , so B is still chosen.
Results
The main results are on a subset of Google voice search with about 3 million utterances (about 2000 hours), with data augmentation adding noise and reverberation, and test sets of 22K utterances for clean speech and a noisy copy of it. Word error rate (WER) is the measure, lower is better.
| Model | Clean WER | Noisy WER |
|---|---|---|
| CLDNN-HMM (previous state of the art) | 8.0 | 8.9 |
| LAS | 16.2 | 19.0 |
| LAS + LM rescoring | 12.6 | 14.7 |
| LAS + sampling | 14.1 | 16.5 |
| LAS + sampling + LM rescoring | 10.3 | 12.0 |
What these numbers mean: LAS with sampling and language model rescoring is 2.3 points behind the hybrid baseline on clean speech (10.3 against 8.0) and 3.1 points behind on noisy speech (12.0 against 8.9), so it did not beat it. The sampling trick reduced the clean error from 16.2% to 14.1%. The beam width mattered up to 16 and gave little beyond that. The authors also found that errors are concentrated in very short and very long utterances, and that rare words are recognised less well than common ones. The paper names its own gaps: it did not use convolutional filters, which the authors suspect would help, and the baseline was unidirectional, so a bidirectional baseline might be stronger. Without a language model, the gap is much larger (16.2 against 8.0 on clean speech), so the language model does much of the work of closing it.
Reading guide
- Abstract and Introduction (sections 1). Read with CTC and HMMs in mind, so the claim of removing independence assumptions is clear.
- Related Work (section 2). This is the Encoder-Decoder Architecture and Attention Mechanism story in speech terms. Sequence to Sequence Learning with Neural Networks introduced the basic sequence-to-sequence encoder-decoder for translation.
- Model, Listen (section 3.1). Needs Bidirectional Recurrent Neural Network and Long Short-Term Memory. The pyramid step is the one new idea here.
- Model, Attend and Spell (section 3.2). Needs Attention Mechanism, Softmax and the decoder view of a Language Model.
- Learning (section 3.3). Needs Scheduled Sampling for the sampled-input trick.
- Decoding and rescoring (section 3.4). Needs Beam Search and the idea of combining two scores by a weight.
- Experiments and Results (section 4). Needs Automatic Speech Recognition for what WER measures. The attention plots in section 4.1 are the best place to see alignment in practice.