HRM — Harmonic Resonance Mixer

A from-scratch sequence-memory architecture with a novel selective-resonance mechanism — built, trained, and validated by controlled ablation. No pretrained weights, no external data.

The mechanism. Memory is a bank of learnable damped oscillators — each channel a 2-D state rotated by a learnable frequency ω and shrunk by a decay each step. On top of that sits the novel piece, a selective damping gate: a content-based gate sets each channel's decay per-timestep, so the network learns which frequency channels to latch vs. forget. Readout is per-channel resonator energy √(a²+b²), which is phase-invariant.

Headline result — noise-robust frequency identification

Classify which of 5 frequencies is hidden in a noisy, random-phase signal (T=100). This is the task family a resonator bank is built for.

70%HRM-full @ noise 3.0
vs
43%GRU @ noise 3.0

At the hardest noise level the GRU baseline collapses toward chance while HRM stays strong — a genuine architectural advantage, at comparable parameter count.

Accuracy vs. noise (HRM-full vs GRU, trained identically at each level)

HRM-fullGRU
0.0 0.2 0.4 0.6 0.8 1.0 0.5 1.0 1.5 2.0 2.5 3.0 chance noise level (std of additive Gaussian noise) test accuracy

Learning curves at noise 2.0

GRUHRM-fullHRM-noGateHRM-noOsc
0.0 0.2 0.4 0.6 0.8 1.0 0 300 600 900 1200 training step test accuracy

Final results — frequency task

modelwhat it isparamsbest acc
HRM-fullresonant memory + selective damping gate (proposed)9,8930.930
GRUstandard gated RNN (baseline)7,5890.786
HRM-noGateablation: novel gate removed9,8930.572
HRM-noOscablation: resonance removed9,8930.236
What the ablation proves. Removing the resonance (freezing ω=0) drops accuracy from 0.93 to 0.24 — the oscillatory memory is doing the work, not the parameter budget. HRM matches or beats the GRU (0.93 vs 0.79) here and pulls clearly ahead as noise rises.

Honest limitation — the adding problem

The other side of the inductive-bias coin: a task of pure delayed scalar recall (sum two marked values across T=120 steps), where resonance is the wrong prior.

modelwhat it isparamstest MSEsolved
GRUstandard gated RNN7,5370.0004
HRM-fullproposed9,7290.1531
HRM-noOscablation: resonance removed9,7290.1655
HRM-noGateablation: gate removed9,7290.1668
MLPno memory (control)47,4890.1668
Here the GRU solves the task while every HRM variant stalls near the constant-guess baseline — resonance buys nothing. The reason is structural: an oscillator rotates a stored value by ω·(T−t), and because the gap between marker and readout varies per example, the value lands at a delay-dependent phase a linear head can't recover; the resonator bank has no way to select which inputs to write either. Lesson, stated plainly: HRM's resonant memory is a specialized prior — it excels at frequency/periodic structure and is a poor fit for arbitrary-delay recall. That trade-off is exactly why both tasks are shown.

Constant-guess MSE baseline on the adding problem = 0.167. Reproduce everything: python3 train_freq.py && python3 sweep.py && python3 train.py && python3 make_report.py.