karpathy-metric-pre
Red-teams your optimization metrics to find vulnerabilities and failure modes before implementation.
Install
mkdir -p .claude/skills/karpathy-metric-pre && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16333" && unzip -o skill.zip -d .claude/skills/karpathy-metric-pre && rm skill.zipInstalls to .claude/skills/karpathy-metric-pre
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use this when: red-team my optimization metric, find ways to game my metric, metric pre-mortem, adversarial metric evaluation, gaming vectors for my KPI, what could an agent exploit in my metric, metric failure modes, proxy divergence risk, eval contamination, silent degradation from optimization, metric gaming pre-mortem, is my metric robust enough for auto-improvement, build secondary metrics, evaluation diversity plan, metric countermeasures, what does overfitting look like in my system, holdout scenario design, disappearance test, metric gaming attack surface, is my metric gameable, optimization agent failure modes, what could go wrong with my eval, unsupervised optimization risk, metric red teamKey capabilities
- →Identify ways an optimization agent could inflate a metric without delivering business value
- →Generate gaming vectors categorized as Direct Gaming, Proxy Divergence, Eval Contamination, Silent Degradation, and Compounding Cascades
- →Propose specific countermeasures for each gaming vector, including secondary metrics and holdout scenarios
- →Define how to apply 'The Disappearance Test' for potential optimizations
- →Synthesize findings into a structured 'Metric Gaming Pre-Mortem' document
- →Provide an honest assessment of metric reliable for unsupervised optimization
How it works
The skill adopts an adversarial persona to gather details about a target metric, then generates specific gaming vectors across five categories. For each vector, it proposes countermeasures and synthesizes the information into a pre-mortem document.
Inputs & outputs
When to use karpathy-metric-pre
- →Red-teaming KPIs
- →Identifying metric failure modes
- →Evaluating optimization agent risks
About this skill
If the user has a program.md from a previous session, ask them to paste the relevant sections. If they're working from their own notes, gather the equivalent information conversationally. Do not proceed until you understand all four elements.
Wait for their response.
STEP 2 — GENERATE GAMING VECTORS For the specific metric and system described, generate a comprehensive list of ways an optimization agent could inflate the metric without delivering the intended business value. Organize these into five categories:
a) Direct Gaming — Ways to hit the number by exploiting the measurement mechanism itself (e.g., formatting tricks that satisfy rubrics, edge cases that inflate scores, shortcuts that satisfy test cases but not real-world conditions)
b) Proxy Divergence — Ways the metric could improve while the actual business outcome it represents stays flat or degrades (e.g., optimizing response time while degrading response quality, reducing churn on paper while just making cancellation harder)
c) Eval Contamination — Ways the optimization loop could inadvertently influence the data or conditions it's being evaluated against (e.g., the agent's outputs during experiments changing the distribution of test inputs, training and evaluation data sharing leakage paths)
d) Silent Degradation — Side effects that the metric doesn't capture that could accumulate over many optimization cycles (e.g., increasing technical debt, eroding edge-case handling, drifting from compliance requirements, degrading user trust through subtle behavior changes)
e) Compounding Cascades — How a locally optimal change could create problems in connected systems (e.g., a pricing optimization that improves margin metrics but creates fulfillment bottlenecks, a support agent optimization that reduces handle time but increases repeat contacts)
For each gaming vector, provide:
- A specific, concrete scenario (not abstract — describe what the agent would actually do)
- Why it would register as an improvement on the primary metric
- What real-world damage it would cause
- How long it might persist before a human notices
STEP 3 — BUILD THE DEFENSE For each gaming vector identified, propose specific countermeasures:
a) Secondary Metrics — Additional measurements that would catch this failure mode. Be specific: name the metric, how to compute it, and what threshold should trigger investigation.
b) Holdout Scenarios — Test cases the optimization agent should never see during its loop but that should be evaluated periodically by a human. Describe the specific scenarios and why they'd catch this gaming vector.
c) The Disappearance Test — For each potential optimization the agent might propose, define how to apply Gu's test: "If this exact task disappeared, would this still be a worthwhile improvement?" Translate this into a concrete check for the user's domain.
STEP 4 — DELIVER THE EVALUATION DIVERSITY PLAN Synthesize the above into a single actionable document. </instructions>
<output> Produce a structured "Metric Gaming Pre-Mortem" document with these sections:-
Primary Metric Summary — Restate what's being optimized and what it's supposed to represent (2-3 sentences, confirming shared understanding)
-
Gaming Vector Table — A table with columns: Category | Scenario | Why It Looks Like Improvement | Actual Damage | Detection Difficulty (Low/Medium/High) | Time to Human Detection
-
Evaluation Diversity Plan — For each gaming vector:
- The secondary metric or holdout scenario that catches it
- How to implement that check (specific enough to build)
- How often to run it
- Who should review the results
-
Top 3 Most Dangerous Vectors — The gaming vectors most likely to occur AND most likely to go undetected. For each: why it's the highest risk, and the single most important countermeasure.
-
The Honest Assessment — A brief statement on whether this metric, even with the proposed countermeasures, is robust enough for unsupervised optimization, or whether it needs fundamental rethinking before auto-improvement should be attempted.
Format as a clean markdown document. </output>
<guardrails> - Be genuinely adversarial. The value of this prompt is in surfacing scenarios the user hasn't considered. Do not soften the analysis to be polite. - Every gaming vector must be specific to the user's described system and metric. Do not generate generic "an agent might overfit" warnings. Describe what overfitting would actually look like in their specific context. - Do not invent technical details about the user's system. If you need more information to generate specific gaming vectors, ask. - Do not claim a metric is "safe" or "ungameable." Every metric has cracks. Find them. - If the user's primary metric is clearly inadequate (e.g., it measures activity rather than outcomes, or it's easily gamed by trivial means), say so directly in the Honest Assessment rather than just listing gaming vectors. - Do not recommend abandoning the optimization effort. The goal is to make it robust, not to discourage it. - If a gaming vector requires domain-specific knowledge you lack, flag it as "potential vector requiring domain expert review" rather than guessing at specifics. </guardrails>See Also
karpathy-triplet-diag— Define the system, editable surface, and metric this red-team is evaluating.karpathy-trace-infrastructure— Ensure traces capture enough to detect the gaming vectors identified here.harness-engineering— Place mechanical guardrails in the harness to block detected gaming patterns.ai-systems-architect— Architect secondary metrics and evaluator diversity into the pipeline.outcome-based-system-prompt— Remove prompt-level duct tape that creates proxy divergence risk.
When not to use it
- →When the user wants reassuring analysis instead of adversarial evaluation
- →When the user is not evaluating an optimization metric or KPI
- →When the user does not want to surface failure modes that look like success
Limitations
- →Every gaming vector must be specific to the user's described system and metric
- →Does not claim a metric is 'safe' or 'ungameable'
- →Does not recommend abandoning the optimization effort, but rather making it reliable
How it compares
This skill provides a specialized adversarial evaluation of metrics, focusing on how an optimization agent might 'game' the system, which is distinct from standard metric analysis or performance monitoring.
Compared to similar skills
karpathy-metric-pre side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| karpathy-metric-pre (this skill) | 0 | 2mo | No flags | Advanced |
| llm-evaluation | 6 | 2mo | No flags | Advanced |
| evaluating-llms-harness | 3 | 7mo | Review | Advanced |
| qutip | 4 | 8mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by aibot88
View all by aibot88 →You might also like
llm-evaluation
wshobson
Implement comprehensive evaluation strategies for LLM applications using automated metrics, human feedback, and benchmarking. Use when testing LLM performance, measuring AI application quality, or establishing evaluation frameworks.
evaluating-llms-harness
davila7
Evaluates LLMs across 60+ academic benchmarks (MMLU, HumanEval, GSM8K, TruthfulQA, HellaSwag). Use when benchmarking model quality, comparing models, reporting academic results, or tracking training progress. Industry standard used by EleutherAI, HuggingFace, and major labs. Supports HuggingFace, vLLM, APIs.
qutip
davila7
Quantum mechanics simulations and analysis using QuTiP (Quantum Toolbox in Python). Use when working with quantum systems including: (1) quantum states (kets, bras, density matrices), (2) quantum operators and gates, (3) time evolution and dynamics (Schrödinger, master equations, Monte Carlo), (4) open quantum systems with dissipation, (5) quantum measurements and entanglement, (6) visualization (Bloch sphere, Wigner functions), (7) steady states and correlation functions, or (8) advanced methods (Floquet theory, HEOM, stochastic solvers). Handles both closed and open quantum systems across various domains including quantum optics, quantum computing, and condensed matter physics.
torchdrug
davila7
Graph-based drug discovery toolkit. Molecular property prediction (ADMET), protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis, GNNs (GIN, GAT, SchNet), 40+ datasets, for PyTorch-based ML on molecules, proteins, and biomedical graphs.
string-database
davila7
Query STRING API for protein-protein interactions (59M proteins, 20B interactions). Network analysis, GO/KEGG enrichment, interaction discovery, 5000+ species, for systems biology.
transformer-lens-interpretability
davila7
Provides guidance for mechanistic interpretability research using TransformerLens to inspect and manipulate transformer internals via HookPoints and activation caching. Use when reverse-engineering model algorithms, studying attention patterns, or performing activation patching experiments.