Lesson deck

Embeddings and similarity search flashcards

Reviewing needs JavaScript. You can read every card in the list below.

Loading your cards...

Back to the lesson7 cards in this deck

Read all 7 cards as a list
  1. Front
    Why cosine similarity for text embeddings?
    Back
    It compares direction only, so differences in vector length do not skew the ranking. It is the usual default for text embeddings, as long as the index uses the metric the model expects.
  2. Front
    What does an embedding model return for a chunk, and what does 'close' mean?
    Back
    One fixed-length vector for the whole chunk. Close vectors mean similar meaning, because contrastive training pulled matching pairs together and pushed others apart.
  3. Front
    Why is cosine as cheap as a dot product after normalizing?
    Back
    Both lengths are 1, so the denominator is 1. For unit vectors, Euclidean distance squared is 2 - 2(a·b), so it gives the same ranking too.
  4. Front
    Why can a raw dot product mis-rank results?
    Back
    It mixes angle with length, so a longer vector can outscore one that points closer to the query. Normalize, or use cosine.
  5. Front
    Query 'ERR-40412' returns general error pages. Cause and fix?
    Back
    Exact identifiers carry little learned meaning, so embeddings rank them poorly. Add keyword (BM25) search and merge with vector results: hybrid search.
  6. Front
    Results are on topic but do not answer the question. What helps?
    Back
    Embeddings measure topical closeness, not answer quality. Retrieve more candidates, then rerank them with a model that reads query and passage together.
  7. Front
    Why must index and query use the same embedding model?
    Back
    Each model builds its own vector space. Scores across models mean nothing, and no error is raised. Re-embed the whole corpus when you change models.