GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #4
A Generative AI Engineer is deciding between using LSH (Locality Sensitive Hashing) and HNSW (Hierarchical Navigable Small World) for indexing their vector database. Their top priority is semantic…
The correct answer is A. Compare the cosine similarities of the embeddings of returned results against those of a. Semantic accuracy in a vector database context measures how semantically similar the retrieved documents are to the query. Cosine similarity between embeddings is the canonical metric for this: it quantifies the angular closeness of two vectors in the embedding space, directly…
Question
A Generative AI Engineer is deciding between using LSH (Locality Sensitive Hashing) and HNSW (Hierarchical Navigable Small World) for indexing their vector database. Their top priority is semantic accuracy. Which approach should the Generative AI Engineer use to evaluate these two techniques?
Options
- ACompare the cosine similarities of the embeddings of returned results against those of a
- BCompare the Bilingual Evaluation Understudy (BLEU) scores of returned results for a
- CCompare the Recall-Oriented-Understudy for Gisting Evaluation (ROUGE) scores of returned
- DCompare the Levenshtein distances of returned results against a representative sample of test
How the community answered
(26 responses)- A77% (20)
- B4% (1)
- C8% (2)
- D12% (3)
Explanation
Semantic accuracy in a vector database context measures how semantically similar the retrieved documents are to the query. Cosine similarity between embeddings is the canonical metric for this: it quantifies the angular closeness of two vectors in the embedding space, directly reflecting semantic relatedness. Comparing cosine similarities of results from LSH vs. HNSW against a ground-truth set reveals which algorithm retrieves more semantically relevant documents. BLEU (B) measures n-gram overlap for machine translation quality. ROUGE (C) measures recall-oriented n-gram overlap for summarization quality. Levenshtein distance (D) measures character-level edit distance between strings, which is a surface-level string metric with no connection to semantic meaning.
Topics
Community Discussion
No community discussion yet for this question.