# Quanda Tda Eval

> Evaluates Training Data Attribution (TDA) methods by measuring how accurately they approximate counterfactual training effects, detect mislabeled or shortcut-dependent samples, and support downstream classification tasks. Use when the user wants to benchmark on General TDA Benchmark Suite, or asks about evaluating this task. Reports Linear Datamodeling Score (LDS).

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

---


# quanda-tda-eval

> Quanda: An Interpretability Toolkit for Training Data Attribution Evaluation and Beyond — Bareeva et al. (2024) (arXiv:2410.07158, 2024)

## What this evaluates

Evaluates Training Data Attribution (TDA) methods by measuring how accurately they approximate counterfactual training effects, detect mislabeled or shortcut-dependent samples, and support downstream classification tasks.

## Datasets

- **General TDA Benchmark Suite** — total ?; splits: (unstated); repo https://github.com/dilyabareeva/quanda

## Metrics

- `Linear Datamodeling Score (LDS)` **(primary)** — range: [-1, 1]
  - Spearman rank correlation between the sum of attributions over randomly sampled training subsets and the actual model outputs after retraining on those subsets. Averaged over test samples.
- `Class Detection` — range: [0, 1]
  - Ratio of test samples where the training sample with the highest attribution belongs to the correct class.
- `Mislabeling Detection` — range: [0, 1]
  - Area under the curve (AUC) of the cumulative mislabeling detection curve, computed by ranking training samples by self-influence and checking against ground-truth noisy labels.
- `Shortcut Detection` — range: [0, 1]
  - Area under the precision-recall curve (AUPRC) quantifying the ranking of shortcutted training samples relative to clean samples for shortcut-triggering test predictions.

## Input / output format

**Input**: For each test sample z, the model receives the full training dataset D, the computed attributions τ(z, D) for each training sample, and optionally ground-truth labels or subset definitions for downstream tasks.

**Output**: Ranked list or scalar attribution scores for each training sample relative to the test sample, used to compute correlations, ratios, or AUC/AUPRC scores.

## Scoring recipe

```python
def compute_lds(attributions, test_points, subsets, retrained_outputs):
    lds_scores = []
    for z in test_points:
        tau_z = attributions[z]
        pred_scores = [sum(tau_z[i] for i in subset) for subset in subsets]
        actual_scores = [retrained_outputs[s] for s in subsets]
        lds_scores.append(spearman_corr(pred_scores, actual_scores))
    return mean(lds_scores)

def compute_class_detection(attributions, test_points, train_labels, gold_labels):
    correct = 0
    for z in test_points:
        top_idx = argmax(attributions[z])
        if train_labels[top_idx] == gold_labels[z]:
            correct += 1
    return correct / len(test_points)
```

## Common pitfalls

- Assuming attributions are strictly linear when computing LDS, as the metric explicitly relies on the assumption that subset attributions equal the sum of individual attributions.
- Confusing AUC with AUPRC: Mislabeling Detection uses AUC, while Shortcut Detection and Mixed Datasets explicitly use AUPRC due to highly skewed classification tasks.
- Misinterpreting Model Randomization direction: Lower Spearman correlation between original and randomized model attributions indicates a better score, unlike most metrics where higher is better.

## Evidence (verbatim from paper)

> In this section, we summarize the evaluation metrics that are currently implemented in quanda and provide references for related work. Ground truth metrics evaluate the attributions against the ground truth values that the respective TDA methods aim to approximate, e.g., the counterfactual effects of modifying the training dataset. ... The final LDS score is the average LDS score over the test samples.

## Citation

```bibtex
@misc{bareeva2024quanda,
  title={Quanda: An Interpretability Toolkit for Training Data Attribution Evaluation and Beyond},
  author={Bareeva et al. (2024)},
  year={2024},
  note={arXiv:2410.07158}
}
```

- arXiv: 2410.07158

