All models

Embedded Topic Model

A topic model that places words and topics in one embedding space and infers topic mixtures with a neural network.

Language · 26 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 (30 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
21.2M
Operations
26
Framework
PyTorch
Recurrent
No
Published
Transactions of the Association for Computational Linguistics (TACL) 2020
Cited by
798 (as of 24 October 2026)
Authors
Adji B. Dieng, Francisco J. R. Ruiz, David M. Blei
License
MIT
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
m16427
Graph hash
f6c286c3a4d8f5200db049b2009a3398c8c0f232aef7b422df26dfed90d976f1
Skeleton hash
bf64b9888028d339205239aa41bd73f0b3135a67ab5497ef6282b5f6de27adae
Architecture hash
3996f235574c765ee143630dae664f54ab961d62527eadb00560bd5cb2056e46
Diagram SHA-256
b0a4359aff1151278a977bea3bc86390189e7981a75ca402328b239e30b7d313
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 embedded topic model (ETM) is a model of documents that joins a traditional topic model, which finds the themes running through a collection of texts, with word embeddings. It was built to address a weakness the paper attributes to latent Dirichlet allocation (LDA): it fails with large vocabularies, so practitioners must prune their vocabularies heavily to get good topics.

In the ETM each word is an embedding and each topic is a point in the same space, and a topic's distribution over words is proportional to the exponentiated inner product of the two. The topic mixture of a document is produced by an inference network, a neural network that reads the document and outputs the mean and variance of a Gaussian. Its input is the bag-of-words of the document normalized by the number of words. The authors replaced the usual Dirichlet prior with a logistic normal so that reparameterization is easier to use. The word embeddings can be fitted beforehand or learned together with the topics, and the example command in the official repository trains 50 topics with learned embeddings on 20NewsGroup.

The paper reports that, among the models with interpretable topics it compared, the ETM gave the best predictions. It also reports that the ETM is robust to stop words left in the vocabulary, unlike most common topic models.

Key idea. The ETM represents words and topics as vectors in one embedding space, so each topic's word distribution comes from inner products and stays interpretable with large vocabularies.

  • Embedded Topic Model
  • ETM
  • topic modeling in embedding spaces
  • topic model
  • topic embeddings
  • word embeddings
  • neural topic model
  • document model
  • variational topic model

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

Cite the paper

@misc{dieng2019topicmodelingembeddingspaces,
      title={Topic Modeling in Embedding Spaces}, 
      author={Adji B. Dieng and Francisco J. R. Ruiz and David M. Blei},
      year={2019},
      eprint={1907.04907},
      archivePrefix={arXiv},
      primaryClass={cs.IR},
      url={https://arxiv.org/abs/1907.04907}, 
}