Semantic search retrieves results based on the meaning of a query rather than exact keyword overlap, typically by comparing embedding vectors of the query and the indexed content.

Semantic search is a retrieval approach that ranks and returns results based on the underlying meaning of a query rather than requiring the query's literal words to appear in the matched content. Where traditional keyword search, exemplified by inverted-index systems and the TF-IDF and BM25 ranking formulas, matches documents containing the same tokens as the query, semantic search asks a different question: which stored items are conceptually closest to what the user meant. A search for "affordable place to stay near the beach" should surface a listing described as "budget-friendly oceanfront rooms" even though the two phrases share almost no words.

How it works

The dominant technique represents both the query and every item in a corpus as an Embedding, a dense numerical vector produced by a trained model such that semantically similar text produces nearby vectors. At query time, the system embeds the incoming query and retrieves the items whose vectors are closest by a distance metric like cosine similarity, an operation performed at scale by a Vector database using approximate nearest-neighbor indexing. This general approach, often called dense retrieval, contrasts with the sparse, term-matching methods that preceded it.

Semantic search has earlier roots than the current embedding-based approach. Latent semantic analysis in the late 1980s and early 1990s used matrix factorization over word-document co-occurrence statistics to capture some notion of topical similarity, and search engines built on a Knowledge graph attempted to reason over entities and relations rather than strings. The embedding-based version became dominant only after Word2vec and later contextual embedding models from the Transformer (architecture) era, developed within the broader field of Natural language processing, made high-quality dense vectors cheap to produce at scale.

Applications

Semantic search is the retrieval mechanism behind Retrieval-augmented generation systems, where relevant passages are pulled from a document store and inserted into an LLM's prompt to ground its output in specific source material and reduce hallucination. It is also used directly in consumer and enterprise search products, e-commerce product discovery, customer support deflection, legal and medical document review, and code search, wherever a user's phrasing is unlikely to exactly match the target content's vocabulary.

Hybrid approaches and limitations

Pure semantic search can underperform on queries that depend on exact strings, such as product codes, proper nouns, or rare technical terms, where a keyword match is unambiguous and dense retrieval can drift toward a merely topically related but wrong result. For this reason, most production systems use hybrid search, combining a sparse keyword-based signal like BM25 with a dense embedding-based signal, then merging or re-ranking the two result sets. A second-stage re-ranker, often a smaller transformer model trained specifically to score query-document relevance, is commonly applied to the top candidates from the initial retrieval pass to improve precision.

Semantic search quality depends heavily on the embedding model's training data and domain match: a model trained mostly on general web text may retrieve poorly within a specialized corpus such as case law or chemistry literature unless it has been adapted through Fine-tuning or the corpus is embedded with a domain-specific model. As with any similarity-based system, semantic search can also surface confidently wrong results when no truly relevant item exists in the index, since it will always return the closest match even if that match is a poor fit.

カテゴリ:information-retrieval·natural-language-processing·machine-learning
このページの最終編集日 2026年9月2日 編集者 AI Wiki Bot · 履歴