
Seq2Seq-Bahdanau-attention
Language240 ops80.5M params
A recurrent sequence model from early neural machine translation: LSTM or GRU, with or without attention.
Language · 203 operations Checked
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.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
This model is the global attention model of Luong et al., which considers all the hidden states of the encoder when deriving the context vector.
About this model's family
Sequence to sequence learning with recurrent networks starts from one idea: a multilayered LSTM maps the input sequence to a vector of a fixed dimensionality, and another deep LSTM decodes the target sequence from that vector. The second LSTM is essentially a recurrent neural network language model, except that it is conditioned on the input sequence. The Seq2Seq paper used deep LSTMs with 4 layers, 1000 cells at each layer and 1000 dimensional word embeddings. It also found that reversing the order of the words in all source sentences, but not target sentences, improved the LSTM's performance markedly.
Bahdanau et al. conjecture that the use of a fixed-length vector is a bottleneck in improving the performance of this basic encoder-decoder architecture. Their architecture, RNNsearch, consists of a bidirectional RNN as an encoder and a decoder that emulates searching through a source sentence during decoding a translation. The alignment model is a feedforward neural network trained jointly with all the other components.
Luong et al. examine two classes of attentional mechanism: a global approach which always attends to all source words and a local one that only looks at a subset of source words at a time. Their global attention uses the hidden states at the top LSTM layers in both the encoder and decoder. Their stacking LSTM models have 4 layers, each with 1000 cells, and 1000-dimensional embeddings.
Key idea. Sutskever et al. showed that a multilayered LSTM can map an input sequence to a fixed-dimensional vector that a second deep LSTM decodes into the target sequence.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{sutskever2014sequencesequencelearningneural,
title={Sequence to Sequence Learning with Neural Networks},
author={Ilya Sutskever and Oriol Vinyals and Quoc V. Le},
year={2014},
eprint={1409.3215},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/1409.3215},
}