liveBook · Manning

Relevance checking

As explained in Software Testing with Generative AI

The evaluation of whether retrieved information matches the subject and intent of a query.

Relevance checking evaluates whether retrieved information matches a query’s subject and intent. In retrieval-augmented generation, weak checking can make an accurate language model produce an unusable response because the wrong context was retrieved. section 11.2.2

Wrong endpoint context

A query about the Auth API—login, logout, and validate endpoints—returned risks about deleting rooms, invalid room IDs, and deletion confirmation messages. The response looked like hallucination, but the underlying failure was selecting a room-based user story as the most relevant result. section 11.2.2

Improve relevance checking by:

  • Trying different queries based on available user stories. section 11.2.2
  • Comparing desired results with erroneous results. section 11.2.2
  • Tweaking queries and considering advanced tooling when multiple data sources compete. section 11.2.2

How Software Testing with Generative AI covers it

How deep it goes
Diagnoses mismatched retrieval through concrete results and query experiments, then points toward advanced tooling without detailing its implementation.
Examples
Uses an Auth API query that retrieves room-deletion risks as its central mismatch example.
What it assumes
Assumes familiarity with user stories, APIs, acceptance criteria, queries, and retrieval-augmented generation.
What you can do after
Diagnose poor generated responses by testing query variations and tracing errors to irrelevant retrieved data.
How it connects
Connects retrieval-augmented generation with language models, queries, user stories, APIs, and acceptance criteria.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Testing with Generative AI. The section links point to the parts of the book it draws on.