Abstract:
Large Language Models (LLMs) hold promise for advancing natural language understanding in specialized domains such as healthcare. However, their tendency to generate factually incorrect or misleading content, known as hallucinations, poses significant
risks in clinical applications. This thesis addresses the challenge of hallucination detection in domain-specific LLMs by leveraging internal model representations to identify factual inconsistencies. Focusing on the medically specialized MMed-Llama-3-8B
model, the research employs layer-specific probing via Multi-Layer Perceptrons (MLPs),
trained using cross-validation on curated biomedical question-answering datasets. To
improve detection beyond individual layer performance, ensemble strategies were introduced, including a Genetic Algorithm-optimized voting mechanism and a TabPFNbased meta-classifier. The best ensemble configuration achieved an F1-score of 0.63
for hallucination detection and an overall accuracy of 75% on test data. These results
demonstrate that internal states encode meaningful signals for detecting hallucinations,
and that multi-layer aggregation enhances detection reliability. While internal probing
alone may not suffice for fully autonomous deployment in clinical settings, it represents a
valuable tool for augmenting trust and safety in LLM-assisted medical decision-making.