What is the difference between sparse and dense embeddings?
LLM Engineer Interview Questions: Embeddings, Vector Search, and Cosine Similarity Explained
Audio flashcard · 0:23Nortren·
What is the difference between sparse and dense embeddings?
0:23
Sparse embeddings, like those produced by BM25 or TF-IDF, have one dimension per vocabulary word and most values are zero. They capture exact word matches well. Dense embeddings have a few hundred to a few thousand dimensions, all nonzero, and capture semantic meaning rather than exact words. Dense embeddings handle paraphrasing and synonyms, while sparse embeddings handle precise terminology.
huggingface.co