SeAl-KD methodology for SNN knowledge distillation that selectively aligns class-level and temporal knowledge. Equalizes competing logits at erroneous timesteps and reweights temporal alignment based on confidence and inter-timestep similarity. Works on static images and neuromorphic event-based datasets.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add hiyenwong/ai_collection --skill selective-alignment-kd-snn --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Selective Alignment Kd Snn?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hiyenwong-selective-alignment-kd-snn-5e28ddad)More formats (shields.io, HTML) on the badges page.
---
name: selective-alignment-kd-snn
description: "SeAl-KD methodology for SNN knowledge distillation that selectively aligns class-level and temporal knowledge. Equalizes competing logits at erroneous timesteps and reweights temporal alignment based on confidence and inter-timestep similarity. Works on static images and neuromorphic event-based datasets."
---
# Selective Alignment Knowledge Distillation SNN
## Description
SeAl-KD (Selective Alignment Knowledge Distillation) methodology addressing the uniform timestep alignment limitation in Spiking Neural Network knowledge distillation. Selectively aligns class-level and temporal knowledge by equalizing competing logits at erroneous timesteps and reweighting temporal alignment based on confidence and inter-timestep similarity. Consistent improvements on static image and neuromorphic event-based datasets.
Based on: "Not All Timesteps Matter Equally: Selective Alignment Knowledge Distillation for Spiking Neural Networks" (arXiv: 2605.14252) by Sun et al., May 2026.
## Activation Keywords
- SNN knowledge distillation
- selective alignment KD
- SeAl-KD
- temporal knowledge distillation SNN
- spiking neural network distillation
- 脉冲神经网络知识蒸馏
- 选择性对齐知识蒸馏
- timestep alignment SNN
## Core Problem
Standard SNN knowledge distillation treats all timesteps equally, but:
1. **Not all timesteps contain equally useful information**
2. **Competing logits at different timesteps can confuse the student**
3. **Early timesteps may be more confident than late ones**
## Key Innovations
### 1. Timestep Confidence-Based Reweighting
```python
def compute_timestep_weights(logits_history, temperature=1.0):
"""Reweight timesteps based on prediction confidence."""
# Convert logits to probabilities at each timestep
probs = softmax(logits_history / temperature, dim=-1)
# Confidence = max probability at each timestep
confidence = probs.max(dim=-1).values # [T]
# Normalize weights across timesteps
weights = confidence / confidence.sum()
return weights
```
### 2. Erroneous Timestep Logit Equalization
```python
def equalize_erroneous_logits(student_logits, teacher_logits, timestep):
"""Equalize competing logits at erroneous timesteps."""
# Identify competing classes (top-2 predictions that disagree)
student_top2 = student_logits[timestep].topk(2)
teacher_top2 = teacher_logits[timestep].topk(2)
if student_top2.indices[0] != teacher_top2.indices[0]:
# Student disagrees with teacher at this timestep
# Equalize the competing logits to reduce confusion
mean_logits = (student_logits[timestep] + teacher_logits[timestep]) / 2
student_logits[timestep] = mean_logits
return student_logits
```
### 3. Inter-Timestep Similarity Reweighting
```python
def compute_similarity_weights(logits_history, gamma=0.5):
"""Reweight based on inter-timestep similarity."""
T = len(logits_history)
similarity_weights = torch.ones(T)
for t in range(T):
# Compute similarity to neighboring timesteps
if t > 0:
sim_prev = cosine_similarity(logits_history[t], logits_history[t-1])
if t < T - 1:
sim_next = cosine_similarity(logits_history[t], logits_history[t+1])
# Low similarity = unique information = higher weight
similarity_weights[t] = 1.0 - gamma * (sim_prev + sim_next) / 2
return similarity_weights / similarity_weights.sum()
```
## Implementation Pattern
### Full SeAl-KD Loss
```python
def seal_kd_loss(student_logits, teacher_logits, T_timesteps,
alpha=0.5, beta=0.5, temperature=2.0):
"""
Selective Alignment KD loss for SNNs.
Args:
student_logits: [T, B, C] student logits over time
teacher_logits: [T, B, C] teacher logits over time
alpha: weight for class-level alignment
beta: weight for temporal alignment
"""
total_loss = 0
for t in range(T_timesteps):
# Step 1: Equalize erroneous logits
s_logits = equalize_erroneous_logits(
student_logits, teacher_logits, t
)
# Step 2: Compute timestep weights
conf_weight = compute_timestep_weights(
student_logits[t:t+1], temperature
)
sim_weight = compute_similarity_weights(
student_logits, gamma=0.5
)[t]
timestep_weight = conf_weight * sim_weight
# Step 3: Class-level KD loss (KL divergence)
class_loss = kl_divergence(
F.softmax(teacher_logits[t] / temperature, dim=-1),
F.softmax(s_logits[t] / temperature, dim=-1)
) * temperature ** 2
# Step 4: Temporal alignment loss
if t > 0:
temporal_loss = mse_loss(
s_logits[t] - s_logits[t-1],
teacher_logits[t] - teacher_logits[t-1]
)
else:
temporal_loss = 0
total_loss += timestep_weight * (alpha * class_loss + beta * temporal_loss)
return total_loss / T_timesteps
```
## Key Results
| Dataset Type | Standard KD | SeAl-KD | Improvement |
|-------------|-------------|---------|-------------|
| Static Images (CIFAR-10) | Baseline | +1-3% | Consistent gains |
| Neuromorphic Events (DVS) | Baseline | +2-4% | Larger gains on event data |
## Pitfalls
1. **Temperature Tuning**: The softmax temperature is critical — too low makes weights too peaked, too high flattens them
2. **Erroneous Timestep Detection**: Equalization should only happen when student genuinely disagrees with teacher, not on noisy predictions
3. **Timestep Count**: Shorter SNNs benefit more from selective alignment (each timestep matters more)
4. **Teacher Quality**: The teacher must be well-trained; distilling from a poor teacher amplifies errors
## Applications
- Compressing large SNNs for edge deployment
- Training SNNs from ANN teachers (ANN-to-SNN distillation)
- Event-based vision tasks with neuromorphic sensors
- Low-latency SNN inference with fewer timesteps
## Related Skills
- `sealkd-snn-knowledge-distillation` - SeAl-KD methodology
- `snn-learning-survey` - SNN learning rules survey
- `multi-plasticity-snn-training` - Multi-plasticity SNN training
## Resources
- Paper: https://arxiv.org/abs/2605.14252
- Key: Timestep-selective knowledge distillation for SNNs
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!