{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2606-01301","title":"Med-HEAL: Analyzing and Mitigating Hallucinations in Medical LLMs with Hallucination-Aware In-Context Learning","arxiv_id":"2606.01301","date":"2026-05-31","proceeding":null,"authors":["Yiming Liao","Zeno Franco","Jose Eduardo Lizarraga Mazaba","Keke Chen"],"abstract":"Hallucinations in medical large language models (LLMs) pose serious risks for clinical decision support, particularly when models must reason over complex electronic health records (EHRs). However, existing benchmarks often lack a realistic clinical context and provide limited insight into how hallucinations can be mitigated in practice. We introduce Med-HEAL, a framework for systematically identifying, analyzing, and mitigating hallucinations in medical LLMs using clinically grounded data. Building on the EHRNoteQA benchmark derived from MIMIC-IV discharge summaries, we construct a hallucination dataset by evaluating BioMistral-7B on open-ended clinical question answering tasks. Model outputs are labeled through a dual evaluation pipeline that combines LLM-as-a-Judge assessment (GPT-4o) with human auditing by medical student reviewers, producing correctness judgments and annotations of reasoning errors via a custom web-based evaluation system. We then leverage this dataset to investigate mitigation strategies: a self-critique pipeline, in which the test model reviews its own answers to detect potential errors and regenerates responses for flagged cases, and retrieval-augmented in-context learning (RA-ICL), which exposes the model to hallucinated and corrected examples. Experiments across five open-source LLMs-BioMistral, Llama-3.1, DeepSeek, Qwen2.5, and Qwen3, show that the self-critique strategy improves accuracy for three of five models (p < 0.05) without requiring parameter updates. Med-HEAL provides both a reusable hallucination dataset and a practical framework for studying and mitigating hallucinations in medical LLMs, supporting safer deployment of AI systems in clinical environments. Our code and data are publicly available at https://github.com/yimingliao-blad/med-heal.git.","url_abs":"https://arxiv.org/abs/2606.01301","url_pdf":"https://arxiv.org/pdf/2606.01301","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":null,"mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2606.01301"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/yimingliao-blad/med-heal","reach":null}],"summary":{"ran":14,"unverified":5},"by_repo_kind":{"found_in_text":{"samples":19,"ran":14,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"70bb037a2b4cc449","entry":"assemble_note_text","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/legacy/pilot_12_ra_icl/build_note_embeddings.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/legacy/pilot_12_ra_icl/build_note_embeddings.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"70bb037a2b4cc449"}},{"code_sha256_prefix":"2416e8bb6e0a9f35","entry":"bootstrap_delta","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/stats.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/stats.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2416e8bb6e0a9f35"}},{"code_sha256_prefix":"a7b09b0a06d8ff5a","entry":"build_judge_user","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/llm.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/llm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a7b09b0a06d8ff5a"}},{"code_sha256_prefix":"9fafe34c699ee2cb","entry":"build_pool_embeddings","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/legacy/pilot_12_ra_icl/build_note_embeddings.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/legacy/pilot_12_ra_icl/build_note_embeddings.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9fafe34c699ee2cb"}},{"code_sha256_prefix":"ae3a16d5b0034f27","entry":"copy_asset","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/data_assets.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/data_assets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ae3a16d5b0034f27"}},{"code_sha256_prefix":"0de6339bc4fc5b3a","entry":"env_for_legacy","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/config.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/config.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0de6339bc4fc5b3a"}},{"code_sha256_prefix":"b38b8b67b3db5da2","entry":"evaluate_one","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/legacy/pilot_12_ra_icl/evaluate_fullscale_pilot12.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/legacy/pilot_12_ra_icl/evaluate_fullscale_pilot12.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b38b8b67b3db5da2"}},{"code_sha256_prefix":"f0ebc27fe5d62c02","entry":"file_info","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/data_assets.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/data_assets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f0ebc27fe5d62c02"}},{"code_sha256_prefix":"b9a261c5c75e6950","entry":"load_pilot7_controls","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/legacy/pilot_12_ra_icl/analyze_pilot12.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/legacy/pilot_12_ra_icl/analyze_pilot12.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b9a261c5c75e6950"}},{"code_sha256_prefix":"6f6260842721f3e9","entry":"mcnemar_exact","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/stats.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/stats.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6f6260842721f3e9"}},{"code_sha256_prefix":"de3d34655b0969fb","entry":"paired_summary","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/stats.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/stats.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"de3d34655b0969fb"}},{"code_sha256_prefix":"e125c6da102eac5a","entry":"parse_binary","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/llm.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/llm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e125c6da102eac5a"}},{"code_sha256_prefix":"1aea88fcb5ac567a","entry":"resolve_path","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/config.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/config.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1aea88fcb5ac567a"}},{"code_sha256_prefix":"ccfe2f5d5709a273","entry":"resolve_project_path","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/data_assets.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/data_assets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ccfe2f5d5709a273"}},{"code_sha256_prefix":"60514da571582bde","entry":"classify_question","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/legacy/pilot_12_ra_icl/analyze_fullscale_pilot12.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/legacy/pilot_12_ra_icl/analyze_fullscale_pilot12.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"60514da571582bde"}},{"code_sha256_prefix":"438722c182de3c8c","entry":"load_config","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/config.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/config.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"438722c182de3c8c"}},{"code_sha256_prefix":"9670ba25faf901be","entry":"load_correct_pool","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/legacy/pilot_12_ra_icl/build_retrieval_indices.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/legacy/pilot_12_ra_icl/build_retrieval_indices.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9670ba25faf901be"}},{"code_sha256_prefix":"83941c06f092f61e","entry":"load_pilot_baseline","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/legacy/pilot_12_ra_icl/analyze_pilot12_phase3.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/legacy/pilot_12_ra_icl/analyze_pilot12_phase3.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"83941c06f092f61e"}},{"code_sha256_prefix":"4e4f08fa346f0d9f","entry":"write_matrix","repo":"yimingliao-blad/med-heal","repo_kind":"found_in_text","path":"src/pre_atom/registry.py","file_url":"https://github.com/yimingliao-blad/med-heal/blob/HEAD/src/pre_atom/registry.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4e4f08fa346f0d9f"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}