Streaming Speech Recognition on a Microcontroller: a 65.7M-Parameter Transducer in 2 and 4 Bits on the ESP32-P4

Billal BoumedinearXiv 2026

TL;DR

Researchers have successfully squeezed a 65.7-million parameter speech recognition model onto an ESP32-P4 microcontroller, achieving faster-than-real-time streaming transcription. By combining aggressive 2/4-bit quantization with hand-optimized RISC-V SIMD kernels, they maintained high accuracy (4.34% WER on LibriSpeech) without needing a dedicated neural accelerator.

What Problem Does This Paper Address?

Automatic Speech Recognition (ASR) on microcontrollers is typically limited to "keyword spotting"—recognizing a handful of pre-defined commands like "Hey Siri." Transcribing arbitrary, open-vocabulary speech usually requires models with tens of millions of parameters, which far exceed the memory and computational budgets of standard low-power chips.

The challenge is two-fold:

  1. Memory: How do you fit a ~70MB model into a device where every megabyte of RAM is precious?
  2. Compute: How do you run complex transformer-like architectures (specifically Zipformer2 transducers) on a 400 MHz processor without an NPU (Neural Processing Unit)?

Methods

The authors ported Kroko, a streaming Zipformer2 transducer, to the ESP32-P4. Their approach relies on three main pillars:

1. Extreme Weight Quantization

Instead of standard 8-bit integers, the authors used a mix of 2-bit and 4-bit weights. They employed the "Cactus Quants" layout, which uses Hadamard rotations to spread out weight outliers, making them easier to quantize using Lloyd-Max levels.

To minimize accuracy loss, they didn't just round the numbers. They used GPTQ (a layer-wise second-order error compensation technique) and a sensitivity-based bit plan. By measuring which layers were most sensitive to noise, they allocated 4 bits to critical matrices and 2 bits to the rest, fitting the entire model into a 26.65 MB file.

2. Integer-Only Pipeline

To avoid the slow performance of floating-point math, the authors converted the entire activation pipeline to int16 and int8. They used a GPU-based simulator to determine exactly where tensors could be downsampled to 8-bit without destroying the signal-to-noise ratio.

3. Hand-Optimized SIMD Kernels

The ESP32-P4 features a 128-bit SIMD extension called PIE (Processor Instruction Extensions). The authors wrote custom assembly kernels to handle the heavy lifting of matrix multiplications and Hadamard transforms. These kernels were designed to be bit-exact with a PC-based reference, allowing them to validate accuracy on large datasets using a laptop before ever flashing the chip.

Figure 1: The pipeline on the chip. The six encoder stacks run at the frame rates shown, each with 5.12 s of left context.

Datasets

The model was evaluated on several standard ASR benchmarks:

  • LibriSpeech: The primary benchmark for clean and "other" (noisy/challenging) speech.
  • FLEURS (English): Used for both calibration and testing real-world prompted speech.
  • Common Voice 17.0: A dataset of crowdsourced speech used to test robustness across different speakers.

Calibration for the quantization process was performed using 512 clips from the FLEURS training set.

Key Insights and Ideas

  • Sensitivity is Non-Uniform: The authors found that stacks nearest to the output are the most sensitive to quantization. As shown in Figure 2, Stack 3 (the largest) survived with only 13.8% of its parameters at 4 bits, while the final stacks (4 and 5) required 100% 4-bit storage to maintain accuracy.
  • GPTQ is the "Secret Sauce": The ablation study (Figure 3) revealed that simple rounding to 2/4 bits resulted in a massive Word Error Rate (WER) of 8.83%. Adding GPTQ repair brought that down to 4.75%, proving that how you round is as important as the bit-depth.
  • Integer Math is "Free": Surprisingly, moving from floating-point activations to a carefully designed integer pipeline resulted in virtually zero loss in accuracy (see Figure 5), while providing the speed necessary for real-time performance.
  • Bit-Exactness Saves Time: By ensuring the C engine produced the exact same bits as the hardware, the researchers could run 15-minute evaluations on a laptop that would have taken 4 hours on the microcontroller.
Table 1: Kroko’s encoder stacks. Rate: output frames per second. The last column gives the share of each stack’s matrix parameters stored at 4 bits in our 2/4-bit file (Section 4).

Key Results

  • Speed: The system processes audio at 0.7x real-time (using both cores). A 1.28-second chunk of audio is processed in just 0.90 seconds.
  • Accuracy: On LibriSpeech test-clean, the quantized model achieved a 4.34% WER, only a slight degradation from the original int8 model's 3.94%.
  • Efficiency: The encoder time per chunk was reduced from an initial 51.3 seconds (plain C) to just 0.62 seconds through successive optimizations.
  • Memory Footprint: The weights were reduced from 71 MB (int8) to 26.65 MB, allowing them to fit within the 32 MB PSRAM alongside the engine state and display buffers.
Table 3: Ablation of the rounding on LibriSpeech test-clean (2620 clips, 53,029 words), float activations, greedy search, Whisper’s English text normalizer. Size: the .kq archive the chip’s file is made from (the chip’s file is 0.42 MB smaller). Error: relative error of the encoder output on 24 held-out FLEURS clips.

Limitations and Future Work

  • Quiet Audio Sensitivity: The model is notably more sensitive to very quiet inputs than the original version, often dropping the first few words of a sentence in low-volume recordings.
  • Language Support: The current implementation is English-only. The authors plan to extend this to Modern Standard Arabic in the future.
  • Hardware Specifics: The work is currently tied to the ESP32-P4 revision v3; earlier revisions had different PIE instruction encodings.
  • Energy Consumption: The authors did not measure the power draw of the system, which is a critical metric for battery-powered microcontroller applications.
  • Front-End Optimization: The convolutional front-end is still partly running in floating-point and remains a candidate for further optimization.

Summary updated

Abstract

We run Kroko, a 65.7M-parameter streaming Zipformer2 transducer for English, on the ESP32-P4, a microcontroller with two 400 MHz RISC-V cores, a 128-bit SIMD extension (PIE) and 32 MB of PSRAM, but no neural accelerator. Without any training, the encoder's 290 matrices are stored with 2 or 4 bits per weight in Hadamard-rotated groups: the width of each matrix comes from its measured sensitivity, and each matrix is first corrected toward the original model's output, then rounded with GPTQ and a search over the group norms. The released 71 MB of int8 weights become a 26.65 MB file. Activations are int16 between the matrix products and int8 into them. A C engine with hand-written PIE kernels processes each 1.28 s chunk of audio in 0.90 s on both cores, beam search included, and its PC build computes the same bits as the chip, so accuracy is measured on whole test sets. LibriSpeech WER is 4.34% on test-clean and 10.26% on test-other, against 3.94% and 9.17% for the released model; on FLEURS and Common Voice the gap grows to 2.3 and 1.1 points. A GPU simulator shows that the integer arithmetic costs nothing and that the whole gap comes from the weights, and an ablation on all of test-clean shows that GPTQ does most of the work. We also report the port's speed history, from 51.3 s to 0.62 s of encoder time per chunk, each design step measured again in one build, an attempt to reach 16 MB that stopped at 19.63 MB, and what did not work. We did not measure energy. The inference engine, the firmware and the 2/4-bit weights are available at https://github.com/BoumedineBillal/esp32-pie-asr.
BibTeX
@misc{boumedine2026streaming,
  author = {Billal Boumedine},
  title = {{Streaming Speech Recognition on a Microcontroller: a 65.7M-Parameter Transducer in 2 and 4 Bits on the ESP32-P4}},
  year = {2026},
  eprint = {2610.38739},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.38739},
}
Figure