skills/llm/score-variance-baseline-mixin/SKILL.md
Mix a small fraction of plain baseline responses into an adversarial submission to preserve cross-row score variance
npx skillsauth add wenmin-wu/ds-skills llm-score-variance-baseline-mixinInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
In metrics that reward disagreement between LLM judges (e.g. variance or rank-correlation penalties), a perfectly-adversarial submission where every row gets the same derailed score is actually bad — the variance collapses to zero. The fix: keep a 10-15% fraction of rows as plain, un-attacked baselines. The baselines produce a normal score distribution; the adversarial rows cluster at the derailed value. The bimodal mixture has higher variance than either alone, which is exactly what the metric rewards.
import random
def submission_row(row, rng, baseline_frac=0.10):
if rng.random() < baseline_frac:
return plain_essay(row), "baseline"
else:
return adversarial_essay(row), "attack"
rng = random.Random(42)
submission = [submission_row(r, rng) for r in test_rows]
plain_essay and an adversarial_essay functionbaseline_frac on a held-out slice: measure the competition metric for frac in {0, 0.05, 0.10, 0.15, 0.20}data-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF