Skip to content

Task/hallucination detection - #1010

Closed
Kesavar-Kabilar wants to merge 12 commits into
sunlabuiuc:masterfrom
Kesavar-Kabilar:task/hallucination_detection
Closed

Task/hallucination detection#1010
Kesavar-Kabilar wants to merge 12 commits into
sunlabuiuc:masterfrom
Kesavar-Kabilar:task/hallucination_detection

Conversation

@Kesavar-Kabilar

@Kesavar-Kabilar Kesavar-Kabilar commented Apr 18, 2026

Copy link
Copy Markdown

Hallucination Detection Task for MIMIC-IV
Contributor: Kesavar Kabilar (kabilar2@illinois.edu)

Type of Contribution: Standalone Task

Original Paper: Hegselmann et al. (2023)

High-Level Description
This contribution introduces a HallucinationDetectionTask designed to verify the factual consistency of clinical summaries against source medical notes. Using an Anchored Cropping strategy, the task centers a 100-word context window around potential hallucinations to ensure the model has sufficient clinical evidence while staying within Transformer sequence limits.

We validated this implementation with a Source-Summary Mismatch Ablation, achieving 74% accuracy on original pairs and 92% on mismatched pairs, proving the model's sensitivity to grounded evidence.

File Guide
pyhealth/tasks/hallucination_detection.py: Core logic for the detection task.
pyhealth/tasks/init.py: Task registration.
tests/test_hallucination.py: Unit tests using synthetic patient data (performance: <1s).
examples/mimic4_hallucination_detection_transformer.py: Full pipeline and ablation study script.
docs/api/tasks/pyhealth.tasks.HallucinationDetectionTask.rst: API documentation.
docs/api/tasks.rst: Updated index for the tasks documentation.

@Kesavar-Kabilar
Kesavar-Kabilar force-pushed the task/hallucination_detection branch from 41ea079 to 1683b0d Compare April 18, 2026 22:25

@jhnwu3 jhnwu3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.google.com/presentation/d/1WQiCGVjBM2MSyWN6Vmcygf0kNwXDPhXO2VjT1CsghFA/edit?usp=sharing

Please see this.

There's a bunch of other issues like the schemas here are not meant to be primitive schemas, but rather what downstream representation these inputs should be, etc.

For instance, there's a binary processor here.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

@github-actions github-actions Bot added the stale label Aug 8, 2026
@github-actions

Copy link
Copy Markdown

This PR has been automatically closed due to inactivity. Please re-open it if you think it is still relevant.

@github-actions github-actions Bot closed this Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants