Cloud concept · Updated

Hallucinations - Hallucinations are AI-generated outputs that present fabricated, incorrect, or unsupported information as though it were reliable.

In short

Generative AI can produce convincing answers without establishing that their claims are true or supported by the supplied evidence. Engineers must account for this limitation because fabricated facts, citations, instructions, or commitments can cause operational failures, legal exposure, and loss of customer trust.

Cloud Concepts Hub →

6 key aspects of Hallucinations

Managing hallucinations requires evidence-based generation, independent validation, appropriate abstention, and controls proportional to the consequences of error.

01
Plausibility is not factuality

Fluent language and specific details do not establish correctness. Verify consequential claims against authoritative documents, databases, or tools rather than relying on the model's apparent confidence.

02
Grounding reduces but does not eliminate risk

Supply relevant, current evidence through retrieval or tool calls, and check whether generated claims are supported by that evidence. Even a faithfully grounded answer can be wrong if the underlying source is incorrect.

03
Abstention is a valid outcome

Design applications to acknowledge missing evidence, ask clarifying questions, or escalate to a person. Test that these behaviors occur instead of fabricated answers when the available context is insufficient.

04
Consistency and correctness are separate

Lower sampling randomness can make responses more consistent without making them true. Evaluate factual accuracy independently from repeatability and output formatting.

05
Risk determines verification strength

Use stronger validation and human approval for legal, financial, medical, or operational decisions. Treat generated content as untrusted input when it can initiate actions or change resources.

06
Legal and trust consequences

False claims, fabricated advice, or invented commitments can harm users and create legal disputes. Review hallucination risks alongside, but separately from, bias, privacy, and intellectual property risks.

Cloud services for Hallucinations

A grounded application can use Amazon OpenSearch Service to retrieve approved evidence and Amazon Bedrock to generate an answer from that evidence. Contextual grounding checks can help flag unsupported responses, while application logic verifies citations, validates tool arguments, and routes consequential decisions for human approval. Amazon SageMaker AI supports custom model development and evaluation when additional control is needed. Across these services, engineers remain responsible for source quality, access controls, representative testing, and monitoring; no individual service makes generated answers automatically true.

Amazon Bedrock

Provides foundation-model inference and capabilities for building grounded applications through Knowledge Bases for Amazon Bedrock. Amazon Bedrock Guardrails includes contextual grounding checks that can help identify unsupported or irrelevant responses in supported workflows, but these checks do not guarantee factual correctness.

Amazon OpenSearch ServiceAmazon OpenSearch Service

Supports vector and hybrid search for retrieving relevant evidence in RAG applications. Retrieval quality, document freshness, access controls, and source metadata affect whether a generator receives useful and appropriate grounding material.

Amazon SageMakerAmazon SageMaker

Supports building, tuning, and deploying models with custom inference and evaluation workflows. Engineers can use these workflows to test unsupported claims, compare model or prompt changes, and implement application-specific validation; hosting or fine-tuning alone does not prevent hallucinations.

Hallucinations exam questions

Real practice exam questions on Hallucinations, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIB-C01 (beta)

A consumer electronics company discovers that its generative AI support assistant has told some customers that their warranties were extended by two years. No such extension exists, but several customers have already relied on the messages when deciding whether to purchase repairs. The company can identify the affected conversations. Leadership wants to limit further harm, address customers who received incorrect information, and preserve unrelated support functions. What should the business sponsor require FIRST?

Show answerCORRECT ANSWER

Temporarily route warranty inquiries to support specialists, retain unrelated support functions, and have an authorized team review affected conversations and proactively resolve incorrect commitments with customers.

This response contains the failing function while preserving other services. Human review and proactive customer follow-up address the harm from fabricated commitments already communicated, including determining appropriate corrections or remedies.

AIP-C01

A company uses an Amazon Bedrock foundation model to draft answers about approved maintenance procedures. Amazon OpenSearch Service stores the authoritative passages in an index distributed across multiple shards. Before releasing an answer, an application retrieves evidence for each generated claim and runs an evidence-support evaluator.

During load testing, some OpenSearch searches return HTTP 200 with timed_out set to true or a nonzero _shards.failed count. These responses can still contain highly relevant passages. The evaluator sometimes approves a claim using these passages even though a missing shard contains a correction that contradicts the claim.

The company requires every evidence search used for verification to complete without a timeout or shard failure. Transient failures may be retried within a fixed verification deadline, but an answer must be withheld if this requirement cannot be met. Existing claim-support checks must remain in place.

Which change BEST meets these requirements?

Show answerCORRECT ANSWER

Set allow_partial_search_results to false on verification searches. Require a successful search response with timed_out set to false and _shards.failed equal to zero before accepting its evidence. Retry unsuccessful or incomplete searches within the deadline, and withhold the answer if any required search cannot complete. Then apply the existing claim-support checks.

Disabling partial search results prevents shard failures from being silently accepted as usable partial evidence. Explicitly checking timeout and shard-completion indicators ensures that an HTTP-successful but incomplete response does not pass the verification boundary. Bounded retries allow recovery without releasing an answer when verification cannot complete. Complete retrieval still does not prove factual correctness, so the existing claim-support checks remain necessary.

AIF-C01

A software company uses an Amazon Bedrock foundation model to help customers write commands for its developer tools. The assistant sometimes invents command-line flags for newly released versions. The company updates its official command reference weekly and needs answers to reflect the customer's installed version without retraining the model. Which approach best addresses this problem?

Show answerCORRECT ANSWER

Retrieve relevant passages from the current official reference for the installed version, include them in the prompt, and instruct the model to acknowledge when the passages do not support an answer.

Retrieval-augmented generation supplies authoritative, version-specific information at request time without retraining. Restricting answers to that evidence and acknowledging gaps reduces the risk of invented flags, although it does not guarantee accuracy.

Practice Hallucinations in a full exam

Questions on Hallucinations in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Hallucinations

3 min read

Hallucinations occur when a generative AI system produces information that is false, fabricated, or unsupported by the evidence it should use. Examples include nonexistent API parameters, invented legal precedents, incorrect product specifications, and summaries that attribute statements to documents that never contained them. A response can be grammatically correct, internally coherent, and confidently worded while still being unreliable.

Language models generate sequences based on learned patterns and the context supplied at inference time; this process does not inherently verify every claim against an authoritative source. Missing context, ambiguous requests, outdated information, and poor retrieval can increase the likelihood of unsupported answers. Hallucination is not intentional deception, and a model's confident wording is not a calibrated measure of factual correctness.

In cloud applications, hallucinations matter whenever generated content influences users or downstream systems. A customer-support assistant might invent a refund entitlement, while an engineering assistant might recommend a nonexistent configuration setting. If an agent passes an invented resource identifier into a tool, the error can propagate into an operational workflow. Validate tool arguments, enforce authorization independently of the model, and require approval before consequential actions.

Retrieval-augmented generation, or RAG, reduces risk by supplying relevant information from controlled sources. For example, a support application can retrieve the current refund policy and instruct the model to answer only from that policy, citing the supporting passage. However, retrieval can return stale, irrelevant, or incomplete material, and generation can still misrepresent it. A citation is useful only when the cited source exists and actually supports the claim.

Other controls include explicit instructions to acknowledge insufficient evidence, authoritative API lookups, schema validation, deterministic calculations, grounding checks, and human review. Schema validation confirms structure, not factual truth. Lowering temperature generally reduces sampling variability but does not guarantee correctness; a system can repeatedly produce the same false answer. Fine-tuning can improve task behavior but does not replace reliable evidence or verification.

Hallucination is related to, but distinct from, other generative AI disadvantages. Inaccuracy is broader and can include ordinary classification or calculation errors. Nondeterminism concerns variation between executions rather than truthfulness. Limited interpretability makes it difficult to establish why an answer was produced, but an explanation generated by the same model is not proof that its answer is correct. Biased output and intellectual property infringement are separate risks that can coexist with hallucinations.

Legal exposure depends on the use case and applicable law. Fabricated statements about a person may create defamation risk, invented contractual assurances may trigger disputes, and incorrect medical or financial guidance may harm end users. Fabricated attribution or licensing claims can also mislead users about intellectual property rights. Use risk-based review, appropriate disclosures, and clear escalation paths; disclaimers alone do not make unsafe output acceptable.

Evaluate systems with representative questions, authoritative reference answers, unsupported-claim checks, and cases where the correct behavior is to abstain. Monitor production failures and repeat evaluations when models, prompts, tools, or retrieval data change. Stronger verification increases latency, cost, and review effort, but those trade-offs are often justified when incorrect output could affect safety, money, legal rights, or customer trust.

Learn Hallucinations in lessons

6 short lessons on Hallucinations in 3 certification courses.

Open the lessons