Skip to content

deps(deps): update sentence-transformers requirement from <5.3.0,>=5.2.0 to >=5.2.0,<5.4.0#58

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/pip/sentence-transformers-gte-5.2.0-and-lt-5.4.0
Open

deps(deps): update sentence-transformers requirement from <5.3.0,>=5.2.0 to >=5.2.0,<5.4.0#58
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/pip/sentence-transformers-gte-5.2.0-and-lt-5.4.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Mar 16, 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 @github
Copy link
Copy Markdown
Contributor Author

dependabot bot commented on behalf of github Mar 16, 2026

Labels

The following labels could not be found: dependencies, python. Please create them before Dependabot can add them to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

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.0...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 force-pushed the dependabot/pip/sentence-transformers-gte-5.2.0-and-lt-5.4.0 branch from 909e8ab to 2a6a309 Compare March 31, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants