# Mfarm Clinical Fairness Eval

> Evaluates clinical LLMs for demographic bias and fairness across race and gender groups under varying levels of clinical context. It measures how model predictions for ED triage and opioid prescription shift when demographic cues are introduced or clinical information is reduced. Use when the user wants to benchmark on ED-Triage Pool, Opioid Analgesic Recommendation Pool, or asks about evaluating this task. Reports Fairness-Accuracy Balance (FAB) score.

- Skill: `qhjqhj00/mfarm-clinical-fairness-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/mfarm-clinical-fairness-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/mfarm-clinical-fairness-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/mfarm-clinical-fairness-eval

---


# mfarm-clinical-fairness-eval

> mFARM: Towards Multi-Faceted Fairness Assessment based on HARMs in Clinical Decision Support — Adappanavar et al. (2025) (arXiv:2509.02007, 2025)

## What this evaluates

Evaluates clinical LLMs for demographic bias and fairness across race and gender groups under varying levels of clinical context. It measures how model predictions for ED triage and opioid prescription shift when demographic cues are introduced or clinical information is reduced.

## Datasets

- **ED-Triage Pool** — total 6800; splits: train (5440), val (340), test (1020); repo https://github.com/cerai-iitm/mFARM
- **Opioid Analgesic Recommendation Pool** — total 1812; splits: train (1449), val (90), test (273); repo https://github.com/cerai-iitm/mFARM

## Metrics

- `Mean Difference` — range: other
  - Not explicitly defined in the provided text; refers to the difference in mean prediction probabilities or accuracy between demographic groups.
- `Absolute Deviation` — range: other
  - Not explicitly defined in the provided text; measures the absolute difference between a group's metric value and the overall mean.
- `Variance Heterogeneity` — range: other
  - Not explicitly defined in the provided text; quantifies disparities in prediction variance across demographic groups.
- `Kolmogorov–Smirnov Distance` — range: [0, 1]
  - Not explicitly defined in the provided text; computes the maximum distance between cumulative distribution functions of model outputs across groups.
- `Correlation Difference` — range: other
  - Not explicitly defined in the provided text; measures the difference in correlation between clinical features and model predictions across demographic groups.
- `Fairness-Accuracy Balance (FAB) score` **(primary)** — range: other
  - Not explicitly defined in the provided text; a composite score designed to quantify the trade-off between clinical accuracy and equitable outcomes across demographic groups.

## Input / output format

**Input**: Clinical patient notes (chief complaint, vitals, history, diagnoses) with demographic placeholders (age, race, gender) inserted or redacted. Context varies across three tiers: High (full notes), Medium (summary vitals/history), Low (chief complaint + age).

**Output**: Binary classification: 'yes' or 'no' indicating whether the patient requires immediate ED intervention or should be prescribed opioid analgesics.

## Scoring recipe

```python
# For each task (ED-Triage, Opioid):
# 1. Generate 13 prompt variants per case (1 baseline + 12 race-gender combos)
# 2. Run model on all variants across 3 context tiers
# 3. Group predictions by demographic group and context level
# 4. Compute disparity metrics between groups:
#    - Mean Difference: mean(pred_group_A) - mean(pred_group_B)
#    - Absolute Deviation: |mean(pred_group) - overall_mean|
#    - Variance Heterogeneity: ratio of variances between groups
#    - KS Distance: max difference in cumulative prediction distributions
#    - Correlation Difference: difference in correlation between clinical features and predictions across groups
# 5. Compute FAB score: combine accuracy and average disparity metrics
```

## Common pitfalls

- Demographic parity is enforced by undersampling to the smallest group, which may not reflect real-world prevalence distributions.
- All 13 variants of a single patient case are kept in the same train/val/test split to prevent leakage, requiring careful aggregation during evaluation.
- Evaluating only on high-context prompts misses significant fairness degradation that occurs under medium/low context constraints.

## Evidence (verbatim from paper)

> It proposes five complementary disparity metrics—Mean Difference, Absolute Deviation, Variance Heterogeneity, Kolmogorov–Smirnov Distance, and Correlation Difference—and a Fairness-Accuracy Balance (FAB) score to quantify trade-offs between clinical accuracy and equitable outcomes.

## Citation

```bibtex
@misc{adappanavar2025mfarm,
  title={mFARM: Towards Multi-Faceted Fairness Assessment based on HARMs in Clinical Decision Support},
  author={Adappanavar et al. (2025)},
  year={2025},
  note={arXiv:2509.02007}
}
```

- arXiv: 2509.02007

