Learnable Pulse Accumulation for On-Device Speech Recognition: How Much Attention Do You Need?
Abstract
Self-attention scales quadratically with sequence length, limiting transformer-based speech models on edge devices. We introduce the Learnable Pulse Accumulator (LPA), an O(n) replacement that substitutes key-query dot products with learned gating functions: content-dependent rectangular pulses, periodic windows, and position-dependent basis functions. An MSE diagnostic sweep determines per-layer replacement difficulty and ordering. Replacing 8 of 12 wav2vec2-base layers yields 10.61% word error rate (WER) on LibriSpeech test-clean, +7.24 percentage points (pp) over the 3.37% baseline, with 3.27x speedup at 120s audio on Apple M4 Pro via an optimized MLX inference path. Cross-domain validation on SepFormer speech enhancement shows all 16 intra-chunk attention layers can be replaced without collapse, suggesting the depth wall arises from linguistic computation rather than an LPA limitation. LPA's near-binary gates at inference enable dense GPU computation with no CPU-GPU synchronization, and all operations map to mobile neural accelerators.
Figures & tables
| Configuration | WER | |
|---|---|---|
| Naïve replacement † | 58.33 | — |
| + Selective init, unfreeze LN † | 26.50 | 31.8 |
| + Inter-stage alignment † | 16.18 | 10.3 |
| + FFN co-adapt (0.1 lr) † | 14.64 | 1.5 |
| + Temperature curriculum † | 11.72 | 2.9 |
| + Periodic + positional gates | 10.25 | 1.5 |
| Layers | SI-SNRi | from baseline |
|---|---|---|
| 0 (baseline) | 5.69 | — |
| 2/16 | 8.89 | 3.20 |
| 4/16 | 8.92 | 3.23 |
| 8/16 | 8.14 | 2.45 |
| 11/16 | 7.68 | 1.99 |
| 16/16 | 6.82 | 1.13 |
| Audio | Base | Base | 8/12 | 12/12 | 8/12 | Speedup |
|---|---|---|---|---|---|---|
| (fp32) | (fp16) | (fp32) | (fp32) | (MLX) | vs fp16 | |
| 10s | 47 | 45 | 59 | 65 | 42 | 1.07 |
| 30s | 183 | 186 | 157 | 135 | 125 | 1.49 |
| 60s | 500 | 522 | 350 | 246 | 244 | 2.14 |
| 120s | 1668 | 1767 | 895 | 479 | 540 | 3.27 |
| wav2vec2 WER (%) | SepFormer SI-SNRi (dB) | ||||
|---|---|---|---|---|---|
| Layers | LPA | SM | LPA | SM | |
| 0 (base) | 3.18 | 3.18 | 5.69 | 5.69 | |
| 1 | 4.26 | 5.44 | 7.27 | 8.38 | |
| 2 | 4.64 | 7.31 | 8.89 | 9.60 | |
| 4 | 6.38 | 15.47 | 8.92 | 9.62 | |
| 8 | 9.92 | 29.04 | 8.14 | 9.12 | |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Audio | Attn | Attn | LPA (PT) | LPA (MLX) | Speedup |
|---|---|---|---|---|---|
| (fp32) | (fp16) | (fp32) | (fp16) | vs fp16 | |
| 10 s | 47.1 ms | 45.3 ms | 58.8 ms | 42.4 ms | 1.07 |
| 30 s | 182.7 ms | 186.1 ms | 156.9 ms | 124.9 ms | 1.49 |
| 60 s | 499.7 ms | 521.6 ms | 349.5 ms | 244.2 ms | 2.14 |
| 120 s | 1668.0 ms | 1767.1 ms | 894.8 ms | 540.1 ms | 3.27 |
| Layer | MSE | Surviving / 144 | Difficulty |
|---|---|---|---|
| L0 | 0.006 | 48 | easy |
| L2 | 0.007 | 48 | easy |
| L1 | 0.007 | 51 | easy |
| L3 | 0.021 | 57 | moderate |
| L6 | 0.030 | 74 | moderate |
| L5 | 0.034 | 75 | moderate |
| Layers | Naïve | +Recipe | +Architecture | +Order |
|---|---|---|---|---|
| 0 | 3.34 | 3.34 | 3.34 | 3.34 |
| 1 | 4.59 | 4.88 | 4.38 | 4.25 |
| 2 | 6.21 | 5.17 | 4.71 | 4.67 |
| 3 | 9.94 | 7.17 | 6.55 | 4.77 |
| 4 | 10.43 | 6.93 | 6.35 | 5.31 |
| 5 | 13.20 | 7.73 | 7.24 | 5.26 |
| Layers | dev-clean | test-clean | test-other |
|---|---|---|---|
| 0 | 3.18 | 3.37 | 8.67 |
| 1 | 4.26 | 4.63 | 11.83 |
| 2 | 4.64 | 4.78 | 12.67 |
| 4 | 6.38 | 6.62 | 16.52 |
| 6 | 7.35 | 7.90 | 18.98 |
| 7 | 7.90 | 8.50 | 20.84 |
| Audio | Base | Base | 8/12 | 12/12 | 8/12 | Speedup vs Base fp16 | |
|---|---|---|---|---|---|---|---|
| (fp32) | (fp16) | (fp32) | (fp32) | (MLX) | 12/12 PT | 8/12 MLX | |
| 10s | 47 | 45 | 59 | 65 | 42 | 0.69 | 1.07 |
| 30s | 183 | 186 | 157 | 135 | 125 | 1.38 | 1.49 |
| 60s | 500 | 522 | 350 | 246 | 244 | 2.12 | 2.14 |
| 120s | 1668 | 1767 | 895 | 479 | 540 | 3.69 | 3.27 |
| Audio | Frames | Attention | LPA (12p) | Ratio |
|---|---|---|---|---|
| 10s | 500 | 0.95 MB | 23 KB | 42 |
| 30s | 1,500 | 8.6 MB | 70 KB | 125 |
| 60s | 3,000 | 34.3 MB | 140 KB | 250 |
| 120s | 6,000 | 137.3 MB | 281 KB | 500 |
| Component | Attention | LPA ( ) | LPA ( ) |
|---|---|---|---|
| Linear projections | 1,696 | 1,696 | 1,696 |
| / gate prediction | 3,311 | 797 | 807 |
| Softmax / element-wise | 2,110 | 201 | 201 |
| / accumulation | 3,311 | 136 | 142 |
| Total per layer | 10,428 | 2,835 | 2,851 |
| 12 layers | 125 ms | 34.0 ms | 34.2 ms |