Repository navigation
fix(deps): update dependency sentence-transformers to v6 - #374
Open
dreadnode-renovate-bot[bot] wants to merge 1 commit into
Open
dreadnode-renovate-bot[bot] wants to merge 1 commit into
dreadnode-renovate-bot[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
dreadnode-renovate-bot
Bot
force-pushed
the
renovate/sentence-transformers-6.x
branch
from
September 2, 2026 00:29
ecb95ca to
8afcff8
Compare
dreadnode-renovate-bot
Bot
force-pushed
the
renovate/sentence-transformers-6.x
branch
from
September 20, 2026 00:31
8afcff8 to
7052c0a
Compare
dreadnode-renovate-bot
Bot
deleted the
renovate/sentence-transformers-6.x
branch
October 4, 2026 01:09
dreadnode-renovate-bot
Bot
force-pushed
the
renovate/sentence-transformers-6.x
branch
2 times, most recently
from
October 7, 2026 00:31
7052c0a to
6ec1418
Compare
dreadnode-renovate-bot
Bot
force-pushed
the
renovate/sentence-transformers-6.x
branch
from
October 25, 2026 00:29
6ec1418 to
d2c89cb
Compare
dreadnode-renovate-bot
Bot
force-pushed
the
renovate/sentence-transformers-6.x
branch
3 times, most recently
from
November 15, 2026 00:21
aa76785 to
dd906a4
Compare
| datasource | package | from | to | | ---------- | --------------------- | ----- | ----- | | pypi | sentence-transformers | 5.7.0 | 6.3.0 |
dreadnode-renovate-bot
Bot
force-pushed
the
renovate/sentence-transformers-6.x
branch
from
November 18, 2026 00:21
dd906a4 to
353b0c0
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
>=5.1.0,<6.0.0→>=6.3.0,<6.4.0Release Notes
huggingface/sentence-transformers (sentence-transformers)
v6.3.0: - Token-pooling-aware training andkernelssupportCompare Source
Train multi-vector models for smaller document representations with token-pooling-aware and Matryoshka training. This release also adds optional kernels for MaxSim, Ward clustering, and transformer backbones, native AWS Neuron inference, faster utilities, and fixes across encoding, training, and evaluation.
Install with:
Token-pooling-aware training (#4286)
Train for fewer document embeddings
Token pooling for multi-vector models merges similar document token embeddings to reduce the embeddings stored and scored during retrieval. With
MultiVectorTokenPoolingLoss, you can now train the encoder for this compression so its document embeddings retain more useful information after pooling.Wrap a retrieval loss with the pooling configurations you intend to deploy:
Pass
losstoMultiVectorEncoderTrainerto train on the average of the unpooled and factor-4 retrieval losses. Because both variants reuse the same encoder embeddings, training adds clustering and scoring work without another encoder pass.A matched experiment compared two ModernBERT-base models with fresh 128-dimensional projections, trained on the same 120,000 MS MARCO triplets with seed 42:
Factor-4 pooling reduces the average document representation from 193.22 to 48.68 embeddings, while the pooling-aware model retains 97.8% of its unpooled score.
To compress documents with the trained example model, pass a pooler to
encode_documentor set the runtime default withMultiVectorEncoder(..., token_pooling=...). By default, pooling leaves query embeddings unchanged:See the blogpost for the method and experiments, and the training guide for complete scripts. (#4286)
Adaptive token budgets
Choose one of three
HierarchicalTokenPoolingcontrols to match the document budget you want to deploy:pool_factor=4max_tokens=16distance_threshold=...For an adaptive budget, calibrate a threshold from representative document embeddings so the pooler targets an average count while allocating vectors according to each document's content:
The threshold targets an average on the calibration sample, so individual documents can receive more or fewer vectors and another corpus can have a different average. If the sample already fits the budget, calibration returns
Noneand no pooling is needed.These controls also work without pooling-aware training, so you can try compression on an existing model and evaluate it by passing the poolers to multi-vector evaluators.
Matryoshka training for multi-vector models
MultiVectorMatryoshkaLosstrains a model to retain retrieval quality when token embeddings are truncated. Wrap your retrieval loss with the dimensions you want to support:After training, use the shorter vectors by passing
truncate_dim=64to bothencode_queryandencode_document, or set that width as the model constructor default.In a separate matched experiment with 30,000 MS MARCO triplets, Matryoshka training preserves more retrieval quality at 64 dimensions, measured by mean nDCG@10 (%) across 13 NanoBEIR datasets:
Using 64 dimensions halves vector storage at unchanged precision, with retention measured against each model's own 128-dimensional score.
To train for fewer vectors and shorter dimensions together, wrap
MultiVectorMatryoshkaLosswithMultiVectorTokenPoolingLossso pooling happens before truncation. See the Matryoshka guide for complete training and evaluation scripts.Optional kernels for MaxSim, token pooling, and transformer backbones (#4344)
With
use_kernels=True, all four model types can use compatible Hub kernels to accelerate operations in their transformer backbones. For multi-vector models, the same setting also enables kernels for MaxSim and MeanMaxSim scoring, as well as the Ward clustering used in token pooling:Install the optional dependencies with
pip install "sentence-transformers[kernels]"before enabling kernels. The default multi-vector providers target CUDA and require Triton for MaxSim acceleration, falling back to reference implementations when a compatible device or provider build is unavailable.In the Ward benchmark, the kernel reduces pooling time from 7.00 seconds with fastcluster to 1.02 seconds, about 6.9x faster, for 5,000 SciFact titles and abstracts. Including encoding, the improvement is smaller: 23.14 to 18.91 seconds, an 18% reduction with mLateOn, BF16, batch size 32, factor 2, and an RTX 3090.
Kernels are opt-in runtime settings, so enable them again when reloading a saved model. For finer control, pass a Transformers
KernelConfigto choose providers separately for the backbone, scoring, and pooling operations, as described in the kernel guide. (#4344)Native AWS Neuron inference (#4293)
After installing TorchNeuron in a supported AWS environment, set
device="neuron"to run dense, cross-encoder, and multi-vector inference through the existing torch backend:For multi-process encoding, load the model on CPU in a fresh parent process so workers can use separate Neuron cores. See the PR for setup and device-allocation details.
Smaller Features
Compatibility Notes
similarity_fcttocolbert_scoresfor ranking losses,colbert_scores_pairwisefor margin MSE, orcolbert_kd_scoresfor KL distillation. (#4344)activation_checkpointing_enable,activation_checkpointing, andactivation_checkpointing_kwargsacross supported Transformers versions, or keep the legacy gradient-checkpointing names in existing scripts. (#4328)truncate_dimis saved with the model, buttoken_poolingis a runtime default, so supply the pooler again after reload. (#4286)normalize_embeddingsretain their unnormalized behavior to preserve compatibility with existing embeddings. (#4286)Bug Fixes
Evaluation and ranking metrics
Encoding and low-precision models
pathlib.Pathmodel paths in SentenceTransformer. (#4326)Training
device. (#4350)Hard-negative mining and retrieval examples
All Changes
chore] Increment the dev version by @tomaarsen in #4245fix] flaky rendezvous in distributed tests by @eSVeeF in #4266callbackafter each epoch in CrossEncoder.fit() by @tanishqbaweja in #4294kernelssupport for MaxSim, and Ward clustering, and transformers backbones by @tomaarsen in #4344New Contributors
Full Changelog: huggingface/sentence-transformers@v6.2.0...v6.3.0
v6.2.0: - Model merging, faster loading, and distributed evaluationCompare Source
This release adds model merging for all four model types, reduces redundant Hub requests when loading models, and distributes evaluator inference across DDP ranks. It also includes lower-memory training losses, more flexible multi-vector compression, and fixes throughout inference, training, and evaluation.
Install this version with
Model merging for all four model types (#3776)
Combine compatible fine-tuned checkpoints without another training run using
SentenceTransformer.merge,SparseEncoder.merge,CrossEncoder.merge, orMultiVectorEncoder.merge. The integration uses Arcee AI's mergekit and supports well over a dozen methods such as Linear, SLERP, TIES, and DARE.Install the
mergeextra withpip install "sentence-transformers[merge]". For example, take a weighted average of two compatible MiniLM models:Or interpolate between the same inputs with SLERP:
The method returns a model that can be used, trained, and saved normally. Configuration, prompts, and processors come from the first input. Inputs must have compatible architectures, module configurations, and tokenizers. Merging uses FP32 on CPU by default and holds the inputs and result in memory.
See the merging guides for Sentence Transformers, Cross Encoders, Sparse Encoders (plus an example evaluation!), and Multi-Vector Encoders. Be sure to evaluate the merged model on your own tasks, since combining checkpoints can improve some tasks while regressing others.
Faster Hub model loading (#3890)
Combined with
huggingface_hub>=1.26.0, model loading now resolves the requested branch or tag to a commit once and reuses that result across component downloads, reducing repeated Hub requests. Older Hub versions retain the previous loading behavior.The loading benchmarks in #3890 measured constructor time in fresh processes with a warm cache and online Hub access. Values are medians of seven alternating runs per configuration:
sentence-transformers-testing/stsb-bert-tiny-safetensorssentence-transformers/all-MiniLM-L6-v2sparse-encoder-testing/splade-bert-tiny-nqcross-encoder/ms-marco-MiniLM-L6-v2Constructor time fell by 43 to 61 percent in these workloads. Loading models from local directories is unchanged and unaffected by this improvement.
Distributed evaluator inference during DDP training (#4004)
During DDP training, evaluators now share their
encode()andpredict()work across the existing training processes for all four model types, with each rank processing a shard of the inputs. Rank zero combines predictions in their original order, computes metrics over the full dataset, and writes evaluation output once. Metrics are then broadcast to every rank for checkpoint selection and early stopping.This now happens automatically when using an evaluator through the trainer. It also covers
encode_query(),encode_document(), andrank(), which use those inference methods internally.Explicit
deviceandpoolarguments retain their usual behavior, and calls with arguments that cannot be serialized fall back to rank zero. Predictions are gathered through CPU memory, so the speedup depends on inference cost and communication overhead. Evaluator support for FSDP and DeepSpeed is unchanged.Smaller Features
Experimental FP32 layers for CrossEncoders (#4230)
CrossEncoders can compute selected linear layers in FP32 to reduce BF16 score ties while keeping a reduced-precision backbone:
This uses the exact
model.named_modules()paths. The selection is saved with the model, works under autocast during training and inference, and leaves stored parameter dtypes unchanged. In my experiments, this doesn't improve NDCG@10, but solely helps reduce ties caused by the low BF16/FP16 output precision.Lower memory training losses (#4026, #4029, #4030)
BatchSemiHardTripletLossuses quadratic intermediate memory instead of constructing cubic distance and mask tensors. It also corrects a gradient issue when selected negative distances tie (#4026).BatchAllTripletLossremoves invalid anchor-positive pairs before constructing triplets. Memory is quadratic for paired labels, though large label groups can still require cubic storage (#4029).CoSENTLoss,AnglELoss, and their sparse counterparts use sorted suffix reductions with linear intermediate storage. MPS execution requires PyTorch 2.9 or newer (#4030).Multi-vector compression and scoring (#3965, #3941, #4008, #4153)
HierarchicalTokenPoolingaccepts fractionalpool_factorvalues for finer control over compression (#3965) and can use optionalfastclusterlinkage for faster clustering (#3941).HierarchicalTokenPoolingnow normalizes output tokens by default, including protected tokens. Older saved configurations retain their previous behavior. Setnormalize_embeddings=Falseon the pooling module to opt out (#4008).chunk_elements(#4153).Compatibility Notes
huggingface_hub2.x support, retaining Python 3.10 support and the Hub 1.3.0 minimum (#4162, #4003).int8oruint8calibration ranges from a single vector now raisesValueError. Encode floats first, then callquantize_embeddingswith representativecalibration_embeddingsor explicitranges(#4150)...path components, even withtrust_remote_code=True. Keep custom modules inside the checkpoint tree (#4175).Bug Fixes
Pooling precision and normalization
Multi-process inference
Model placement and memory
clear_placement_cache()after changing dispatch hooks or adding modules following the first inference call (#3986, #4035).use_cacheoverrides inconfig_kwargsremain honored ([#3992](https://redirect.github.com/huggingface/sentence-tConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.