Manuscript Offprint

arXiv:2609.02689

GaLe: memory-efficient Global Approximate and Local Exact features

Alberto Ancilotto, Elisabetta Farella

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Embedded devices typically lack the resources of GPU-equipped machines, and existing inference methods suffer from either high computational overhead (patch-based) or accuracy loss (approximation-based). We propose GaLe, a memory-efficient technique that enables the deployment of pretrained networks on constrained devices without retraining. GaLe partitions feature maps into two components: a local exact (LEL_E) representation that preserves fine details and a global approximate (GAG_A) representation that retains long-range dependencies. Unlike standard tiling, GaLe supports global operations and attention mechanisms found in hybrid CNN-transformer models. Validated on ImageNet, our method matches exact-inference performance while achieving up to 65% speedup and 90% RAM reduction on a Cortex-M33 compared to patch-based inference. We further demonstrate GaLe's versatility across classification, detection, and generation tasks, highlighting its potential as a foundation for resource-efficient architecture design.

Index Terms— Embedded Systems, TinyML, Memory-Efficient Inference, Microcontrollers, RAM Reduction

1. INTRODUCTION

Deep neural networks have grown increasingly resource-demanding, with modern attention-based architectures pushing the limits of available hardware. This is particularly true in embedded and TinyML systems, where the benefits of edge processing (in terms of privacy, latency, and energy efficiency) clash with strict hardware limitations. Typical MCU constraints include static memory (FLASH) restricting parameters to under 2MB, compute capacities orders of magnitude lower than GPUs, and most critically, dynamic memory (RAM) often below 1MB. RAM capacity is the primary bottleneck for modern building blocks like inverted residuals [1, 2, 3] and attention mechanisms [4, 5]. To address this challenge, we propose a novel memory-efficient inference strategy enabling the deployment of pre-trained networks on resource-constrained devices without retraining, requiring only a small calibration set. Our method relies on feature map

Figure

Fig. 1. Graphical representation of local exact and global approximate decomposition for a convolutional layer

partitioning, where layer outputs are decomposed into two complementary representations: (i) a local exact (LEL_E) component for fine-grained details and (ii) a global approximate (GAG_A) component for long-range dependencies. Unlike previous reduction methods [6, 7], this approach supports global receptive fields and attention blocks, minimizing accuracy loss while potentially guiding memory-aware architecture search. It also remains compatible with standard deployment runtimes such as ONNX, TFLite, and STM32Cube.Ai. Our contributions are two-fold. First, we introduce a hardware-aware partial-patch-based inference method that optimizes memory usage via contiguous RAM slices. We reduce computational overhead by estimating the minimal patch overlap required to achieve target precision and by leveraging GAG_A features to compensate for missing data. Second, we extend this approach to hybrid CNN-transformer architectures. We derive an attention formulation based on GAG_A and LEL_E features that enables sequential block processing with lower overhead than standard memory-efficient attention implementations [8, 9], and can operate alongside or replace them in memory-constrained settings.

References (32)

  • MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
  • Mobilenetv2: Inverted residuals and linear bottlenecks
  • Searching for mobilenetv3
  • Efficientvit: Lightweight multi-scale attention for high-resolution dense prediction
  • An image is worth 16x16 words: Transformers for image recognition at scale
  • Mcunetv2: Memory-efficient patch-based inference for tiny deep learning
  • Poet: Training neural networks on tiny devices with integrated rematerialization and paging
  • Self-attention does not need $o(n^{2})$ memory (opens arXiv in a new tab)
  • Flashattention: Fast and memory-efficient exact attention with io-awareness
  • Mobilenetv4 - universal models for the mobile ecosystem
  • Xception: Deep learning with depthwise separable convolutions
  • Mcunet: Tiny deep learning on iot devices (opens arXiv in a new tab)
  • On-device training under 256kb memory
  • Efficientnet: Rethinking model scaling for convolutional neural networks
  • Phinets: A scalable backbone for low-power ai at the edge
  • Xinet: Efficient neural networks for tinyml
  • Swin transformer: Hierarchical vision transformer using shifted windows
  • Separable self-attention for mobile vision transformers
  • Joint token pruning and squeezing towards more aggressive compression of vision transformers
  • Learned token pruning for transformers
  • Multitailed vision transformer for efficient inference
  • Slicing aided hyper inference and fine-tuning for small object detection
  • Automated design intelligence with gapflow
  • Squeeze-and-excitation networks
  • Token merging: Your vit but faster (opens arXiv in a new tab)
  • Token fusion: Bridging the gap between token pruning and token merging
  • Computing receptive fields of convolutional neural networks
  • tflite-micro
  • Fastvit: A fast hybrid vision transformer using structural reparameterization
  • FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Adversarial diffusion distillation
  • Perceptual losses for real-time style transfer and super-resolution