Manuscript Offprint

arXiv:2611.12530

K-prop: Deep Online Learning by Backpropagating Temporal Kernels

Bingkun Liu, Paul Haider, Federico Benitez, Mihai A. Petrovici, Walter Senn

Abstract

Self-recurrence represents an important component for temporal processing in neural networks, both artificial and biological, where it appears naturally in the form of leaky integration. However, due to the complex temporal dependencies of the gradient, an efficient and effective method of online training is still lacking. Here we propose K-prop, a novel online learning method for leaky neural networks. It dramatically reduces the computational and memory cost of real time recurrent learning (RTRL) by propagating kernel gains. K-prop also outperforms existing RTRL approximations and achieves performance comparable to backpropagation through time in sequence learning, classification, and reinforcement learning tasks. We further analyze how its sole approximation affects gradient quality and identify conditions under which K-prop remains accurate and effective.

1 Introduction

Temporal processing is fundamental to both biological and artificial intelligence, requiring systems to transform continuous inputs into structured internal representations. Effective training for temporal dynamics relies on accurate credit assignment over time, commonly addressed by backpropagation through time (BPTT, Werbos [2002]). However, BPTT requires storing and replaying full trajectories, limiting its applicability to online settings. In contrast, many natural and real-world systems operate continuously, where learning must occur in real time without access to stored past states, motivating the need for efficient online learning mechanisms. Prior research [Irie et al., 2024] suggests that online learning can also improve sample efficiency in reinforcement learning settings.

Artificial neural networks typically employ instantaneous neurons, whose activations depend only on the current input. In contrast, leaky (integrating) neurons evolve according to continuous dynamics of the type τu˙=−u+Wr\tau \dot{u} = -u + Wr, where the membrane potential uu decays with time constant τ\tau while integrating presynaptic input rr through weights WW. These dynamics emulate biological membrane potentials and have therefore been widely adopted in computational neuroscience [Dayan and Abbott, 2005]. Beyond biological inspiration, leaky neurons offer an intrinsic mechanism for temporal processing: each neuron implements a low-pass filter, and networks of such units naturally construct rich temporal kernels in an online manner. Unlike Temporal Convolutional Networks (TCN, Bai et al. [2018]), which require access to full input sequences, leaky networks have the potential to process streaming data continuously while maintaining a distributed, multi-timescale memory, a power that has recently been demonstrated in models [Spieler et al., 2024, Ebato et al., 2024]. Moreover, their dynamics align naturally with analog hardware, where voltage-based circuits exhibit leaky integration [Stoliar et al., 2017, Yang et al., 2020].

*bingkun.liu@unibe.ch

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Despite these advantages, online training of feedforward leaky networks remains fundamentally challenging. Due to temporal integration, activity at each layer influences future downstream responses, making the gradient depend jointly on spatial pathways and temporal dynamics, analogous to recurrent networks. In principle, exact gradients can be computed by BPTT or real-time recurrent learning (RTRL, Williams and Zipser [1989]). RTRL, while online, incurs prohibitive computational complexity of order O(n4)\mathcal{O}(n^4), rendering it impractical beyond very small networks. Existing RTRL approximations either reduce complexity at the expense of gradient quality or fail to scale to deep architectures. As a result, investigating online learning in large and deep leaky networks remains challenging.

In this work, we introduce Kernel propagation (K-prop), a novel learning algorithm for feedforward leaky networks that achieves efficient, online, and accurate gradient approximation. The central idea is to express gradient contributions as a decomposition over exponential temporal kernels, and to propagate only their gain coefficients backward through the network. This transforms the combinatorial explosion of possible temporal pathways into a tractable, layer-wise computation analogous to standard backpropagation.

K-prop offers the following key contributions:

Efficiency and effectiveness: K-prop significantly reduces the quartic complexity of RTRL to near-quadratic scaling, while maintaining a close approximation to the exact gradient. It achieves best-in-class task performance, close to the exact RTRL/BPTT solutions, in deep architectures.

Continuous formulation: Derived directly in continuous time, K-prop is robust to arbitrarily small time steps and naturally suited for analog systems and for dealing with continuous or sparse data.

Layer-wise locality: K-prop remains layer-wise local during training, facilitating practical implementation without requiring global information pathways.

References (68)

  • On the non-universality of deep learning: quantifying the cost of symmetry
  • An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling
  • Exploring the performance of ml/dl architectures on the mnist-1d dataset (opens arXiv in a new tab)
  • A solution to the learning dilemma for recurrent networks of spiking neurons
  • Optimal kronecker-sum approximation of real time recurrent learning
  • Online spatiotemporal learning in deep neural networks
  • Prospective and retrospective coding in cortical neurons (opens arXiv in a new tab)
  • Tag-trigger-consolidation: a model of early and late long-term-potentiation and depression
  • *Theoretical neuroscience: computational and mathematical modeling of neural systems*
  • The high-conductance state of neocortical neurons in vivo
  • Impact of time-history terms on reservoir dynamics and prediction accuracy in echo state networks
  • Backpropagation through space, time and the brain
  • Eligibility traces and plasticity on behavioral time scales: experimental support of neohebbian three-factor learning rules
  • Scaling down deep learning with MNIST-1d
  • Latent equilibrium: a unified learning theory for arbitrarily fast computation with arbitrarily slow neurons
  • Deep residual learning for image recognition
  • Exploring the promise and limits of real-time recurrent learning
  • Planning and acting in partially observable stochastic domains
  • Gradient-based learning applied to document recognition
  • Efficient temporal processing of naturalistic sounds
  • Approximating real-time recurrent learning with random kronecker factors
  • James M Murray. Local online learning in recurrent networks with random feedback. eLife, 8:e43299, may 2019. ISSN 2050-084X. doi: 10.7554/eLife.43299. URL https://doi.org/10.7554/eLife.43299. (opens the publisher in a new tab)
  • Nature neuroscience, 17(12):1661–1663, 2014
  • Specaugment: A simple data augmentation method for automatic speech recognition (opens arXiv in a new tab)
  • A neuronal least-action principle for real-time learning in cortical circuits
  • Failures of gradient-based deep learning
  • The expressive leaky memory neuron: an efficient and expressive phenomenological neuron model can solve long-horizon tasks
  • A leaky-integrate-and-fire neuron analog realized with a mott insulator
  • Unbiased online recurrent optimization
  • A standard interface for reinforcement learning environments (opens arXiv in a new tab)
  • An annotated journey through modern visual neuroscience
  • Pete Warden. Speech commands: A dataset for limited-vocabulary speech recognition. arXiv preprint arXiv:1804.03209, 2018. (opens arXiv in a new tab)
  • A learning algorithm for continually running fully recurrent neural networks
  • Gradient-based learning algorithms for recurrent networks and their computational complexity
  • Leaky integrate-and-fire neurons based on perovskite memristor for spiking neural networks
  • Understanding auditory spectro-temporal receptive fields and their changes with input statistics by efficient coding principles
  • Online learning of long-range dependencies
  • Hierarchical exponential kernels can be expressed as a linear summation of exponential kernels
  • We therefore assume $\tau_i \neq \tau_j$ for any $i \neq j$
  • We use bold symbols to denote vectors and matrices
  • The gradient must integrate over temporal contributions $\frac{\partial \mathbf{u}_{[2]}(t)}{\partial \mathbf{r}_{[1]}(t' < t)}$, which are scaled by the decay term $\frac{1}{\tau} e^{\frac{t' - t}{\tau}}$:
  • To compute this explicitly, we replace matrix operations with summations
  • We next group L2 neurons that share the same time constant and collect all distinct $\tau$'s into the set $\Upsilon_{L2}$
  • To maintain consistent layer indexing for the back-propagation process, we use $[-index]$ to denote layers by their distance from the output, and indices $i, j, k, \ldots$ follow this order, with $\epsilon$ still as the error signal arrives at the last leaky layer
  • However, in this case, we encounter an intractable expression due to the temporally varying $\rho_{j}^{\prime}(t^{\prime})$
  • This approximation effectively requires $\rho'$ to vary slowly over time, which is better satisfied by smooth activation functions
  • The path weight $w_p$ is defined as the product of all synaptic weights, the rate derivatives $\rho',$ and the error $\epsilon_p$ entering the path $p$
  • This suggests that maximizing the reuse of $\zeta_{\star}^{\tau}$ is beneficial
  • This equation can be written in matrix form as in Equation 4, which highlights its strong similarity to instantaneous gradient backpropagation
  • To apply K-prop to a residual network, we propagate each kernel gain $\mathcal{K}^{\tau}$ along both the skip and residual pathways, then sum the contributions at the merge point for each $\tau$
  • Kernels contained by any other, more indirect paths between layers m and n (via other intermediate layers) will neither affect nor be affected by kernels along the direct connection from $m$ to $n$, so their contribution to $\mathcal{T}_{j,[mn]}^{\tau}$ should be zero
  • Empirically, we do not observe any benefit from using identical or near-identical time constants across layers
  • Although BPTT is computationally efficient, it incurs a memory cost that scales with sequence length $T$, as it requires storing the full trajectory
  • Each sample spans 360ms and contains a digit pattern of approximately 90ms embedded at a random temporal position, requiring both temporal
  • Apart from increasing the number of time steps, we use the default sample-generation settings of Greydanus and Kobak [2024], including the default training/test split of 4000/1000 samples
  • We evaluate the 20-class command-label subset, rather than the 12-class subset used in Ellenberger et al. [2025]
  • The learning rate decays exponentially in N-sum and follows a cosine annealing schedule (180 epochs total) in MNIST1D
  • To obtain more continuous inputs, observations from each environment step (20 ms) are interpolated by inserting 3 intermediate frames to obtain $dt = 5ms$
  • do nothing, fire left engine, fire main engine, and fire right engine
  • The critic propagates a scalar value signal, while the actor propagates a cross-entropy loss using the chosen action as the target label
  • We find the latter more effective, as it preserves learning speed while improving stability
  • Such range of time constants could be achieved through modulation of the membrane conductance [Destexhe et al., 2003] or prospective coding [Haider et al., 2021, Senn et al., 2024, Brandt et al., 2024]
  • MNIST1D and GSC benefits from GPU acceleration due to larger matrix operations
  • (Left) Gradient cosine similarity check with BPTT like Fig
  • (5), with $\mathbf{n} \sim \mathcal{N}(0, \sigma^2)$
  • sweet spot
  • The performance slightly decreases as $\alpha$ approaches 1, while still maintaining an accuracy of 94%, suggesting that K-prop preserves a usable gradient quality
  • For GSC, $\tau_{\rho}$ at each layer is instead set to the sum of the time constants in its downstream layers