Skip to content

Bump sentence-transformers from 5.2.3 to 5.3.0#383

Merged
praveenkk123 merged 2 commits intomainfrom
dependabot/pip/sentence-transformers-5.3.0
Mar 30, 2026
Merged

Bump sentence-transformers from 5.2.3 to 5.3.0#383
praveenkk123 merged 2 commits intomainfrom
dependabot/pip/sentence-transformers-5.3.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Mar 23, 2026

Bumps sentence-transformers from 5.2.3 to 5.3.0.

Release notes

Sourced from sentence-transformers's releases.

v5.3.0 - Improved Contrastive Learning, New Losses, and Transformers v5 Compatibility

This minor version brings several improvements to contrastive learning: MultipleNegativesRankingLoss now supports alternative InfoNCE formulations (symmetric, GTE-style) and optional hardness weighting for harder negatives. Two new losses are introduced, GlobalOrthogonalRegularizationLoss for embedding space regularization and CachedSpladeLoss for memory-efficient SPLADE training. The release also adds a faster hashed batch sampler, fixes GroupByLabelBatchSampler for triplet losses, and ensures full compatibility with the latest Transformers v5 versions.

Install this version with

# Training + Inference
pip install sentence-transformers[train]==5.3.0
Inference only, use one of:
pip install sentence-transformers==5.3.0
pip install sentence-transformers[onnx-gpu]==5.3.0
pip install sentence-transformers[onnx]==5.3.0
pip install sentence-transformers[openvino]==5.3.0

Updated MultipleNegativesRankingLoss (a.k.a. InfoNCE)

MultipleNegativesRankingLoss received two major upgrades: support for alternative InfoNCE formulations from the literature, and optional hardness weighting to up-weight harder negatives.

Support other InfoNCE variants (#3607)

MultipleNegativesRankingLoss now supports several well-known contrastive loss variants from the literature through new directions and partition_mode parameters. Previously, this loss only supported the standard forward direction (query → doc). You can now configure which similarity interactions are included in the loss:

  • "query_to_doc" (default): For each query, its matched document should score higher than all other documents.
  • "doc_to_query": The symmetric reverse — for each document, its matched query should score higher than all other queries.
  • "query_to_query": For each query, all other queries should score lower than its matched document.
  • "doc_to_doc": For each document, all other documents should score lower than its matched query.

The partition_mode controls how scores are normalized: "joint" computes a single softmax over all directions, while "per_direction" computes a separate softmax per direction and averages the losses.

These combine to reproduce several loss formulations from the literature:

Standard InfoNCE (default, unchanged behavior):

loss = MultipleNegativesRankingLoss(model)
# equivalent to directions=("query_to_doc",), partition_mode="joint"

Symmetric InfoNCE (Günther et al. 2024) — adds the reverse direction so both queries and documents are trained to find their match:

loss = MultipleNegativesRankingLoss(
    model,
    directions=("query_to_doc", "doc_to_query"),
    partition_mode="per_direction",
)

GTE improved contrastive loss (Li et al. 2023) — adds same-type negatives (query <-> query, doc <-> doc) for a stronger training signal, especially useful with pairs-only data:

loss = MultipleNegativesRankingLoss(
</tr></table> 

... (truncated)

Commits
  • ce48ecc Merge branch 'main' into v5.3-release
  • cec08f8 Fix citation for EmbeddingGemma paper (#3687)
  • c29b3a6 Release v5.3.0
  • 55c13de Prep docs main page for v5.3.0 (#3686)
  • 72e75f7 [tests] Add slow reproduction tests for most common models (#3681)
  • 237e441 [fix] Fix model card generation with set_transform with new column names (#...
  • 7f180b4 [feat] Add hardness-weighted contrastive learning to losses (#3667)
  • 5890086 Disallow query_to_query/doc_to_doc with partition_mode="per_direction" due to...
  • 6518c36 CE trainer: Removed IterableDataset from train and eval dataset type hints (#...
  • 1e0e84c Add tips for adjusting batch size to improve processing speed (#3672)
  • Additional commits viewable in compare view

@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels Mar 23, 2026
Bumps [sentence-transformers](https://github.com/huggingface/sentence-transformers) from 5.2.3 to 5.3.0.
- [Release notes](https://github.com/huggingface/sentence-transformers/releases)
- [Commits](huggingface/sentence-transformers@v5.2.3...v5.3.0)

---
updated-dependencies:
- dependency-name: sentence-transformers
  dependency-version: 5.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/pip/sentence-transformers-5.3.0 branch from fda3b81 to 839b6bc Compare March 30, 2026 20:15
@praveenkk123 praveenkk123 merged commit 559fed9 into main Mar 30, 2026
2 of 3 checks passed
@praveenkk123 praveenkk123 deleted the dependabot/pip/sentence-transformers-5.3.0 branch March 30, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant