STEdgeFormer: MCU and NPU Deployable Transformer Architecture
Organizations: STMicroelectronics, Canada
Abstract
Transformer-based sequence models have achieved strong performance in language and time-series modeling, but self-attention remains computationally and memory intensive for deployment on resource-constrained edge accelerators. We propose STEdgeFormer, a lightweight, hardware-aware sequence architecture designed for efficient execution on embedded neural accelerators. STEdgeFormer combines polynomial mixture layers and DyT normalization with an accelerator-aware causal memory block, replacing pairwise self-attention with compact causal aggregation. On TinyStories, the fully NPU-supported STEdgeFormer (MW) achieves a perplexity of 7.39 with 4.12M parameters and 6.51 MB RAM, with an end-to-end latency of 40 ms. In comparison, the standard 4.12M-parameter configuration achieves a lower perplexity of 6.79 but requires CPU fallback for unsupported operators, resulting in 1450 ms latency. Vanilla Transformer, on the other hand, achieves a perplexity score of 5.71 using a 4.40M-parameter model, but it cannot be deployed on the hardware. On downstream tasks, STEdgeFormer achieves 94% accuracy on ECG5000 and 93% accuracy on Speech Commands with 1.39M parameters. These results demonstrate that hardware-aware architectural choices and operator compatibility can have a substantial impact on practical inference latency, beyond model size and task accuracy alone. Rather than targeting state-of-the-art accuracy on individual benchmarks, STEdgeFormer is designed to provide a deployable sequence modeling architecture under the memory, computational, and operator constraints of embedded neural accelerators.
Figures & tables
| Model | Accuracy (%) | Flash / RAM (MB) |
|---|---|---|
| DS-CNN Zhang et al. (2017) | 94.68 | 1.40/0.497 |
| Attention RNN Wen and others (2021) | 96.90 | 0.202/- |
| DenseNet-BiLSTM Wen and others (2021) | 97.30 | 0.223/- |
| NoisyDARTS-TC14 Wen and others (2021) | 97.40 | 0.107/- |
| NAS2 Wen and others (2021) | 97.50 | 0.886/- |
| NAO2-12 Wen and others (2021) | 97.50 | 0.274/- |
| Model | Params/RAM | Seq. Len. | Depth | Dim. | PPL | Latency (ms) |
|---|---|---|---|---|---|---|
| STEdgeFormer-XL ⊕,↑ | 30.0/- | 512 | 12 | 256 | 5.34 | - |
| STEdgeFormer-S ⊕,↑ | 2.85/- | 128 | 8 | 128 | 9.73 | - |
| STEdgeFormer-L ⊕,↑ | 6.55/- | 128 | 8 | 256 | 6.03 | -) |
| Transformer (Vanilla) ↓ | 4.40/- | 128 | 8 | 192 | 5.71 | unsupported |
| STEdgeFormer ⊕ | 4.12/6.23 | 128 | 8 | 196 | 6.79 | 1450 |
| STEdgeFormer (MW) † | 4.12/6.51 | 128 | 8 | 196 | 7.39 | 40 |
| Model | Accuracy (%) | Flash / RAM |
|---|---|---|
| E-NanoHydra Cioflan et al. (2025) | 94.13 | 3.82 kB peak memory |
| A-NanoHydra Cioflan et al. (2025) | 94.47 | 12.57 kB peak memory |
| Pruned DT (INT-8) Dau et al. (2019) | 92.40 | Fits L1 cache ( kB) |
| TCN Baseline Ingolfsson et al. (2021) | 94.20 | 60 kB low RAM footprint |
| LSTM-FCN Baseline Karim et al. (2018) | 94.10 | 1.62 MB static RAM |
| ECG-CBA (CNN-BiLSTM) Ammar et al. (2025) | 99.60 | 4.8 MB static RAM |
Sequence Modeling
Sequence modeling studies how to represent, predict, classify, and generate ordered data such as text, time series, events, and biological sequences.
See all 271 papers