AI models, particularly large language models (LLMs) like ChatGPT, have revolutionised how we interact with technology. They can answer questions, write content, and even create images. However, these powerful tools sometimes produce unexpected and inaccurate results, known as hallucinations. Here, we'll explore the subject of AI hallucinations and how to mitigate them.
What are AI hallucinations?
AI hallucinations occur when an AI model generates incorrect or misleading information but presents it as if it were factual. It's almost as if the AI is 'seeing' or 'understanding' something that's not actually there, hence the term 'hallucination'.
Types of AI hallucinations
AI hallucinations can manifest in various forms, each presenting unique challenges. Here are some common types of AI hallucinations:
- Factual inaccuracies: This occurs when an AI model presents untrue information as a fact. For instance, ChatGPT once claimed that the Golden Gate Bridge was transported across Egypt in October 2016.
- Visual hallucinations: In computer vision systems, AI might perceive objects or patterns that don't exist. For example, seeing pandas in pictures of bicycles.
- False positives and negatives: AI might identify non-existent threats or fail to recognise real ones, which can be particularly problematic in cybersecurity and medical diagnostics.
- Made-up sources or quotes: AI may struggle to consistently identify which parts of text should be treated as bibliographic data, leading to a mix of accurate and fabricated citations and quotes.
- Context-conflicting hallucinations: This is when responses directly contradict the input or conversation context. For example, providing information about Tokyo's weather when asked about Paris.
Hallucinations vs bias
Bias occurs when AI models produce content that reflects systematic errors or distortions, often mirroring human biases found in the training data. This can lead to unfair or prejudiced outputs, such as resume-scanning AI models favouring male candidates.
AI hallucinations and bias are distinct issues in artificial intelligence, though they can sometimes be related. Here are the key differences between AI bias and hallucination:
- Origin: Hallucinations stem from the AI's limitations in processing information and generating responses, while bias often originates from imbalances in training data or flawed algorithm design.
- Consistency: Biased outputs tend to be consistent in their prejudice, whereas hallucinations can be more random and unpredictable.
- Relation to training data: Bias directly reflects patterns in the training data, while hallucinations can produce information entirely unrelated to the AI's training.
- Impact: Bias often perpetuates existing social inequalities, whereas hallucinations can spread misinformation or incorrect decision-making in various fields.
Why AI hallucinations happen
AI hallucinations stem from the fundamental nature of how these models work. LLMs don't truly 'understand' information; they predict the most likely sequence of words based on their training data. Several factors can lead to hallucinations:
- Insufficient or low-quality training data: If the AI lacks relevant information, it may generate a plausible-sounding but incorrect response.
- Overfitting: When an AI model memorises its training data too closely, it struggles to generalise to new situations.
- Misinterpretation of prompts: AI models can sometimes misunderstand the context or intent of a query.
How to mitigate the risk
While it's impossible to prevent AI hallucinations completely, there are ways to minimise their occurrence:
- Prompt engineering: Paying attention to how you create your prompts and using techniques such as chain-of-thought prompting can increase your chances of getting accurate and helpful responses from the AI.
- Using Multiple LLMs: Comparing the outputs from different models helps identify inconsistencies and inaccuracies. Multiple LLMs can also verify each other's outputs, reducing the risk of hallucinations.
- Use specialised AI tools: Opting for AI models designed for specific tasks rather than general-purpose chatbots can significantly reduce hallucinations. Specialised models are trained on domain-specific data, making them more accurate and less prone to errors in their area of expertise.
- Fact-check: Always verify critical information from AI responses. Automated fact-checking tools can streamline this process, but it's essential to maintain human oversight in the process, as AI systems may still make errors.
When using AI tools, always approach the results with a critical eye. Verify important information and use AI as a helpful assistant rather than an infallible oracle. With proper understanding and management, AI can be an incredibly powerful device in our technological toolkit.