liveBook · Manning

Semantic evaluation

As explained in Machine Learning Platform Engineering

Semantic correctness is the degree to which generated content conveys the intended meaning accurately.

Semantic evaluation tests whether an LLM response preserves the intended meaning instead of requiring an exact string match. It is necessary because identical prompts can produce different but equally valid outputs. section 13.2 section 12.1.1

Evaluate responses against qualities that remain meaningful when wording changes:

  • Semantic correctness: determine whether the response conveys the intended meaning. section 13.2
  • Factual accuracy: check whether claims are correct rather than merely well-formed. section 13.0
  • Guideline adherence: verify that responses stay appropriately scoped and aligned with business policies. section 13.0

RAG documentation assistant

A documentation assistant may answer the same engineering question with different wording across runs. Semantic evaluation accepts variation when the answer remains accurate, appropriately scoped, and aligned with the intended guidelines. DeepEval provides a named implementation path for semantic evaluation in production LLM applications. section 1.4.2 section 13.0

Listing 12.1 Parameters that control output randomness
temperature=0.0  #1
temperature=0.7  #2
temperature=1.5  #3

top_k=1 #4
top_k=40  #5
top_k=100  #6

top_p=0.1  #7
top_p=0.9  #8
top_p=1.0 #9

Use sampling parameters to understand why repeated calls vary and why evaluation must judge meaning rather than exact output text. section 12.1.1

How Machine Learning Platform Engineering covers it

How deep it goes
Defines semantic, factual, and guideline-based assessment but stops short of specifying detailed scoring procedures.
Examples
Uses a RAG documentation assistant and DeepEval to illustrate evaluation of variable but potentially valid responses.
What it assumes
Assumes awareness of LLM applications and teaches why probabilistic outputs invalidate traditional assertions.
What you can do after
Apply it via DeepEval to assess LLM responses beyond exact string matching.
How it connects
Connects LLM testing with factual accuracy, guideline adherence, safety, RAG, and prompt engineering.

Also explained in

Compare how 2 books explain semantic evaluation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.