MedCPT
AI for Evidence Utilization · Retrieve

MedCPT: Contrastive Pre-trained Transformers with Large-scale PubMed Search Logs

Qiao Jin, Won Kim, Qingyu Chen, Donald C. Comeau, Lana Yeganova, John Wilbur, Zhiyong Lu
Bioinformatics 2023
These slides were generated with the help of AI and may contain errors.
01Motivation

Matching terms, not their meaning

  • PubMed’s Best Match learns to rank from 100+ features — but none capture meaning.
  • Search “lead heart damage” — meaning the metal — and the top hits use “lead” as a verb instead.
PubMed Best Match for “lead heart damage”: the top hit matches “lead” as the
PubMed Best Match for “lead heart damage”: the top hit matches “lead” as the verb (“…cardiac damage may lead to…”), not the intended metal. Screenshot: PubMed.
02Workflow

MedCPT learns to retrieve and rerank from PubMed clicks

Training

Click supervision → retriever → reranker

PubMed click pairs

255M query–article pairs

Train the retriever

Contrastive learning
with in-batch negatives

Mine hard negatives

High-ranked alternatives
from the trained retriever

Train the reranker

18.3M filtered pairs
+ mined hard negatives

Search

The trained encoders retrieve, then rerank

Encode the query

Map the query to a vector

Retrieve candidates

Search stored article vectors
Articles encoded offline

Score each candidate

Read query + article jointly

Return ranked articles

Order by relevance score

Query + article encoders retrieve candidates; the cross-encoder reranks them. Simplified from Figures 1–2.
03Method

Three encoders: retrieve, then re-rank

  • MedCPT is a family of three contrastively pre-trained encoders.
  • A query encoder and an article encoder retrieve; a cross-encoder re-ranks the top hits.
MedCPT’s three encoders: a query (QEnc) and article (DEnc) encoder for retrieval, plus a cross
MedCPT’s three encoders: a query (QEnc) and article (DEnc) encoder for retrieval, plus a cross-encoder (CrossEnc) re-ranker. Fig. 1.
04Training details

Contrastive training on PubMed clicks

  • Retriever training uses 255M query–article pairs from PubMed search logs.
  • Contrastive learning pulls relevant pairs together in embedding space.
  • The cross-encoder re-ranker is then trained on hard negatives from the retriever.
Training: contrastive bi-encoders from clicks (A), then a cross-encoder on hard negatives (B).
Training: contrastive bi-encoders from clicks (A), then a cross-encoder on hard negatives (B). Fig. 2.
05Result

State-of-the-art zero-shot performance on BEIR

  • Evaluated zero-shot on the biomedical subtasks of BEIR.
  • MedCPT (330M) achieves the highest average across the five evaluated tasks.
MethodSizeTREC-COVIDNFCorpusBioASQSciFactSciDocsAvg.
Sparse retrievers
BM25–0.6560.3250.4650.6650.1580.454
BM25 + MiniLM66M0.7570.3500.5230.6880.1660.497
docT5query220M0.7130.3280.4310.6750.1620.462
Dense retrievers
Contriever + MiniLM176M0.7010.344–0.6920.171–
ColBERT110M0.6770.3050.4740.6710.1450.454
Large language model retrievers
Google GTR-XXL4.8B0.5010.3420.3240.6620.1610.398
OpenAI cpt-text-XL175B0.6490.407–0.754––
MedCPT (ours)
MedCPT (retriever only)220M0.6970.3400.3320.7240.1230.443
MedCPT330M0.7090.3550.5530.7610.1720.510
Selected methods; zero-shot nDCG@10. Avg. covers all five tasks; – = not reported. Source: Table 1.
06Result

The MedCPT document encoder outperforms every baseline on RELISH

  • RELISH scores how well a model finds articles related to a given paper.
  • MedCPT’s document encoder tops every baseline — including PubMed’s own PMRA related-articles algorithm.
MethodMAP@10NDCG@10Avg.
BM2586.7287.3987.21
PMRA87.5788.4088.40
BioSentVec88.1087.7688.29
PubMedBERT81.0782.3982.26
SciNCL92.7491.9192.52
MedCPT (DEnc)93.9993.1293.72
Article-similarity re-ranking on RELISH (%). MedCPT’s document encoder leads. Source: Table 2.
07Result

MedCPT leads on BIOSSES and ranks second on MedSTS

  • MedCPT’s embeddings capture sentence-level meaning, not just document relevance.
  • Its query encoder leads on BIOSSES; BioSentVec is slightly ahead on MedSTS.
ModelBIOSSESMedSTS
BioWordVec0.6940.747
BioSentVec (PubMed+MIMIC)0.7950.767
PubMedBERT0.5280.521
SPECTER0.6940.702
SciNCL0.8470.706
MedCPT (QEnc)0.8930.765
Pearson correlation with human sentence-similarity judgments (BIOSSES, MedSTS). Underlined values are best in each column; MedCPT ranks second on MedSTS. Source: Table 3.
08Impact

A widely used biomedical retriever

09Summary

MedCPT at a glance

BackgroundBiomedical search should match meaning, not just keywords.
ProblemLexical search (PubMed Best Match) misses semantically related papers.
ApproachQuery and article encoders retrieve; a cross-encoder reranks. Trained using PubMed click pairs.
ResultsLeading zero-shot biomedical retrieval; first on BIOSSES and second on MedSTS.
Impact10M+ downloads across the three encoders; powers NCBI LitSense 2.0; the most-used retriever in medical RAG.