Skip to content

Update sentence-transformers requirement from ~=5.2.3 to ~=5.3.0#286

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/pip/sentence-transformers-approx-eq-5.3.0
Open

Update sentence-transformers requirement from ~=5.2.3 to ~=5.3.0#286
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/pip/sentence-transformers-approx-eq-5.3.0

Conversation

@dependabot
Copy link
Contributor

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

Updates the requirements on sentence-transformers to permit the latest version.

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 will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [sentence-transformers](https://github.com/huggingface/sentence-transformers) to permit the latest version.
- [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
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the type/Dependencies Pull requests that update a dependency file label Mar 13, 2026
@dependabot dependabot bot requested a review from DefinetlyNotAI as a code owner March 13, 2026 05:29
@dependabot dependabot bot added the type/Dependencies Pull requests that update a dependency file label Mar 13, 2026
@pull-request-size pull-request-size bot added the size/XS Extra Small size pr label Mar 13, 2026
@github-actions
Copy link

Hi! Thanks for contributing for the first time to Logicytics 🤗 We hope it goes as smoothly as possible and appreciate your valuable contribution.

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

Labels

size/XS Extra Small size pr type/Dependencies Pull requests that update a dependency file

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

0 participants