nerdexam
Databricks

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…

Vector Search Performance Evaluation

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)
  • A
    77% (20)
  • B
    4% (1)
  • C
    8% (2)
  • D
    12% (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

#Vector Databases#Approximate Nearest Neighbor (ANN)#Evaluation Metrics#Semantic Search

Community Discussion

No community discussion yet for this question.

Full GENERATIVE-AI-ENGINEER-ASSOCIATE Practice