MLCrack

    NATURAL LANGUAGE PROCESSING · INTERVIEW QUESTION

    What is semantic similarity?

    🟢 beginner · NLP

    Hint: Focus on the decision rule, assumptions, and failure mode behind nlp.

    Answer

    Semantic similarity measures meaning closeness between texts. Embedding cosine similarity is common, but evaluation should use task labels and hard negatives.

    Interview reasoning

    Cosine proximity is meaningful only relative to the embedding objective and task. Antonyms can be distributionally close despite opposite decision meaning.

    Semantic relevance requires a task-specific definition, not merely topic similarity. Create query-document judgments with realistic ambiguity and hard negatives, keeping documents and query families appropriately separated. A passage mentioning the same entity may fail to answer the query, so measure evidence sufficiency alongside ranking.

    Worked example. 'How to stop a subscription' and 'subscription pricing' are related but answer different needs.

    Validation

    Use expert-labeled similar and near-miss pairs, with retrieval metrics when applicable.

    Report recall/ranking by query type, audit false negatives and annotation agreement, and compare lexical and embedding baselines.

    Common pitfalls

    High similarity does not imply entailment, factual equivalence, or identity.

    Click logs encode incumbent exposure and position. Random irrelevant negatives can make a retrieval benchmark unrealistically easy.

    Likely follow-up: Use expert-labeled similar and near-miss pairs, with retrieval metrics when applicable.