Skip to content

Sentence Transformer

A class of transformer models that produce fixed-length sentence embeddings optimised for semantic similarity and retrieval tasks.

Sentence transformers are a family of models, built on architectures like BERT, that are fine-tuned specifically to produce high-quality fixed-length embeddings for sentences and paragraphs. The original Sentence-BERT added a pooling step and a training method that makes semantically similar sentences land close together in vector space, which is exactly what semantic search needs.

This matters because a plain language model produces representations of individual tokens, not a single useful vector for a whole sentence. Sentence transformers solve that by learning to compress an entire passage into one embedding optimised for similarity comparison, so two sentences with the same meaning yield vectors with high cosine similarity.

The Sentence Transformers library has become the most widely used toolkit for generating text embeddings for vector databases, offering hundreds of pre-trained models for different needs — general retrieval, question answering, multilingual search, domain-specific tasks. Choosing among them involves balancing embedding quality against dimension, speed, and cost, and it is one of the first practical decisions in building a vector search system.