Evaluating Vertical LLMs for Cancer Diagnosis and Treatment Support: Methods and Deployment Essentials

    This article explains how to evaluate domain-specific large language models (LLMs) for cancer diagnosis and treatment support. It covers how to define clinical tasks, set up blinded comparisons with proper control groups, split evaluation data from training data, and score outputs across multiple dimensions with a safety gate. It also describes statistical methods for reporting win rates with confidence intervals and stratified analysis, so readers can judge whether a model's advantage is real and where its errors concentrate.

    1. Background: What a Vertical LLM Evaluation Needs

    Over the past two years, the number of large language models built for medical use has grown quickly. Developers often support their models with claims such as “win rate in head-to-head comparisons” or “overall better than a certain general-purpose model.” These results have some value, but they rarely show readers what a model can and cannot do in a real clinical workflow. Clinical decisions need traceable evidence, and the cost of an error is much higher than in general text generation. An evaluation framework therefore has to answer three questions: On which types of tasks does the model perform well? Where do its errors concentrate? Can physicians actually benefit from it in daily use?

    General-purpose LLMs are trained on broad corpora and are good at language understanding and generation. However, they may not reliably handle disease-specific guideline details, drug contraindications, or staging criteria. Vertical models are usually trained further or enhanced with knowledge from medical literature, clinical guidelines, and de-identified case records. The goal is to improve accuracy on specialized tasks. Comparisons between the two model types should use the same task definition, the same input materials, and the same scoring criteria. Otherwise, the conclusions cannot be compared fairly.

    2. Task Definition: Defining “Good” Before Evaluating

    Before starting an evaluation, the team needs to break the clinical task into observable units. In oncology decision support, common tasks include:

    • Generating a set of candidate initial treatment plans based on a clinical case summary;
    • Identifying the key evidence behind each plan, such as staging, genetic testing results, or prior treatments;
    • Flagging risks that need human review, such as drug interactions, liver or kidney function limits, or documented allergies.

    Each task needs a clear input format, output format, and criteria for what counts as a complete answer. If the output is free text, ask the model to respond in fixed sections covering its conclusion, supporting evidence, and statement of uncertainty. This makes it easier for reviewers to score each item.

    3. Evaluation Design: Blinding, Controls, and Data Splitting

    3.1 Blinding and Randomization

    Reviewers should not know which model or physician produced a given plan. Removing identifying labels from the outputs and randomizing their order reduces position bias and preconceived judgments.

    3.2 Control Groups

    Controls usually include three groups:

    • The output of a general-purpose LLM under the same prompt;
    • The independent answer of a physician without model assistance;
    • The revised result of a physician after reviewing model assistance.

    Each comparison answers a different question. Comparing the vertical model with the general-purpose model shows whether the vertical model performs better. Comparing the model with physicians working alone shows whether the model can substitute for human judgment. Comparing physicians with and without model assistance shows whether the model helps human performance. The conclusion from one comparison cannot replace the others.

    3.3 Dataset Splitting

    The evaluation set must be strictly separated from the training data. If test cases appear during training, scores will be inflated. The cases should cover different disease courses and age groups, as well as common and rare diseases, and be stratified by difficulty. If all cases come from a single center, the results have limited external validity, and the report needs to state this clearly.

    4. Metrics: From a Single Score to Multidimensional Assessment

    A single overall score can hide important problems. At minimum, scoring should be split into the following five dimensions:

    1. Accuracy: whether the conclusion agrees with guidelines and authoritative consensus;
    2. Completeness: whether key considerations are missing;
    3. Safety: whether the output contains advice that could cause harm, and how severe any missed risks would be;
    4. Explainability: whether the reasoning can be traced to patient record information or literature;
    5. Uncertainty expression: whether the model recognizes insufficient information and recommends human review.

    Each dimension can be scored on a 1 to 5 scale. Safety should work as a veto rule: any high-risk error makes the case fail, regardless of high scores on other dimensions. Weights must be set before the evaluation begins and must not be adjusted after seeing the results.

    A sample weighted scoring implementation is shown below:

    1. function weighted_score(scores, weights):
    2. total_weight = sum(weights[d] for d in scores)
    3. weighted_sum = sum(scores[d] * weights[d] for d in scores)
    4. return weighted_sum / total_weight
    5. function passes_safety_gate(case_result):
    6. if case_result.has_high_risk_error:
    7. return false
    8. return true

    5. Statistical Methods: Making Win-Rate Conclusions Reliable

    Head-to-head comparisons are often reported as win rates. For each case, reviewers judge which of two plans is better, and the win rate is the proportion of cases won by one side. Win rates should be reported with confidence intervals. Without them, random variation in small samples is easy to misread. Ties should be recorded separately and should not be counted as wins for either side.

    The sample code below uses the bootstrap method to estimate a confidence interval for the win rate:

    1. function bootstrap_win_rate_ci(outcomes, n_iter, alpha):
    2. # outcomes: 1 means A wins, 0 means B wins, 0.5 means a tie
    3. n = length(outcomes)
    4. rates = empty list
    5. repeat n_iter times:
    6. sample = draw n items from outcomes with replacement
    7. append (sum(sample) / n) to rates
    8. sort rates ascending
    9. lower = rates[floor(alpha / 2 * n_iter)]
    10. upper = rates[floor((1 - alpha / 2) * n_iter) - 1]
    11. return (sum(outcomes) / n, lower, upper)

    If the confidence interval includes 0.5, the sample size is too small to show a statistically meaningful difference between the two models. In that case, report the result as no significant difference and do not declare a winner. Expanding the sample and retesting is the safer approach.

    Stratified results should also be reported. A model may have a high overall win rate but still perform poorly on complex cases. Stratified analysis can expose this kind of problem.