All models

MemoryNetwork

A question-answering network that reads a memory of sentences through several attention hops before answering.

Language · 41 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 (6 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
18.2K
Operations
41
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2015
Cited by
1,345 (as of 29 October 2026)
Authors
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, Rob Fergus
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
m1754
Graph hash
6dd3384b9bb5e0a0d1e0baf1a8c09547e58da3fe2dd3d738067510577ffcad60
Skeleton hash
16c67462c4d6673c7103cecddfc901bbb709286eefd78246326edc80045b011c
Architecture hash
a104d984614829cd516bd24ea2fc8caa7aada6c5250c24d5c315b2834ebedf15
Diagram SHA-256
fb5684a10ae4079c1d044b14287c10ad6373d715943eee6a8476034445b66cfe
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

The End-To-End Memory Network (MemN2N) is a neural network with a recurrent attention model over a possibly large external memory. It is a form of Memory Network, but unlike the earlier model it is trained end-to-end and so requires significantly less supervision during training.

The model takes a set of inputs to be stored in the memory and a query, and outputs an answer. Inputs and query are embedded as vectors, and the match between the query state and each memory is an inner product followed by a softmax. The memory's response is a sum of output vectors weighted by the resulting probabilities, and because this function is smooth, gradients can be backpropagated through it.

Memory layers are stacked to give multiple hops: the input to each layer above the first is the sum of the output and the input from the layer below. Unless otherwise stated, the paper's experiments used a model with K = 3 hops. The paper applies the model to synthetic question answering and to language modeling, and reports that multiple computational hops yield improved results in both cases.

Key idea. The paper built a Memory Network trained end-to-end, with a recurrent attention model that performs multiple computational hops over an external memory per output symbol.

  • End-To-End Memory Network
  • MemN2N
  • MemoryNetwork
  • memory network
  • bAbI question answering
  • question answering
  • multi-hop attention
  • external memory

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

Cite the paper

@misc{sukhbaatar2015endtoendmemorynetworks,
      title={End-To-End Memory Networks}, 
      author={Sainbayar Sukhbaatar and Arthur Szlam and Jason Weston and Rob Fergus},
      year={2015},
      eprint={1503.08895},
      archivePrefix={arXiv},
      primaryClass={cs.NE},
      url={https://arxiv.org/abs/1503.08895}, 
}