MedTextWeaver: Procedural Knowledge Evolution in Agentic Medical Text Editing

Ziyan Xiao, Yinghao Zhu, Liang Peng, Kyongtae T Bae, Lequan YuarXiv 2026

TL;DR

Adapting Large Language Models (LLMs) for medical text editing is notoriously difficult because expert feedback is sparse, fragmented, and spread across conflicting goals like clinical accuracy and patient readability. MedTextWeaver is a training-free framework that solves this by progressively distilling local, messy feedback into globally coherent editing principles and actionable procedural knowledge. By structuring how agents learn from multi-dimensional supervision, it significantly outperforms standard RAG and memory-based agent baselines across both English and Chinese clinical datasets.

What Problem Does This Paper Address?

Medical text editing isn't just about fixing typos; it’s a high-stakes balancing act. A single radiology report or discharge summary must simultaneously satisfy diverse stakeholders: patients need it to be readable, medical experts demand absolute clinical correctness, and insurance companies require strict format compliance (as illustrated in Figure 1).

Figure 1: Project Motivation. Medical text editing agents suf- fer from challenges of small-sample, fragmented, and multi- dimensional supervision provided by various stakeholders.

When researchers try to adapt LLM agents to this task using standard Retrieval-Augmented Generation (RAG) or memory-based methods, they run into three major roadblocks:

  1. Feedback Scarcity & Fragmentation: Expert feedback usually targets isolated errors or specific text spans rather than providing a complete behavioral specification.
  2. Diminishing Returns: Simply accumulating more raw feedback records does not lead to linear performance gains (Figure 2a).
  3. Interacting Dimensions: Optimizing for one quality dimension (e.g., readability) often inadvertently degrades another (e.g., factual correctness), leading to highly unstable model behavior (Figure 2b and 2c).

Methods

Instead of directly retrieving past feedback examples, MedTextWeaver introduces a four-stage pipeline to evolve fragmented observations into structured, reusable knowledge:

  1. Reflective Observation Construction: Converts raw score evaluations into structured textual evidence containing the specific error and its underlying rationale.
  2. Hierarchical Knowledge Distillation: Recursively merges individual observations using a tree-based deduplication process. This eliminates noise and groups isolated mistakes into broader, generalized error categories.
  3. Cross-Dimensional Knowledge Synthesis: Shifts the framework from dimension-specific optimization to problem-oriented synthesis. It reorganizes the distilled knowledge by dominant error types, fusing insights across different quality dimensions to resolve conflicting goals.
  4. Principle Formation & Agent Workflow: Abstracts the procedural knowledge into high-level, human-interpretable editing principles.

During execution, these evolved assets are injected into a two-agent workflow consisting of an Error Detection Agent (which uses the principles and relevant procedural items to flag flaws) and a Text Revision Agent (which applies targeted corrections to generate the final text).

The MedTextWeaver pipeline from raw feedback to agent execution

Datasets

The authors evaluated MedTextWeaver across three distinct clinical text datasets spanning two languages:

  • MIMIC Radiology Report: English chest X-ray reports.
  • MIMIC Discharge: English discharge summaries representing semi-structured patient outcome documents.
  • In-house Radiology Report: A newly collected 2025 dataset consisting of Chinese abdominal CT reports from a hospital in China.

Each dataset was split 60:40 into training (used to populate the agent's memory) and testing subsets.

Key Insights and Ideas

  • More Feedback $\neq$ Better Performance: Unstructured accumulation of feedback introduces conflicting instructions that confuse the LLM. True adaptation requires transforming raw data into higher-level representations.
  • Problem-Oriented Synthesis Resolves Conflicts: By grouping knowledge around specific error types (e.g., "Improper Terminology") rather than optimizing for "Correctness" or "Readability" in silos, the agent learns how changes in one dimension impact another.
  • Principles vs. Procedures: Ablation studies revealed that high-level principles primarily drive readability adjustments (global perception), whereas fine-grained procedural knowledge is absolutely vital for maintaining clinical correctness and strict formatting rules.

Key Results

MedTextWeaver demonstrated substantial improvements over strong base LLMs (like DeepSeek-v4 and Gemini-3.5) and established memory-based agent frameworks (AWM, MemoryBank, ExpeL, EvolveR):

  • Overall Pass Rate (OPR) Gains: Compared to a baseline DeepSeek-v4-flash model without acquired knowledge, MedTextWeaver boosted the OPR by 34.67% on MIMIC Chest X-rays, 4.40% on MIMIC Discharge summaries, and 17.00% on the In-house Abdominal CT dataset.
  • Real-World Error Detection: In a head-to-head validation study against human-labeled ground truth errors (annotated by medical experts with 6–10 years of experience), MedTextWeaver consistently improved error detection accuracy by up to 20.4%, precision by 16.3%, and recall by 28.6% across various backbone models (Figure 5).
Case study demonstrating how distilled experience improves error detection accuracy

Limitations and Future Work

While highly effective, the paper notes a few limitations:

  • Simplified Agent Architecture: The execution environment is currently restricted to a simplified two-agent setup (detection and revision). Real-world clinical workflows might require more complex multi-agent collaborations.
  • LLM-as-a-Judge Dependency: The formatting compliance evaluation relies on an LLM-as-a-Judge framework built from clinical guidelines, which inherently carries the risk of subtle model biases.

Future work includes scaling this framework to broader clinical settings and exploring how these evolved, interpretable principles can serve as a direct interface for clinicians to audit and steer LLM behavior safely.

Summary updated

BibTeX
@misc{xiao2026medtextweaver,
  author = {Ziyan Xiao and Yinghao Zhu and Liang Peng and Kyongtae T Bae and Lequan Yu},
  title = {{MedTextWeaver: Procedural Knowledge Evolution in Agentic Medical Text Editing}},
  year = {2026},
  eprint = {2602.00740},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.00740},
}
Figure