skills/symmetry-validation-suite/SKILL.md
Provides empirical test protocols and metrics to validate whether hypothesized symmetries actually hold in data or models before committing to equivariant architecture. Includes invariance/equivariance testing, group structure verification, and distribution analysis under transforms. Use when testing invariance, validating equivariance, checking symmetry assumptions, debugging symmetry-related model failures, or needing data-driven validation before architecture decisions.
npx skillsauth add lyndonkl/claude symmetry-validation-suiteInstall 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.
Wrong symmetry assumptions hurt model performance -- too much symmetry over-constrains, while missing symmetry wastes capacity. Validate before committing to equivariant architecture.
Copy this checklist and track your progress:
Symmetry Validation Progress:
- [ ] Step 1: List symmetry hypotheses to test
- [ ] Step 2: Design transformation test sets
- [ ] Step 3: Run invariance/equivariance tests
- [ ] Step 4: Verify group structure
- [ ] Step 5: Analyze data distribution under transforms
- [ ] Step 6: Document validation results
Step 1: List symmetry hypotheses to test
Gather candidate symmetries from previous discovery work. For each, document: the transformation type, whether invariance or equivariance is expected, and confidence level. Prioritize testing low-confidence hypotheses. If no hypotheses exist, work with user through domain analysis to identify candidate symmetries first.
Step 2: Design transformation test sets
For each symmetry, create test protocol: Sample representative inputs from data distribution. Define transformation sampling strategy (random rotations, all permutations, etc.). Determine appropriate sample sizes for statistical significance. Consider edge cases and boundary conditions. See Transformation Sampling for guidance. For detailed methodology, consult Methodology Details.
Step 3: Run invariance/equivariance tests
For invariance testing: Apply transformation T to input x, compute outputs f(x) and f(T(x)), measure error ||f(T(x)) - f(x)||. For equivariance testing: Compute f(T(x)) and T'(f(x)) where T' is the output transformation, measure error ||f(T(x)) - T'(f(x))||. Use Testing Protocols for implementation details. Aggregate across samples and compute statistics. For complete code examples, see Test Implementation Examples.
Step 4: Verify group structure
Check that claimed transformations form a valid group: Test closure (composition of two transforms is a transform). Test associativity. Verify identity element exists. Verify inverses exist. For Lie groups, check that generators close under commutator. See Group Structure Tests.
Step 5: Analyze data distribution under transforms
Check if transformed data stays in-distribution: Apply transforms to training data. Compare statistics of original vs transformed data. Check for distributional shift that might break assumptions. Identify transformation ranges that maintain validity. This catches "approximate symmetry" cases where symmetry holds only within bounds.
Step 6: Document validation results
Create validation report using Output Template. For each symmetry: state hypothesis, test methodology, quantitative results, pass/fail decision. Recommend whether to use hard equivariance constraint, soft constraint (regularization), data augmentation, or no symmetry at all. Quality criteria for this output are defined in Quality Rubric.
def test_invariance(model, data_samples, transform_fn, n_transforms=100):
"""
Test if model output is invariant to transformations.
Returns:
mean_error: Average ||f(T(x)) - f(x)||
max_error: Maximum error observed
pass_rate: Fraction with error < threshold
"""
errors = []
for x in data_samples:
y_orig = model(x)
for _ in range(n_transforms):
x_transformed = transform_fn(x)
y_transformed = model(x_transformed)
error = norm(y_transformed - y_orig)
errors.append(error)
return {
'mean_error': mean(errors),
'max_error': max(errors),
'std_error': std(errors),
'pass_rate': sum(e < threshold for e in errors) / len(errors)
}
def test_equivariance(model, data_samples, input_transform, output_transform):
"""
Test if f(T(x)) = T'(f(x)) for equivariance.
Returns:
mean_error: Average ||f(T(x)) - T'(f(x))||
relative_error: Error normalized by output magnitude
"""
errors = []
for x in data_samples:
# Method 1: Transform then model
x_T = input_transform(x)
y1 = model(x_T)
# Method 2: Model then transform
y = model(x)
y2 = output_transform(y)
error = norm(y1 - y2)
relative = error / (norm(y2) + eps)
errors.append({'absolute': error, 'relative': relative})
return aggregate_stats(errors)
For reliable results:
| Group | Sampling Strategy | |-------|-------------------| | SO(2) | Uniform random angles θ ∈ [0, 2π) | | SO(3) | Uniform random quaternions or axis-angle | | SE(3) | Combine SO(3) rotation + uniform translation | | Translations | Uniform within expected data range |
| Group | Sampling Strategy | |-------|-------------------| | Cₙ | All n rotations | | Dₙ | All 2n elements (rotations + reflections) | | Sₙ | Random permutations (full enumeration if n ≤ 6) |
For random g₁, g₂ ∈ G:
Compute g₃ = g₁ · g₂
Verify g₃ ∈ G (within numerical tolerance)
For random g₁, g₂, g₃ ∈ G:
Compute (g₁ · g₂) · g₃
Compute g₁ · (g₂ · g₃)
Verify equality (within tolerance)
For random g ∈ G:
Verify g · e = e · g = g
Find g⁻¹ and verify g · g⁻¹ = e
| Error Level | Interpretation | |-------------|----------------| | < 1e-6 | Exact symmetry (numerical precision) | | 1e-6 to 1e-3 | Strong approximate symmetry | | 1e-3 to 0.01 | Weak approximate symmetry | | > 0.01 | Symmetry likely doesn't hold |
| Validation Result | Recommendation | |-------------------|----------------| | Exact symmetry confirmed | Use hard equivariant constraint | | Strong approximate | Use equivariant architecture | | Weak approximate | Consider soft constraint or augmentation | | Symmetry broken | Don't enforce this symmetry | | Partial symmetry | Use conditional/local equivariance |
SYMMETRY VALIDATION REPORT
==========================
Tested Symmetries:
1. [Transformation]: [Invariance/Equivariance]
- Sample size: [N samples × M transforms]
- Mean error: [value]
- Max error: [value]
- Pass rate: [%] at threshold [value]
- RESULT: [PASS/FAIL/PARTIAL]
- Recommendation: [Hard constraint/Soft/Augmentation/None]
2. [Transformation]: [Invariance/Equivariance]
...
Group Structure:
- Closure: [PASS/FAIL]
- Associativity: [PASS/FAIL]
- Identity/Inverse: [PASS/FAIL]
Distribution Analysis:
- Transform range where symmetry holds: [bounds]
- Detected breaking factors: [list]
SUMMARY:
- Confirmed symmetries: [list]
- Rejected symmetries: [list]
- Proceed to architecture design with: [group specification]
testing
Cluster a conference's event records into a small set of coarse themes with finer sub-clusters, an explicit outlier bucket, and soft (multi-membership) affinities — using the hybrid embed-then-label pipeline (embed abstracts, reduce, density-cluster, then LLM-label the clusters) when embedding libraries are available, and an LLM-reasoned hierarchical fallback when they are not. Embeddings do the grouping; the LLM only names the groups. Conference-agnostic. Use when turning structured event records into a navigable theme map for preference elicitation and scheduling, when you need 6-8 reasonable themes rather than 20 muddy ones, or when overlapping talks must belong to more than one theme. Trigger keywords - theme clustering, cluster talks, embed then label, soft membership, outlier talks, conference themes, topic map.
development
Build a personal conference schedule as a constraint-optimization problem — hard constraints (no time overlap, room-to-room travel time, capacity/registration, the attendee's own must-attends and blackouts) plus a user-owned weighted objective trading interest against breadth, pacing (maximize contiguous free time), and serendipity. Surfaces unbreakable conflicts (two high-value overlapping talks the model cannot rank) as decisions for the human rather than silently picking, and reports what each choice traded away. Conference-agnostic. Use to turn a preference profile plus a theme map into a day-by-day plan, to resolve overlapping sessions, or to balance a packed vs paced schedule. Trigger keywords - schedule optimization, conference schedule, constraint optimization, overlapping talks, contiguous free time, conflict surfacing, packed vs paced.
development
Parse a heterogeneous conference program (markdown, HTML, PDF-derived text, or JSON) into normalized event records with per-field confidence scores and independent classification axes (topic, depth, format, prerequisites, recorded, capacity). Detects the program's format before extracting, treats every inferred field as uncertain (present vs inferred vs missing), and flags thin or missing abstracts so downstream enrichment can target them. Conference-agnostic. Use when ingesting a conference or event schedule into a structured store, normalizing a talk/session list, or extracting per-session metadata with calibrated confidence. Trigger keywords - program ingestion, parse schedule, session extraction, event records, conference program, talk metadata, per-field confidence.
development
Build a personalized preference profile from a small number of well-chosen, cluster-grounded questions instead of a long survey. Represents the person's interests as an uncertainty region over the theme map, picks the single highest-information-gain choice-based question (contrasting real talks from different clusters), balances exploiting known interests against exploring uncertain ones, deliberately injects outlier probes to fight selection bias, and stops as soon as the schedule would be stable. Also elicits the user-owned objective weights and hard constraints. Interactive — runs where it can actually ask the person. Conference-agnostic. Use to turn a theme map into a preference profile, to decide what to ask a conference attendee, or to elicit scheduling priorities. Trigger keywords - preference elicitation, ask few questions, information gain, choice-based questions, selection bias probe, objective weights, attendee preferences.