TL;DR
GaLe (Global approximate and Local exact) is a training-free technique that allows complex neural networks to run on memory-starved microcontrollers by splitting feature maps into high-resolution local patches and a low-resolution global summary. It achieves up to 90% RAM reduction and significant speedups compared to traditional tiling methods, all while maintaining near-original accuracy on tasks ranging from ImageNet classification to image generation.
What Problem Does This Paper Address?
The "TinyML" revolution aims to bring AI to the smallest of devices—microcontrollers (MCUs) with less than 1MB of RAM. However, modern high-performance architectures like MobileNetV4 and Vision Transformers are memory-hungry.
Existing solutions generally fall into two camps, both with major drawbacks:
- Patch-based inference (PPBI): This breaks images into tiles. To maintain accuracy, tiles must overlap significantly to account for the "receptive field" of convolutional layers. This creates massive computational overhead and fails entirely for layers that require global context, such as Squeeze-and-Excitation (SE) blocks or Attention mechanisms.
- Approximation-based methods: These reduce resolution or compress weights, which often leads to a significant drop in accuracy.
The authors of GaLe seek a "middle way" that preserves both fine-grained local details and long-range global dependencies without the heavy computational tax of traditional tiling.
Methods
GaLe introduces a dual-path representation for feature maps:
- Local Exact (LE): The input is divided into horizontal slices. Unlike square patches, these slices align naturally with the contiguous memory layout (NHWC) used by most embedded runtimes, optimizing cache usage.
- Global Approximate (GA): A downsampled, low-resolution version of the entire feature map is processed in parallel. This provides the "global context" that local patches lack.
Key innovations include:
- Learned Padding: Instead of padding patches to the full theoretical receptive field (which is often overkill), GaLe uses a small calibration set to find the minimal overlap needed to stay within a user-defined error tolerance ($\epsilon$).
- Adaptive Slicing: As data moves deeper into a network and spatial resolution naturally decreases, GaLe merges slices. This reduces the number of times weights must be reloaded from slow Flash memory to fast RAM.
- Hybrid Attention: For Transformers, GaLe decouples the attention mechanism into several "strided" local heads and one downsampled global head, avoiding the $O(N^2)$ memory explosion of standard self-attention.
Datasets
The authors validated GaLe across several domains:
- Classification: ImageNet and iNaturalist (for fine-grained classification).
- Object Detection: RT-DETR-L and YOLOv11n.
- Image Generation: SD-Turbo (a distilled diffusion model).
Key Insights and Ideas
- Global Context is a Safety Net: The GA branch effectively "compensates" for the missing data at the edges of local patches. This allows for much smaller overlaps than mathematically "exact" tiling, drastically cutting redundant computation.
- Hardware-Awareness Matters: By switching from square patches to horizontal slices, the authors ensure that data is stored contiguously in memory. This reduces cache misses, which is a critical bottleneck on low-power MCUs.
- Calibration is Cheap: The method doesn't require full retraining. The authors found that the "learned padding" parameters stabilize with as few as 32 calibration samples, making it easy to deploy pre-trained models quickly.
- Unified Framework: Unlike previous methods that only work for CNNs or only for Transformers, GaLe provides a single strategy that handles hybrid architectures effectively.
Key Results
GaLe consistently outperformed standard patch-based inference (PPBI) and resolution scaling:
- Efficiency: On a Cortex-M33 MCU, GaLe achieved a 90% RAM reduction with a 65% speedup compared to standard tiling for MobileNetV2.
- Accuracy: Across various models (ResNet, MobileNet, EfficientViT), the accuracy loss was typically less than 1% compared to full-memory inference.
- Versatility: It successfully compressed the memory footprint of SD-Turbo (diffusion) by over 25x while maintaining high image quality, a feat unattainable by previous token-merging strategies alone.
- Detection: In object detection, GaLe maintained mAP (mean Average Precision) while resolution scaling failed on small objects and standard tiling failed on large objects due to spatial fragmentation.
Limitations and Future Work
- Calibration Requirement: While the calibration set is small, the method still requires a representative sample of data before deployment, which might not always be available in privacy-sensitive edge cases.
- Hardware Variance: The speedup benefits are most pronounced on simpler MCUs (like the Cortex-M33). On more powerful devices with complex tiered caches (like a Raspberry Pi 4), the memory-aware slice layout provides diminishing returns in terms of pure latency.
- Future Directions: The authors suggest GaLe could be used to guide "memory-aware" Neural Architecture Search (NAS), designing new models specifically intended to be partitioned this way.
Reference: Ancilotto, A., & Farella, E. (2026). GaLe: memory-efficient Global Approximate and Local Exact features. arXiv:2609.02689v1.
Summary updated