Unit Interference Experimental Design Lens
Philosophical Mode: Causal-Structural
Primary Question: "What is the unit, and can treatments spill over?"
Focus: Experimental Unit, Cluster Structure, Shared Resources, Network Effects, SUTVA Violations
When to Use
- Online A/B tests with shared infrastructure
- Distributed systems where units share caches, queues, or services
- Social or network experiments where units are connected
- User invokes
/exp-lens-unit-interference or /make-experiment-diag unit
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:
- Focus on the unit definition and whether SUTVA is plausible
- Map the full unit-cluster-resource hierarchy before assessing interference
- Identify every shared resource that could transmit treatment effects across groups
- Distinguish direct spillover (shared cache) from indirect spillover (market equilibrium)
- 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:
Unit Definition
- Find what constitutes one experimental unit
- Is it a user, request, session, query, item, sample, trial, or instance?
- Look for: user, request, session, query, item, sample, trial, instance
Cluster & Group Structure
- Find groupings of units that might share treatment effects
- Identify natural clustering that predates treatment assignment
- Look for: cluster, group, shard, server, region, batch, household, team
Shared Resources
- Find infrastructure shared across treatment groups
- Identify components both treatment and control units touch
- Look for: cache, queue, pool, database, service, load_balancer, gpu, memory
Network & Social Connections
- Find connections between units that could transmit treatment effects
- Identify paths by which a treated unit could alter a control unit's experience
- Look for: network, graph, friend, neighbor, link, message, recommend, influence
Treatment Assignment Boundary
- Find where the treatment boundary is drawn
- Identify whether the assignment is at the unit level or a coarser level
- Look for: bucket, hash, experiment_id, variant, flag, feature_flag, rollout
Step 2: Map the Unit-Cluster-Resource Hierarchy
For each level of the hierarchy:
- Can treatment at one level affect outcomes at another?
- Identify specific spillover pathways between levels
- Assess whether SUTVA (stable unit treatment value assumption) is plausible at each level
Document:
- Unit Level: The atomic entity receiving treatment
- Cluster Level: Natural groupings of units with shared context
- System Level: Infrastructure shared across all groups
Step 3: Analyze Interference Pathways
CRITICAL — Analyze Interference Pathways:
For every shared resource or connection:
- Could treatment group A's behavior change the experience of control group B?
- Is this interference direct (shared cache hit rates) or indirect (market-level equilibrium effects)?
- What is the likely magnitude: negligible, moderate, or invalidating?
- Is there a mitigation strategy (cluster-level randomization, holdout, depletion correction)?
Rate each pathway:
- HIGH: Interference almost certainly contaminates the control group
- MEDIUM: Plausible interference under realistic usage patterns
- LOW: Theoretical but unlikely to affect measured outcomes
Step 4: Create the Diagram
Use flowchart with:
Direction: TB (units nested within clusters nested within the system)
Subgraphs:
- "EXPERIMENTAL UNITS" (the atomic entities being randomized)
- "CLUSTER STRUCTURE" (groupings above the unit level)
- "SHARED RESOURCES" (infrastructure accessible by both groups)
- "INTERFERENCE PATHWAYS" (explicit spillover routes)
Node Styling:
cli class: Experimental units
phase class: Cluster / group nodes
stateNode class: Shared resources
gap class: Interference pathways
handler class: Treatment assignment
detector class: SUTVA boundary
Step 5: Write Output
Write the diagram to: temp/exp-lens-unit-interference/exp_diag_unit_interference_{YYYY-MM-DD_HHMMSS}.md
Output Template
# Unit Interference Diagram: {System / Experiment Name}
**Lens:** Unit Interference (Causal-Structural)
**Question:** What is the unit, and can treatments spill over?
**Date:** {YYYY-MM-DD}
**Scope:** {What was analyzed}
## Unit Hierarchy
| Level | Count | Shared Resources | Interference Risk |
|-------|-------|-----------------|-------------------|
| {unit level} | {N} | {resources} | {LOW / MEDIUM / HIGH} |
| {cluster level} | {N} | {resources} | {LOW / MEDIUM / HIGH} |
| {system level} | {N} | {resources} | {LOW / MEDIUM / HIGH} |
## Unit-Cluster Diagram
```mermaid
%%{init: {'flowchart': {'nodeSpacing': 40, 'rankSpacing': 50, 'curve': 'basis'}}}%%
flowchart 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 Assignment ["TREATMENT ASSIGNMENT"]
ASSIGN["Assignment Logic<br/>━━━━━━━━━━<br/>hash / flag / bucket"]
SUTVA{"SUTVA<br/>Boundary<br/>plausible?"}
end
subgraph Units ["EXPERIMENTAL UNITS"]
direction TB
TREAT["Treatment Units<br/>━━━━━━━━━━<br/>receive variant"]
CTRL["Control Units<br/>━━━━━━━━━━<br/>receive baseline"]
end
subgraph Clusters ["CLUSTER STRUCTURE"]
direction TB
CL_T["Treatment Cluster<br/>━━━━━━━━━━<br/>shared context"]
CL_C["Control Cluster<br/>━━━━━━━━━━<br/>shared context"]
end
subgraph Shared ["SHARED RESOURCES"]
direction TB
RES1["Shared Cache<br/>━━━━━━━━━━<br/>cross-group access"]
RES2["Shared Queue<br/>━━━━━━━━━━<br/>cross-group access"]
end
subgraph Interference ["INTERFERENCE PATHWAYS"]
direction TB
PATH1["Spillover Path 1<br/>━━━━━━━━━━<br/>mechanism + magnitude"]
PATH2["Spillover Path 2<br/>━━━━━━━━━━<br/>mechanism + magnitude"]
end
%% ASSIGNMENT %%
ASSIGN --> TREAT
ASSIGN --> CTRL
ASSIGN --> SUTVA
%% CLUSTER NESTING %%
TREAT --> CL_T
CTRL --> CL_C
%% SHARED RESOURCE ACCESS %%
CL_T --> RES1
CL_C --> RES1
CL_T --> RES2
CL_C --> RES2
%% INTERFERENCE %%
RES1 -.->|"spillover"| PATH1
RES2 -.->|"spillover"| PATH2
PATH1 -.->|"contaminates"| CTRL
PATH2 -.->|"contaminates"| CTRL
%% CLASS ASSIGNMENTS %%
class TREAT,CTRL cli;
class CL_T,CL_C phase;
class RES1,RES2 stateNode;
class PATH1,PATH2 gap;
class ASSIGN handler;
class SUTVA detector;
Color Legend:
| Color |
Category |
Description |
| Dark Blue |
Units |
Experimental units receiving treatment or control |
| Purple |
Clusters |
Cluster / group nodes above the unit level |
| Dark Teal |
Shared Resources |
Infrastructure accessible by both groups |
| Yellow |
Interference |
Spillover and contamination pathways |
| Orange |
Assignment |
Treatment assignment logic |
| Red |
SUTVA Boundary |
Plausibility check for the independence assumption |
Interference Pathway Analysis
| Source |
Mechanism |
Magnitude Estimate |
Mitigation |
| {resource} |
{how spillover occurs} |
{negligible / moderate / invalidating} |
{strategy} |
SUTVA Assessment
- Independence assumption: {plausible / violated / unknown}
- Identified violations: {list specific pathways or "none detected"}
- Recommended mitigation: {cluster randomization / geo holdout / none needed / further investigation}
---
## 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 experimental lens selection
- `/mermaid` - MUST BE LOADED before creating diagram
- `/exp-lens-causal-assumptions` - For DAG-level causal structure analysis
- `/exp-lens-randomization-blocking` - For randomization strategy and blocking design
1---2name: exp-lens-unit-interference3description: Create Unit Interference experimental design diagram showing unit hierarchy, cluster structure, shared resources, and SUTVA violation pathways. Causal-Structural lens answering "What is the unit, and can treatments spill over?"4---56# Unit Interference Experimental Design Lens78**Philosophical Mode:** Causal-Structural9**Primary Question:** "What is the unit, and can treatments spill over?"10**Focus:** Experimental Unit, Cluster Structure, Shared Resources, Network Effects, SUTVA Violations1112## When to Use1314- Online A/B tests with shared infrastructure15- Distributed systems where units share caches, queues, or services16- Social or network experiments where units are connected17- User invokes `/exp-lens-unit-interference` or `/make-experiment-diag unit`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- Focus on the unit definition and whether SUTVA is plausible27- Map the full unit-cluster-resource hierarchy before assessing interference28- Identify every shared resource that could transmit treatment effects across groups29- Distinguish direct spillover (shared cache) from indirect spillover (market equilibrium)30- 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**Unit Definition**41- Find what constitutes one experimental unit42- Is it a user, request, session, query, item, sample, trial, or instance?43- Look for: user, request, session, query, item, sample, trial, instance4445**Cluster & Group Structure**46- Find groupings of units that might share treatment effects47- Identify natural clustering that predates treatment assignment48- Look for: cluster, group, shard, server, region, batch, household, team4950**Shared Resources**51- Find infrastructure shared across treatment groups52- Identify components both treatment and control units touch53- Look for: cache, queue, pool, database, service, load_balancer, gpu, memory5455**Network & Social Connections**56- Find connections between units that could transmit treatment effects57- Identify paths by which a treated unit could alter a control unit's experience58- Look for: network, graph, friend, neighbor, link, message, recommend, influence5960**Treatment Assignment Boundary**61- Find where the treatment boundary is drawn62- Identify whether the assignment is at the unit level or a coarser level63- Look for: bucket, hash, experiment_id, variant, flag, feature_flag, rollout6465### Step 2: Map the Unit-Cluster-Resource Hierarchy6667For each level of the hierarchy:68- Can treatment at one level affect outcomes at another?69- Identify specific spillover pathways between levels70- Assess whether SUTVA (stable unit treatment value assumption) is plausible at each level7172Document:73- **Unit Level**: The atomic entity receiving treatment74- **Cluster Level**: Natural groupings of units with shared context75- **System Level**: Infrastructure shared across all groups7677### Step 3: Analyze Interference Pathways7879**CRITICAL — Analyze Interference Pathways:**80For every shared resource or connection:81- Could treatment group A's behavior change the experience of control group B?82- Is this interference direct (shared cache hit rates) or indirect (market-level equilibrium effects)?83- What is the likely magnitude: negligible, moderate, or invalidating?84- Is there a mitigation strategy (cluster-level randomization, holdout, depletion correction)?8586Rate each pathway:87- **HIGH**: Interference almost certainly contaminates the control group88- **MEDIUM**: Plausible interference under realistic usage patterns89- **LOW**: Theoretical but unlikely to affect measured outcomes9091### Step 4: Create the Diagram9293Use flowchart with:9495**Direction:** `TB` (units nested within clusters nested within the system)9697**Subgraphs:**98- "EXPERIMENTAL UNITS" (the atomic entities being randomized)99- "CLUSTER STRUCTURE" (groupings above the unit level)100- "SHARED RESOURCES" (infrastructure accessible by both groups)101- "INTERFERENCE PATHWAYS" (explicit spillover routes)102103**Node Styling:**104- `cli` class: Experimental units105- `phase` class: Cluster / group nodes106- `stateNode` class: Shared resources107- `gap` class: Interference pathways108- `handler` class: Treatment assignment109- `detector` class: SUTVA boundary110111### Step 5: Write Output112113Write the diagram to: `temp/exp-lens-unit-interference/exp_diag_unit_interference_{YYYY-MM-DD_HHMMSS}.md`114115---116117## Output Template118119```markdown120# Unit Interference Diagram: {System / Experiment Name}121122**Lens:** Unit Interference (Causal-Structural)123**Question:** What is the unit, and can treatments spill over?124**Date:** {YYYY-MM-DD}125**Scope:** {What was analyzed}126127## Unit Hierarchy128129| Level | Count | Shared Resources | Interference Risk |130|-------|-------|-----------------|-------------------|131| {unit level} | {N} | {resources} | {LOW / MEDIUM / HIGH} |132| {cluster level} | {N} | {resources} | {LOW / MEDIUM / HIGH} |133| {system level} | {N} | {resources} | {LOW / MEDIUM / HIGH} |134135## Unit-Cluster Diagram136137```mermaid138%%{init: {'flowchart': {'nodeSpacing': 40, 'rankSpacing': 50, 'curve': 'basis'}}}%%139flowchart TB140 %% CLASS DEFINITIONS %%141 classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;142 classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;143 classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;144 classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff;145 classDef newComponent fill:#2e7d32,stroke:#81c784,stroke-width:2px,color:#fff;146 classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;147 classDef detector fill:#b71c1c,stroke:#ef5350,stroke-width:2px,color:#fff;148 classDef gap fill:#ff6f00,stroke:#ffa726,stroke-width:2px,color:#000;149 classDef integration fill:#c62828,stroke:#ef9a9a,stroke-width:2px,color:#fff;150151 subgraph Assignment ["TREATMENT ASSIGNMENT"]152 ASSIGN["Assignment Logic<br/>━━━━━━━━━━<br/>hash / flag / bucket"]153 SUTVA{"SUTVA<br/>Boundary<br/>plausible?"}154 end155156 subgraph Units ["EXPERIMENTAL UNITS"]157 direction TB158 TREAT["Treatment Units<br/>━━━━━━━━━━<br/>receive variant"]159 CTRL["Control Units<br/>━━━━━━━━━━<br/>receive baseline"]160 end161162 subgraph Clusters ["CLUSTER STRUCTURE"]163 direction TB164 CL_T["Treatment Cluster<br/>━━━━━━━━━━<br/>shared context"]165 CL_C["Control Cluster<br/>━━━━━━━━━━<br/>shared context"]166 end167168 subgraph Shared ["SHARED RESOURCES"]169 direction TB170 RES1["Shared Cache<br/>━━━━━━━━━━<br/>cross-group access"]171 RES2["Shared Queue<br/>━━━━━━━━━━<br/>cross-group access"]172 end173174 subgraph Interference ["INTERFERENCE PATHWAYS"]175 direction TB176 PATH1["Spillover Path 1<br/>━━━━━━━━━━<br/>mechanism + magnitude"]177 PATH2["Spillover Path 2<br/>━━━━━━━━━━<br/>mechanism + magnitude"]178 end179180 %% ASSIGNMENT %%181 ASSIGN --> TREAT182 ASSIGN --> CTRL183 ASSIGN --> SUTVA184185 %% CLUSTER NESTING %%186 TREAT --> CL_T187 CTRL --> CL_C188189 %% SHARED RESOURCE ACCESS %%190 CL_T --> RES1191 CL_C --> RES1192 CL_T --> RES2193 CL_C --> RES2194195 %% INTERFERENCE %%196 RES1 -.->|"spillover"| PATH1197 RES2 -.->|"spillover"| PATH2198 PATH1 -.->|"contaminates"| CTRL199 PATH2 -.->|"contaminates"| CTRL200201 %% CLASS ASSIGNMENTS %%202 class TREAT,CTRL cli;203 class CL_T,CL_C phase;204 class RES1,RES2 stateNode;205 class PATH1,PATH2 gap;206 class ASSIGN handler;207 class SUTVA detector;208```209210**Color Legend:**211| Color | Category | Description |212|-------|----------|-------------|213| Dark Blue | Units | Experimental units receiving treatment or control |214| Purple | Clusters | Cluster / group nodes above the unit level |215| Dark Teal | Shared Resources | Infrastructure accessible by both groups |216| Yellow | Interference | Spillover and contamination pathways |217| Orange | Assignment | Treatment assignment logic |218| Red | SUTVA Boundary | Plausibility check for the independence assumption |219220## Interference Pathway Analysis221222| Source | Mechanism | Magnitude Estimate | Mitigation |223|--------|-----------|-------------------|------------|224| {resource} | {how spillover occurs} | {negligible / moderate / invalidating} | {strategy} |225226## SUTVA Assessment227228- **Independence assumption**: {plausible / violated / unknown}229- **Identified violations**: {list specific pathways or "none detected"}230- **Recommended mitigation**: {cluster randomization / geo holdout / none needed / further investigation}231```232233---234235## Pre-Diagram Checklist236237Before creating the diagram, verify:238239- [ ] LOADED `/mermaid` skill using the Skill tool240- [ ] Using ONLY classDef styles from the mermaid skill (no invented colors)241- [ ] Diagram will include a color legend table242243---244245## Related Skills246247- `/make-experiment-diag` - Parent skill for experimental lens selection248- `/mermaid` - MUST BE LOADED before creating diagram249- `/exp-lens-causal-assumptions` - For DAG-level causal structure analysis250- `/exp-lens-randomization-blocking` - For randomization strategy and blocking design