Condenser
A Transformer pre-training architecture for dense retrieval whose LM prediction conditions on a dense representation.
Language · 371 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.
At a glance
- Task
- Language
- Parameters
- 123.7M
- Operations
- 371
- Framework
- PyTorch
- Recurrent
- No
- Published
- EMNLP 2021
- Cited by
- 167 (as of 24 October 2026)
- Authors
- Luyu Gao, Jamie Callan
- Source
- GitHub: luyug/Condenser
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
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.
Details
- Stable ID
- m15409
- Graph hash
- 1ffd94be5a1208b27e05376483d5e132659ca624103f4a91ddfcbc4bea936527
- Skeleton hash
- 6a42ab0f22e93bb0c2d4bc32a2551468326b2ffa0193cf36b8523a8080184e04
- Architecture hash
- 2e80f65cbc880e6e572c669a97835eb4dc05932e76675ccc42b6e2e426f78182
- Diagram SHA-256
- fdff9ea5daaed0861f36b04bfc8d62cc3e9e05bda940458489005d85a5f49d4e
- 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
Condenser is a Transformer architecture for pre-training the text encoders used in dense retrieval, where a sentence or passage is encoded into a single dense vector for comparison and retrieval. The paper starts from the observation that dense encoders need a lot of data and sophisticated techniques to train effectively, and suffer in low data situations. It finds a key reason in the internal attention structure of standard language models, which it says is not ready-to-use for aggregating text information into the dense representation.
The proposal is to pre-train toward a dense encoder with an architecture in which language model prediction conditions on the dense representation, the phrase the name is drawn from. The paper reports that Condenser improves over a standard language model by large margins on various text retrieval and similarity tasks.
In the released code, pre-training warm starts from BERT (bert-base-uncased), and the Condenser head is automatically omitted when a saved model is loaded for fine-tuning. The authors note that head weights are not necessary for fine-tuning but are critical for further pre-training, for example for domain transfer.
Key idea. Condenser is a Transformer pre-training architecture in which language model prediction conditions on the dense representation, preparing the encoder for dense retrieval.
- Condenser
- dense retrieval
- dense retrieval pre-training
- dense encoder
- text retrieval
- passage retrieval
- pre-training architecture
- Luyu/condenser
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{gao2021condenserpretrainingarchitecturedense,
title={Condenser: a Pre-training Architecture for Dense Retrieval},
author={Luyu Gao and Jamie Callan},
year={2021},
eprint={2104.08253},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2104.08253},
}