Manuscript Offprint

arXiv:2608.26587

Surgical Alignment in Knowledge Graph Training for Clinical Diagnosis with Large Language Models

Saksham Khatwani, He Cheng, Majid Afshar, Dmitriy Dligach, Yanjun Gao

Abstract

Biomedical knowledge graphs (KGs) offer structured medical knowledge that can ground large language model (LLM) reasoning in clinical diagnosis application, yet how KG signal should be integrated into LLMs remains an open question. We present a systematic study spanning five KG task formulations, three training paradigms, two KGs, and three base LLMs. At the task level, all paradigms improve over the non-finetuned baseline, but methods with comparable in-domain accuracy show substantially different knowledge transfer behavior. We introduce Gradient Intervention Density (GID) and Gradient Distortion (GD) to measure how broadly an optimizer modifies the pretrained model. GID and GD together reveal a clear divide: KG-judgment training under KL regularization produces sparse, localized updates (a regime we term as surgical alignment), while task-specific SFT produces dense ones. A controlled ablation shows that the objective and KL contribute to sparsity independently, and the paradigms that produce sparse updates also improve reasoning quality, even when their in-domain accuracy is lower than task-specific SFT. Assessing KG-LLM integration thus requires complementing accuracy with optimization-geometry diagnostics. Our implementation can be found at https://github.com/LARK-NLP-Lab/Surgical-Alignment.

1 Introduction

Large language models (LLMs) have demonstrated remarkable potential in clinical diagnostics (Goh et al., 2024; Liu et al., 2025), yet their outputs remain prone to factual error rather than grounded medical logic (Kim et al., 2025; Asgari et al., 2025). Biomedical Knowledge Graphs (KGs), which encode clinical concepts and their relations in a curated, structured form, offer a natural scaffolding necessary for trustworthy reasoning for grounding LLM reasoning in medical knowledge. However, how to incorporate KGs into LLMs for clinical diagnosis remains an open question.

Existing approaches differ in where the KG enters the pipeline. Inference-time methods use KG as retrieval context (e.g. Retrieval-Augmented Generation with prompting-based method (Gao et al., 2025; Zuo et al., 2025), or with external memories for agentic systems (Anokhin et al., 2025; Xu et al., 2025)). Training-time methods supervise LLM directly on KG-derived signals, either through supervised fine-tuning of the graph structure (Tian et al., 2024; Chen et al., 2025b,a), or through preference-based reinforcement learning (RL) such as Group Relative Policy Optimization (GRPO) (Shao et al., 2024), reasoning as a reward model (Yan et al., 2025; Han et al., 2025), and implicit rewards derived from KG (Kansal and Jha, 2026). Within training-time methods, approaches further differ in task formulation: models may be trained to judge candidate reasoning paths or to generate paths from partial input (Kansal and Jha, 2026). As existing work is largely optimized and evaluated on narrow benchmarks and task-specific targets, the field lacks a unified understanding of which task formulations and objectives produce KG-grounded reasoning that generalizes beyond the supervision task, particularly in clinical diagnosis where KG reasoning may improve faithfulness.

We focus on the training-time question through a systematic study spanning five KG task formulations, consisting of three judgment-based tasks that assess the validity of reasoning paths and two generative tasks that complete partial reasoning chains. Moreover, we study three training paradigms, two KGs (UMLS (Bodenreider, 2004) and PrimeKG (Chandak et al., 2023)), and three base LLMs (Qwen2.5-7B, Qwen3-8B, Gemma-7B) (Qwen et al., 2025; Yang et al., 2025; Team et al., 2024). We investigate two complementary questions: (i) how each combination of task formulation and training paradigm shapes transfer to other KG tasks and downstream clinical benchmarks, and (ii) how each training objective reshapes the pretrained model itself. For the first, we evaluate transfer using ROUGE-L (Lin, 2004), CUI-F (Afshar et al., 2024; Gao et al., 2022), and QA accuracy across diagnosis prediction (ProbSum, DDXPlus) (Gao et al., 2022; Tchango et al., 2022) and medical QA (MedQA, MedMCQA) (Jin et al., 2020; Pal et al., 2022). All paradigms improve over the non-finetuned baseline, but methods with comparable in-domain accuracy exhibit substantially different transfer behavior, and their relative ordering reverses across benchmarks.

For the second, we move beneath task performance, since accuracy alone does not reveal how a given objective actually reshapes the model. We introduce Gradient Intervention Density (GID), a layer-wise diagnostic that quantifies the sparsity of an optimizer's update footprint relative to the pretrained baseline. Additionally, we define Gradient Distortion (GD), which quantifies the deviation of model parameters from their pretrained baseline. Judgment-based KG objectives under Kullback-Leibler (KL) regularization induce sparse, localized updates, a regime we term surgical alignment, whereas task-specific SFT produces dense ones. A controlled ablation study shows that the KG objective alone produces sparser updates than task-specific SFT (even without KL), and also improves clinical reasoning quality evaluated by PDSQI-9 (Croxford et al., 2025).

Our proposal is not a new RL architecture, but a novel analytical framework and insights for KG-LLM integration: the impact of different training paradigm on KGs, and what changes go behind it. Optimization geometry, alongside task accuracy, becomes a first-class evaluation dimension. While we evaluate this framework in clinical use-cases, it is domain agnostic. Our contributions include:

• Empirical landscape of KG-LLM integration

We present a comprehensive study of various KG task formulations (path-judging vs. path generation), training paradigms (supervised fine-tuning vs. reinforcement learning), KG and LLM choice, examining how each combination shapes knowledge transfer across KG tasks and clinical diagnostic benchmarks.

• A lens of optimization-geometry We provide the first application of gradient-level optimization-geometry analysis to KG-LLM integration. We introduce Gradient Intervention Density (GID) and Gradient Distortion (GD), layer-wise metrics that quantifies the sparsity and deviation of an optimizer's update footprint relative to the pretrained baseline.

• Conceptualizing surgical alignment Combining GID and GD analysis with a controlled ablation that varies training objective and KL strength independently, we establish surgical alignment: a regime where judgment-based KG training produces sparse, localized parameter updates that co-occur with improvements on higher-level PDSQI-9 reasoning dimensions (organization, synthesis), even when in-domain accuracy is lower than task-specific SFT.

References (24)