Skip to main content
Back

Hugging Face Ships Sentence Transformers v6.0 Adding ColBERT-Style Retrieval

Sentence Transformers v6.0 adds a fourth model family for ColBERT-style late-interaction retrieval, unlocking token-level embeddings for text and visual documents.

Pro

  • Sentence Transformers v6.0 ships MultiVectorEncoder, a fourth model family for ColBERT-style late-interaction retrieval.
  • Existing ColBERT, PyLate, and ColPali models load out of the box with training support.
  • Covers both text retrieval and ColPali-style visual document retrieval without OCR.
  • Adds MaxSim scoring, XTR variants, hierarchical token pooling, and NanoBEIR evaluators.
  • Follows Sentence Transformers joining Hugging Face, with Tom Aarsen continuing as lead maintainer.
  • Softly breaking API renames land with deprecation warnings and a v5 to v6 migration guide.

The team behind Sentence Transformers has shipped v6.0, adding a new model family called MultiVectorEncoder that brings ColBERT-style late-interaction retrieval into the library as a first-class citizen. It's the fourth architecture in the lineup, covering token-level (multi-vector) embeddings for both text retrieval and ColPali-style visual document retrieval, alongside the existing dense bi-encoders, cross-encoder rerankers, and sparse encoders under one API.

The release lands right after the library changed hands. Sentence Transformers, the popular open-source library for generating sentence embeddings, has transitioned to Hugging Face, remaining community-driven and open-source while gaining Hugging Face's infrastructure. Tom Aarsen has been maintaining the project since late 2023 and will continue to lead it.

What late interaction actually means

Standard dense embeddings squash an entire passage into a single fixed-length vector, then compare vectors with cosine similarity. That is fast but throws away information. Late-interaction models like ColBERT keep one vector per token and score a query-document pair by matching each query token against its best-matching document token, then summing those scores. That operation is called MaxSim, and it typically beats single-vector retrieval on out-of-domain benchmarks at the cost of storage and memory.

Until v6.0, running ColBERT or ColPali meant reaching for separate libraries like PyLate or colpali-engine. Now, existing ColBERT, PyLate, and ColPali checkpoints load out of the box, with full training and evaluation support. The migration guide includes specific paths for users coming from those two ecosystems.

Inference in a few lines

The API mirrors the rest of the library, with one important twist: queries and documents are encoded asymmetrically because their token counts differ dramatically.

from sentence_transformers import MultiVectorEncoder
model = MultiVectorEncoder("lightonai/LateOn")
queries = ["What is the capital of France?"]
documents = [
    "Paris is the capital of France.",
    "Berlin is the capital of Germany.",
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
# Each entry is a 2D tensor of shape (num_tokens, embedding_dim)
print(query_embeddings[0].shape)  # torch.Size([10, 128])
scores = model.similarity(query_embeddings, document_embeddings)

Rather than a matrix of fixed-size vectors, encode_query and encode_document return lists of 2D tensors with variable token counts. Scoring happens through MaxSim under the hood.

Skipping OCR for visual documents

The more interesting piece is visual document retrieval. ColPali-style models treat a PDF page as a grid of image patches and match text query tokens against patch embeddings directly, skipping OCR entirely. A single page can produce hundreds of patch vectors while a query stays under 30 tokens, and MaxSim handles the asymmetry naturally. The same MultiVectorEncoder class loads vidore/colqwen2.5-v0.2 and other ColPali variants with no special handling.

What ships in the box

  • Scoring functions: ColBERT scoring, MeanMaxSim, XTRScores, and XTRKDScores are all built in.
  • Losses: MultiVectorMultipleNegativesRankingLoss, a cached variant for larger batches, MultiVectorDistillKLDivLoss for knowledge distillation, and MultiVectorMarginMSELoss.
  • Token pooling: HierarchicalTokenPooling and LambdaTokenPooling for reducing per-token vector counts when storage matters.
  • Evaluators: MultiVectorNanoBEIREvaluator, MultiVectorInformationRetrievalEvaluator, and reranking and distillation evaluators.
  • PEFT adapters and distributed training: LoRA-style finetuning and FSDP work the same as with bi-encoders.
  • Interpretability: heatmap tools show which document tokens or image patches matched which query tokens.

How this fits with the rest of the library

v6.0 is the fourth major architectural expansion in about a year. Aarsen took over maintainership in late 2023 and shipped modernized training for Sentence Transformer models in v3.0, followed by overhauls to Cross Encoder models in v4.0 and Sparse Encoder models in v5.0. The v5.0 release was the biggest jump yet, introducing sparse embedding models, encode-method improvements, and a Router module for asymmetric models that enables hybrid sparse-plus-dense search.

A single library now covers the four retrieval paradigms teams actually mix in production:

FamilyOutputBest for
SentenceTransformerOne dense vector per inputGeneral semantic search, clustering
CrossEncoderRelevance score for a pairReranking a shortlist
SparseEncoder (SPLADE)High-dim sparse vectorLexical + semantic hybrid search
MultiVectorEncoderOne vector per token/patchLate interaction, visual docs

Softly breaking changes

Existing v5 code keeps working, though the release notes flag a handful of renamed parameters and updated import paths. Trainer's tokenizer is now processing_class, tokenizer_kwargs becomes processor_kwargs, and CrossEncoder.max_length is now max_seq_length. Deprecation warnings will nudge you along rather than break builds outright, and a dedicated migration guide covers the v5.x to v6.x jump.

Why it matters

For anyone building retrieval systems, this consolidates a fragmented stack. Gluing together a bi-encoder library for first-stage retrieval, a cross-encoder for reranking, and a separate ColBERT or ColPali implementation for late interaction is no longer necessary; all four families now share the same trainer, evaluators, loss abstractions, and Hugging Face Hub plumbing. Over 16,000 Sentence Transformers models are publicly available on the Hub, serving more than a million monthly unique users, so pulling ColBERT and ColPali workflows into that ecosystem lowers the bar for teams that want to try late interaction on their own corpora, especially for PDF-heavy or scan-heavy domains where OCR pipelines have been the bottleneck.