Sentence Transformers v5.7.0 Fixes Silent Gradient Bugs, Boosts Training 3.9x

tomaarsen · x · 2026-08-06

Sentence Transformers v5.7.0 focuses on correctness and performance. It rebuilds all gradient-cached losses on a shared superclass, fixing silent gradient bugs like reranker variants replaying different dropout masks during the backward pass.

The update introduces token-based mini-batch packing for cached losses. Combined with Flash Attention on the Natural Questions dataset, training is 3.9x faster without quality loss. It also fixes model.compile() silently becoming a no-op during inference, achieving 3x faster batch-size-1 inference with CUDA graphs.

Related event: Sentence Transformers v5.7.0 Fixes Gradient Bugs and Boosts Speed(3 posts)→

Original post →

More from coding & agent

coding & agent channel →