Variance Stability Experimental Design Lens
Philosophical Mode: Stability
Primary Question: "Is the signal larger than the noise?"
Focus: Run-to-Run Variance, Seed Sensitivity, Nondeterminism Sources, Confidence Intervals, Noise Floor
When to Use
- ML experiments with high variance across seeds
- Systems benchmarks with environmental noise
- Results where small differences are claimed as improvements
- User invokes
/exp-lens-variance-stability or /make-experiment-diag variance
Critical Constraints
NEVER:
- Modify any source code files
- Do not litter the codebase with useless comments, TODO markers, or explanatory annotations — the skill output and diagram speak for themselves
ALWAYS:
- Count the actual number of independent runs — single-run results must be flagged prominently
- Assess whether claimed improvements exceed the observed standard deviation
- Identify all sources of nondeterminism, not just random seeds
- Report when confidence intervals are absent — absence is a finding, not an omission
- BEFORE creating any diagram, LOAD the
/mermaid skill using the Skill tool - this is MANDATORY
Analysis Workflow
Step 1: Launch Parallel Exploration Subagents
Spawn Explore subagents to investigate:
Random Seed Management
- Find how seeds are set and varied
- Look for: seed, random_state, torch.manual_seed, np.random, set_seed, PYTHONHASHSEED
Nondeterminism Sources
- Find sources of nondeterminism beyond seeds
- Look for: cudnn, benchmark, deterministic, parallel, async, thread, race, order, nondeterministic
Multiple Run Protocol
- Find how many runs are performed per condition
- Look for: n_runs, trials, repeat, replicate, mean, std, confidence, interval, aggregate
Variance Reporting
- Find how variance is reported (if at all)
- Look for: std, stderr, confidence, interval, range, median, quartile, bootstrap, error_bar
Signal-to-Noise Assessment
- Find whether claimed improvements exceed observed variance
- Look for: significant, difference, improvement, margin, effect_size, gap, overlap
Step 2: Build Variance Profile
For each reported result:
- How many independent runs?
- What is the standard deviation across runs?
- Does the claimed improvement exceed the noise floor?
- Are confidence intervals reported?
- What sources of nondeterminism exist beyond seeds?
Build the variance profile.
Step 3: Analyze Signal vs Noise
CRITICAL — Analyze Signal vs Noise:
For every claimed improvement:
- Is the improvement magnitude larger than the run-to-run standard deviation?
- Could the ranking of methods change under reruns?
- Are the "best" results cherry-picked from multiple seeds?
Step 4: Create the Diagram
Use the mermaid skill conventions to create a stochasticity diagram with:
Direction: TB (nondeterminism sources flow down through aggregation to reported results)
Subgraphs:
- NONDETERMINISM SOURCES
- VARIANCE AGGREGATION
- REPORTED RESULTS
Node Styling:
stateNode class: Nondeterminism sources
handler class: Aggregation methods
output class: Reported results
gap class: Unreported variance or single-run results
detector class: Confidence intervals and statistical tests
cli class: Seed management
Step 5: Write Output
Write the diagram to: temp/exp-lens-variance-stability/exp_diag_variance_stability_{YYYY-MM-DD_HHMMSS}.md
Output Template
# Variance Stability Analysis: {Experiment Name}
**Lens:** Variance Stability (Stability)
**Question:** Is the signal larger than the noise?
**Date:** {YYYY-MM-DD}
**Scope:** {What was analyzed}
## Variance Profile
| Experiment | N Runs | Mean | Std | CI | Signal > Noise? |
|------------|--------|------|-----|----|-----------------|
| {experiment} | {n} | {mean} | {std} | {CI or "Not reported"} | {Yes/No/Unclear} |
## Nondeterminism Inventory
| Source | Type | Controlled? | Impact |
|--------|------|-------------|--------|
| {source} | {seed/hardware/async/etc} | {Yes/No/Partial} | {Low/Medium/High} |
## Stochasticity Diagram
```mermaid
%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%
graph TB
%% CLASS DEFINITIONS %%
classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;
classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;
classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;
classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff;
classDef newComponent fill:#2e7d32,stroke:#81c784,stroke-width:2px,color:#fff;
classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;
classDef detector fill:#b71c1c,stroke:#ef5350,stroke-width:2px,color:#fff;
classDef gap fill:#ff6f00,stroke:#ffa726,stroke-width:2px,color:#000;
classDef integration fill:#c62828,stroke:#ef9a9a,stroke-width:2px,color:#fff;
subgraph NDSources ["NONDETERMINISM SOURCES"]
direction TB
SEED["Random Seed<br/>━━━━━━━━━━<br/>Controlled via<br/>seed management"]
HW["Hardware Variance<br/>━━━━━━━━━━<br/>GPU/CPU ordering<br/>differences"]
ASYNC["Async Operations<br/>━━━━━━━━━━<br/>Thread/process<br/>race conditions"]
end
subgraph Aggregation ["VARIANCE AGGREGATION"]
direction TB
MULTI["Multiple Runs<br/>━━━━━━━━━━<br/>N independent<br/>repetitions"]
CI["Confidence Interval<br/>━━━━━━━━━━<br/>Statistical bounds<br/>on estimates"]
end
subgraph Results ["REPORTED RESULTS"]
direction TB
RESULT["Reported Result<br/>━━━━━━━━━━<br/>Mean ± std<br/>with CI"]
SINGLE["Single-Run Result<br/>━━━━━━━━━━<br/>No variance<br/>reported"]
end
SEED --> MULTI
HW --> MULTI
ASYNC --> MULTI
MULTI --> CI
CI --> RESULT
MULTI --> SINGLE
%% CLASS ASSIGNMENTS %%
class SEED cli;
class HW,ASYNC stateNode;
class MULTI handler;
class CI detector;
class RESULT output;
class SINGLE gap;
Seed Sensitivity Assessment
| Seed |
Run Result |
Rank Among Methods |
| {seed} |
{result} |
{rank} |
Reporting Completeness Checklist
Key Findings
- {Description of whether signals exceed noise and reporting completeness}
---
## Pre-Diagram Checklist
Before creating the diagram, verify:
- [ ] LOADED `/mermaid` skill using the Skill tool
- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)
- [ ] Diagram will include a color legend table
---
## Related Skills
- `/make-experiment-diag` - Parent skill for lens selection
- `/mermaid` - MUST BE LOADED before creating diagram
- `/exp-lens-reproducibility-artifacts` - For environment and artifact reproducibility
- `/exp-lens-error-budget` - For systematic error and bias analysis
1---2name: exp-lens-variance-stability3description: Create a variance analysis profile assessing whether signals exceed noise and whether results are stable across random seeds. Stability lens answering "Is the signal larger than the noise?"4---56# Variance Stability Experimental Design Lens78**Philosophical Mode:** Stability9**Primary Question:** "Is the signal larger than the noise?"10**Focus:** Run-to-Run Variance, Seed Sensitivity, Nondeterminism Sources, Confidence Intervals, Noise Floor1112## When to Use1314- ML experiments with high variance across seeds15- Systems benchmarks with environmental noise16- Results where small differences are claimed as improvements17- User invokes `/exp-lens-variance-stability` or `/make-experiment-diag variance`1819## Critical Constraints2021**NEVER:**22- Modify any source code files23- Do not litter the codebase with useless comments, TODO markers, or explanatory annotations — the skill output and diagram speak for themselves2425**ALWAYS:**26- Count the actual number of independent runs — single-run results must be flagged prominently27- Assess whether claimed improvements exceed the observed standard deviation28- Identify all sources of nondeterminism, not just random seeds29- Report when confidence intervals are absent — absence is a finding, not an omission30- BEFORE creating any diagram, LOAD the `/mermaid` skill using the Skill tool - this is MANDATORY3132---3334## Analysis Workflow3536### Step 1: Launch Parallel Exploration Subagents3738Spawn Explore subagents to investigate:3940**Random Seed Management**41- Find how seeds are set and varied42- Look for: seed, random_state, torch.manual_seed, np.random, set_seed, PYTHONHASHSEED4344**Nondeterminism Sources**45- Find sources of nondeterminism beyond seeds46- Look for: cudnn, benchmark, deterministic, parallel, async, thread, race, order, nondeterministic4748**Multiple Run Protocol**49- Find how many runs are performed per condition50- Look for: n_runs, trials, repeat, replicate, mean, std, confidence, interval, aggregate5152**Variance Reporting**53- Find how variance is reported (if at all)54- Look for: std, stderr, confidence, interval, range, median, quartile, bootstrap, error_bar5556**Signal-to-Noise Assessment**57- Find whether claimed improvements exceed observed variance58- Look for: significant, difference, improvement, margin, effect_size, gap, overlap5960### Step 2: Build Variance Profile6162For each reported result:631. How many independent runs?642. What is the standard deviation across runs?653. Does the claimed improvement exceed the noise floor?664. Are confidence intervals reported?675. What sources of nondeterminism exist beyond seeds?6869Build the variance profile.7071### Step 3: Analyze Signal vs Noise7273**CRITICAL — Analyze Signal vs Noise:**74For every claimed improvement:75- Is the improvement magnitude larger than the run-to-run standard deviation?76- Could the ranking of methods change under reruns?77- Are the "best" results cherry-picked from multiple seeds?7879### Step 4: Create the Diagram8081Use the mermaid skill conventions to create a stochasticity diagram with:8283**Direction:** `TB` (nondeterminism sources flow down through aggregation to reported results)8485**Subgraphs:**86- NONDETERMINISM SOURCES87- VARIANCE AGGREGATION88- REPORTED RESULTS8990**Node Styling:**91- `stateNode` class: Nondeterminism sources92- `handler` class: Aggregation methods93- `output` class: Reported results94- `gap` class: Unreported variance or single-run results95- `detector` class: Confidence intervals and statistical tests96- `cli` class: Seed management9798### Step 5: Write Output99100Write the diagram to: `temp/exp-lens-variance-stability/exp_diag_variance_stability_{YYYY-MM-DD_HHMMSS}.md`101102---103104## Output Template105106```markdown107# Variance Stability Analysis: {Experiment Name}108109**Lens:** Variance Stability (Stability)110**Question:** Is the signal larger than the noise?111**Date:** {YYYY-MM-DD}112**Scope:** {What was analyzed}113114## Variance Profile115116| Experiment | N Runs | Mean | Std | CI | Signal > Noise? |117|------------|--------|------|-----|----|-----------------|118| {experiment} | {n} | {mean} | {std} | {CI or "Not reported"} | {Yes/No/Unclear} |119120## Nondeterminism Inventory121122| Source | Type | Controlled? | Impact |123|--------|------|-------------|--------|124| {source} | {seed/hardware/async/etc} | {Yes/No/Partial} | {Low/Medium/High} |125126## Stochasticity Diagram127128```mermaid129%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%130graph TB131 %% CLASS DEFINITIONS %%132 classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;133 classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;134 classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;135 classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff;136 classDef newComponent fill:#2e7d32,stroke:#81c784,stroke-width:2px,color:#fff;137 classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;138 classDef detector fill:#b71c1c,stroke:#ef5350,stroke-width:2px,color:#fff;139 classDef gap fill:#ff6f00,stroke:#ffa726,stroke-width:2px,color:#000;140 classDef integration fill:#c62828,stroke:#ef9a9a,stroke-width:2px,color:#fff;141142 subgraph NDSources ["NONDETERMINISM SOURCES"]143 direction TB144 SEED["Random Seed<br/>━━━━━━━━━━<br/>Controlled via<br/>seed management"]145 HW["Hardware Variance<br/>━━━━━━━━━━<br/>GPU/CPU ordering<br/>differences"]146 ASYNC["Async Operations<br/>━━━━━━━━━━<br/>Thread/process<br/>race conditions"]147 end148149 subgraph Aggregation ["VARIANCE AGGREGATION"]150 direction TB151 MULTI["Multiple Runs<br/>━━━━━━━━━━<br/>N independent<br/>repetitions"]152 CI["Confidence Interval<br/>━━━━━━━━━━<br/>Statistical bounds<br/>on estimates"]153 end154155 subgraph Results ["REPORTED RESULTS"]156 direction TB157 RESULT["Reported Result<br/>━━━━━━━━━━<br/>Mean ± std<br/>with CI"]158 SINGLE["Single-Run Result<br/>━━━━━━━━━━<br/>No variance<br/>reported"]159 end160161 SEED --> MULTI162 HW --> MULTI163 ASYNC --> MULTI164 MULTI --> CI165 CI --> RESULT166 MULTI --> SINGLE167168 %% CLASS ASSIGNMENTS %%169 class SEED cli;170 class HW,ASYNC stateNode;171 class MULTI handler;172 class CI detector;173 class RESULT output;174 class SINGLE gap;175```176177## Seed Sensitivity Assessment178179| Seed | Run Result | Rank Among Methods |180|------|-----------|-------------------|181| {seed} | {result} | {rank} |182183## Reporting Completeness Checklist184185- [ ] Number of runs reported per condition186- [ ] Standard deviation or standard error reported187- [ ] Confidence intervals reported188- [ ] All seeds or seed range disclosed189- [ ] Nondeterminism sources acknowledged190191## Key Findings192193- {Description of whether signals exceed noise and reporting completeness}194```195196---197198## Pre-Diagram Checklist199200Before creating the diagram, verify:201202- [ ] LOADED `/mermaid` skill using the Skill tool203- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)204- [ ] Diagram will include a color legend table205206---207208## Related Skills209210- `/make-experiment-diag` - Parent skill for lens selection211- `/mermaid` - MUST BE LOADED before creating diagram212- `/exp-lens-reproducibility-artifacts` - For environment and artifact reproducibility213- `/exp-lens-error-budget` - For systematic error and bias analysis