Standard 8 stops to get here

Semantic Search

Search that matches on meaning rather than exact words, by turning queries and documents into embeddings and returning the documents whose vectors are closest.

Your route here

8 stops · basics first
  1. Dataset ✓ understood

    A collection of data examples used for training, validating, or testing machine learning models.

  2. Feature ✓ understood

    A single measurable property of an example, such as a house's floor area or how many links an email contains, used as an input to a model.

  3. Machine Learning ✓ understood

    Building systems that learn patterns from data instead of following hand-written rules, getting better at a task as they see more examples.

  4. Neural Network ✓ understood

    A model built from layers of simple units, each taking a weighted sum of its inputs and applying a nonlinearity; training adjusts the weights so the whole stack maps inputs to useful outputs.

  5. Deep Learning ✓ understood

    A subset of machine learning that uses neural networks with multiple layers (deep neural networks) to learn hierarchical representations of data.

  6. Representation Learning ✓ understood

    Letting a model learn its own internal description of the data, such as embeddings or layered visual features, instead of relying on features designed by hand.

  7. Embedding ✓ understood

    A list of numbers (a vector) that represents a word, sentence, image or other item, learned so that similar items end up close together.

  8. Semantic Similarity ✓ understood

    Measuring how similar two pieces of text are in meaning, often using embedding-based distance metrics.

  9. Semantic Search · you are here ✓ understood

Picture it

Keyword search

  • Matches the words in the query
  • Great for names, codes, exact phrases
  • Misses synonyms and rewording

Semantic search

  • Matches the meaning of the query
  • Finds "car" when you asked for "vehicle"
  • Can blur exact identifiers
They fail in opposite places, which is why many real systems run both and merge the results.

Semantic search finds documents by what they mean rather than which words they contain. Ask “how do I get my money back?” and it can surface a page titled “Refund policy”, even though the two share no keywords. It is the dense-vector branch of information retrieval, and the most common retrieval step in retrieval-augmented generation.

How it works

An embedding model turns each document, or each chunk of a long document, into an embedding: a vector positioned so that texts with similar meanings land close together. Those vectors are stored, usually in a vector database. At query time the query is embedded with the same model, and the system returns the documents whose vectors are nearest, typically by cosine similarity. Approximate nearest-neighbour indexes keep this fast across millions of vectors.

The embedding model does the real work. Sentence-BERT made this practical by training a BERT network to produce sentence vectors that can be compared directly with cosine similarity. That cut finding the most similar pair among 10,000 sentences from about 65 hours with BERT to about 5 seconds. Dense Passage Retrieval then showed that learned dense retrieval could beat the BM25 keyword baseline on open-domain question answering.

The catch

Meaning-matching has blind spots. The same DPR paper notes that keyword methods are better with highly selective terms, and embeddings can blur exact identifiers like product codes, error numbers or rare names. Semantic similarity also isn’t relevance: a passage can be on the right topic and still not answer the question. That’s why production systems often run semantic and keyword search together (“hybrid search”) and re-rank the combined results.

Where it sits

Semantic Search

Leads to

Nothing yet: a destination in its own right.

Explore nearby

Sources

  1. Nils Reimers and Iryna Gurevych, "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks" . EMNLP 2019
  2. Vladimir Karpukhin et al., "Dense Passage Retrieval for Open-Domain Question Answering" . EMNLP 2020