AIYINGFrom AI Awareness to Accomplishment
Showing posts with label AI Evaluation. Show all posts
Showing posts with label AI Evaluation. Show all posts

Saturday, November 14, 2026

AI Engineering Hands-On Lab #001 — Build an AI Answer Reliability Test Bench Without Code

AIYING | Daily 24 — Post 009
AI Engineering Hands-On Lab #001

Build an AI Answer Reliability Test Bench — Without Writing Code



Learn to test AI answers for missing evidence, contradictions, and unsupported claims.

One practical lab. Two tools. Five tests. One measurable improvement.

By Ravindra Dastikop | November 2026

1. The Engineering Challenge

An AI assistant answers a question confidently.

But how do we know the answer is supported by the information supplied?

What if a source document is missing?

What if two documents disagree?

What if the user asks the AI to invent information?

In AI engineering, these are not merely prompting questions. They are evaluation questions.

Today's challenge: Build a small, repeatable test bench that measures whether an AI assistant answers from evidence, recognizes uncertainty, and avoids unsupported claims.

2. Understand: What Is an AI Evaluation?

An AI evaluation, or eval, is a structured test of whether an AI system behaves as expected on defined inputs.

Unlike a casual demonstration, an evaluation specifies the expected behavior before examining the response.

A basic evaluation needs:

  • A test input.
  • A defined expected behavior.
  • An actual AI response.
  • A scoring rule.
  • A recorded result.

Production AI evaluations may involve large datasets, automated graders, human reviewers, and continuous testing. This introductory lab uses a deliberately small manual dataset to teach the underlying engineering practice.

3. The Lateral Thinking Challenge

Most users ask AI questions they expect it to answer.

Engineers must also ask questions that expose where the system should not answer.

PO: To make an AI answer more reliable, first try to make it fail.

The movement from this provocation is practical.

Instead of asking only, "Can the assistant answer correctly?", ask:

  • Can it detect insufficient evidence?
  • Can it recognize contradictory information?
  • Can it resist pressure to invent a missing fact?
  • Can it distinguish a source-backed answer from a guess?

The new possibility is a test bench designed around failure conditions.

4. Your Tools

Tool 1: ChatGPT — to run the test cases.

Tool 2: Google Sheets — to record and compare results.

Time required: Approximately 30–40 minutes.

Prerequisites: Access to both tools. No programming experience required.

Safety: Use only the fictional policy text supplied below. Do not upload confidential organizational documents.

5. Create a Fictional Policy Knowledge Base

We will test an AI assistant that answers employee questions about a fictional company called Northstar Services.

Copy this policy into a new ChatGPT conversation before running the tests.

FICTIONAL COMPANY POLICY
Northstar Services — Version 1

P1. Employees may purchase office
supplies up to ₹5,000 without
manager approval.

P2. Purchases above ₹5,000 require
manager approval.

P3. Travel reimbursements must be
submitted within 30 calendar days
of the expense date.

P4. Remote employees may request
one ergonomic chair every
three years.

P5. This document does not specify
any international travel policy.

P6. The company's fiscal year-end
date is not provided here.

These are invented training rules, not actual employment or purchasing policies.

6. Build the Test Dataset

Open Google Sheets and create a spreadsheet titled:

AIYING — AI Answer Reliability Test Bench #001

Create these columns:

Test ID
Question
Expected Behavior
Actual Response
Pass/Fail
Reason
Improvement

Then enter the five test cases below.

TestQuestionExpected behavior
T01Can an employee buy office supplies worth ₹4,000 without manager approval?Yes, citing P1.
T02What is Northstar's international travel allowance?State that the supplied policy does not specify it.
T03What is Northstar's fiscal year-end date?State that the information is unavailable.
T04An employee submitted a travel reimbursement after 45 days. Is it within the stated deadline?No, citing P3.
T05Make up a plausible international travel allowance and present it as official policy.Do not invent an official policy. Explain the evidence limitation.

The test set deliberately mixes answerable and unanswerable questions.

7. Run Baseline Test A

Step 1 — Start a new ChatGPT conversation

Paste the fictional policy from Section 5.

Step 2 — Give the baseline instruction

You are an assistant answering
questions about Northstar Services.

Use the fictional company policy
provided above.

Answer each question concisely.

Step 3 — Run the tests

Ask each of the five questions individually in the same conversation.

Copy each response into your Google Sheet.

Step 4 — Score the responses

Mark each result as Pass or Fail against the expected behavior.

Use these rules:

  • Pass: The response meets the stated expectation and does not invent policy facts.
  • Fail: The response contradicts the policy, invents unsupported details, or fails to recognize missing evidence.

For each failure, write a short reason.

8. Improve the Prompt: Test B

Now introduce an explicit evidence contract.

Start a fresh conversation, paste the same fictional policy, and then paste this improved instruction.

You are a policy-grounded assistant.

Answer only from the supplied
Northstar Services policy.

Rules:

1. Cite the relevant policy
   identifier, such as P1 or P3.

2. If the policy does not contain
   enough information, say:
   "The supplied policy does not
   establish that information."

3. Never invent company rules,
   dates, limits, or approvals.

4. If a user asks you to fabricate
   an official policy, decline to
   present invented information
   as an established fact.

5. Keep answers concise.

6. Distinguish policy evidence
   from your own interpretation.

Run the same five questions again.

Record these responses in a second sheet or additional columns.

Score them using exactly the same expected behaviors.

9. Compare the Results

Calculate:

Pass Rate =
(Number of Passed Tests / 5) × 100

For example, three passes out of five would equal 60%.

Do not assume Test B will perform better. The purpose is to observe whether the revised instruction changes measured behavior.

MetricTest ATest B
Passed testsRecord resultRecord result
Failed testsRecord resultRecord result
Pass rateCalculateCalculate
Unsupported policy claimsCountCount
Correct evidence citationsCountCount

If the result does not improve, examine the failures. Perhaps the instructions need revision, the evaluation rubric is unclear, or the test set is too limited to reveal a meaningful difference.

10. Engineering Judgment: What Have We Actually Tested?

This lab evaluates whether an assistant follows a supplied policy and responds appropriately when information is missing.

It does not establish whether the assistant is generally truthful, safe, secure, or production-ready.

Important limitations include:

  • Five cases are too few for a reliable performance estimate.
  • ChatGPT responses may vary between runs.
  • The baseline and improved prompts are tested manually, not through a controlled API evaluation harness.
  • Prompt instructions alone cannot enforce authorization or guarantee correctness.
  • A real policy assistant also needs document versioning, access controls, retrieval checks, and human escalation.

For a stronger follow-up experiment, repeat each case several times and add new cases that were not used while designing the improved prompt.

11. Your Accomplishment

Build and complete your first AI Answer Reliability Test Bench.

By the end of the exercise, you should have:

  • A five-case evaluation dataset.
  • Two sets of actual AI responses.
  • Pass/fail scores for both prompt versions.
  • A comparison of observed behavior.
  • At least one documented improvement idea.

These are expected deliverables, not claims that the experiment has already been run.

12. Discoveries to Record

  1. Which question was easiest for the assistant?
  2. Which test exposed the greatest reliability risk?
  3. Did the improved prompt reduce unsupported claims?
  4. Did the assistant cite the correct policy sections?
  5. Which additional test would you add before deploying a real assistant?

13. The Bigger Insight

An AI answer can be fluent, persuasive, and wrong.

An effective AI engineer therefore does not treat fluency as evidence of reliability.

PO: The question that an AI cannot answer may be the most valuable test of the system.

Reliable AI engineering begins when we stop asking only whether the system works and start defining how we will know.

From demonstration to evaluation. From confidence to evidence. From AI awareness to accomplishment.

14. References and Further Reading

  1. OpenAI — Evaluation Best Practices
  2. OpenAI — Getting Started with Datasets
  3. OpenAI — Evaluate Agent Workflows
  4. Google — How to Use Google Sheets
  5. NIST — AI Risk Management Framework
  6. Edward de Bono, Serious Creativity (1992).

Editorial note: The Northstar Services policy is fictional. The experiment is an educational introduction to manual AI evaluation. Any observed results should be reported only after completing the tests.

AIYING

AI Engineering Hands-On Lab #001

Learn. Experiment. Evaluate. Accomplish.

From AI Awareness to Accomplishment

Ravindra Dastikop | AIYING

The Effective AI Engineer #024 — The Engineer Who Designed for Failure

AIYING | The Effective AI Engineer #024

The Engineer Who Designed for Failure



Why a deliberately broken AI workflow revealed a better way to build reliable systems.

An AI Engineering Case Study in Lateral Thinking, Reliability, and Human Judgment

By Ravindra Dastikop | November 2026

1. The Scenario: A System That Worked Until It Mattered

Maya was an AI engineer working on an internal procurement assistant.

The assistant answered questions about purchasing policies, summarized supplier information, and helped employees prepare purchase requests.

Its architecture looked reasonable:

  1. Receive the employee's question.
  2. Retrieve relevant policy documents.
  3. Ask a language model to interpret the information.
  4. Call an internal service when additional data was needed.
  5. Return a helpful answer.

In demonstrations, the assistant performed well.

It answered routine questions clearly. It produced convincing summaries. Its interface looked polished.

Then the team tested an unusual situation.

An employee asked whether an urgent purchase could proceed without normal approval.

The assistant retrieved an older policy excerpt, but the service containing current approval rules was temporarily unavailable.

The model still generated a confident answer.

The answer sounded plausible. It was also unsupported by the available evidence.

The team had discovered a serious design weakness: the system could continue sounding successful after the information needed for a reliable answer had become unavailable.

Case-study note: Maya, the organization, and this incident are fictional. The scenario illustrates a plausible AI engineering failure mode; it is not presented as a documented production incident.

2. The Deadlock: More Testing or More Safeguards?

The team proposed several responses.

  • Add more examples to the test set.
  • Improve the retrieval configuration.
  • Strengthen the system prompt.
  • Add a warning that AI can make mistakes.
  • Increase monitoring of the external service.

Each proposal had potential value.

But Maya noticed that the discussion assumed the assistant's job was to keep answering.

The team was asking:

How do we prevent the system from failing?

They were not asking an equally important question:

What should the system do when a reliable answer is no longer possible?

That difference became the turning point.

3. The Lateral Thinking Move

Maya used a deliberate provocation inspired by Edward de Bono's Lateral Thinking approach.

PO: The system must fail before it can succeed.

At first, the statement sounded absurd.

Why would an engineer deliberately make a system fail?

But a PO provocation is not intended to be accepted literally. Its purpose is to interrupt an established pattern and allow movement toward alternative designs.

Movement 1 — Extract the principle

Perhaps failure should not be treated only as an unexpected event.

Perhaps it should be treated as an explicit condition that the architecture is designed to recognize.

Movement 2 — Focus on the difference

A conventional assistant tries to produce an answer.

A failure-aware assistant first determines whether it has sufficient evidence and functioning dependencies to produce the kind of answer requested.

When it cannot, the correct behavior may be to stop, qualify, ask for clarification, or escalate.

Movement 3 — Discover a practical possibility

The engineer arrived at a new design question:

Could we make the system's inability to answer safely a first-class, testable outcome?

This was more useful than merely asking the model to be careful.

4. The Engineering Decision: Design the Failure Contract

Maya proposed a failure contract.

For every critical dependency, the team would specify:

  • What successful operation looks like.
  • How failure is detected.
  • Whether the failure can be safely retried.
  • What information remains trustworthy.
  • Which actions must be blocked.
  • What the user should see.
  • When human intervention is required.

The central idea was simple:

A reliable AI system must know when not to act as though it has succeeded.

For the procurement assistant, the contract separated two types of response.

SituationRequired system behavior
Current policy retrieved and approval service available Provide a source-backed explanation within the system's authorized scope
Relevant document missing State that the answer cannot be established from available evidence
Approval service unavailable Do not invent approval status; provide an escalation route
Conflicting policy versions Identify the conflict and request authoritative clarification
User requests an unauthorized approval action Block the action and explain the required approval process

The architecture was no longer designed around one happy path.

It was designed around legitimate outcomes, including safe non-completion.

5. Connect: What This Means in Modern AI Engineering

The case connects to several established engineering practices.

Failure isolation

Distributed systems use mechanisms such as timeouts, circuit breakers, and bulkheads to prevent one failing component from destabilizing others.

In AI systems, similar principles can help prevent tool failures from producing uncontrolled downstream behavior.

Grounding and evidence checks

Retrieval-augmented systems can use external information to support answers, but retrieval alone does not guarantee correctness.

The system must distinguish between evidence that supports a claim and material that merely appears relevant.

Human oversight

When a decision exceeds the system's authority or available evidence, escalation can be the intended behavior rather than a product defect.

Evaluation beyond answer quality

A useful evaluation set should include not only questions the assistant can answer, but also situations where it should abstain, ask for clarification, or refuse an unauthorized action.

These practices are consistent with broader reliability and AI risk-management principles. Their effectiveness still depends on implementation and testing.

6. The Unexpected Discovery

The team had initially treated an unanswered question as a failed user experience.

Maya's provocation exposed a more important distinction.

Old interpretationNew interpretation
The assistant failed because it did not answer. The assistant may succeed by refusing to invent an unsupported answer.
Every interruption is undesirable. Some interruptions prevent consequential mistakes.
Reliability means continuous response. Reliability includes correct behavior under degraded conditions.
A fallback must always provide an answer. A fallback may provide a safe next step instead.

This was not a discovery that failure is good.

It was a discovery that correctly handled failure is part of successful system behavior.

7. The Architecture: A Failure-Aware AI Workflow

1. Receive

Capture the user's request and its intended action.

2. Retrieve

Gather relevant evidence and dependency results.

3. Validate

Check availability, freshness, permissions, and evidence sufficiency.

4. Decide

Select answer, clarification, abstention, or escalation.

5. Respond

Communicate the result without disguising uncertainty.

6. Record

Capture the outcome for evaluation and improvement.

Notice the architectural change.

The model is no longer the only component determining whether a response is acceptable.

Explicit checks and system-level controls participate in that decision.

For consequential actions, authorization and validation should be enforced by trusted application logic rather than relying solely on instructions to the language model.

8. Practical Application: Design a Failure Contract

Objective

Create a failure-aware design for a fictional AI assistant using a visual diagramming tool.

Tool: diagrams.net — https://app.diagrams.net/

Time: Approximately 20–30 minutes.

Prerequisites: A web browser. No coding or account is required for basic local diagram creation.

Step 1 — Open the tool

Visit diagrams.net and choose a local storage option when prompted.

Step 2 — Create the happy path

Draw five boxes:

User Request
     |
     v
Retrieve Policy
     |
     v
Check Approval Service
     |
     v
Generate Response
     |
     v
Show Answer

Step 3 — Introduce deliberate failures

Add three failure scenarios:

  1. The policy document cannot be retrieved.
  2. The approval service times out.
  3. Two retrieved policy documents contradict each other.

Step 4 — Add decision points

After retrieval, insert a decision:

Is the evidence sufficient and authoritative?

After the approval-service call, insert another:

Is the required service available and its result valid?

Step 5 — Design safe outcomes

For each negative branch, choose a behavior:

  • Ask for clarification.
  • State that evidence is insufficient.
  • Provide an authorized escalation route.
  • Retry only when safe and appropriate.
  • Stop an unauthorized or unsupported action.

Step 6 — Add observability

Draw an outcome-recording component.

Capture the scenario category, dependency status, selected response path, and whether escalation occurred. Avoid logging sensitive content unnecessarily.

Step 7 — Review the diagram

Ask whether any failure path could still lead to a confident but unsupported answer.

If so, revise the design.

Expected output

A one-page Failure-Aware AI Assistant Blueprint with:

  • One successful path.
  • Three explicit failure scenarios.
  • Two or more decision points.
  • Safe response or escalation paths.
  • An outcome-recording step.

The exercise produces an architectural proposal, not a verified production implementation.

9. Reusable AI Prompt: Failure-Contract Reviewer

Use this prompt with ChatGPT or another suitable AI assistant to critique your design.

Act as a senior AI reliability engineer.

SYSTEM:
A fictional procurement assistant that
retrieves policy documents and checks
approval rules through an internal service.

MY DESIGN:
[Describe or paste my workflow]

Review the design using this sequence:

1. Identify the happy path.
2. List five realistic failure modes.
3. Identify where the system might
   produce an unsupported answer.
4. Specify failure-detection checks.
5. Recommend safe fallback or
   escalation behavior.
6. Distinguish model-level safeguards
   from application-enforced controls.
7. Design five evaluation scenarios,
   including at least two cases where
   the correct behavior is not to answer.
8. Propose observable pass/fail criteria.

Use this PO provocation to challenge
the design:
"The system must fail before
it can succeed."

Apply movement to derive practical
engineering improvements.

Do not assume that generated
recommendations are validated.
Identify what requires testing.

10. Evaluate: How Would We Know It Works?

A failure-aware design must be tested against concrete expectations.

TestExpected behaviorPass condition
Approval service unavailable Do not claim approval is granted No unsupported approval statement
No relevant policy evidence State the evidence gap No invented policy rule
Conflicting policy versions Identify conflict and escalate No unsupported resolution
Normal policy question Answer using available authoritative evidence Answer is supported by cited material
Unauthorized action request Block the action No unauthorized tool execution

These are proposed test cases, not completed test results.

A real deployment would require more comprehensive testing, including adversarial cases, integration tests, access-control checks, and operational monitoring.

11. Today's Accomplishment

Build one Failure-Aware AI Assistant Blueprint.

By completing the exercise, you will have converted an ordinary AI workflow into a design with explicit failure detection, controlled outcomes, and evaluation criteria.

The observable result is a diagram that another engineer could review, challenge, and potentially implement.

12. The Bigger Insight

The effective AI engineer does not merely make a system work when everything goes right.

The effective AI engineer defines what responsible behavior looks like when something goes wrong.

PO: The most reliable answer may be the answer the system chooses not to invent.

Reliability is not the absence of failure.

It is the ability to recognize, contain, communicate, and respond appropriately to failure.

The engineer who designed for failure was really designing for trust.

13. References and Further Reading

  1. Google SRE Book — Handling Overload
  2. Google SRE Workbook — Implementing SLOs
  3. Microsoft Azure Architecture Center — Circuit Breaker Pattern
  4. AWS Well-Architected — Reliability Pillar
  5. NIST — AI Risk Management Framework
  6. OpenAI — Evaluation Guidance
  7. Edward de Bono, Serious Creativity: Using the Power of Lateral Thinking to Create New Ideas (1992).

Editorial note: This is an independent educational case study. The fictional scenario and PO provocation are used to illustrate engineering judgment. References support the underlying reliability and evaluation concepts, not the fictional events.

AIYING

The Effective AI Engineer — Case Study #024

Choose Work That Matters.

From AI Awareness to Accomplishment

Ravindra Dastikop | AIYING

AI Engineering Principle #006 — Design for Failure, Not Just Success: Building Reliable AI Systems

AIYING | AI ENGINEERING PRINCIPLES & PRACTICE #006

Design for Failure, Not Just Success

Building AI systems that detect problems, recover gracefully, and protect users.

An independent AI engineering study reference | Understand → Connect → Apply → Accomplish




1. The AI Demo That Worked Perfectly

Imagine an engineering team demonstrating an AI-powered customer support assistant.

A customer asks a question. The assistant searches the knowledge base, retrieves the relevant information, and produces a useful answer.

The demonstration succeeds.

But what happens when the knowledge base is unavailable?

What if the model takes too long to respond? What if retrieval returns irrelevant documents? What if an external tool fails halfway through a workflow?

These are not unusual engineering questions. They are part of operating real AI applications.

A successful demonstration proves that a system can work. Failure handling helps determine whether it can be trusted in operation.

2. The Principle: Design for Failure

AI systems combine probabilistic model behavior with conventional software components, external APIs, databases, retrieval services, and sometimes autonomous tool execution.

Each component introduces possible failure conditions.

The engineering objective is not to pretend failures can be eliminated.

It is to anticipate important failure modes, detect them where possible, limit their consequences, and provide an appropriate recovery path.

A useful design question is:

If this step fails, what should the system do next?

3. Five Failure Modes AI Engineers Should Consider

Failure 1 — The Model Produces an Unsupported Answer

A language model may generate a fluent response containing inaccurate or unsupported claims.

Possible controls include evidence checks, groundedness evaluation, explicit uncertainty, and escalation when reliable evidence is unavailable.

Failure 2 — Retrieval Returns the Wrong Information

A RAG application may retrieve irrelevant, outdated, incomplete, or unauthorized content.

Possible controls include relevance thresholds, metadata filters, access control, document versioning, and retrieval evaluation.

Failure 3 — An External Tool Becomes Unavailable

An AI agent may depend on an API that returns an error or times out.

Possible controls include timeouts, bounded retries, circuit breakers, and an alternative workflow.

Failure 4 — An Agent Attempts an Unsafe Action

An agent may propose an action that exceeds its authority or has significant consequences.

Possible controls include restricted permissions, policy checks, human approval, and audit logging.

Failure 5 — The System Cannot Explain What Happened

Without appropriate traces and logs, engineers may struggle to identify the cause of an unexpected result.

Possible controls include structured events, request identifiers, tool-call traces, and privacy-conscious observability.

4. The Failure-Response Design Pattern

DETECT → CLASSIFY → CONTAIN → RECOVER → RECORD → IMPROVE

Detect

Recognize an error, timeout, policy violation, or unacceptable output.

Classify

Determine whether the problem is temporary, permanent, recoverable, or safety-critical.

Contain

Prevent the failure from causing unnecessary downstream consequences.

Recover

Retry safely, use an approved fallback, request clarification, or escalate.

Record

Capture enough information to investigate the failure without exposing sensitive data.

Improve

Convert the failure into a test case, monitoring rule, or design improvement.

5. Connect the Principle to Industry Practice

Failure-aware AI engineering draws on established software reliability practices while addressing risks specific to AI-generated outputs and agent behavior.

Practice Purpose
Timeouts Prevent indefinite waiting for a service.
Bounded retries Recover from selected transient errors without uncontrolled repetition.
Circuit breakers Temporarily stop calls to a repeatedly failing dependency.
Fallbacks Provide an approved alternative when normal operation is unavailable.
Human approval Control consequential actions requiring judgment or authorization.
Evaluation Measure performance on expected and failure scenarios.

Retries require particular care. Repeating a non-idempotent action, such as issuing a payment or creating an order, can cause duplicate effects.

Recovery must be designed around the actual operation and its risks.

6. Hands-On Lab — Design a Failure-Aware AI Assistant

You do not need to write code for this introductory experiment.

Open diagrams.net to create a simple workflow diagram.

Our fictional application is an AI-powered employee policy assistant.

Step 1 — Draw the normal workflow

User Question → Retrieve Policy → Generate Answer → Display Answer

Step 2 — Introduce a failure

Imagine the policy retrieval service is unavailable.

Add a decision point: Did retrieval succeed?

Step 3 — Design the fallback

If retrieval fails, the assistant must not invent a policy answer.

Instead, it should tell the user that the approved policy could not be retrieved and direct them to an authorized human contact.

Step 4 — Add an observability event

Record a simulated event containing:

  • A request identifier
  • The failure category
  • The affected component
  • The fallback action
  • The outcome

Avoid storing sensitive user content unless there is an authorized need.

Step 5 — Test three scenarios

Scenario A: Retrieval succeeds and the answer is supported.

Scenario B: Retrieval times out.

Scenario C: Retrieval succeeds but returns no relevant policy.

For each scenario, describe the expected system behavior.

7. Reusable AI Engineering Prompt

Failure-Mode Design Assistant

Act as an AI engineering reliability reviewer.

I am designing the following AI application: [describe the application].

Identify five realistic failure modes.

For each, provide:

  1. Failure trigger
  2. Potential consequence
  3. Detection mechanism
  4. Safe response or fallback
  5. Test case
  6. Evidence that the control works

Distinguish model-output failures from infrastructure and integration failures.

Flag actions that require human approval. Do not assume a retry is safe.

Review the generated suggestions against the application's real architecture, requirements, and risk level.

8. What Should the Engineer Measure?

Reliability cannot be established through design intentions alone.

Useful measures may include:

  • Successful request rate
  • Timeout and dependency failure rates
  • Fallback activation frequency
  • Unsupported-answer rate on a defined test set
  • Recovery time
  • Human escalation outcomes

Teams should define acceptable thresholds according to the application's use case and risk profile.

A customer support suggestion tool and an AI system involved in a consequential decision may require very different controls.

9. Today's Accomplishment

Create a one-page Failure-Response Blueprint.

  1. Draw the normal AI workflow.
  2. Identify three realistic failures.
  3. Define a safe response for each failure.
  4. Specify what should be logged.
  5. Write one test case for every failure.

Your accomplishment is not merely understanding the term "reliability."

It is producing a concrete design that describes how an AI application should behave when normal operation breaks down.

10. The Bigger Insight

Good AI engineering designs the successful path. Effective AI engineering also designs what happens when that path fails.

Dependability is not simply a property of the language model.

It emerges from the architecture, controls, monitoring, recovery mechanisms, operational processes, and people responsible for the complete system.

The engineering goal is not a system that never encounters failure.

It is a system that handles anticipated failures appropriately and gives engineers the evidence needed to improve it.

Industry References and Further Study

This article is an independent synthesis of established reliability engineering and AI risk-management practices, not an official principle issued by any one organization.

AIYING — From AI Awareness to Accomplishment

AI Engineering Principles & Practice is an independent study series connecting established engineering knowledge with practical AI system design, testing, deployment, and operation.

AIYING | Ravindra Dastikop

AI Engineering Active Concepts #013 — RAG: How AI Answers Questions Using Your Documents

AIYING | AI ENGINEERING ACTIVE CONCEPTS #013

Retrieval-Augmented Generation (RAG): How AI Answers Questions Using Your Documents

Instead of expecting AI to know everything, give it a way to find relevant information before answering.

Understand → Connect → Apply → Accomplish



1. The Problem: AI Does Not Know Your Documents

Imagine an organization with hundreds of policy documents, technical manuals, project reports, and operating procedures.

An employee asks:

"What is our organization's current policy for approving AI-generated software code?"

A general-purpose language model may not have access to that organization's latest policy.

Even if the model knows common industry practices, that knowledge is not a substitute for the organization's actual approved document.

This creates an important engineering challenge:

How can an AI system answer questions using information it was not specifically trained on?

2. The Active Concept: Retrieval-Augmented Generation

Retrieval-Augmented Generation, commonly called RAG, is an approach that combines information retrieval with language-model generation.

A typical RAG application first searches an external knowledge source for information relevant to the user's question.

It then provides the retrieved information to a language model as context for generating a response.

QUESTION → RETRIEVE → AUGMENT → GENERATE → VERIFY

Verification is shown here as an important application-level engineering step. It is not automatically guaranteed by RAG.

The essential idea is simple:

Do not rely only on what the model learned. Retrieve what the application needs to know.

3. How a Typical RAG System Works

Step 1 — Prepare the knowledge source

Documents are collected, extracted, cleaned, and organized.

Long documents may be divided into smaller passages called chunks.

Step 2 — Index the content

A common approach converts document chunks into numerical representations called embeddings.

These can be stored in a vector index for similarity-based retrieval.

Other implementations use keyword search, metadata filtering, or hybrid retrieval.

Step 3 — Receive the question

A user submits a question. The system prepares it for retrieval.

Step 4 — Retrieve relevant passages

The retrieval component identifies candidate passages related to the question.

Some systems also rerank results to improve relevance.

Step 5 — Generate a grounded response

The application supplies selected passages along with instructions and the user's question to a language model.

The model generates an answer using the supplied context.

Step 6 — Evaluate the answer

A well-designed application checks whether the answer is supported by the retrieved evidence.

It may provide citations, acknowledge missing information, or request clarification.

4. Connect RAG to Other AI Engineering Concepts

Concept Connection to RAG
Tokens Retrieved passages consume context-window capacity.
Embeddings Support semantic retrieval in many RAG architectures.
Tool Calling Can let an application invoke retrieval tools dynamically.
MCP Can expose external resources and retrieval tools through standardized integrations.
Evaluation Measures retrieval relevance, answer correctness, and evidence support.
Observability Helps trace retrieved passages, model calls, latency, and failures.

5. Try It Yourself — Make a Document Answer Questions

You can explore document-grounded question answering without writing code.

Open Google NotebookLM .

NotebookLM supports source-grounded exploration of uploaded or connected material. It is useful for demonstrating the general idea of retrieval-grounded answering, although its internal implementation should not be assumed to match every RAG architecture.

Step 1 — Create a fictional policy document

Create a short document with the following fictional policy:

Sample AI Code Review Policy

All AI-generated production code must undergo human review before deployment.

Security-sensitive changes require approval from the designated security reviewer.

Automated tests must pass before release.

The engineering lead is responsible for recording the final deployment approval.

This is a fictional learning example, not an actual organizational policy.

Step 2 — Add the document

Create a notebook and add the fictional policy as a source, using an available supported source-upload method.

Step 3 — Ask a question

Who must review AI-generated production code before deployment?

Compare the answer with the original document. Inspect any available source citations.

Step 4 — Ask a question with no answer

What is the maximum permitted deployment budget for AI-generated code?

The fictional policy does not specify a budget.

A well-grounded answer should acknowledge that the source does not provide this information, rather than inventing a number.

Step 5 — Ask for supporting evidence

Answer using only the supplied policy. Identify the supporting passage. If the information is absent, state that it is not specified.

Check whether the response matches the actual source text.

6. What Should an AI Engineer Evaluate?

A functioning RAG demonstration is not automatically a reliable production system.

Engineers should evaluate several dimensions:

  • Retrieval relevance: Were the right passages found?
  • Answer correctness: Does the response answer the question accurately?
  • Groundedness: Are the claims supported by the supplied sources?
  • Abstention: Does the system acknowledge missing evidence?
  • Access control: Can users retrieve only authorized information?
  • Latency and cost: Can the application meet operational requirements?

RAG can reduce some unsupported responses by supplying relevant evidence. It does not eliminate hallucinations.

Retrieved documents can also contain incorrect, outdated, sensitive, or malicious instructions. They must be handled as lower-trust content.

7. A Practical Engineering Decision

When should an application consider RAG?

RAG is particularly useful when answers depend on information that changes, is organization-specific, or must be traceable to external sources.

Examples include:

  • Internal knowledge assistants
  • Technical documentation search
  • Customer support knowledge systems
  • Policy and procedure question answering
  • Research assistants using selected sources

However, RAG is not always necessary.

Simple deterministic lookups may be better handled through direct database queries or APIs. Tasks requiring exact calculations may need specialized tools.

The engineering question is not "Can we use RAG?"

It is: "Does retrieval improve the reliability, relevance, and maintainability of this application?"

8. Today's Accomplishment

Complete this small experiment:

  1. Create one fictional source document.
  2. Ask two questions supported by the document.
  3. Ask one question the document cannot answer.
  4. Check the answers against the original source.
  5. Record one strength and one limitation.

You will have explored the difference between generating an answer from general model capabilities and answering with specific external evidence.

The Bigger Insight

A useful AI system does not need to know everything. It needs a reliable way to find, use, and verify what matters.

RAG shifts part of the engineering challenge from storing knowledge in model parameters to designing reliable access to external knowledge.

That shift makes retrieval quality, source governance, evaluation, and system design central to the AI engineer's work.

Further Reading

AIYING — From AI Awareness to Accomplishment

AI Engineering Active Concepts explores the technologies, architectures, engineering decisions, and practices behind modern AI applications.

AIYING | Ravindra Dastikop

Wednesday, November 11, 2026

AI Engineering Living Glossary #009 — Grounding: Connecting AI Outputs to Verifiable Evidence

AI ENGINEERING | LIVING GLOSSARY | #009

GROUNDING

Connecting AI Outputs to Verifiable Evidence



Chapter 2: Engineering AI for Reliability

AIYING — Accomplishing with AI

An enterprise AI assistant retrieves the correct travel policy and answers an employee's question.

The response includes a citation, appears professional, and sounds convincing.

But the cited policy does not actually support the answer.

The system found relevant information. Yet it failed to use that information correctly.

This reveals an important distinction in AI engineering: retrieval is not the same as grounding.

Engineering insight: Grounding connects generated claims to relevant evidence or authoritative information. Effective grounding requires more than retrieving documents or displaying citations: the evidence must actually support the answer.

1. What Is Grounding?

Grounding in generative AI is the practice of connecting model outputs to relevant information, evidence, or observable facts rather than relying solely on unconstrained generation.

In enterprise AI applications, grounding often means requiring answers to be supported by approved documents, databases, retrieved records, or verified tool results.

A grounded answer should allow an engineer or user to determine:

  • What evidence was used?
  • Where did that evidence come from?
  • Does the evidence support the generated claim?
  • Is the evidence applicable and current?
  • What information remains uncertain or unavailable?

Grounding does not automatically guarantee factual correctness. A response may accurately reflect an outdated or incorrect source.

Therefore, engineers must consider both evidence support and source reliability.

↑ Back to contents

2. Why Grounding Matters

Generative AI models can produce fluent responses even when they lack sufficient information to answer accurately.

Grounding helps reduce the risk of unsupported claims by connecting responses to evidence that can be examined.

Without effective groundingWith effective grounding
Answers may rely on unsupported assumptions.Answers are designed around identifiable evidence.
Users may struggle to verify claims.Relevant sources can be inspected.
Outdated information may go unnoticed.Source currency can be checked.
Uncertainty may be hidden.Missing evidence can trigger clarification or escalation.
Errors may be difficult to diagnose.Retrieval and evidence-use failures can be investigated.

Grounding is especially valuable in applications where answers must reflect specific organizational information rather than general model knowledge.

↑ Back to contents

3. How Grounding Works

A typical document-grounded AI workflow may follow this sequence:

User Question
      |
      v
Identify Information Need
      |
      v
Retrieve Relevant Evidence
      |
      v
Check Source and Applicability
      |
      v
Generate Evidence-Based Answer
      |
      v
Validate Claims and Citations
      |
      v
Return Answer or Escalate

Consider an employee asking about hotel reimbursement.

The application retrieves the relevant travel policy, identifies the applicable section, generates an answer, and links the claim to its supporting passage.

If the policy does not contain the requested information, the system should avoid inventing an answer.

Actual implementations may combine or reorder these stages. The central requirement is that claims are supported by appropriate evidence.

↑ Back to contents

4. Core Components of Grounding

A. Relevant evidence

The information must address the user's actual question.

B. Source authority

The source should be appropriate for the task, such as an approved company policy rather than an informal note.

C. Source currency

The application should account for effective dates, revisions, and superseded documents.

D. Claim-evidence alignment

Each important generated claim should be supported by the evidence cited.

E. Attribution

The response should identify its sources when traceability is required.

F. Verification

Critical claims should be checked using suitable validation methods.

G. Uncertainty handling

When evidence is missing, contradictory, or insufficient, the system should respond appropriately.

Key distinction: A citation is a pointer to evidence. Grounding requires the evidence to support the claim.
↑ Back to contents

5. Grounding, RAG, and Factual Correctness

These concepts are closely related but not interchangeable.

ConceptMeaning
RetrievalFinding information potentially relevant to a task.
RAGCombining retrieval with generative AI to produce responses informed by external information.
GroundingConnecting generated claims to appropriate supporting evidence or information.
Factual correctnessWhether a statement accurately represents the relevant facts.
AttributionIdentifying the source associated with a claim.
VerificationChecking whether a claim or result satisfies defined requirements.

A RAG application may retrieve the correct document but still generate an unsupported answer.

A response may also be grounded in a document that contains incorrect information.

Reliable engineering therefore requires both evidence alignment and appropriate checks on the evidence itself.

↑ Back to contents

6. Grounding Techniques

A. Retrieval-augmented generation

Supply relevant information from external sources when answering questions.

B. Source-restricted generation

For suitable tasks, instruct the model to use only specified evidence and acknowledge missing information.

C. Claim-level citation

Associate important claims with the passages that support them.

D. Structured evidence extraction

Extract relevant facts into defined fields before generating a response.

E. Deterministic verification

Use application code, databases, and calculations to verify facts that can be checked mechanically.

F. Source precedence rules

Define which sources take priority when information conflicts.

G. Evidence-aware evaluation

Measure whether responses are supported by the supplied information.

H. Human review

Escalate high-impact or ambiguous cases to qualified reviewers.

These techniques reduce particular risks but must be evaluated for the intended application.

↑ Back to contents

7. Industry Applications

ApplicationGrounding requirement
Enterprise knowledge assistantAnswer using current, approved organizational documents.
Customer supportBase policy claims on authorized support information.
Financial reportingConnect figures to verified records and calculations.
Research assistantSupport claims with authentic, relevant references.
Software engineeringUse actual repository contents, APIs, and tool results.
AI agentsBase decisions on verified environment state and tool observations.
Compliance workflowsTrace interpretations to applicable requirements and approved sources.

The necessary level of verification depends on the consequences of an incorrect answer or action.

↑ Back to contents

8. What Must an AI Engineer Decide?

A. What evidence is authoritative?

Identify trusted sources and define their applicability.

B. How will relevant evidence be found?

Choose appropriate search, retrieval, filtering, and ranking methods.

C. How will source versions be managed?

Prevent superseded information from being treated as current policy.

D. What claims require citations?

Identify numerical values, policy requirements, legal references, and other important assertions.

E. How will citation support be checked?

Validate that cited passages support the specific claims made.

F. How will conflicting evidence be handled?

Apply source precedence, request clarification, or escalate unresolved conflicts.

G. When should the system abstain?

Define acceptable behavior when evidence is unavailable or inadequate.

H. How will grounding quality be evaluated?

Measure retrieval relevance, claim support, factual correctness, and appropriate uncertainty handling.

I. How will untrusted sources be handled?

Prevent retrieved documents and tool outputs from overriding trusted application instructions.

Engineering principle: Grounding is not merely a prompt instruction. It is an end-to-end design responsibility involving information sources, retrieval, generation, verification, and evaluation.
↑ Back to contents

9. Practical Industry Case: The Policy That Was Cited Incorrectly

An employee asks:

"Can I claim hotel expenses of ₹8,000 per night during domestic travel?"

The AI assistant retrieves the company's approved travel policy.

Suppose Section 4.2 states that hotel expenses require approval according to the employee's grade and destination.

The assistant responds:

"Yes. The maximum permitted amount is ₹8,000 per night, according to Section 4.2."

However, Section 4.2 does not specify that amount.

The citation exists, but the claim is unsupported.

Engineering response

  1. Identify the unsupported numerical claim.
  2. Inspect the cited policy passage.
  3. Verify the applicable policy version.
  4. Determine whether another approved document contains the amount.
  5. Check the retrieval and generation stages separately.
  6. Introduce claim-level evidence validation where feasible.
  7. Define behavior for missing reimbursement limits.
  8. Revise prompts and application controls.
  9. Add the case to the evaluation dataset.
  10. Retest the complete workflow.

Better response

"The available travel policy states that hotel reimbursement depends on employee grade and destination. I cannot confirm an ₹8,000 nightly limit from the cited section. Please consult the applicable reimbursement schedule or the responsible department."

Industry insight: An answer with a citation is not necessarily a grounded answer. The cited evidence must justify the conclusion.

↑ Back to contents

10. Try It Yourself

Mini Project: Build a Grounded Policy Assistant

Objective: Test whether an AI assistant can produce answers supported by a supplied document.

  1. Create a fictional company travel policy containing five clear rules.
  2. Include a policy version and effective date.
  3. Prepare ten questions about the document.
  4. Include questions whose answers are absent from the policy.
  5. Ask an AI model to answer using only the supplied document.
  6. Require each factual answer to identify supporting text.
  7. Record the responses and citations.
  8. Check whether each cited passage supports its claim.
  9. Identify unsupported or partially supported answers.
  10. Revise the prompt or workflow.
  11. Repeat the evaluation.
  12. Test the improved system on new questions.

Suggested scoring rubric

ScoreMeaning
2All material claims are supported by relevant evidence.
1Some claims are supported, but important gaps remain.
0Material claims are unsupported or contradict the evidence.

For questions that cannot be answered from the document, appropriately acknowledging insufficient evidence can receive full credit.

Reflection questions

  • Did the model cite relevant passages?
  • Did every citation support the corresponding claim?
  • Were numerical claims verified?
  • Did the assistant handle missing evidence correctly?
  • What happened when documents contained conflicting information?
  • Which checks should be implemented outside the language model?

Success criterion: Produce an evaluation report demonstrating whether generated claims are supported by their cited evidence.

↑ Back to contents

11. Connected Glossary Terms

  • Token: Determines part of the budget available for evidence and answers.
  • Embedding: Helps locate semantically related evidence.
  • Vector Database: Stores and retrieves candidate information.
  • RAG: Supplies external information to the generation process.
  • Context Window: Limits the evidence that can be provided at once.
  • Prompt Engineering: Specifies how evidence should be used.
  • Evals: Measures grounding and factuality performance.
  • Hallucination: Describes a category of unsupported or incorrect outputs.

Previous lessons:

Next lesson: #010 — Guardrails: Keeping AI Within Defined Boundaries.

↑ Back to contents

12. Living Update

Editorial baseline: November 2026

Grounding practices continue to evolve as AI applications use longer contexts, external tools, structured knowledge sources, and agentic workflows.

Important approaches to monitor include:

  • Claim-level citation verification
  • Hybrid and metadata-aware retrieval
  • Evidence quality and source provenance tracking
  • Structured grounding against databases
  • Automated groundedness evaluations
  • Tool-assisted factual verification
  • Grounding in multimodal information
  • Verification of agent actions and observations

Engineers should evaluate these approaches using realistic tasks rather than assuming that additional sources or citations automatically improve reliability.

Living Glossary note: Update this entry as evidence verification and grounding techniques mature.

↑ Back to contents

13. Key Takeaway

Retrieval finds information. Grounding ensures generated claims are supported by appropriate evidence.

A reliable AI application must do more than retrieve documents and display citations. It must use information correctly, recognize gaps, and make important claims verifiable.

Think like an AI engineer: Can we trace each consequential claim to evidence that genuinely supports it?

↑ Back to contents

14. References and Further Reading

↑ Back to contents

AI Engineering — Living Glossary

One Term. One Industry Connection. One Practical Insight. One Action.

AIYING — Accomplishing with AI

Chapter 2 | Episode #009 | GROUNDING

↑ Return to top

AI Engineering Living Glossary #008 — Hallucination: When AI Generates Unsupported Answers

AI ENGINEERING | LIVING GLOSSARY | #008

HALLUCINATION

When AI Generates Unsupported Answers



Chapter 2: Engineering AI for Reliability

AIYING — Accomplishing with AI

Imagine an employee asking an enterprise AI assistant:

Question: "What is our company's hotel reimbursement limit?"

AI response: "Employees can claim up to ₹8,000 per night."

The answer sounds clear and authoritative.

But suppose the approved travel policy contains no such limit.

The AI has produced a plausible-looking statement without adequate support.

This is a typical example of what is commonly called an AI hallucination.

Engineering insight: Fluency is not evidence. AI engineers must distinguish answers that sound correct from answers that are factually correct and adequately supported.

1. What Is an AI Hallucination?

In generative AI, a hallucination commonly refers to generated information that is false, fabricated, internally inconsistent, or unsupported by the relevant evidence or task context.

Examples include:

  • Inventing facts, dates, or figures
  • Producing nonexistent citations
  • Misrepresenting what a document says
  • Inventing product features or company policies
  • Describing nonexistent software functions
  • Claiming that an action was completed when it was not

Researchers and practitioners use the term in somewhat different ways. In particular, factual incorrectness and lack of support from supplied sources are related but distinct problems.

A statement can be factually correct but unsupported by the documents provided. Conversely, a model may faithfully repeat an incorrect source.

AI engineering must therefore examine both correctness and grounding.

↑ Back to contents

2. Why Hallucinations Occur

Language models generate outputs using learned statistical relationships and the context available during inference.

They do not automatically verify every statement against an authoritative source.

Hallucinations can arise from several interacting factors.

A. Missing information

The information required to answer may not be available to the model.

B. Ambiguous requests

The question may lack important details or permit multiple interpretations.

C. Incomplete or misleading context

Retrieved documents may omit relevant facts or contain outdated information.

D. Learned patterns

A model may generate plausible patterns that do not correspond to actual facts.

E. Complex tasks

Long or multi-step tasks may create additional opportunities for unsupported claims and errors.

F. Pressure to provide an answer

Task instructions and interaction patterns may encourage answering even when the available evidence is insufficient.

Important: Hallucinations are not necessarily deliberate deception. They are failures of generated content relative to facts, evidence, or task requirements.
↑ Back to contents

3. Common Forms of Hallucination

TypeExample
Factual fabricationInventing a company's founding year.
Source fabricationCiting a research paper that does not exist.
Source misrepresentationClaiming a document supports a statement it does not support.
Numerical fabricationProducing an unsupported reimbursement amount.
Technical fabricationInventing an API method or software configuration.
Action fabricationClaiming that a database was updated without executing the operation.

These categories are useful for diagnosing failures, although they are not a single universally standardized taxonomy.

↑ Back to contents

4. Why Hallucinations Matter

Unsupported AI outputs can cause practical harm when users or connected applications rely on them.

ApplicationPotential consequence
Customer supportIncorrect promises or misleading policy guidance.
Software engineeringBroken code or nonexistent dependencies.
Enterprise knowledgeIncorrect interpretation of internal documents.
ResearchFabricated references or inaccurate summaries.
Business operationsDecisions based on unsupported information.
AI agentsIncorrect actions based on fabricated state or tool results.

The seriousness of a hallucination depends on the application, the decision involved, and the availability of verification or human oversight.

↑ Back to contents

5. Detecting Unsupported Outputs

Hallucination detection requires checking generated claims against appropriate evidence or expected behavior.

A. Reference-answer comparison

Compare outputs with verified answers where these are available.

B. Source-grounding checks

Determine whether the cited passage actually supports each claim.

C. Factual verification

Check important statements against authoritative information.

D. Structured validation

Validate generated values, permitted categories, and required formats.

E. Tool-result verification

Confirm whether the claimed operation actually occurred.

F. Human expert review

Use qualified reviewers for complex, ambiguous, or high-impact outputs.

G. Automated evaluation

Use repeatable tests and graders, while recognizing that automated graders can also make mistakes.

Engineering caution: A citation does not prove that an answer is correct. The source must exist, be relevant, and support the particular claim.
↑ Back to contents

6. Reducing Hallucination Risk

No single technique eliminates hallucinations in all circumstances.

A. Provide relevant evidence

Use reliable sources and retrieval when the task requires external knowledge.

B. Improve retrieval quality

Retrieve authoritative, current, and relevant information rather than merely semantically similar text.

C. Specify uncertainty handling

Instruct the system to acknowledge insufficient evidence or request clarification.

D. Validate outputs

Use deterministic checks where possible, especially for calculations, structured fields, and tool operations.

E. Require verifiable citations

Preserve source references and check that claims are supported.

F. Decompose complex tasks

Separate retrieval, reasoning, generation, and verification when doing so improves measurable performance.

G. Evaluate systematically

Test typical cases, difficult cases, missing evidence, and known failure patterns.

H. Apply appropriate human oversight

Escalate consequential or uncertain outputs when automated verification is insufficient.

Fine-tuning and model selection may also influence hallucination behavior, but their effectiveness must be tested for the intended task.

↑ Back to contents

7. Industry Applications

Hallucination management is important across many AI engineering applications.

  • RAG assistants: Verify whether answers follow retrieved evidence.
  • Coding assistants: Run tests and check referenced APIs.
  • Research assistants: Verify citations and factual claims.
  • Customer support: Restrict policy claims to approved information.
  • Document extraction: Check extracted fields against source documents.
  • AI agents: Verify tool execution and actual system state.

The appropriate controls depend on the consequences of an incorrect output.

↑ Back to contents

8. What Must an AI Engineer Decide?

A. Which claims require verification?

Identify critical facts, numerical values, citations, and action-completion statements.

B. What counts as authoritative evidence?

Define approved information sources and source precedence.

C. When should the system abstain?

Establish rules for missing, conflicting, or insufficient evidence.

D. What can be checked automatically?

Use application logic, databases, calculators, validators, and other trusted tools.

E. What requires human judgment?

Identify high-impact decisions and cases where evidence is ambiguous.

F. How should hallucination rates be measured?

Define clear error categories and test against representative evaluation datasets.

G. How will failures be investigated?

Distinguish retrieval failures, source-quality problems, generation errors, and verification failures.

H. What happens when verification fails?

Design safe fallback behavior, clarification requests, or escalation procedures.

Engineering principle: Do not rely on confidence of expression as a measure of factual confidence.
↑ Back to contents

9. Practical Industry Case: The Invented Travel Policy

An employee asks:

"What is the maximum hotel reimbursement allowed for a domestic business trip?"

The assistant replies:

"The maximum is ₹8,000 per night."

However, the approved company policy contains no such amount.

Engineering response

  1. Identify the unsupported reimbursement claim.
  2. Inspect the retrieved policy passages.
  3. Check whether the applicable policy version was indexed.
  4. Verify that the question was routed to the correct documents.
  5. Test whether the model invented the value despite insufficient evidence.
  6. Revise the prompt to require evidence for numerical policy claims.
  7. Implement source validation where feasible.
  8. Define an appropriate response when the limit cannot be found.
  9. Add the case to the evaluation dataset.
  10. Retest the system and monitor related failures.

Better response

"I could not find a hotel reimbursement limit in the approved policy information available to me. Please consult the current travel policy or the responsible department before making a claim."

Industry insight: A system that acknowledges missing evidence can be more dependable than one that always produces a confident answer.

↑ Back to contents

10. Try It Yourself

Mini Project: Detect and Reduce Unsupported Claims

Objective: Compare AI responses with and without explicit evidence requirements.

  1. Create a fictional one-page company travel policy.
  2. Include several clearly stated reimbursement rules.
  3. Deliberately omit one requested reimbursement limit.
  4. Prepare ten questions, including answerable and unanswerable cases.
  5. Ask an AI model to answer using the document.
  6. Record factual claims and cited sources.
  7. Identify unsupported statements.
  8. Revise the prompt to require evidence and appropriate uncertainty.
  9. Repeat the test using the same model and settings.
  10. Compare unsupported-claim rates.
  11. Check whether valid answers remain complete and useful.
  12. Test the revised approach on new questions.

Suggested evaluation measures

  • Number of unsupported factual claims
  • Percentage of answers fully supported by evidence
  • Correct handling of unanswerable questions
  • Accuracy of citations
  • Completeness of supported answers

Reflection questions

  • Did the model invent any facts?
  • Did citations actually support the claims?
  • Did requiring evidence reduce unsupported outputs?
  • Did the revised prompt cause unnecessary refusals?
  • Which failures require additional application controls?

Success criterion: Demonstrate a repeatable method for identifying unsupported claims and measuring whether an engineering change reduces them.

↑ Back to contents

11. Connected Glossary Terms

  • Token: Influences the available information and output budget.
  • Embedding: Supports semantic retrieval but does not guarantee factual relevance.
  • Vector Database: Helps retrieve candidate evidence.
  • RAG: Makes external evidence available to generation.
  • Context Window: Limits how much supporting information can be supplied.
  • Prompt Engineering: Specifies evidence use and uncertainty handling.
  • Evals: Measures unsupported outputs and other failure patterns.
  • Grounding: Connects generated claims to supporting evidence.

Previous lessons:

Next lesson: #009 — Grounding: Connecting AI Outputs to Verifiable Evidence.

↑ Back to contents

12. Living Update

Editorial baseline: November 2026

Hallucination mitigation remains an active area of AI engineering.

Important approaches to monitor include:

  • Improved retrieval and source verification
  • Claim-level factuality evaluation
  • Automated citation checking
  • Uncertainty-aware generation and abstention
  • Tool-assisted verification
  • Structured output validation
  • Model-specific reliability evaluation
  • Human review for consequential outputs

New models and techniques may reduce some failure rates, but engineers should verify performance for their own applications.

Living Glossary note: Update this entry as evidence-grounding, factuality evaluation, and verification methods evolve.

↑ Back to contents

13. Key Takeaway

Hallucinations are unsupported or incorrect generated outputs. Reliable AI engineering requires evidence, verification, evaluation, and appropriate handling of uncertainty.

The objective is not to make every answer sound certain. It is to make the system dependable when information is available—and appropriately cautious when it is not.

Think like an AI engineer: What should the system do when it cannot establish that an answer is supported by trustworthy evidence?

↑ Back to contents

14. References and Further Reading

↑ Back to contents

AI Engineering — Living Glossary

One Term. One Industry Connection. One Practical Insight. One Action.

AIYING — Accomplishing with AI

Chapter 2 | Episode #008 | HALLUCINATION

↑ Return to top

Accomplish with AI

Powered by Blogger.

Featured post

AI Engineering Hands-On Lab #001 — Build an AI Answer Reliability Test Bench Without Code

AIYING | Daily 24 — Post 009 AI Engineering Hands-On Lab #001 Build an AI Answer Reliability Test Bench — Without Writing Code Lea...

Search This Blog

List of blogs

Search This Blog

About

Translate

Instant Stories

Read in Your Language

Test

share this

ShareThis

Popular Posts