Add `do_query_expansion: false` to load without query expansion

#3
by tomaarsen HF Staff - opened

Hello!

Heads up, this PR was AI-generated and human-reviewed.

Pull Request overview

  • Add "do_query_expansion": false to config_sentence_transformers.json, so the model loads without ColBERT-style [MASK] query expansion.

Details

When this model is loaded through PyLate or Sentence Transformers' MultiVectorEncoder, a ColBERT config with no explicit do_query_expansion flag defaults to query expansion being on. That pads every query out to query_length with [MASK] tokens. If the model was trained without query expansion, those never-trained expansion vectors dominate the MaxSim score for short queries and pull retrieval quality down.

Adding do_query_expansion: false restores the behavior the model was trained with. On the 13 NanoBEIR datasets (mean nDCG@10) this raises the mean score from 0.527 to 0.662.

The change is a single key in config_sentence_transformers.json, nothing else is touched. Happy to adjust the wording or approach if you had something else in mind.

  • Tom Aarsen
tomaarsen changed pull request status to open
DavidGF changed pull request status to merged

Sign up or log in to comment