Skip to content

fix(deps): update dependency sentence-transformers to v6 - #374

Open
dreadnode-renovate-bot[bot] wants to merge 1 commit into
mainfrom
renovate/sentence-transformers-6.x
Open

dreadnode-renovate-bot[bot] wants to merge 1 commit into
mainfrom
renovate/sentence-transformers-6.x

Conversation

@dreadnode-renovate-bot

@dreadnode-renovate-bot dreadnode-renovate-bot Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
sentence-transformers >=5.1.0,<6.0.0 → >=6.2.0,<6.3.0 age confidence

Release Notes

huggingface/sentence-transformers (sentence-transformers)

v6.2.0: - Model merging, faster loading, and distributed evaluation

Compare 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

# Inference only, use one of:
pip install sentence-transformers==6.2.0
pip install sentence-transformers[openvino]==6.2.0

# Multimodal dependencies (optional):
pip install sentence-transformers[image]==6.2.0
pip install sentence-transformers[audio]==6.2.0
pip install sentence-transformers[video]==6.2.0

# Training + Inference
pip install sentence-transformers[train]==6.2.0
pip install sentence-transformers[merge]==6.2.0

# Or combine as needed:
pip install sentence-transformers[train,image]==6.2.0

Model merging for all four model types (#​3776)

Combine compatible fine-tuned checkpoints without another training run using SentenceTransformer.merge, SparseEncoder.merge, CrossEncoder.merge, or MultiVectorEncoder.merge. The integration uses Arcee AI's mergekit and supports well over a dozen methods such as Linear, SLERP, TIES, and DARE.

Install the merge extra with pip install "sentence-transformers[merge]". For example, take a weighted average of two compatible MiniLM models:

from sentence_transformers import SentenceTransformer

models = [
    "sentence-transformers/all-MiniLM-L6-v2",
    "sentence-transformers/multi-qa-MiniLM-L6-cos-v1",
]

merged = SentenceTransformer.merge(
    models,
    method="linear",
    parameters={"weight": [0.6, 0.4]},
)
merged.save_pretrained("merged-MiniLM-L6")

embeddings = merged.encode(["Combining compatible model weights."])

Or interpolate between the same inputs with SLERP:

merged = SentenceTransformer.merge(
    models,
    method="slerp",
    parameters={"t": 0.5},
)

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:

Model Before After HTTP requests before / after
sentence-transformers-testing/stsb-bert-tiny-safetensors 5.78 s 2.26 s 34 / 8
sentence-transformers/all-MiniLM-L6-v2 6.39 s 2.66 s 35 / 9
sparse-encoder-testing/splade-bert-tiny-nq 5.77 s 2.25 s 34 / 8
cross-encoder/ms-marco-MiniLM-L6-v2 4.38 s 2.48 s 23 / 9

Constructor 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() and predict() 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(), and rank(), which use those inference methods internally.

Explicit device and pool arguments 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:

from sentence_transformers import CrossEncoder

model = CrossEncoder(
    "cross-encoder/ms-marco-MiniLM-L6-v2",
    device="cuda",
    model_kwargs={"dtype": "bfloat16"},
    keep_in_fp32_modules=["0.model.classifier"],
)

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)
  • BatchSemiHardTripletLoss uses quadratic intermediate memory instead of constructing cubic distance and mask tensors. It also corrects a gradient issue when selected negative distances tie (#​4026).
  • BatchAllTripletLoss removes 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)
  • HierarchicalTokenPooling accepts fractional pool_factor values for finer control over compression (#​3965) and can use optional fastcluster linkage for faster clustering (#​3941).
  • HierarchicalTokenPooling now normalizes output tokens by default, including protected tokens. Older saved configurations retain their previous behavior. Set normalize_embeddings=False on the pooling module to opt out (#​4008).
  • MaxSim scoring budgets score blocks using both query and document token counts, reducing memory use for long query batches. A single query-document pair can still exceed chunk_elements (#​4153).

Compatibility Notes

  • Python and Hub versions: Added Python 3.14 and huggingface_hub 2.x support, retaining Python 3.10 support and the Hub 1.3.0 minimum (#​4162, #​4003).
  • Scalar quantization: Inferring int8 or uint8 calibration ranges from a single vector now raises ValueError. Encode floats first, then call quantize_embeddings with representative calibration_embeddings or explicit ranges (#​4150).
  • Checkpoint paths: Module paths must be relative and cannot contain .. path components, even with trust_remote_code=True. Keep custom modules inside the checkpoint tree (#​4175).

Bug Fixes

Pooling precision and normalization
  • Improved FP16/BF16 mean and weighted-mean pooling arithmetic, corrected weighted positions under left padding, and fixed prompt exclusion in flattened CLS fallback selection (#​4106, #​4104, #​4159).
  • Corrected normalization of single sparse vectors and sparse matrices with non-default dtypes or low-precision values (#​4149, #​4045).
Multi-process inference
  • Worker exceptions are reported to the caller, and terminated workers are detected while polling for results (#​3920, #​4146).
  • Worker tensor outputs are moved to CPU before queueing, including tensors nested in lists and dictionaries. Hard-negative mining also stops its pool if mining fails (#​3971, #​4086).
Model placement and memory
  • Improved device handling for quantized models and models using Accelerate device maps or offloading, and reduced repeated placement work. Call clear_placement_cache() after changing dispatch hooks or adding modules following the first inference call (#​3986, #​4035).
  • Disabled Transformer KV caching by default when supported, reducing unnecessary inference memory use. Explicit use_cache overrides in config_kwargs remain honored (#​3992).
Cached and compiled training
  • Avoided redundant DDP synchronization during cached-loss replay (#​4039).
  • Corrected image slicing for cached training batches containing zero or multiple images per sample, including custom training loops (#​4157).
  • Fixed checkpoint restoration for compiled models, including best-checkpoint loading, and forwarded gradient-checkpointing options from newer Transformers versions (#​4130, #​4241).
CSR training
  • Preserved the 4k reconstruction path, corrected raw-space targets and auxiliary residual scaling for normalized autoencoders, and prevented inference from changing dead-feature statistics (#​4111, #​4117, #​3910).
  • Supported k_aux=0 and used ordinary MSE for zero-variance reconstruction batches (#​4017, #​4016).
Quantization, search, and mining
  • Reused scalar calibration ranges across ragged multi-vector embeddings, accepted BF16 inputs, and corrected FP16 range arithmetic (#​4025, #​4089, #​4113).
  • Corrected scalar-quantized candidate rescoring. Use the same corpus calibration ranges when searching reused indexes (#​4058).
  • Fixed binary USearch rescoring, padding when the corpus is smaller than top_k, and the metric used for approximate FAISS inner-product search (#​3948, #​3956, #​4022).
  • Sped up CPU cosine semantic_search by normalizing each corpus chunk once (#​4197).
  • Corrected paraphrase candidate capacity, deduplicated pairs before the max_pairs cap, and excluded self-matches before enforcing each sentence's top_k (#​3930, #​3979, #​4189).
  • Used the supplied CrossEncoder for hard-negative filtering when only min_score is set (#​4073).
Ranking losses and evaluators
  • Stabilized ListMLE/PListMLE normalization and long-list weights, and corrected one-based PListMLE positions (#​4012, #​4166, #​4051).
  • Preserved gradients for strongly misordered pairs through weighted log-sigmoid, returned differentiable zero when no label pairs are ordered, and retained LambdaLoss pairs crossing the top-k cutoff (#​4116, #​4032, #​4172).
  • Resolved model-derived IR scorers on each call and honored separate corpus models and cached embeddings in sparse IR evaluation (#​3976, #​4147).
  • Corrected binary thresholds for tied scores and treated string positives and negatives as whole documents in reranking evaluation (#​4023, #​4164).
Other fixes
  • Preserved SparseEncoder.max_active_dims and Router module sharing across saving and loading (#​4046, #​4180).
  • Fixed sampler epoch propagation, label grouping, and seed handling, and added bounded no-duplicate resampling. Extra passes can repeat samples or still fall short of the estimated batch count (#​4002, #​4013, #​4109, #​3946).
  • Preserved external ONNX weight files during export and upload, and accepted dictionary configurations for static OpenVINO quantization (#​3913, #​4219).

All Changes

[!IMPORTANT]
✂ PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

@dreadnode-renovate-bot

dreadnode-renovate-bot Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: uv.lock
Using CPython 3.13.17 interpreter at: /opt/containerbase/tools/python/3.13.17/bin/python3
error: No solution found when resolving dependencies for split (markers: python_full_version >= '3.12' and python_full_version < '3.14')
  cause: Because sentence-transformers>=6.2.0 depends on transformers>=5.0.0,<6.0.0 and dreadnode[all] depends on sentence-transformers>=6.2.0, we can conclude that dreadnode[all] depends on transformers>=5.0.0,<6.0.0.
         And because dreadnode[all] depends on transformers>=4.41.0,<5.0.0 and your project requires dreadnode[all], we can conclude that your project's requirements are unsatisfiable.

@dreadnode-renovate-bot dreadnode-renovate-bot Bot added area/python Changes to Python package configuration and dependencies type/digest Dependency digest updates labels Aug 19, 2026
@dreadnode-renovate-bot
dreadnode-renovate-bot Bot force-pushed the renovate/sentence-transformers-6.x branch from ecb95ca to 8afcff8 Compare September 2, 2026 00:29
@dreadnode-renovate-bot
dreadnode-renovate-bot Bot force-pushed the renovate/sentence-transformers-6.x branch from 8afcff8 to 7052c0a Compare September 20, 2026 00:31
@dreadnode-renovate-bot dreadnode-renovate-bot Bot changed the title fix(deps): update dependency sentence-transformers to v6 fix(deps): update dependency sentence-transformers to v6 - autoclosed Oct 4, 2026
@dreadnode-renovate-bot
dreadnode-renovate-bot Bot deleted the renovate/sentence-transformers-6.x branch October 4, 2026 01:09
@dreadnode-renovate-bot dreadnode-renovate-bot Bot changed the title fix(deps): update dependency sentence-transformers to v6 - autoclosed fix(deps): update dependency sentence-transformers to v6 Oct 7, 2026
@dreadnode-renovate-bot
dreadnode-renovate-bot Bot force-pushed the renovate/sentence-transformers-6.x branch 2 times, most recently from 7052c0a to 6ec1418 Compare October 7, 2026 00:31
| datasource | package               | from  | to    |
| ---------- | --------------------- | ----- | ----- |
| pypi       | sentence-transformers | 5.7.0 | 6.2.0 |
@dreadnode-renovate-bot
dreadnode-renovate-bot Bot force-pushed the renovate/sentence-transformers-6.x branch from 6ec1418 to d2c89cb Compare October 25, 2026 00:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/python Changes to Python package configuration and dependencies type/digest Dependency digest updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants