Source-linked AI summary

KMGen: A Skill-based Approach for Synthetic Individual Patient Data Generation

Jalen Jiang, Chufan Gao, Ethan Rasmussen, Stephen Z. Xie, Jimeng Sun

arXiv:2608.22618v1cs.LG

TL;DR

Clinical-trial IPD is often inaccessible, limiting analyses that require patient-level survival and adverse-event information. KMGen unifies automated KM-curve extraction with mechanistic synthetic IPD generation, achieving close agreement with held-out oncology-trial data across survival and AE measures.

  • Problem

    Restricted access to clinical-trial IPD leaves researchers reliant on aggregate statistics that omit granular event timing and censoring patterns.

    Source: §1 · p. 2, §4 · p. 15
  • Method

    KMGen combines automated extraction from published KM plots with registry-driven synthetic IPD generation using explicit patient archetypes, rank-coupled survival sampling, and cycle-based AE scheduling.

    Source: §1 · pp. 2–3
  • Results

    Across three oncology trials and 30 regenerations per trial, KMGen matched held-out IPD across survival and AE measures, achieving mean ΔKM ≤0.051.

    Source: §4 · pp. 15–16
  • Takeaways & Limitations

    The resulting synthetic IPD is suitable for methodological development where access to real patient-level data is restricted.

    Source: §4 · p. 16

    The shared-frailty model does not represent term-specific AE co-occurrence because registry records report marginal incidences rather than joint AE statistics.

    Source: §2.2.3 · p. 9

Abstract

from arXiv · show

Individual patient data (IPD) from clinical trials is the substrate for survival modeling, meta-analysis, and safety research, yet IPD is rarely released. Prior work has addressed only half of this gap: reconstructing Kaplan-Meier (KM) curves from published plots -- typically requiring manual digitization or human-in-the-loop correction -- while offering no mechanism for generating the adverse-event (AE) streams that constitute the other half of a patient record. We introduce KMGen, the first end-to-end framework that (i) fully automates KM curve extraction at accuracy competitive with human-guided tools, and (ii) generates synthetic per-patient AE trajectories from public trial registry records. The extraction stage is a fully automated agentic pipeline -- an agent generates code to extract each step in the KM curve -- achieving a mean Integrated Absolute Error (IAE) of 0.0151 on a 32-plot benchmark spanning clean, edge-case, and adversarial conditions. The IPD generation stage decouples patient archetype extraction from statistical sampling: an LLM distills the trial record into arm-specific statistics, adverse events, patient demographics, and risk multipliers. A mechanistic sampler generates patient events via clinical archetypes, bootstrap rank-correlation coupling to the empirical KM curve (preserving the marginal survival distribution exactly), and cycle-based AE scheduling with an induction/maintenance split. Across three held-out oncology trials spanning an order of magnitude in cohort size and 30 independent regenerations per trial, KMGen achieves mean integrated KM absolute difference $Δ_{\text{KM}}\,{\leq}\,0.051$, sex/ECOG JSD ${\leq}\,0.013$ on 5 of 6 demographic slots, and recovers ${\geq}\,71\%$ of the top-15 AEs by exact MedDRA term under a single fixed parameter set. The pipeline is released as open source at https://github.com/chufangao/kmgen.

1. Introduction

KMGen addresses restricted clinical-trial IPD access with a unified framework that extracts survival data from published KM plots and generates auditable synthetic patient records when reconstruction is infeasible. Its evaluations report strong extraction and generation fidelity across synthetic benchmarks and held-out oncology trials, using an architecture that assigns interpretation to multimodal LLMs and computation to deterministic code.

1. Introduction

  • KMGen unifies adaptive hybrid KM extraction with deterministic synthetic IPD generation to extend access beyond trials with published survival figures.The framework combines extraction from published KM plots with synthetic generation from clinical trial reports and KM curves.Source: §1 · pp. 2–3
  • Its extraction pipeline combines multimodal LLM strategy selection with deterministic computer vision for axis calibration, curve separation, and pixel-level precision.The toolbox includes color-based extraction, spatial cluster separation, and tick-mark bounding-box detection for overlapping, black-and-white, and artifact-affected plots.Source: §1 · p. 2
  • Its generation pipeline converts trial records into structured MedDRA-compliant configurations, then samples auditable patient event streams using survival coupling, archetypes, risk multipliers, and phase-aware AE scheduling.Bootstrap rank-correlation coupling preserves the marginal survival distribution by construction, while cycle-based scheduling separates induction and maintenance phases.Source: §1 · pp. 2–3
  • Mean IAE was 0.0151 across 32 synthetic KM plots, while generation achieved Δ_KM ≤0.051 and top-15 AE overlap ≥71% across three oncology trials and 30 regenerations.The generation results used a single fixed parameter set and also reported faithful early-phase AE timing.Source: §1 · p. 3

1.1. Generalizable Insights about Machine Learning in the Context of Healthcare

  • KMGen assigns interpretive tasks to the multimodal LLM and exact computational tasks to deterministic code, improving reproducibility across digitization and IPD-generation workflows.The design restricts the LLM to strategy selection and structured-field population while deterministic code handles tasks requiring exactness.Source: §1.1 · p. 3

2. Methods

KMGen combines adaptive, self-correcting KM-plot extraction with registry-derived synthetic IPD generation. Its sampler preserves empirical survival marginals while modeling archetypes, demographics, cycle-based adverse events, and evaluation fidelity across extraction and generation stages.

2.1. KM Plot Extraction Pipeline

  • KM extraction splits visual analysis from deterministic execution: an LLM identifies plot challenges and writes tailored code, while Python performs pixel-precise tracing and localized corrections.This division lets the analyst strategize over context while the extractor counts pixels and produces coordinates.Source: §2.1 · p. 4
  • The extraction toolbox detects plot bounds, separates arm colors, removes reference lines, bridges dashed gaps, enforces continuity and monotonicity, detects terminal drops, and masks decorations.Outputs include configurable-granularity coordinates, axis ranges, arm labels and colors, and readable patients-at-risk tables; five checks validate and, when needed, trigger re-extraction.Source: §2.1 · pp. 4–5

2.1.1. Synthetic KM Plot Evaluation

  • The synthetic benchmark contains 32 plots spanning standard cases, published-figure edge cases, single-degradation stresses, and combined adversarial conditions across 12–144-month axes.Ground truth uses Weibull-sampled event times with random censoring and four-decimal matplotlib step curves; errors are normalized to [0, 1] before integration.Source: §2.1.1 · pp. 5–6

2.1.2. KM Plot Extraction Metrics

  • IAE compares extracted and truth arms after left-step interpolation on merged x-grids, ranges from 0 to 1, and equals zero for a perfect match.Secondary metrics are score, median absolute error at 100 time points, and median overall-survival error when the curve crosses 0.5.Source: §2.1.2 · p. 6

2.2. IPD Generation Methodology

  • IPD generation converts a public registry record into synthetic patient event streams through configuration extraction, sampling, and evaluation against held-out real IPD.The full implementation is specified in Appendix C.Source: §2.2 · p. 6

2.2.1. Trial Configuration Schema

  • Each arm’s JSON configuration records trial identity, enrollment, treatment timing, demographics, empirical KM survival, and MedDRA adverse-event incidence and seriousness fields.Non-default drug-class or paper-specific risk adjustments are serialized through override dictionaries.Source: §2.2.1 · p. 6

2.2.2. Patient Archetype Extraction

  • Archetype extraction prioritizes structured ClinicalTrials.gov data, then reconstructed KM pairs, publications, and finally SAPs or protocols, limiting curve-tracing error to the survival channel.The hierarchy reflects increasing source noisiness; demographics, MedDRA terms, and AE incidences are not read from curves.Source: §2.2.2 · p. 7

2.2.3. Statistically Sampling for Synthetic IPD

  • The sampler expands age, sex, ECOG, and comorbidity into 8–16 archetypes, couples empirical KM bootstrap draws to frailty ranks, and schedules correlated AEs across induction and maintenance cycles.The permutation preserves the marginal KM distribution exactly; shared patient propensity induces positive cross-AE correlation, while term-specific co-occurrence is not represented because registries report marginal incidences.Source: §2.2.3 · pp. 7–9

3. Results

KMGen achieves accurate automated KM extraction and high-fidelity synthetic IPD generation across three oncology trials. End-to-end fidelity is strongest for survival, demographics, AE frequencies, and organ-system distributions, with limitations concentrated in label alignment, AE burden calibration, and onset concentration.

3.1. KM Extraction Results

  • Mean IAE is 0.0151 across 32 plots, with 22 scoring below 0.015 and degradation concentrated in combination stress tests.Real-trial extraction has mean IAE 0.0262 across three arms; the n=430 Gemcitabine arm achieves 0.0133, while smaller cohorts are noisier.Source: §3.1 · pp. 10–11

3.2. IPD Generation Results

  • Mean ΔKM ≤0.051 and top-15 AE overlap ≥71% across three trials, using one untuned parameter set and 30 independent regenerations.Stage A demographic scalar errors are ≤2%, while AE shared-term MAE is below 0.035.Source: §3.2 · p. 11, Table 2 · p. 12

3.3. Extraction Quality (Stage A)

  • Scalar demographic relative errors are ≤1.3%, while AE shared-term MAE ranges from 1.7–3.5 percentage points and shrinks with trial size.Race and region JSD equals 1.0 because ClinicalTrials.gov and real-IPD label taxonomies do not overlap.Source: §3.3 · pp. 11–13

3.4. End-to-End Fidelity (Stage B)

  • Sex JSD is ≤0.006 and ECOG JSD ≤0.013 where support matches, while the NCT03041311 ECOG mismatch yields JSD=0.272±0.048.Anthropometric KS means are ≤0.22; significant large-cohort rejections reflect statistical power rather than large effects.Source: §3.4 · p. 13
  • Mean ΔKM is 0.049, 0.051, and 0.040 across trials, while extraction contributes only 0.016, 0.007, and 0.006 to the corresponding errors.The extraction contribution is 12–32% of total ΔKM, with residual error dominated by finite-sample noise in the reference KM.Source: Figure 2 · p. 10, §3.4 · p. 13, Extraction-error propagation · p. 13
  • Top-15 AE overlap reaches 80% on NCT00844649, cosine similarity reaches 0.940±0.003, and mean onset error stays below 0.8 months.Synthetic AE burden initially undershoots by 4–6 events per patient, but ση=0.8 narrows the gap to 0.7–3.3 without changing ΔKM.Source: Figure 3 · p. 14, Extraction-error propagation · p. 14

4. Discussion · Appendix A. Generation Algorithm

KMGen unifies automated Kaplan–Meier extraction with mechanistic synthetic IPD generation, achieving close survival, demographic, and adverse-event agreement across three oncology trials. Its interpretable, deterministic architecture supports methodological use while explicitly limiting claims about causal toxicity, regulatory evidence, non-oncology validation, and cross-model invariance.

4. Discussion

  • The framework decouples LLM-based archetype extraction from deterministic statistical generation, making clinical priors explicit and preserving the marginal survival distribution exactly.Induction–maintenance splits and archetype risk multipliers are parameterized, while bootstrap rank-correlation coupling preserves survival independently of rank-noise σ.Source: §4 · p. 15
  • The oncology configuration is overridable rather than architectural, with risk dictionaries and induction or cycle parameters adaptable to other drug classes and monitoring designs.The evaluated trials cover a CDK4/6 inhibitor, targeted–chemotherapy combination, and cytotoxic doublet, but non-oncology performance remains unvalidated.Source: §4 · p. 16
  • The LLM selects extraction strategies and populates typed configurations, while deterministic vision and sampling routines prevent silent numerical perturbations.No controlled cross-model comparison was performed, and residual extraction error concentrates on the adversarial benchmark tail.Source: §4 · p. 16
  • Synthetic cohorts are intended for methodological stress-testing and safety-monitoring validation, not as substitutes for randomized trials or sources of regulatory claims.KMGen models structural event–survival correlation through realized cycle counts but does not simulate causal toxicity-induced mortality.Source: §4 · p. 16
  • ∆KM ≤0.051 and top-15 AE overlap ≥71% across three oncology trials and 30 regenerations per trial demonstrate KMGen’s overall synthetic-IPD performance.The trials span 37–430 patients and three drug classes under one fixed parameter set; sex/ECOG JSD is ≤0.013 on five of six demographic slots.Source: §4 · pp. 15–16

Appendix A. Generation Algorithm

  • Algorithm 1 instantiates each synthetic patient from a trial configuration and couples patient-specific frailty and noisy risk ranks to bootstrapped empirical KM time–event pairs.The algorithm outputs patient demographics, overall survival, and adverse-event lists using cohort size n, KM pairs (t_k, e_k), archetypes, and rank-noise σ.Source: Appendix A · p. 20
  • The algorithm samples adverse events by phase-weighted Poisson counts, assigning induction and maintenance rates and uniformly distributing onsets within cycle windows.For each patient and adverse event, phase weights use α across induction cycles and 1−α afterward; event onsets are sampled within (t_k, t_k+c/3).Source: Appendix A · p. 20

Appendix B. Risk-Multiplier Evidence Base

Appendix B documents the clinical evidence underlying KMGen’s default AE risk multipliers, while emphasizing that per-organ values are calibrated estimates rather than directly reported relative risks. Age, sex, ECOG, comorbidity, and OS adjustments draw on heterogeneous toxicity and survival-related evidence.

Risk-multiplier framework

  • Table 3 defines default AE risk multipliers by patient factor and organ system, all relative to a baseline of 1.0.The per-SOC values are clinical estimates informed by overall effect sizes in cited studies.Source: Appendix B · p. 20, Table 3 · p. 21

Age

  • OR 1.85 (95% CI 1.22–2.82) links age ≥72 with grade 3–5 toxicity, while supporting studies address cardiac, CIPN, and renal risks without organ-specific estimates.Hurria et al. (2011), Swain et al. (2003), Argyriou et al. (2012), and Launay-Vacher et al. (2007) inform age-related calibration.Source: Appendix B · pp. 20–21

Sex

  • OR 1.34 (95% CI 1.27–1.42) indicates higher grade 3+ AE risk in women than men, with hematologic OR = 1.30 and symptomatic OR = 1.33.Unger et al. (2022) provides the overall estimates, while Schmetzer and Flörcken (2012) reviews sex-based pharmacokinetic and toxicity differences.Source: Appendix B · p. 21

ECOG, comorbidity, and OS

  • Grade ≥3 nausea occurred in 16.4% of patients with PS 2 versus 8.5% with PS 0–1, although other studies found ECOG nonsignificant or excluded from final models.Comorbidity evidence includes chemotherapy receipt, cancer survival, and febrile-neutropenia mortality, while OS multipliers are inferred through toxicity–survival associations rather than reported survival ratios.Source: Appendix B · pp. 21–22

Appendix C. Implementation Details

Appendix C specifies a deterministic, single-backbone implementation with safeguards for leakage, trial-specific real-IPD ingestion, and normalized AE evaluation. It also documents an unexercised Weibull fallback for missing empirical KM data.

Agent backbone

  • Both agents use Claude Opus 4.6 with default decoding, emit no numeric outputs directly, and rely on deterministic routines or typed schemas without model sweeps.The extraction agent emits Python for computer vision, while the configuration agent fills the sampler’s typed schema.Source: Appendix C · p. 22

Data-leakage firewall

  • The extraction agent excludes IPD-directory files through an explicit KM CSV glob filter, reserving real patient data for evaluation.Source: Appendix C · p. 22

Real IPD ingestion

  • Trial-specific loaders ingest CDISC SDTM-AD data across three trials, adapting demographics, ECOG, and survival assembly for the non-standard NCT00844649 structure.NCT03041311 and NCT02499770 use ADSL, ADAE, and ADTTE; NCT00844649 derives ECOG from Karnofsky status and combines follow-up with disposition data.Source: Appendix C · p. 22

AE term normalization

  • AE terms are canonicalized during extraction and evaluation by lowercasing, collapsing whitespace, stripping punctuation, and standardizing British-to-American MedDRA spellings.For example, “anaemia” becomes “anemia,” preventing cosmetic spelling differences from inflating mismatches.Source: Appendix C · p. 22

Weibull fallback

  • When empirical KM CSV data are unavailable, the sampler uses a parametric Weibull fallback from Carroll (2003), though this branch is not exercised in the main experiments.Source: Appendix C · p. 22

Appendix D. Ablation Studies · Appendix E. Additional Analyses

Appendix D tests the AE timing, propensity, archetype, and cohort-size design choices, while Appendix E documents additional analyses using the shared evaluation protocol. The results support the induction–maintenance split, load-bearing frailty and archetypes, larger cohorts for frequency metrics, and targeted propensity recalibration.

Appendix D. Ablation Studies

  • The ablations target specific methodological claims, including induction fraction, patient propensity, archetype multipliers, and synthetic cohort size, on NCT03041311.Each ablation states its motivation before reporting the result.Source: Appendix D · pp. 22–24
  • KS reaches 0.151 at α=0.85, versus 0.372 at α=0.50 and 0.192 at α=0.95, validating the induction–maintenance split.The results support the default α=0.80–0.85 for cytotoxic regimens, consistent with early cycles carrying the highest AE burden Crawford et al. (2008).Source: Appendix D · p. 23, Figure 6 · p. 23
  • Burden KS decreases from 0.308 without frailty to 0.127 at ση=1.0, showing that lognormal patient propensity is load-bearing.The default ση=0.4 yields KS = 0.249 as a conservative balance between dispersion realism and numerical stability in small cohorts.Source: Appendix D · p. 23, Figure 8 · p. 24, Figure 9 · p. 24
  • At ση=0.8, the burden gap closes on all three trials while ∆KM is unchanged to four decimal places and AE cosine similarity changes by <0.01.The appendix therefore recommends ση=0.8 as the operating default.Source: Appendix D · p. 24
  • Removing archetype risk multipliers preserves marginal KM fidelity but eliminates within-cohort heterogeneity in AE onset and burden.The full model produces AE burden distributions closer to real IPD, supporting organ-system-level risk stratification.Source: Appendix D · p. 24, Figure 10 · p. 25
  • AE JSD decreases from 0.192 to 0.173 and cosine similarity increases from 0.84 to 0.86 as synthetic enrollment grows from 0.5× to 5×.∆KM and onset KS show bootstrap-level variance rather than monotone trends, with metrics generally stable above 1× and supporting the 2× default.Source: Appendix D · p. 24, Figure 11 · p. 25

Appendix E. Additional Analyses

  • Appendix E isolates KM-extraction error propagation and per-trial AE-burden recalibration through propensity dispersion ση.Both analyses use the same evaluation code path, seeds, and 2× enrollment as Table 2.Source: Appendix E · p. 26

E.1. Extraction-Error Propagation

Extraction error contributes only a limited portion of end-to-end KM discrepancy: propagated error is 0.006–0.015, while nonzero oracle-input error reflects a finite-sample floor.

E.1. Extraction-Error Propagation

  • The analysis isolates extraction error by regenerating 30 cohorts from the extracted published KM and 30 from an oracle KM while holding all other inputs fixed.Only the survival channel is traced from a plot image, using the one arm per trial matched to held-out real IPD.Source: §E.1 · p. 26
  • 0.006–0.015 propagated ΔKM accounts for 12–32% of total ΔKM and at most about half the extraction IAE across 30 regenerations per trial.The sampler does not amplify upstream extraction error; values are means over 30 regenerations for the single matched arm.Source: §E.1 · p. 26, Table 4 · p. 26
  • Oracle-input ΔKM remains above zero on every trial, establishing a finite-sample floor even with a perfect reference curve.Bootstrap-resampled cohorts can differ from the reference realization despite exact curve input.Source: §E.1 · p. 26

E.2. AE-Burden Recalibration via ση · Appendix F. Supplementary Figures

The AE-burden channel can be recalibrated independently of survival, and ση=0.8 is recommended because it improves burden fidelity without materially changing KM, demographic, or AE-frequency metrics. Supplementary figures show close agreement for anthropometric distributions and visualize per-patient AE burden across all three trials.

E.2. AE-Burden Recalibration via ση

  • 31%, 25%, and 66% burden-KS improvements support ση=0.8 over the default, while mean burden approaches real values from below across all three trials.Although ση=1.0 minimizes burden KS on two trials, it overshoots observed burden and offers improvements within one standard deviation of ση=0.8; the smallest cohort’s truncated AE registry cannot recover its missing tail through dispersion alone.Source: §E.2 · pp. 26–27
  • At ση=0.8, synthetic mean burden is 13.0 vs. 15.1, 9.5 vs. 12.8, and 14.8 vs. 15.4 across the three trials.These values approach real burden monotonically while preserving the other fidelity channels within resampling noise.Source: §E.2 · p. 26, Table 5 · p. 27
  • ∆KM is invariant to ση, with identical values to four decimal places, while AE-frequency metrics move by less than 0.01 across the sweep.The result follows from assigning survival by bootstrap permutation independently of AE sampling, allowing burden tuning in isolation.Source: §E.2 · pp. 26–27, Table 5 · p. 27
  • Table 6 reports the complete Stage-B fidelity results at the recommended ση=0.8, with only burden rows changing materially relative to ση=0.4.Demographic, survival, and AE-frequency rows remain within resampling noise, using 30 regenerations and synthetic cohorts at twice real enrollment.Source: Table 6 · p. 28

Appendix F. Supplementary Figures

  • KS statistics are ≤0.24 for weight, height, and BMI across all three trials, indicating that truncated-Gaussian sampling reproduces real anthropometric distribution shapes.Figure 12 compares real and synthetic distributions for each anthropometric measure.Source: Figure 12 · p. 29
  • Figure 13 visualizes AE burden per patient across the three trials, with dashed lines marking the corresponding means.The figure provides a supplementary view of the burden distributions and their central tendencies.Source: Figure 13 · p. 30

Appendix G. Full Extraction Gallery · G.1. Standard Synthetic (5) · G.2. Edge Cases (7)

Appendix G presents paired visual diagnostics for all 32 benchmark plots, covering standard synthetic examples and challenging edge cases. The gallery overlays extracted and ground-truth KM step functions, reports per-plot errors, and documents visible successes and failure modes.

Appendix G. Full Extraction Gallery

  • The gallery covers every plot in the 32-plot benchmark with source overlays, extracted coordinates, ground-truth steps, shaded absolute differences, and printed IAE.Aligned rings indicate faithful tracing, while drift reveals extraction error.Source: Appendix G · p. 31
  • Captions report IAE, median AE, median OS error when defined, and arm count, while plots are ordered by ascending IAE.Per-plot numeric details are collected in Table 7, sorted best-first by IAE.Source: Appendix G · p. 31, Table 7 · p. 32
  • The gallery tests challenging features including overlapping confidence intervals, clustered crossing lines, dense event ticks, color mixing, and overlapping dotted and solid lines.These source plots were selected to expose extraction behavior under visually difficult conditions.Source: Appendix G · p. 31

G.1. Standard Synthetic (5)

G.2. Edge Cases (7)

  • Edge cases retain clean tracking for minimal-event, near-flat, confidence-interval-shaded, and four-arm plots, including closely overlapping segments.The four-arm example preserves color separation and continuity tracking.Source: Figure 17 · p. 36, §G.2 · p. 37, Figure 18 · p. 37
  • Dense-step and cumulative-incidence cases require fine sampling and an inverted monotonicity constraint to recover rising curves.The cumulative-incidence example recovers rising structure rather than decreasing survival structure.Source: Figure 19 · p. 38
  • A multi-panel edge case shows that differing per-panel xmax values can inflate aggregate IAE beyond what any individual panel indicates.This documents a metric-scope effect rather than a single-panel tracing failure.Source: Figure 20 · p. 39

G.3. Single-Degradation Stress Tests (12)

Single-degradation stress tests show that KM extraction remains accurate across difficult visual conditions, while dense multi-arm overlap exposes color attribution as the primary bottleneck. The pipeline uses masking, calibration, and curve-tracing strategies to handle annotations, artifacts, grayscale styling, blur, and low-resolution plots.

G.3. Single-Degradation Stress Tests (12)

  • Masking excluded heavy annotations, gridlines, and overlapping legends before tracing, including gridlines removed under a >30% row/column coverage rule.Legend overlap was handled with a rectangular exclusion zone.Source: Figure 21 · p. 40, Figure 23 · p. 42
  • HSL masking separated three similarly hued arms, while per-panel xmax calibration kept multi-panel recomputation mismatch below 0.002 IAE.The similar hues left only a narrow separation margin.Source: Figure 22 · p. 41
  • JPEG artifacts stayed within 1–2 px, grayscale separation held for solid versus dashed curves, and centroid tracing absorbed blur while low pixel density increased absolute S(t) errors.Dashed gaps were bridged in black-and-white plots, whereas tiny plots remained more sensitive to mask errors.Source: Figure 23 · p. 42, Figure 24 · p. 43, Figure 25 · p. 44
  • 0.042–0.072 per-arm IAE occurred on an eight-arm, two-panel cumulative-incidence plot, where heavy overlap made color attribution the bottleneck.Several arms shared hue bands, causing occasional tracer jumps between arms in dense regions.Source: §G.3 · p. 45

G.4. Combination Stress Tests (8)

Combination stress tests show that KM extraction remains robust across several interacting degradations, while overlapping flat curves are intrinsically easy and stacked adversarial artifacts create the hardest conditions.

G.4. Combination Stress Tests (8)

  • Overlapping flat curves keep both arms between 0.95–1.00 across 60 months, making near-zero extraction error possible throughout.Step markers land on the curves, so overlap and flatness effectively defeat the stress test.Source: Figure 27 · p. 46, §G.4 · p. 46
  • B&W overlapping solid and dashed curves remain resolvable when grayscale separation is combined with gap bridging.Step markers continue to land on the curves throughout the stress test.Source: §G.4 · p. 46
  • Four-arm tiny plots preserve color separation, but low per-column sample counts limit extraction; adding B&W compounds grayscale ambiguity.The combined tiny-and-B&W condition makes the low-pixel problem more difficult.Source: Figure 28 · p. 47
  • Tiny blurry plots produce the highest IAE among these single-style combinations, while stretched dense plots show occasional drift in densest regions.Blur widens edges, whereas dense step structure stresses extraction through aspect-ratio stretching.Source: Figure 29 · p. 48
  • JPEG artifacts and blur keep extraction within a few pixels through centroid tracking, but gridlines, leader lines, and B&W stack three failure modes.The adversarial grid-annotation case pulls red markers near t = 14 and complicates solid-versus-dashed grayscale separation.Source: Figure 30 · p. 49

G.5. Best vs. Worst Case Analysis · Appendix H. Skill 1: KM Plot Extraction Pipeline · Appendix I. Skill 2: IPD Generation

The appendices examine plot-specific factors affecting KM extraction and describe automated workflows for KM extraction and IPD generation. They emphasize visual diagnostics, provenance-first trial sourcing, reconstructed OS KM curves as survival ground truth, and documented evidence for configuring synthetic IPD.

G.5. Best vs. Worst Case Analysis

  • IAE 0.07442 marked the hardest plot, where gridlines, an annotation leader line, and black-and-white rendering compounded reference-line, annotation, and curve-disambiguation failures.By contrast, stress combo flat overlap achieved IAE 0.00118 because flat, overlapping curves made pixel-assignment errors nearly harmless; image resolution limited intermediate cases such as stress combo jpeg blurry dark (IAE 0.041).Source: §G.5 · p. 50

Appendix H. Skill 1: KM Plot Extraction Pipeline

  • The KM extraction agent visually assesses each plot, writes one image-specific Python script, traces curves at 1/30-month granularity, enforces monotonicity, and verifies outputs with PAR, published-anchor, coverage, and overlay checks.Its core safeguards include tick-based bounding boxes, color or grayscale separation, reference-line masking, continuity tracking, centroid correction, targeted diagnostics, and localized spot-fixes rather than full rewrites.Source: Appendix H · pp. 50–53

Appendix I. Skill 2: IPD Generation

  • The IPD-generation configuration agent prioritizes ClinicalTrials.gov JSON, wires reconstructed OS KM CSVs verbatim as survival ground truth, and uses publications or protocols only for missing details.Unsupported fields must be omitted rather than guessed; non-OS endpoints are ignored, and held-out ipd/ directories remain off-limits to prevent leakage.Source: Appendix I · pp. 53–54
  • ClinicalTrials.gov JSON is drained first for arm definitions, enrollment, demographics, adverse events, metadata, and regimen hints, preserving its values unless a later source is more granular.AE probabilities are computed per arm as numAffected / numAtRisk using the registry’s MedDRA organ-system labels.Source: Appendix I · p. 55
  • Each arm receives a separate configuration with an exact KM-CSV arm name, arm-specific enrollment, demographics, survival source, and adverse-event probabilities, without pooling arms.The generator emits exactly n_enrolled synthetic patients for that arm.Source: Appendix I · pp. 55–56
  • The generator uses the OS KM CSV as ground-truth survival data, directly bootstrapping (time, event) pairs for matching arm rows without parametric fitting.Legacy parametric survival fields are used only when no arm-specific KM CSV exists.Source: Appendix I · pp. 55, 58
  • Publication and supplement data fill only registry gaps, while SAP or protocol data supply cycle structure, treatment phases, assessment schedules, and otherwise unavailable class-effect toxicities.Demographic values must be sourced or omitted rather than guessed, and merged categorical buckets must be split with documented provenance.Source: Appendix I · pp. 55–56
  • AE generation preserves exact MedDRA naming, deduplicates terms across serious and other-event lists, schedules toxicity through induction fractions, and applies evidence-based risk-modifier overrides only when justified.Typical induction fractions range from 0.85–0.92 for cytotoxic chemotherapy, 0.50–0.65 for immunotherapy, 0.60–0.75 for targeted therapy, and 0.30–0.50 for maintenance-only treatment.Source: Appendix I · pp. 56–57

Appendix J. Limitations and Future Directions

KMGen’s remaining limitations span AE burden and structure, demographic taxonomy, validation safeguards, and survival accuracy, motivating targeted recalibration, validation, and modeling extensions.

Limitations

  • Synthetic cohorts generate 4–6 fewer adverse events per patient than real IPD, reflecting conservative propensity variance, prevalence-to-rate approximation, and missing sub-5% registry events.Raising ση from 0.4 to 0.8 recovers most of the burden gap without harming survival or frequency channels, but does not resolve the structural causes.Source: Appendix J · p. 59
  • Deterministic cycle sampling creates periodic onset peaks, while archetype-conditioned independence omits term-specific AE co-occurrence beyond shared toxicity propensity.Mean onset error remains below 0.8 months, and copula or per-SOC frailty modeling would require unpublished joint AE statistics.Source: Appendix J · p. 59
  • The pipeline lacks configuration range checks and a minimum cohort-size floor, risking invalid sampler inputs and unreliable conditional structure in very small arms.A validation pass is planned, while a few dozen patients per arm are recommended as a practical minimum.Source: Appendix J · p. 59
  • Median overall survival error ranges from 7% to 19%, with KM extraction error a real but minority contributor because oracle curves reduce ΔKM by only 0.006–0.016.KMGen accepts this residual to preserve full automation; human review remains compatible and advisable in practice.Source: Appendix J · p. 60

Future Directions

  • Future work prioritizes ση = 0.8, prevalence-to-rate correction, validation, onset spreading, learned dispersion parameters, and broader frailty, co-occurrence, and non-oncology extensions.Learning parameters from real IPD is excluded to preserve the public-information-only setting; expert priors or published trial corpora offer leakage-free alternatives.Source: Appendix J · p. 60
Loading 2608.22618v1…