Source-linked AI summary

Syndrome, Synergy, and Safety: Structured Reasoning and Knowledge-Driven Alignment for TCM Prescription Generation

Zheng Chen, ZhiCheng Du, Haoxuan Li, Peiwu Qin

arXiv:2609.25755v1cs.CLcs.AI

TL;DR

LLM-based TCM prescription generation lacks auditable li-fa-fang-yao reasoning, longitudinal follow-up adjustment, and strict enforcement of contraindication rules. The paper proposes a progressive four-stage framework combining structured reasoning, trajectory modeling, and rule-based DPO alignment. Across the reported evaluations, Mistral-7B surpasses zero-shot GPT-5 on all three TCM metrics, while the safety checker and probe set have stated coverage limits.

  • Problem

    LLMs lack auditable li-fa-fang-yao reasoning, symptom-driven follow-up adjustment, and strict enforcement of absolute TCM contraindication rules.

    Source: §1 · p. 1
  • Method

    A progressive SFT, PG-CoT, Dynamic, and K-RL framework constrains reasoning to li-fa-fang-yao, models follow-up transitions, and encodes pharmacological rules as DPO preference signals.

    Source: §1 · p. 1, §6 · p. 8
  • Results

    Mistral-7B at 7B parameters surpasses zero-shot GPT-5 on all three TCM evaluation metrics.

    Source: §5.1 · p. 6
  • Takeaways & Limitations

    Across diverse model families and scales, the framework substantially improves prescription quality, reasoning auditability, and adversarial safety.

    Source: §6 · p. 8

    The safety checker covers explicit incompatibility rules and toxicity, while its 53-scenario probe set may not represent the full range of clinical safety challenges.

    Source: Limitations · p. 9

Abstract

from arXiv · show

Applying large language models to Traditional Chinese Medicine (TCM) prescription generation reveals three clinically critical gaps: models produce end-to-end mappings without auditable reasoning following the li-fa-fang-yao paradigm (SR Gap), treat each encounter in isolation without follow-up adjustment via sui zheng jia jian (LA Gap), and fail to enforce absolute contraindication rules such as Shi Ba Fan (SC Gap). We propose a progressive four-stage framework (SFT $\to$ PG-CoT $\to$ Dynamic $\to$ K-RL) that addresses each gap: PG-CoT constrains CoT distillation under the li-fa-fang-yao paradigm to produce auditable diagnostic chains, Dynamic SFT models patient trajectories with explicit transition reasoning, and K-RL encodes deterministic pharmacological rules as rule-based DPO preference signals. Across 12 fine-tuned models and 6 zero-shot baselines, our framework substantially improves prescription quality over zero-shot baselines---with a 7B model (Mistral-7B) surpassing zero-shot GPT-5 on all three TCM evaluation metrics.

1 Introduction

LLM-based TCM prescription generation faces gaps in auditable li-fa-fang-yao reasoning, follow-up adjustment, and enforcement of absolute contraindication rules. The paper proposes a four-stage framework to address these gaps and evaluates it against fine-tuned and zero-shot models.

1 Introduction

  • TCM prescribing requires a structured path from syndrome differentiation to formula composition, and missed steps risk patient safety.Junior practitioners may lack prescribing experience, especially in follow-up visits, which represent a substantial share of TCM outpatient care.Source: §1 · p. 1
  • LLMs map symptoms directly to prescriptions without an auditable li-fa-fang-yao chain, and do not strictly enforce Shi Ba Fan and Shi Jiu Wei rules.The paper identifies these as the Structured Reasoning and Safety Compliance gaps; contraindicated combinations may be life-threatening.Source: §1 · p. 1
  • Existing medical LLMs treat follow-up encounters in isolation, despite the need to adjust herbs and dosages as symptoms evolve.The paper identifies this as the Longitudinal Adaptation Gap.Source: §1 · p. 1
  • The framework combines SFT, PG-CoT, Dynamic, and K-RL to build interpretability, longitudinal adjustment, and hard safety on a common foundation.PG-CoT constrains reasoning to li-fa-fang-yao, Dynamic models sui zheng jia jian, and K-RL encodes pharmacological rules as DPO preference signals.Source: §1 · p. 1
  • The evaluation covers 12 fine-tuned models and 6 zero-shot baselines, with the framework reported to outperform zero-shot high-parameter models.Figure 1 presents the three clinical gaps, the progressive framework, and its targeted outcomes.Source: §1 · p. 2, Figure 1 · p. 2

2 Related Work

Prior work covers medical LLMs, TCM NLP, reasoning distillation, safety alignment, and longitudinal patient modeling, but the passages describe unresolved gaps in structured TCM prescription reasoning and follow-up adjustment.

2.1 Medical NLP and TCM

  • TCM-specific NLP has addressed extraction and syndrome classification, while TCM LLMs and benchmarks described here do not tackle prescription generation quality and structured reasoning together.The passage also notes that no prior work systematically models longitudinal follow-up reasoning in TCM prescription generation.Source: §2.1 · p. 2

2.2 Chain-of-Thought and Knowledge Distillation

  • Free-form medical CoT may produce clinically illogical TCM rationales, motivating constrained reasoning that follows the li-fa-fang-yao paradigm.The passage contrasts this need with prior free-form medical CoT and calls for auditable diagnostic chains.Source: §2.2 · p. 2

2.3 Safety Alignment and RLAIF

  • Because TCM contraindications are deterministic pharmacological facts, the paper investigates rule-based rewards as an alternative to preference-based safety alignment.The passage characterizes rule-based rewards as offering zero annotation cost, interpretability, and consistency.Source: §2.3 · p. 2

2.4 Longitudinal Clinical Modeling

  • Existing longitudinal medical models do not explicitly compare symptom evolution and justify herb or dosage changes, which is the sui zheng jia jian capability addressed here.The passage distinguishes clinical follow-up decisions from conversational continuation.Source: §2.4 · p. 2

3 Method

The method formulates TCM prescription generation as producing both a structured diagnostic chain and a prescription, with follow-up cases additionally requiring symptom-evolution reasoning. Its stages add paradigm-guided reasoning, longitudinal adjustment, and rule-based safety alignment.

3.1 Task Definition

  • Given a patient record, the task produces a li-fa-fang-yao reasoning chain and herb-dosage pairs; follow-up cases also use the initial prescription to generate an adjusted one.The framework treats reasoning as conditioning prescription generation, alongside longitudinal dependencies and hard herb-incompatibility constraints.Source: §3.1 · p. 3

3.2 PG-CoT: Paradigm-Guided Chain-of-Thought Distillation

  • PG-CoT distills DeepSeek-R1 reasoning into student models while enforcing the li-fa-fang-yao sequence for clinically auditable diagnostic decisions.The chain includes syndrome analysis, treatment principle, formula rationale, and safety verification; a pilot comparison reports auditability +0.29 and logical inconsistency −0.12 for the structured variant.Source: §3.2 · p. 3

3.5 Training Overview

  • LoRA adapters are inherited across the four stages, and DPO starts from the Dynamic adapter to preserve reasoning and longitudinal capabilities.The DPO stage is trained for one epoch to avoid alignment tax.Source: Figure 2 · p. 4, §3.4 · p. 5, §3.5 · p. 5

3.3 Dynamic Regime: Longitudinal Follow-up Modeling

  • Dynamic follow-up reasoning compares symptoms across visits, explains herb additions or removals, and summarizes the new prescription’s compatibility logic.Pseudo-IDs link records into 17,985 trajectories; filtering by herb-set Jaccard similarity yields 24,689 dynamic samples.Source: §3.3 · pp. 3–4

3.4 K-RL: Knowledge-Driven Preference Alignment

  • K-RL uses deterministic contraindication knowledge as a rule-based DPO reward, with synthetic rejected prescriptions created by injecting contraindicated herbs.Chosen prescriptions pass the checker with S(y)=1.0 and human review; the synthetic-negative distribution may not cover evaluation-time adversarial scenarios.Source: §3.4 · pp. 4–5

4 Experimental Setup

The experiments evaluate stage-wise models against shared held-out cases and zero-shot baselines, using measures of prescription quality, reasoning alignment, and adversarial safety. The setup also notes a format-related caveat for PQS comparisons.

4 Experimental Setup

  • The study evaluates 12 fine-tuned models via QLoRA on a unified 871-case held-out set and compares them with 6 zero-shot baselines.The baselines comprise three general-purpose models and three TCM-specific models, evaluated on the same test and adversarial probe sets.Source: §4 · p. 5, §4.1 · p. 6

4.1 Data and Models

  • The dataset comes from 124,593 TCM outpatient records; all stages share the same 871-case test set after train/test decontamination.Baseline training is sampled to 40K from 94,986 decontaminated records.Source: §4.1 · p. 5, Table 1 · p. 6

4.2 Evaluation Metrics

  • PQS, CQS, and VR assess prescription quality, reasoning alignment, and safety; VR is evaluated on 53 adversarial prompts and lower values are better.The probe set contains direct, contextual, and open-generation prompts and is reported to have a 100% trigger rate.Source: §4.2 · p. 6
  • PQS comparisons between baseline and CoT models may be biased upward for baselines because long structured CoT outputs can cause parser mis-extraction.The passage refers to Appendix H for this format-bias caveat.Source: §4.2 · p. 6

5 Results and Analysis

The results report gains in reasoning quality, longitudinal adaptation, and safety, with Mistral-7B surpassing zero-shot GPT-5 on all three TCM evaluation metrics. Stage-wise results show progressive CQS gains, while PQS comparisons require attention to format bias.

5.1 Main Results

  • Mistral-7B at 7B parameters surpasses zero-shot GPT-5 on all three TCM evaluation metrics.Table 4 compares representative fine-tuned models with zero-shot baselines.Source: §5.1 · p. 6, Table 4 · p. 8

5.2 Comparison with Zero-Shot Baselines

  • Fine-tuned models outperform high-parameter general-purpose and TCM-specific models on prescription quality and reasoning alignment.The comparison advantage is most pronounced on CQS and VR.Source: §5.1 · p. 6, §5.2 · p. 7

5.1 Main Results

  • PG-CoT produces structured li-fa-fang-yao chains with high reasoning alignment, while Dynamic SFT preserves clinical quality and enables follow-up reasoning.K-RL further improves longitudinal adaptation.Source: §5.1 · p. 6
  • Structured reasoning and K-RL reduce safety violations; fine-tuned models achieve lower adversarial VR than all zero-shot baselines.K-RL is most consistent on models with high baseline vulnerability.Source: §5.1 · p. 6, Table 3 · p. 7

5.3 Stage-by-Stage Ablation

  • PG-CoT brings CQS to approximately 0.72 on Mistral models; Dynamic preserves CQS, and K-RL raises it further across three models.The apparent PQS drop is largely format bias; Table 5 summarizes stages A–D, and Figure 4 shows representative stage-wise CQS trajectories.Source: §5.3 · p. 8, Table 5 · p. 8, Figure 4 · p. 8

6 Conclusion

The conclusion presents a progressive four-stage framework for addressing gaps in auditable reasoning, follow-up adjustment, and contraindication safety in TCM prescription generation. It reports improved prescription quality, reasoning auditability, and adversarial safety across model families and scales.

6 Conclusion

  • The four-stage SFT → PG-CoT → Dynamic → K-RL framework targets missing auditable reasoning, longitudinal follow-up adjustment, and contraindication safety.Its stages use paradigm-constrained CoT distillation, sui zheng jia jian transition reasoning, and rule-based DPO preference signals from synthetic safety pairs.Source: §6 · p. 8
  • The framework substantially improves TCM prescription quality, reasoning auditability, and adversarial safety across diverse model families and scales.The conclusion characterizes paradigm-constrained fine-tuning as effective for specialized clinical domains.Source: §6 · p. 8
  • K-RL encodes deterministic pharmacological rules as rule-based DPO preference signals constructed from synthetic safety pairs.This is the conclusion’s stated mechanism for targeting hidden contraindication violations.Source: §6 · p. 8

Limitations

The limitations constrain the safety checker’s scope and the evidence for generalization, stage-specific effects, and longitudinal performance. Several findings also depend on model architecture, data source, or evaluation size.

Limitations

  • The checker covers explicit incompatibility rules and toxicity classifications, not clinical indication-level safety or dosage safety beyond a 40% tolerance window; its probes cover only 53 scenarios.The authors caution that those scenarios may not represent the full range of clinical safety challenges.Source: Limitations · p. 9
  • PG-CoT and K-RL safety benefits are model-dependent, and the authors say K-RL’s safety preferences are only partially internalized.K-RL lowers VR on some architectures but raises it on Gemma-2-9B; PG-CoT lowers VR on Gemma-2-9B but raises it on Phi-3-Mini.Source: Limitations · p. 9
  • The sequential training design confounds K-RL’s added benefit with continued SFT, so stage-wise deltas cannot fully isolate component contributions.K-RL starts from the Dynamic SFT adapter; the authors suggest comparing SFT+DPO without knowledge-based pairs against SFT+KRL.Source: Limitations · p. 9
  • The unified test set contains only initial visits, so longitudinal reasoning is tested indirectly rather than through stratified follow-up evaluation.Pseudo-IDs may also split records from one patient or merge records from different patients.Source: Limitations · p. 9
  • The clinical data come from specific outpatient departments, and generalization to other institutions, regions, or TCM traditions has not been validated.Source: Limitations · p. 9
  • PG-CoT student models inherit errors in DeepSeek-R1 reasoning that pass human review, although structured outputs make those errors auditable and correctable.Source: Limitations · p. 9
  • Expert evaluation covers two raters, 100 cases, and one model, while practical clinical impact remains untested in prospective deployment.The authors report Cohen’s κ = 0.77 and state that these findings may not generalize across model families.Source: Limitations · p. 9

Ethics Statement

The paper describes its clinical reasoning gaps, training data and pilot evaluation, alongside research-use and ethics statements. Its ethics statement reports de-identified, approved outpatient records and cautions against clinical use without oversight and regulatory approval.

Ethics Statement

  • The data were de-identified before access, approved by the originating hospital’s ethics committee, and contained no retained personally identifiable information; the safety checker is supplementary to clinical judgment.The encoded pharmacological rules come from established pharmacopeial references.Source: Ethics Statement · p. 9
  • The models are for research only, not clinical decision-making without medical oversight and regulatory approval; AI was used to polish the manuscript.Source: Ethics Statement · p. 10

A.1 The Li-Fa-Fang-Yao Paradigm and the SR Gap

  • The li-fa-fang-yao chain links pathomechanism, therapeutic principle, formula selection, and herbs; current LLMs map symptoms to prescriptions without an auditable chain.The clinical sequence also includes syndrome differentiation and safety verification; the paper says free-form reasoning does not meet the fixed paradigm.Source: §A.1 · p. 12

A.2 Follow-Up Visits and the LA Gap

  • Follow-up prescribing compares current symptoms with the prior visit, identifies improvement, persistence, and new manifestations, then adds, removes, or adjusts herbs and dosages.The paper calls this sui zheng jia jian and says existing LLMs treat visits independently.Source: §A.2 · p. 12

A.3 Absolute Pharmacological Prohibitions and the SC Gap

  • Shi Ba Fan and Shi Jiu Wei are absolute herb-incompatibility rules; the paper distinguishes these deterministic constraints from general toxicity and motivates specialized PG-CoT, Dynamic, and K-RL components.Combining incompatible herbs can cause severe toxicity or loss of efficacy, while standard RLHF relies on human-label preferences.Source: §A.3 · pp. 12–13, §A.4 · p. 13

B Training Hyperparameters

C Data Pipeline Details

  • The dataset pipeline starts with 124,593 clinical records and retains 24,689 follow-up samples using herb-set Jaccard similarity; herb-name normalization reaches 95.76% coverage.The records yield 17,985 trajectories; pseudo-IDs are used because unique patient identifiers are absent, and single-visit patients are excluded.Source: C Data Pipeline Details · pp. 13, 15, Figure 5 · p. 14

D PG-CoT Pilot Experiment: Free-form vs. Paradigm-Guided CoT

  • In a 500-case pilot, PG-CoT improved auditability by 0.29 and reduced logical inconsistency by 0.12 versus free-form CoT, while also improving prescription quality.The two variants used the same training source and hyperparameters; two licensed practitioners rated auditability and inconsistency on 100 outputs.Source: D PG-CoT Pilot Experiment: Free-form… · p. 15, Table 7 · p. 15

F Metric Design Rationale

The evaluation separates prescription quality, reasoning alignment, and adversarial safety, while accounting for format-related scoring artifacts. Results show that parsing failures can distort prescription scores, so cross-stage comparisons require care.

F Metric Design Rationale

  • Dosage accuracy carries the largest PQS weight (35%), while herb-set F1 contributes 30%, Jaccard 15%, herb count 10%, and safety 10%.Safety violations reduce PQS even when other components score highly; the safety score saturates at 1.0 on the standard test set.Source: F Metric Design Rationale · pp. 15–16
  • CQS combines baseline SFT prescription quality (PQSbase) at 0.6 with reasoning alignment (Areason) at 0.4, separating prescription quality from structured-chain similarity.Areason compares the model’s li-fa-fang-yao sections with expert-verified reference reasoning; fixed PQSbase avoids format-bias artifacts across stages.Source: F Metric Design Rationale · p. 16
  • Because standard cases do not discriminate safety performance, VR probes contraindication adherence under adversarial prompts and ranges from 0.038 to 0.432.The probes include direct requests, contextual triggers, and open generation, from explicit rule-violation requests to less signposted contraindications.Source: F Metric Design Rationale · pp. 16–17

G Complete Results

  • DS-R1-Distill-8B’s PQS falls from 0.560 to 0.268 at PG-CoT, then rises to 0.649 at Dynamic as output formatting improves.Its low Structural Completeness (StrC = 0.09) causes parser mis-extraction; the more stable CQS trajectory indicates the PQS swing is a parser artifact.Source: G Complete Results · p. 17

H Format Bias Quantification

  • Rx-Only extraction raises Herb F1 from ∼0.26 to ∼0.73 and reduces zero-F1 samples from ∼400/871 to ∼10/871, indicating that apparent CoT-related PQS decline is a parsing artifact.The comparison uses dosage-pattern-only extraction from the fang-yi-jie-gou section.Source: H Format Bias Quantification · p. 17
  • Format bias is more severe in models with low Structural Completeness; CQS uses format-stable baseline PQS to reduce parsing artifacts in cross-stage comparisons.DS-R1-Distill-8B (StrC=0.09) drops from 0.560 to 0.268 at PG-CoT, while Qwen3.5-27B (StrC=0.06) drops from 0.566 to 0.310.Source: H Format Bias Quantification · p. 17

I Small Model Structured Output Failures

  • Some models produce unparseable JSON after verbose, repetitive formula rationale, while scale alone does not predict structured-output success.Qwen3.5-0.8B and -2B achieve Areason >0.93 and CQS ≈0.71, whereas Gemma-2-27B remains low; affected outputs typically have well-formed syndrome and treatment-principle sections.Source: I Small Model Structured Output Failures · p. 17

J Case Studies

The cases contrast direct prescription generation with structured reasoning and show how follow-up reasoning can justify changes to a prior formula. The examples illustrate auditable herb selection and adjustment rather than establishing aggregate performance.

Case 1

  • In the initial-visit case, the baseline gives a prescription without diagnostic rationale, while PG-CoT provides a structured chain that makes herb selection auditable.The chain links spleen qi deficiency with dampness to treatment principles and formula rationale.Source: J Case Studies · p. 18
  • For the same initial visit, Dynamic matches PG-CoT and K-RL keeps the prescription unchanged while making safety verification more prominent.No prior prescription exists to adjust in this case.Source: J Case Studies · p. 18

Case 2

  • At follow-up, the baseline generates a new prescription without referring to the prior one, unlike Dynamic’s explicit comparison of current and prior states.The case describes partial improvement after Si Jun Zi Tang, with persistent loose stools and new night sweating.Source: J Case Studies · pp. 18–19
  • Dynamic retains the spleen-fortifying base, adds herbs for qi and sweating, and removes drying herbs because dampness has reduced.It combines the modified Si Jun Zi Tang with Yu Ping Feng San and explains each addition and removal.Source: J Case Studies · p. 19
  • K-RL preserves the Dynamic follow-up prescription when its safety check detects no contraindication violations.The case describes safety verification alongside the longitudinal reasoning.Source: J Case Studies · p. 19

K Expert Evaluation Design

The expert evaluation uses blinded ratings of outputs across training stages, alongside a zero-shot comparison and implementation details. Expert ratings distinguish strengths across stages, while the evaluation covers only a sampled set of cases and one selected model.

K Expert Evaluation Design

  • The expert protocol samples 100 cases—50 initial and 50 follow-up—and anonymizes randomized outputs from all four stages of Mistral-24B.It assesses syndrome accuracy, reasoning coherence, prescription adequacy, safety, and adjustment flexibility, with some dimensions marked not applicable by stage or case type.Source: K Expert Evaluation Design · p. 19, Table 11 · p. 19
  • Baseline scores 3.9 on safety, the lowest across stages; its prescription-adequacy score is 4.7 versus 4.3, 4.5, and 4.6 for PG-CoT, Dynamic, and K-RL.The authors attribute the slight Baseline advantage on prescription adequacy to concise prescription lists without narrative overhead.Source: K Expert Evaluation Design · pp. 19–20
  • K-RL receives the highest expert safety score (4.8), while Dynamic scores highest on syndrome accuracy and coherence (4.6 each).Two TCM professionals independently rated outputs on five dimensions using a 1–5 Likert scale; inter-rater agreement was Cohen’s κ = 0.77.Source: K Expert Evaluation Design · pp. 19–20, Table 11 · p. 19

L Reproducibility

  • Clinical data cannot be released because of patient privacy regulations, but the authors plan to release code, evaluation scripts, and model adapters.They also provide the TCMSafetyChecker rule set and adversarial probe set to support replication of safety evaluation.Source: L Reproducibility · p. 20

M Prompt Templates

  • Baseline prompting requests a prescription from symptoms, whereas PG-CoT and Dynamic prompting requires li-fa-fang-yao analysis and prescription generation.The follow-up Dynamic prompt additionally requests condition-evolution analysis and adjustment rationale based on the initial prescription and current symptoms.Source: M Prompt Templates · p. 20

N Zero-shot vs. Fine-tuned

  • Zero-shot PQS varies by model family: Qwen3.5 models reach 0.34–0.51, while English-centric 7–8B models remain near 0.11–0.20.Mistral-7B rises from 0.113 to 0.701 PQS after Baseline SFT; Qwen3.5-9B is an exception where zero-shot exceeds Baseline SFT.Source: N Zero-shot vs. Fine-tuned · p. 20

O Scaling and Model Family Analysis

Scaling and model-family comparisons show that size, family, and safety behavior do not follow a single pattern. Structured-output compliance and stage-specific variation qualify comparisons based on model scale alone.

Scale effects

  • Among baseline models, larger models generally score higher on PQS, but the advantage diminishes in CoT experiments where output-format effects dominate PQS.Mistral-24B scores 0.721, Mistral-7B 0.701, and Qwen3.5-0.8B 0.639; successful structured-output models reach ∼0.71–0.73 CQS despite PG-CoT PQS of ∼0.35–0.40.Source: O Scaling and Model Family Analysis · p. 20

Model family effects

  • Performance varies by family: Mistral and LLaMA show consistent results, while Qwen3.5 and Gemma models span wider CQS outcomes across stages.Qwen3.5-0.8B/2B reach ∼0.71–0.72 CQS; Gemma-2-2B PG-CoT CQS is ∼0.39 and Gemma-2-27B remains low.Source: O Scaling and Model Family Analysis · p. 20
  • Chinese-centric pretraining does not consistently outperform English-centric models on this task after domain SFT; the authors suggest task-specific fine-tuning may matter more than pretraining language.This is presented as a suggestion, not a universal result beyond the evaluated models and task.Source: O Scaling and Model Family Analysis · pp. 20–21

Scale and safety

  • Adversarial VR remains 0.038–0.432 across scales, and stage rankings vary by family, so safety results should be reported by architecture rather than as one global winner.Mistral-7B has the highest baseline VR (0.432), while Gemma-2-9B has the largest PG-CoT reduction (0.340 to 0.094).Source: O Scaling and Model Family Analysis · p. 21
Loading 2609.25755v1…