TinyFoA: Memory Efficient Forward-Only Algorithm for On-Device Learning

Baichuan Huang, Amir AminifarAAAI 2025

Introduction

On-device learning—the ability to train neural networks directly on edge devices like IoT sensors and mobile phones—is a critical frontier for privacy and real-time adaptation. However, the standard training algorithm, Backpropagation (BP), presents a significant barrier due to its high memory requirements. BP necessitates storing all intermediate activations from the forward pass to compute gradients during the backward pass, a "memory wall" that many resource-constrained microcontrollers cannot scale.

While "forward-only" alternatives such as Hinton’s Forward-Forward (FF) algorithm or PEPITA have been proposed to eliminate the backward pass, they often rely on full-precision weights and activations, still consuming substantial memory. Furthermore, these methods frequently struggle with binarization—a common technique to reduce memory by using 1-bit representations—often resulting in catastrophic accuracy loss. TinyFoA (Tiny Forward-Only Algorithm) addresses these challenges by introducing a memory-lean, binarization-compatible training scheme.

The TinyFoA Methodology

TinyFoA achieves its dramatic memory savings through three primary architectural innovations:

1. Joint Horizontal and Vertical Training

TinyFoA moves away from global end-to-end training. Instead, it employs Horizontal (Layer-wise) Training, where local auxiliary classifiers are placed at each layer. This eliminates the need to store activations for the entire network simultaneously.

The core innovation, however, is Vertical Slicing. TinyFoA divides a single layer into $M$ distinct "slices." During the training process, the algorithm updates only one slice of the weights at a time. This approach reduces the peak memory required for gradient calculations and parameter updates by a factor of $M$ or $M^2$, effectively breaking the memory bottleneck for wide layers.

The TinyFoA architecture utilizing local auxiliary classifiers and vertical slicing to minimize memory footprint during training.

2. Binarization and Fixed Random Projections

To further optimize for hardware, TinyFoA binarizes both weights and activations. This allows the system to replace expensive floating-point multiplications with efficient 1-bit XNOR and pop-count operations. To maintain local training without the "weight transport problem" (the need for symmetric weights in BP), TinyFoA uses fixed random matrices to project local errors, ensuring the update signal remains strictly local to the specific layer and slice.

Experimental Evaluation

The authors benchmarked TinyFoA against standard Backpropagation across several datasets:

  • MNIST: For basic handwritten digit recognition.
  • CIFAR-10 & CIFAR-100: To test object recognition at varying complexities.
  • MIT-BIH Arrhythmia Database: A practical medical IoT application involving ECG signal analysis, demonstrating the algorithm's utility in real-world healthcare monitoring.

Performance and Key Results

TinyFoA demonstrates massive quantitative improvements in memory efficiency while maintaining competitive accuracy. Compared to BP, TinyFoA reduces memory overhead in the forward pass by approximately 96x, in gradient calculation by 24x, and in parameter updates by 12x.

Comparison of training error and memory overhead between Backpropagation (BP) and TinyFoA, highlighting significant memory reductions across sequential training steps.

On the MNIST dataset, TinyFoA achieved an error rate of ~2.10%, remarkably close to BP's 1.33%. Crucially, while other forward-only methods see error rates skyrocket when binarized, TinyFoA remains stable. The use of binary activations also results in a 64x reduction in inference computation compared to full-precision models. These optimizations allow the training of a Fully Connected layer to fit within the 0.5 MB RAM typical of microcontrollers like the ARM Cortex-M7.

Discussion and Future Work

TinyFoA proves that "slicing" the width of a layer is as important as "layering" the depth for memory optimization. By combining local training with vertical slicing and binarization, it provides a viable path for sophisticated on-device learning.

Currently, TinyFoA is optimized for Fully Connected (FC) and Locally Connected (LC) layers. While these are prevalent in many IoT tasks, future research is needed to adapt the vertical slicing principle to Convolutional Neural Networks (CNNs) with weight sharing and more complex architectures like Transformers. As dataset complexity increases, the performance gap between TinyFoA and BP widens, suggesting that further refinements in local gradient estimation may be necessary for high-dimensional computer vision tasks.

Summary updated

BibTeX
@inproceedings{huang2025tinyfoa,
  author = {Baichuan Huang and Amir Aminifar},
  title = {{TinyFoA: Memory Efficient Forward-Only Algorithm for On-Device Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i16.33910},
}
Figure