# Mistake Gated Continual Learning

> Mistake-gated learning for energy and memory efficient continual learning using neuromorphic hardware. Only neurons that "make mistakes" (prediction errors) are updated, reducing compute and memory. Achieves 10-100x energy reduction vs full backprop on MNIST/CIFAR benchmarks.

- Skill: `hiyenwong/mistake-gated-continual-learning` (Agent Skill)
- Install (CLI): `npx get-skill add hiyenwong/mistake-gated-continual-learning`
- Raw SKILL.md: https://api.skillmd.com/api/skills/hiyenwong/mistake-gated-continual-learning/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: hiyenwong (https://skillmd.com/u/hiyenwong)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/hiyenwong/mistake-gated-continual-learning

---


# Mistake Gating for Energy and Memory Efficient Continual Learning

## Description
'Mistorized mistake-gated learning' -- a biologically plausible plasticity rule where synaptic updates are strictly gated by current and past classification errors. Based on Pache & van Rossum 2026 (arXiv:2604.14336v1).

Inspired by human negativity bias and error-related negativity (ERN) in EEG.

## Core Innovation

### Biological Inspiration
- **Human Negativity Bias**: Humans learn more from negative experiences
- **Error-Related Negativity (ERN)**: Brain signal associated with error detection
- **Metabolic Efficiency**: Animals update models without exhausting energy

### Problem Addressed
Standard neural network training:
- Updates parameters on every sample
- Even correctly classified samples trigger updates
- Inefficient for continual learning

### Solution
**Mistake-Gated Learning**: Only update on errors
- Reduces updates by **50-80%**
- No hyperparameters added
- Negligible computational overhead

## Methodology

### Update Rule
```
Standard:     Δw = η * ∇L
Mistake-Gated: Δw = η * ∇L * I(error)

Where I(error) = 1 if prediction ≠ target, else 0
```

### Memorized Version
```
Update on current OR past errors:
Δw = η * ∇L * I(error_t OR error_{t-k} for k in buffer)
```

### Algorithm
```python
def mistake_gated_update(weights, gradient, prediction, target):
    if prediction != target:  # Current error
        weights -= lr * gradient
    elif memory_buffer_has_error():  # Past error
        weights -= lr * gradient
    # Otherwise: no update
```

## Benefits

### 1. Energy Efficiency
- **50-80% fewer updates**
- Synaptic plasticity is metabolically expensive
- Critical for edge/neuromorphic deployment

### 2. Memory Efficiency
- Reduces storage buffer requirements
- Only store samples with errors
- Enables larger replay buffers

### 3. Continual Learning
Well-suited for:
- **Incremental learning**: New knowledge on pre-existing background
- **Online learning**: Data stored for later replay
- **Non-stationary data**: Adapting to distribution shifts

## Implementation

### Basic Implementation
```python
class MistakeGatedOptimizer:
    def __init__(self, base_optimizer, memory_size=100):
        self.base_optimizer = base_optimizer
        self.error_memory = deque(maxlen=memory_size)
    
    def step(self, loss, pred, target):
        current_error = (pred != target).any()
        past_error = len(self.error_memory) > 0
        
        if current_error or past_error:
            self.base_optimizer.step()  # Update
            if current_error:
                self.error_memory.append((input, target))
        else:
            pass  # Skip update
```

### Integration
- Can be added to any optimizer in few lines
- Compatible with SGD, Adam, etc.
- Works with backpropagation

## Technical Specifications

### Performance
- **Update Reduction**: 50-80%
- **Accuracy**: Maintained or improved
- **Overhead**: Negligible (<1% compute)

### Hyperparameters
- **None added** to base optimizer
- Optional: Memory buffer size
- Optional: Past error lookback

## Applications

### Continual Learning Scenarios
1. **Class-Incremental Learning**: New classes added over time
2. **Task-Incremental Learning**: Different tasks sequentially
3. **Domain-Incremental Learning**: Same task, different distributions

### Hardware Deployment
- **Neuromorphic systems**: Event-driven updates
- **Edge devices**: Energy-constrained learning
- **Real-time systems**: Low-latency inference

### Biological Plausibility
- Implements error-driven learning
- Consistent with ERN literature
- Energy-efficient synaptic updates

## Comparison with Standard Methods

| Method | Updates | Energy | Memory | Implementation |
|--------|---------|--------|--------|----------------|
| Standard | 100% | Baseline | Baseline | Simple |
| Mistake-Gated | 20-50% | **-50-80%** | **Reduced** | **Simple** |
| EWC | 100% | High | High | Complex |
| Replay | 100% | Medium | High | Medium |

## Activation Keywords
- mistake gating
- continual learning
- error-gated plasticity
- energy efficient learning
- error-related negativity
- negativity bias
- synaptic update reduction
- biological plasticity

## Related Papers
- Pache & van Rossum 2026: "Mistake gating leads to energy and memory efficient continual learning" (arXiv:2604.14336v1)

## References
```bibtex
@article{pache2026mistake,
  title={Mistake gating leads to energy and memory efficient continual learning},
  author={Pache, Aaron and van Rossum, Mark CW},
  journal={arXiv preprint arXiv:2604.14336},
  year={2026}
}
```

---

_Last updated: 2026-04-17_

