Redflag Detection V4.1 (V20d, 65 rules)

Fine-tuned from Qwen2.5-7B-Instruct for medical red-flag extraction. Aligned with 2026-08 "Red Flad_New" spec, extended with 6 additional critical rules missing from the original spec.

What's new in V4.1 vs V4.0

  • Fixed is_male hallucination (0/269 val cases; V4.0 had schema gap where sex was in prompt but 0 training samples used it)
  • 6 new critical rules covering previously uncovered surgical/OB emergencies:
    • V20-60 testicular_torsion (sex=male defensive gate)
    • V20-61 pyelonephritis (painful_urination + fever + severe)
    • V20-62 severe_pid (foul_discharge + fever + severe)
    • V20-63 eye_emergency (angle-closure glaucoma / sudden vision loss; any age)
    • V20-64 cauda_equina (new_incontinence + severe_weakness; any adult age)
    • V20-65 postpartum_hemorrhage (sex=female defensive gate)
  • Defensive sex gates on Row 34-39 (pregnancy) — blocks conflict only, not required
  • Pediatric age fallback — Row 40-46 accept is_child/is_baby boolean when age_band absent
  • 50 new training samples covering sex extraction from "Patient Info: Age X, Male/Female" blocks (EN/中文/BM)

Performance (val 269, strict)

V4.0 (V20c) V4.1 (V20d)
Exact Match 89.2% 87.0%
Precision 0.918 0.901
Recall 0.749 0.786
F1 0.825 0.839

Performance (clinical-fair, SUSPECTED = TP for recall)

  • Precision: 0.753
  • Recall: 0.853
  • F1: 0.800

Usage

python3 -m vllm.entrypoints.openai.api_server \
    --model ningpy/redflag-detection-V4.1 \
    --served-model-name redflag \
    --dtype float16

Requires V20e rule engine (65 compiled rules with sex_gate + age fallback).

Training

  • 3816 samples (V20c 3766 + patch20d 50 sex-field samples)
  • LoRA r=32 alpha=64, 7 target projections
  • 3 epochs @ 2e-5, seq len 1900, 8×V100 DDP
Downloads last month
-
Safetensors
Model size
8B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ningpy/redflag-detection-V4.1

Base model

Qwen/Qwen2.5-7B
Finetuned
(3032)
this model