Distance-Forward Learning: Enhancing the Forward-Forward Algorithm Towards High-Performance On-Chip Learning

Yujie Wu, Siyuan Xu, Jibin Wu, Lei Deng, Mingkun Xu, Qinghao Wen, Guoqi LiarXiv 2024 · DOI

Abstract

Researchers have supercharged the Forward-Forward (FF) algorithm—a bio-plausible alternative to backpropagation—by reinterpreting it through the lens of distance metric learning. Their new "Distance-Forward" (DF) method achieves state-of-the-art accuracy for local learning on complex datasets while using less than 40% of the memory required by traditional training, making it a prime candidate for high-performance on-chip learning.

Introduction

Standard Deep Learning relies on Backpropagation (BP), which, while effective, has major drawbacks for hardware. Specifically, the "Update Lock" requires layers to wait for a full forward and backward pass before updating, limiting parallelism. Furthermore, BP is a "memory hog," requiring the storage of all intermediate activations to calculate gradients, which is prohibitively expensive for edge devices and neuromorphic chips.

Geoffrey Hinton’s Forward-Forward (FF) algorithm recently emerged as a "local" alternative that replaces the backward pass with two forward passes: one "positive" with real data and one "negative" with corrupted data. However, FF has historically struggled with poor generalization on complex datasets and lacked a solid theoretical framework. This paper aims to bridge that gap, turning FF from a biological curiosity into a high-performance engineering tool.

Methodology

The authors introduce Distance-Forward (DF) Learning, which improves upon FF via three main innovations:

  • Metric Learning Reformulation: The researchers prove that FF is essentially a form of centroid-based metric learning. In this view, the network attempts to move "positive" samples closer to a label-based anchor in a high-dimensional space while pushing "negative" samples away.
  • Goodness-based N-pair Margin Loss: Instead of the simple sigmoid loss used in the original FF, DF employs a margin loss. This forces a clear "gap" between how the network perceives correct vs. incorrect labels. They also implement N-pair mining, comparing a positive sample against multiple negative samples simultaneously to improve stability and label balance.
  • Layer-Collaboration Strategies: To prevent "greedy" local updates from losing important information, two strategies are proposed: DF-O (Overlapping), which groups adjacent layers to allow information flow, and DF-R (Random Feedback), which uses random direct feedback connections for higher parallelism.
Evolution of loss functions from standard Forward-Forward (FF) to the proposed Distance-Forward (DF) learning.

Key Insights

  • The Metric Learning Connection: The realization that FF's "goodness" function is mathematically equivalent to an $L_2$ distance in a metric space allows for the application of established "Metric Learning" research (like triplet losses) to local learning.
  • Hierarchical Refinement: Unlike standard contrastive learning, which often occurs only at the final layer, DF refines the distance-based representation at every layer. Shallow layers establish a rough distance metric, while deeper layers sharpen it.
  • Hardware Resilience: DF is significantly more robust to hardware-related noise, such as device mismatch or sensor interference, than Backpropagation. Because the learning is local and margin-based, the network learns to ignore small fluctuations that would typically disrupt a global gradient chain.

Experimental Results

The model was evaluated on six standard computer vision benchmarks, including MNIST, Fashion-MNIST, SVHN, CIFAR-10, CIFAR-100, and ImageNette. DF significantly outperforms previous FF variants and rivals traditional BP in several key areas:

  • Accuracy: DF achieved 88.2% on CIFAR-10 and 59.0% on CIFAR-100, far surpassing the original FF, which struggled to exceed 60% on CIFAR-10.
  • Memory Efficiency: Training requires less than 40% of the memory of BP for an 11-layer architecture. These savings become more dramatic as networks deepen.
  • Speed and Robustness: DF-R shows lower optimal execution time compared to BP by eliminating sequential dependencies. In tests simulating noisy neuromorphic hardware, DF maintained high accuracy while BP's performance degraded sharply.

Conclusion and Future Work

While a major step forward, some hurdles remain, such as scaling to massive Transformer architectures for NLP and managing hyperparameter sensitivity regarding the margin and regularization coefficients. Future work will focus on implementing DF directly on neuromorphic hardware to fully realize its energy-efficiency potential.

Summary updated

BibTeX
@misc{wu2024distance,
  author = {Yujie Wu and Siyuan Xu and Jibin Wu and Lei Deng and Mingkun Xu and Qinghao Wen and Guoqi Li},
  title = {{Distance-Forward Learning: Enhancing the Forward-Forward Algorithm Towards High-Performance On-Chip Learning}},
  year = {2024},
  eprint = {2408.14925},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.14925},
}
Figure