All models

COIL

BERT-based retriever that scores exact query-document token matches with contextualized vectors plus a CLS match.

Language · 646 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 (38 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
110.1M
Operations
646
Framework
PyTorch
Recurrent
No
Published
NAACL 2021
Cited by
189 (as of 30 October 2026)
Authors
Luyu Gao, Zhuyun Dai, Jamie Callan
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 diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m15154
Graph hash
e6b4ad4a134a4f7153a29162e59f1ad3a06faa54b81f5755822c11fe31a518dd
Skeleton hash
f9c86132318f41765984e6eeb09e47fd0dbad9c26665d704627c0af752fb4cb5
Architecture hash
fb727064cbcb8d7657b8772355d5ac5e31e6de86f3bb9b3f388d9035f723a7d9
Diagram SHA-256
2cc2908d238d00da1cc68527e6d6f8dce7357977d3f3b38eeb042459ce835459
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

COIL (COntextualized Inverted List) is a text retrieval model that keeps the exact term matching of classical search systems such as BM25 but scores each matched term with vectors from a deep language model instead of term frequency. The paper asks how much retrieval gains when contextualized representations are brought back into exact lexical matching.

Each token's language-model output is projected down to a small vector, on the hypothesis that low-dimensional token vectors suffice. For every query token that also appears in the document, the model compares the query token's vector with the vectors of its occurrences in the document and keeps the highest similarity. Because exact matching ignores related words with different surface forms, the model also projects the CLS vector of the query and of the document and adds their similarity to the score. The paper calls the version with CLS matching COIL-full and the version without it COIL-tok.

Document vectors are computed offline and grouped by token into inverted lists, so a query only looks up the lists of its own tokens. The paper's default setting uses 32-dimensional token vectors and a 768-dimensional CLS vector, which it reports as 110M parameters. On the MSMARCO passage collection, the paper reports an MRR of 0.34 for COIL-tok against 0.18 for BM25. It also reports that all of its COIL systems had lower latency than ColBERT.

Key idea. COIL stores contextualized token vectors in inverted lists so that retrieval keeps the efficiency of exact lexical match while scoring matches with deep language model representations.

  • COIL
  • Contextualized Inverted List
  • contextualized exact lexical match
  • COIL-full
  • COIL-tok
  • passage retrieval
  • information retrieval
  • inverted list
  • MSMARCO

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

Cite the paper

@misc{gao2021coilrevisitexactlexical,
      title={COIL: Revisit Exact Lexical Match in Information Retrieval with Contextualized Inverted List}, 
      author={Luyu Gao and Zhuyun Dai and Jamie Callan},
      year={2021},
      eprint={2104.07186},
      archivePrefix={arXiv},
      primaryClass={cs.IR},
      url={https://arxiv.org/abs/2104.07186}, 
}