← AI news

Pooling-aware training improves compressed retrieval in Hugging Face example

Brief by TrendCue AI · Dates refer to the original sources.

Hugging Face’s Tom Aarsen has published a Sentence Transformers example that trains multi-vector embedding models to retrieve documents after token pooling. In his NanoBEIR evaluation, the pooling-aware model retained more of its unpooled retrieval score than an ordinarily trained baseline at the same vector budget.

Training for compressed representations

Token pooling merges similar document vectors to reduce storage, but aggressive compression can remove distinctions needed for retrieval. Aarsen’s example combines a retrieval loss on full document embeddings with one on pooled embeddings. A straight-through estimator passes gradients through the pooling step without differentiating the discrete cluster assignments.

Hugging Face

Results and conditions

At pool_factor=4, mean NanoBEIR@13 nDCG@10 was 51.23 for the pooling-aware model and 49.03 for the ordinary model. Each retained 97.8% and 94.6%, respectively, of its own unpooled score. Both models started from answerdotai/ModernBERT-base and trained for one epoch on the same 120,000 MS MARCO triplets; Aarsen said he did not run a hyperparameter search.

Hugging Face

Code and earlier work

The post provides training and evaluation scripts and example checkpoints. It builds on Stefan Josef’s pooling-aware training work and a LightOn study that also examined targeted training and adaptive budgets. LightOn cautioned that its own results covered a subset of the smaller BEIR datasets.

Hugging Face · LightOn

Original sources

Original websites and X posts open in a new tab.

Community vote