potentialpaper

Code, Not Chains-of-Thought: Localizing Guideline-Adherence Risk by Compiling Guidelines into MedCode

Anonymous authors

ICLR 2027

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. Compiling guidelines into executable code makes chain-of-thought redundant for clinical staging.

Abstract. Clinical large language models can cite guidelines fluently while producing unsupported dosages, staging criteria, or treatment recommendations. We argue that this failure is partly architectural: when the same model both interprets evidence and emits the clinical action, there is no machine-checkable contract between a recommendation and the source guideline. We present \textbf{\textsc{MedCode}}, a model-agnostic framework that compiles oncology guidelines into executable, citation-bound Python rules and restricts the LLM to structured patient-state extraction. The rule engine, rather than the decoder, maps typed evidence to a closed \texttt{ClinicalAction} space with bounded verbatim citations and explicit abstention when required evidence is missing. This design does not eliminate clinical error; residual failures can still arise from extraction or rule authoring. Instead, it localizes guideline-adherence risk to two auditable choke-points, enforced by six static compliance gates and localized rule diffs under guideline updates. We instantiate \textsc{MedCode} on oncology staging and treatment tasks using NCCN-derived rule scaffolds and real clinical cohorts. On TNM staging, deterministic execution substantially improves smaller and open-weight models: Qwen3.6-27B rises from 25.95 to 54.91 TNM accuracy on LungCURE-EN, and Gemma-4-E4B-it rises from 17.31 to 58.70 on EsophagusPKUCH. On treatment recommendation, \textsc{MedCode} improves coverage of physician-specified gold-plan items across all evaluated models, although this rubric measures coverage rather than harmful or extraneous recommendations. Finally, the same executable rules serve as a verifiable GRPO reward for \textsc{MedCode-LM}: distilling a Qwen3.6-27B teacher into a Qwen3.5-4B student raises TNM accuracy from 35.64 to 50.34, approaching the teacher's 52.67 while preserving auditable decision semantics.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
1 Sep 2026ICLR 2027 (under review)submittedICLR 2027Under reviewreviews ↓[1]PDF[1]
Missing a version?

ICLR 2027

Under review · 4 reviews · OpenReview

Updated 24 Nov 2026, 16:54 UTC.

Reviewer wWKKOpenReview ↗
Rating
1/4
Confidence
4/4
Soundness
1/3
Presentation
1/3
Informativeness
1/3
Read review
Summary

The main idea of the paper is to use EMR data to automatically fill out a document for the patient process it through a guideline constructing Python executable versions using LLMs.

Strengths

The paper addresses a timely problem.

Weaknesses

Major Issues

  1. The main contribution of the paper is to limit the LLMs output to machine readable format for EMR data; constructing Python executable decision graphs which then are checked by some predetermined steps. Training the smaller model and showing similar performance doesn't really have novelty as they are already widely known. I don't think the paper is novel enough for ICLR.
  2. The figure doesn't match up to ICLR standards.
  3. The manuscript reads more like a report rather then a scientific paper.
  4. The evaluation is being done by another LLM without any human validation
  5. The accuracy of the generated graphs are not evaluated.
  6. The accuracy of the generated EMR's are not reported.

Minor Issues

  1. The code type font on ``ClinicalAction'' should be removed.
  2. The usage of the word ``diff'' is informal.
  3. The third contribution is not mentioned at all in the abstract.
  4. The table presented should be self sufficient whereas the code type fonts makes it harder and the caption doesn't provide enough information.
  5. Phrases such as ``What is covered in this submission'' should be removed.
Questions for the authors
  1. How accurate is the LLM at filling in the patient record on its own?
  2. How accurate is the LLM at writing rules from the guidelines?
  3. Did you check that the GPT-5.4 judge agrees with human doctors?
Reviewer QTW8OpenReview ↗
Rating
1/4
Confidence
2/4
Soundness
1/3
Presentation
2/3
Informativeness
1/3
Read review
Summary

MedCode compiles oncology guidelines into executable Python rules and restricts LLMs to structured patient-information extraction. The paper evaluates cancer staging and treatment-plan coverage and uses the rules to train a smaller model.

Strengths
  1. The paper addresses an important problem: making guideline-based recommendations easier to inspect and trace to their sources.

  2. The staging gains for several smaller models suggest practical value for tasks with clear rules and sufficient coverage.

Weaknesses
  1. It is unclear whether the added control is worth the loss of flexibility and rule-maintenance costs. Missing context and extraction errors can still lead to wrong decisions. These trade-offs need evaluation in cases with exceptions or conflicting evidence.

  2. The training contribution is not clearly distinguished from MedGuideX [1], which already uses executable guidelines to generate training data and rewards. The paper should explain what its training method adds.

  3. A key missing baseline is an LLM that can use the same rule tools, revisit the record, and explicitly abstain. The current comparison does not show why the LLM must be removed from decision-making.

  4. The ablation should separate extraction quality from execution, keeping the rules fixed and using both model-extracted and clinician-checked patient states. The performance drop for GPT-5.5 also needs error analysis. Saying that strong models have memorized the rules does not explain this loss.

[1] Shen, Y., Cao, L., Du, S., Wang, Y., Zhou, J., Peng, H., & Guo, Y. (2026). MedGuideX: Internalizing Decision Logic from Executable Guidelines into Large Language Models for Clinical Reasoning. arXiv preprint arXiv:2605.26567.

Questions for the authors

Please refer to the weaknesses above.

Reviewer pWcqOpenReview ↗
Rating
1/4
Confidence
2/4
Soundness
2/3
Presentation
1/3
Informativeness
2/3
Flag for ethics review
Yes
Read review
Summary

This paper proposes MEDCODE, which restricts the LLM to structured patient-state extraction while deterministic, citation-bound Python rules map the extracted state to a closed set of clinical actions, with explicit abstention and six static compliance gates. It is evaluated on TNM staging (LungCURE-EN, EsophagusPKUCH) and treatment-plan coverage (a 202-case LungFAHGMU subset), with large gains for smaller open-weight models but not for frontier models. The rule engine is also used as a GRPO reward to post-train a Qwen3.5-4B student (MEDCODE-LM).

Strengths
  1. The evaluation uses real clinical datasets and popular model families. The experiments are conducted on real-world patient records and cover multiple widely used models, including GPT-5.5, DeepSeek-V4-Pro, Qwen3.6, and Gemma-4. The paper reports substantial gains for smaller and open-weight models, and candidly acknowledges that frontier models do not benefit and can even slightly degrade.
Weaknesses
  1. The novelty is limited. The core mechanism where an LLM extracts typed variables and deterministic code executes clinical rules already exists in the similar benchmarks. LungCURE's LCAgent extracts T, N, and M evidence separately and aggregates them with a deterministic rule-based node. CDR-Agent extracts variables from clinical notes and executes Python clinical-decision-rule scripts. However, neither method is included as a baseline.
  2. The effective scope of the method is limited, and its results are difficult to reproduce. On TNM staging, the gains are concentrated on smaller open-weight models, while the stronger models (GPT-5.5 and Qwen3.5-397B) show no improvement or even a decline. The authors attribute this to frontier models having "memorized the staging thresholds," but this explanation would predict no change rather than a decline, so the drop remains unexplained. In addition, two of the three datasets (LungFAHGMU and EsophagusPKUCH) appear to be private in-house cohorts, and all treatment results rely entirely on private data, which makes the main findings difficult to reproduce.
Questions for the authors
  1. Can the authors compare against LCAgent on LungCURE TNM staging and against a simple baseline of structured extraction plus a standard AJCC staging calculator (or a PAL-style code baseline), to show what MEDCODE contributes beyond deterministic aggregation of extracted fields?
  2. Can the authors substantially revise the manuscript’s organization and exposition? Despite having some familiarity with medical LLMs, I found the paper difficult to follow for reasons beyond domain knowledge: clinical terminology, software contracts, evaluation settings, and training claims are introduced together without sufficient separation or definition. Given ICLR’s broad readership, the paper should clearly separate the clinical background and assumptions from the technical contributions, define terms such as TNM and NCCN at first use, and distinguish the 68-guideline scaffold from the actually authored executable rules, the runtime MEDCODE system, and MEDCODE-LM training.
Ethics concerns

Research integrity: inaccurate or unverifiable references

I verified some examples against public records below:

  1. CancerGUIDE (Yang et al., 2025). The listed title and authors do not match the public paper, and the cited arXiv identifier, 2508.04114, resolves to an unrelated applied-physics paper on terahertz communications. The public CancerGUIDE paper is CancerGUIDE: Cancer Guideline Understanding via Internal Disagreement Estimation by Unell et al. (arXiv:2509.07325).
  2. Staniek et al. (2025). I could not locate the cited survey, Computable Clinical Guidelines: A Survey. The cited arXiv identifier, 2503.07291, resolves to an unrelated materials-science paper.
  3. MedKP (cited as Wang et al., 2024a). The paper lists this work with a title, authors, and venue (NAACL 2024) that do not match the actual MedKP paper, which is "MedKP: Medical Dialogue with Knowledge Enhancement and Clinical Pathway Encoding" by Wu et al. (arXiv:2403.06611).
  4. CDR-Agent (Chen et al., 2025). The cited title, authors, and venue (JAMIA) do not match the actual paper by Xiang et al. (arXiv:2505.23055, AMIA 2025), and its description as guideline-graph reasoning does not reflect its content, which extracts variables from clinical notes and executes Python clinical-decision-rule scripts.

I recommend that the AC should verify the bibliography carefully.

Reviewer ayGBOpenReview ↗
Rating
1/4
Confidence
4/4
Soundness
1/3
Presentation
1/3
Informativeness
1/3
Flag for ethics review
Yes
Read review
Summary

This paper tries to address unsupported recommendations from clinical LLMs, which the authors attribute partly to the same model both interpreting the evidence and emitting the clinical action. They propose MedCode, which compiles NCCN guidelines into citation-bound Python rules, restricts the LLM to extracting a typed patient state, and lets a rule engine select an action from a closed set, abstaining when evidence is missing. The evaluation covers TNM staging on LungCURE and an in-house esophageal cohort, treatment-plan coverage on a 202-case lung subset scored by an LLM judge, and the distillation of a 27B teacher into a 4B student with SFT and GRPO using a rule-engine reward. The authors report large staging gains for several open-weight models and coverage gains for all evaluated models.

Strengths

I think the direction is reasonable. Keeping the reading of the record apart from the application of the guideline, and making the latter deterministic and tied to a verbatim citation, is a sensible route towards clinical recommendations that can be audited. The authors are also candid about what their gates do not certify and about the limits of their coverage metric.

Weaknesses

My main concern is that the contribution amounts to prompt engineering combined with hand-written rules, and that it is not evaluated against the alternatives that matter. The paper itself describes the design as restricting the LLM to structured extraction, with the decision left to the rule engine. Executable guideline representations have a long history, which the paper acknowledges, and the only learning component, the distillation, draws almost all of its gain from supervised fine-tuning on extractions, while the rule-based GRPO step that the paper calls decisive adds about one point (Table 6). At the same time, the comparison is thin: there is a single prompting condition whose prompt and guideline text are not specified, no other prompting strategy such as chain-of-thought, few-shot examples or code generation is tried, and none of the guideline-grounded systems discussed in the paper is actually run.

I am also not persuaded by the results that are reported. The method does not help a frontier model: for GPT-5.5 it is level with guideline prompting on lung staging and clearly worse on esophageal staging (75.90 vs. 68.27), and the paper's own ablation attributes the drop to restricting the model to typed extraction (Tables 3-4). The large gains in the abstract are measured against a no-guideline baseline and become much smaller against guideline prompting, and the treatment comparison uses a coverage-only metric judged by an LLM, on cases selected to be guideline-conformant, which does not penalize extraneous or harmful recommendations. More fundamentally, the properties the paper is built around, namely auditability, localized updates, abstention and consistent answers, are not measured. Runnable rules exist only for NSCLC, although the paper provides catalog scaffolds for 68 guidelines and evaluates esophageal staging, and it reports nothing about the number of rules or the effort of writing and maintaining them. When a new therapy enters a guideline, new rules, tests and citations would have to be written and verified by clinicians, and this authoring and maintenance burden, long the main obstacle for computable guidelines, is not addressed.

Beyond these points, the reporting needs substantial work. Several numbers cannot be traced to any table, statements in the text disagree with the tables, the paper contradicts itself on its data sources and on how the GRPO reward is computed, important results are deferred to a supplement that is not part of the paper, and variance and statistical tests are largely missing.

Questions for the authors

How does MedCode compare with other prompting strategies (chain-of-thought, few-shot, code generation and execution) and with an existing guideline-grounded system on the same data?

Why does MedCode reduce GPT-5.5's accuracy, and what does it offer a strong model?

How many rules are there, which of them implement esophageal staging, and is there any evidence for the update and abstention claims?

Ethics concerns

Research integrity. Several references could not be verified as cited. I have sent the details to the AC in a confidential comment.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…

This paper is under review