All models

Seq2Seq-Bahdanau-attention

A recurrent sequence model from early neural machine translation: LSTM or GRU, with or without attention.

Language · 240 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (132 KB)

Open in a new tab

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.

At a glance

Parameters
80.5M
Operations
240
Framework
PyTorch
Recurrent
Yes
Published
NeurIPS 2014
Cited by
17,299 (as of 29 October 2026)
Authors
Ilya Sutskever, Oriol Vinyals, Quoc V. Le
License
BSD-3-Clause
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m2783
Graph hash
6406f9e8ff58d5989d039bc6f323c95c877b6fb916b1dd0b7ba8dc98411e3eb8
Skeleton hash
c7b3507c41a9bc7eb3e4ee553a14795841c0531f13859c910e212c1f75ae83f8
Architecture hash
d1cc1f1401b002ff9986d1dcd99cd5c5dfe5846f7d2ee4d559e26c47c41c6004
Diagram SHA-256
3abe3f7bd1879e8d995965db8ec4ae0c50a4f75088a8fc29953733f21f76d5a6
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model is RNNsearch, the attention model of Bahdanau et al.: its encoder consists of forward and backward recurrent neural networks each having 1000 hidden units, and its decoder has 1000 hidden units.

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.

  • Seq2Seq
  • sequence to sequence
  • LSTM language model
  • GRU language model
  • Bahdanau attention
  • Luong attention
  • RNNsearch
  • neural machine translation
  • RNN encoder-decoder
  • attention-based NMT

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@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}, 
}