An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
AI hallucinations cannot be completely eliminated, but there are several approaches that can significantly reduce the likelihood of inaccurate or unsupported responses.
The most effective approach is to ground the model's responses in trusted information rather than relying only on the model's general knowledge.
- Ground the model with trusted data
For applications that need accurate, domain-specific answers, consider using Retrieval-Augmented Generation (RAG). With RAG, relevant information is retrieved from a trusted knowledge source and provided to the model as context before it generates a response.
For example, you can use Azure AI Search as a retrieval source and instruct the model to answer based only on the retrieved information. You can also configure retrieval behavior, such as the number of documents considered and the relevance/strictness of the retrieved content.
This does not guarantee that hallucinations will never occur, but it can substantially reduce unsupported responses.
- Instruct the model not to guess
Your system instructions can explicitly tell the model to:
Answer only when sufficient information is available in the provided sources.
Clearly state when the information is insufficient.
Avoid making up facts, references, or citations.
Base factual answers on the retrieved source material.
At the application level, you can also implement a fallback such as "The requested information could not be found in the available sources" when retrieval does not return sufficiently relevant information.
- Validate the generated response
For a novice user, it can be difficult to determine whether an AI answer is correct, particularly when they do not already know the subject.
A good practice is to require the application to provide the supporting sources or citations used to generate the answer. Important claims can then be verified against authoritative sources such as Microsoft documentation, government publications, academic research, or official product documentation.
For high-impact scenarios, human review should also be considered before relying on or publishing AI-generated information.
- Evaluate groundedness
If you are building an AI application, you can also evaluate whether the generated response is actually supported by the information provided to the model. Microsoft Foundry provides evaluation capabilities that can help assess metrics such as groundedness, relevance, and response completeness.
Azure AI Content Safety also provides groundedness detection to help determine whether a response is supported by the supplied source material.
- For agent-based applications
If you are using Microsoft Foundry Agent Service with tools such as Azure AI Search, make sure the agent's instructions and tool configuration clearly define when retrieval should be used.
Also review other enabled knowledge sources and tools, because multiple sources can affect how an agent obtains information. If retrieval fails or does not return relevant information, the application should have an appropriate fallback rather than allowing the model to fill the gap with unsupported information.
For scenarios where you need a more direct model interaction without agent orchestration, you can also consider using the model's direct inference API rather than an agent-based workflow. This gives you more direct control over the request, although it does not by itself eliminate hallucinations.
- Model parameters
Lowering parameters such as temperature can make responses more deterministic, but this does not guarantee factual accuracy. The more important control for factual accuracy is providing reliable context and validating the generated response.
In summary, there is no single setting that completely prevents hallucinations. A strong approach is:
Trusted data → Retrieval/RAG → Clear instructions not to guess → Citations/evidence → Groundedness evaluation → Human verification for important decisions.
Please refer this Microsoft documentation:
Grounding and RAG prompt engineering
Evaluate generative AI applications in Microsoft Foundry
Groundedness detection in Azure AI Content Safety
I Hope this helps. Do let me know if you have any further queries.
If this answers your query, please do click Accept Answer and Yes for was this answer helpful.
Thank you!