TopSpark: A Timestep Optimization Methodology for Energy-Efficient
  Spiking Neural Networks on Autonomous Mobile Agents
Autonomous mobile agents require low-power/energy-efficient machine learning
(ML) algorithms to complete their ML-based tasks while adapting to diverse
environments, as mobile agents are usually powered by batteries. These
requirements can be fulfilled by Spiking Neural Networks (SNNs) as they offer
low power/energy processing due to their sparse computations and efficient
online learning with bio-inspired learning mechanisms for adapting to different
environments. Recent works studied that the energy consumption of SNNs can be
optimized by reducing the computation time of each neuron for processing a
sequence of spikes (timestep). However, state-of-the-art techniques rely on
intensive design searches to determine fixed timestep settings for only
inference, thereby hindering the SNNs from achieving further energy efficiency
gains in both training and inference. These techniques also restrict the SNNs
from performing efficient online learning at run time. Toward this, we propose
TopSpark, a novel methodology that leverages adaptive timestep reduction to
enable energy-efficient SNN processing in both training and inference, while
keeping its accuracy close to the accuracy of SNNs without timestep reduction.
The ideas of TopSpark include: analyzing the impact of different timesteps on
the accuracy; identifying neuron parameters that have a significant impact on
accuracy in different timesteps; employing parameter enhancements that make
SNNs effectively perform learning and inference using less spiking activity;
and developing a strategy to trade-off accuracy, latency, and energy to meet
the design requirements. The results show that, TopSpark saves the SNN latency
by 3.9x as well as energy consumption by 3.5x (training) and 3.3x (inference)
on average, across different network sizes, learning rules, and workloads,
while maintaining the accuracy within 2% of SNNs without timestep reduction.
Rachmad Vidya Wicaksana Putra, Muhammad Shafique
# TopSpark: A Timestep Optimization Methodology for Energy-Efficient

###### Abstract

Autonomous mobile agents (e.g., mobile ground robots and UAVs) typically require low-power/energy-efficient machine learning (ML) algorithms to complete their ML-based tasks (e.g., object recognition) while adapting to diverse environments, as mobile agents are usually powered by batteries. These requirements can be fulfilled by Spiking Neural Networks (SNNs) as they offer low power/energy processing due to their sparse computations and efficient online learning with bio-inspired learning mechanisms for adapting to different environments. Recent works studied that the energy consumption of SNNs can be optimized by reducing the computation time of each neuron for processing a sequence of spikes (i.e., timestep). However, state-of-the-art techniques rely on intensive design searches to determine fixed timestep settings for only the inference phase, thereby hindering the SNN systems from achieving further energy efficiency gains in both the training and inference phases. These techniques also restrict the SNN systems from performing efficient online learning at run time. Toward this, we propose TopSpark, a novel methodology that leverages adaptive timestep reduction to enable energy-efficient SNN processing in both the training and inference phases, while keeping its accuracy close to the accuracy of SNNs without timestep reduction. The key ideas of our TopSpark include: (1) analyzing the impact of different timestep settings on the accuracy; (2) identifying neuron parameters that have a significant impact on accuracy in different timesteps; (3) employing parameter enhancements that make SNNs effectively perform learning and inference using less spiking activity due to reduced timesteps; and (4) developing a strategy to trade-off accuracy, latency, and energy to meet the design requirements. The experimental results show that, our TopSpark saves the SNN latency by 3.9x as well as energy consumption by 3.5x for training and 3.3x for inference on average, across different network sizes, learning rules, and workloads, while maintaining the accuracy within 2% of that of SNNs without timestep reduction. In this manner, TopSpark enables low-power/energy-efficient SNN processing for autonomous mobile agents.

## I Introduction

Autonomous mobile agents (e.g., UGVs and UAVs) usually require low-power ML algorithms to complete their ML-based tasks (e.g., object recognition through images/videos), since these agents are typically powered by batteries [1]; see Fig. 1(a). Furthermore, these mobile robots also require to continuously adapt to different operational environments (so-called _dynamic environments_) since the offline-trained knowledge is typically learnt from limited samples and may be obsolete at run time, hence leading to accuracy degradation; see Fig. 1(a). These requirements can be fulfilled by Spiking Neural Networks (SNNs) because of the following two reasons. First, advancements in neuromorphic computing have led SNNs to achieve ultra-low power/energy processing and high accuracy by leveraging their bio-inspired spike-based operations [2, 3, 4]. Second, SNNs employ bio-inspired learning rules locally in each synapse, such as Spike-Timing-Dependent Plasticity (STDP), which are suitable for efficient online learning (i.e., training at run time for updating the knowledge of systems using _unlabeled data_1), thereby adapting to dynamic environments [5, 6, 7]. Furthermore, SNNs are also expected to provide high accuracy that meets the applications' requirements. To achieve higher accuracy, larger-sized SNN models are usually employed as they have a larger number of neurons to recognize more input features than the smaller-sized models; see Fig. 1(b). For instance, the work of [8] studied that a network with 3600 excitatory neurons achieves \(\sim\)90% accuracy for the MNIST, while a network with 100 excitatory neurons only achieves \(\sim\)75%. However, SNN hardware platforms for embedded applications (e.g., mobile robots) typically have limited memory and compute capabilities [9], thereby making it challenging to achieve both high energy efficiency and high accuracy for SNNs at the same time. To address this, previous works have explored different optimization methodologies [8, 10, 11, 12, 13]. However, _most of them have not optimized the computational time of a neuron for processing input spikes (i.e., timestep)_, which also has the potential to substantially reduce the energy consumption of SNN processing, while preserving the excitatory neurons to recognize diverse features.

Footnote 1: Unlabeled data from environments can be leveraged for efficient SNN training at run time using STDP-based unsupervised learning.

**Targeted Research Problem:**_How can we improve the energy efficiency of SNN processing in both the training and inference phases through timestep optimizations, while maintaining the accuracy high._ An efficient solution to this problem will enable low-latency and energy-efficient autonomous mobile agents/robots that can adapt to different environments._

### _State-of-the-Art and Their Limitations_

State-of-the-art works have employed different timestep reduction techniques to optimize the energy consumption of SNN inference, while achieving acceptable accuracy [14, 15, 16, 17]. For instance, the

Fig. 1: (a) Autonomous mobile agents typically require low-power processing and capabilities for adapting to different operational environments to complete ML-based tasks. (b) SNN architecture that supports STDP-based unsupervised learning, i.e., fully-connected network. A larger SNN model has a higher number of excitatory neurons to recognize more features than a smaller one.
work of [14] trained binary-weighted SNNs and then studied the impact of different timesteps on accuracy. Another work performed a gradient descent-based retraining method to learn the parameter values while considering reduced timesteps [15]. Similarly, the work of [16] gradually reduced the timesteps while retraining the network. Meanwhile, a recent work employed search algorithms to find the appropriate timestep reduction [17].

**Limitations:** State-of-the-art works only employed fixed timesteps for SNN inference, through costly (re)training [14, 15, 16] and costly intensive searches [17]. Therefore, the existing techniques limit the SNN systems from further energy efficiency gains in both the training and inference phases. These techniques also hinder the SNN systems from performing efficient online learning/fine-tuning through training at run-time. Furthermore, smart AI-based systems usually need to adjust their accuracy for better battery life at run time [18], thereby requiring adaptive trade-offs between accuracy, latency, and energy, which cannot be accommodated by the existing techniques.

To address these limitations, _a timestep optimization technique for both the training and inference phases is required_. This solution will enable efficient SNN training and inference with smaller timesteps (i.e., lower latency) and lower energy consumption. Moreover, this efficient training can also be leveraged at run time to enable efficient online learning mechanisms.

To highlight the potential of timestep reduction in SNN processing, we present an experimental case study in the following Section I-B.

### _Motivational Case Study and Key Challenges_

We study the accuracy, latency, and energy consumption profiles of an SNN model considering different timesteps. To do this, we perform experiments employing a fully-connected SNN with 400 neurons, rate coding, and pair-wise STDP in unsupervised learning settings [10]. For each timestep setting, we perform training and inference using the MNIST dataset2. Detailed information on the experimental setup will be discussed in Section IV. The experimental results are shown in Fig. 2, from which we draw the following **key observations**.

Footnote 2: The MNIST dataset is commonly used in SNN community for evaluating SNNs with unsupervised learning settings [2][8][10].

* Accuracy scores are typically proportional to timestep settings due to the spiking activity, i.e., smaller timestep leads to lower accuracy, and larger timestep leads to higher accuracy; see Fig. 2(a).
* Accuracy profile of an SNN with timestep reduction may have two regions, compared to the baseline accuracy (i.e., an SNN without timestep reduction): (1) a region with comparable accuracy, and (2) a region with notable accuracy degradation; see Fig. 2(a).
* Timestep reduction can effectively save the latency and energy consumption of SNN processing in both the training and inference phases due to reduced neuron and learning operations; see Fig. 2(b).

_Although reducing timesteps can effectively curtail the latency and energy consumption of SNN processing, aggressive reductions in the timestep may significantly decrease the accuracy_, thereby limiting the applicability of timestep reduction techniques for improving the efficiency gains of SNNs.

**Research Challenges:** Our experiments and observations expose several design challenges that should be solved to address the targeted problem, as discussed in the following.

* _The solution should maximally reduce the timestep_ in the training and the inference to significantly optimize the computation latency and energy consumption of SNN processing, but without noticeably degrading the accuracy.
* _The solution should effectively learn from reduced spiking activity_ to maintain the learning quality as compared to the original SNNs (i.e., without timestep reduction).
* _The optimization techniques should incur minimum overheads (e.g., energy)_ to accommodate efficient online learning and better battery life management.

### _Our Novel Contributions_

To address the research challenges, we propose _TopSpark_, _a novel Timestep optimization methodology for energy efficient Spiking neural networks in training and inference on autonomous mobile agents_. To the best of our knowledge, our TopSpark is the first work that optimizes timesteps of SNNs in both the training and inference phases. Following are the novel steps performed in the TopSpark methodology (see the overview in Fig. 3).

1. **Analyzing the accuracy under different timesteps** to investigate the impact of timestep reduction in the SNN training and inference on the accuracy profiles.
2. **Analyzing the impact of neuron parameters** to investigate the role of neuron parameters and the influence of their values on the accuracy profiles under different timesteps.
3. **Devising parameter enhancement rules to maintain accuracy** by leveraging the knowledge from previous analysis steps, thereby providing effective yet simple solutions with minimum overheads.
4. **Devising a strategy to trade-off accuracy, latency, and energy** to meet the constraints (i.e., target accuracy, target latency, and energy budget), hence enabling a better battery life management.

**Key Results:** We evaluate TopSpark methodology using Python simulations [19] on GPU machines to get the accuracy profiles and leverage the computation time and power to estimate the latency and energy consumption of SNN training and inference. Experimental results with different workloads and STDP-based learning rules show that, our TopSpark saves the latency by 3.9x and energy consumption by 3.5x for training and 3.3x for inference on average, while keeping the accuracy close to the SNNs without timestep reduction.

## II Preliminaries of SNNs

Spiking neural networks (SNNs) are the neural networks' class that employs bio-plausible computation models based on action

Fig. 2: Experimental results considering an SNN with 400 excitatory neurons with a fully-connected architecture in Fig. 1(a), rate coding, and pair-based STDP [10] under different timesteps in training and inference: (a) accuracy profiles; (b) latency and energy consumption normalized to timestep 350.
potentials (i.e., spikes) [2]. An SNN model has a specific neuron model, network architecture, learning rule, and spike coding [8].

_Neuron model_ defines how a neuron operates, updates its internal dynamics (e.g., membrane potential), and generates output spikes over time. The operational time of a neuron to process a sequence of input spikes from a single input (e.g., an image pixel) is defined as _timestep_[17]. Here, we consider the Leaky Integrate-and-Fire (LIF) neuron model because it has been widely used in the SNN community because of its simple yet highly bio-plausible operations [8]; see an overview in Fig. 4. The LIF neuron updates its membrane potential (\(V_{mem}\)) each timestep. \(V_{mem}\) is increased each time an input spike comes, and otherwise, \(V_{mem}\) is decreased. If \(V_{mem}\) reaches a defined threshold voltage (\(V_{th}\)), the neuron generates an output spike. Then, \(V_{mem}\) goes to the reset potential (\(V_{mem}\)) and the neuron cannot generate spikes in a defined refractory period (\(T_{ref}\)).

_Network architecture_ determines the connections among neurons, synapses, as well as inputs and outputs. In this work, we consider a fully-connected network in Fig. 1(b) since it supports unsupervised learning, which is required for enabling efficient online learning mechanisms. In such a network, each input (e.g., an image pixel) is connected to all excitatory neurons. Each excitatory neuron is expected to recognize a specific class. Hence, the connecting synapses are trained to learn the corresponding features. For the _learning rules_, we consider the bio-plausible STDP rules (i.e., pair-based weight-dependent STDP [10] and adaptive learning rate STDP [8]) since they support unsupervised learning scenarios to train the synaptic weights using unlabeled data from operational environments, thus enabling efficient online learning mechanisms [5][12]. To perform SNN processing, the input data is converted into a sequence of spikes (i.e., spike train) using a specific _neural/spike coding_. Here, we consider the rate coding as it can be coupled with different STDP-based learning rules for achieving high accuracy [10]. This rate coding uses Poisson distribution to generate the spike train of each input (e.g., a pixel) whose probability mass function (\(P_{pmf}\)) is given by Eq. 1, with \(\lambda\) denotes the rate parameter, \(k\) denotes the number of occurrences, and \(e\) denotes the Eulers' number.

\[P_{pmf}=\lambda^{k}\cdot\frac{e^{-\lambda}}{k!} \tag{1}\]

To avoid the domination of some excitatory neurons in the training phase, the adaptation potential (\(\theta\)) is employed [10]. Here, \(V_{th}\) is increased by \(\theta\) each time the corresponding neuron generates a spike that triggers the learning process for a specific input feature/pattern, thereby making it harder to stimulate the same neuron to generate spikes for other input patterns; see Fig. 4. In this manner, a certain neuron is expected to produce spikes only when stimulated with a specific pattern (i.e., recognizing a specific class), and other neurons can produce spikes when stimulated with other input patterns (different classes), thereby maximizing the accuracy.

## III TopSpark Methodology

Our TopSpark methodology employs several key novel steps, as shown in the overview in Fig. 5. Detailed descriptions of these steps are provided in the subsequent sections.

### _Analysis of Accuracy Profiles in Different Timesteps_

We first investigate and analyze the impact of timestep reduction in training and inference on accuracy. This study aims at understanding the characteristics of the accuracy profiles considering a given SNN model, dataset, and timestep. To do this, we perform experimental studies with a 400-neuron SNN while considering different timesteps, datasets (i.e., MNIST and Fashion MNIST), and learning rules, i.e., a pair-based weight-dependent STDP (STDP1) [10] and an adaptive learning rate-based STDP (STDP2) [8]3. The experimental results are shown in Fig. 6, from which we draw the following key observations.

Footnote 3: Detailed information on the experimental setup is provided in Section IV.

* **Trends of the accuracy:** In general, different models with different combinations of timesteps, learning rules, and datasets have similar trends, i.e., the accuracy profiles are proportional to the timestep as a larger timestep leads to higher accuracy, while a smaller one leads to lower accuracy. It indicates that, accuracy degradation in different SNN models may be solved using a similar approach, which is beneficial for developing a simple yet effective solution.
* **Advantages:** Most of the timesteps lead to accuracy scores that are comparable to the baseline accuracy (i.e., SNNs without timestep reduction) despite employing different SNN models with different learning rules and datasets; see label-1. It shows that, the timestep may be reduced significantly without facing noticeable accuracy degradation as compared to the baseline.
* **Potentials of small timesteps:** The low accuracy in small timesteps (shown by label-2) should be improved so that these timesteps can be used at run time for offering good trade-offs among accuracy, latency, and energy consumption. For instance, if the SNN-based systems need to reduce their operational power/energy for better battery life, they may reduce the timestep without accuracy loss or with acceptable accuracy degradation as compared to the baseline.

Our observations expose that, a smaller timestep typically has less spiking activity (i.e., a smaller number of pre- and post-synaptic spikes), hence leading to relatively less learning activity and lower accuracy. This indicates that, _a small number of spikes in a reduced timestep should be effectively used for learning the input features_.

### _Identifying the Roles of Neuron Parameters in Different Timesteps_

To maintain the learning quality of SNNs in a reduced timestep, the learning rules should benefit from the available spikes during the training. Hence, the neurons should effectively make use of the presynaptic spikes for generating the post-synaptic spikes, which are then used by the STDP learning rules to recognize different classes. Otherwise, the learning rules will not benefit from the spikes.

To address this, _we investigate the roles of neuron parameters and their impact on the accuracy_. We perform experimental case studies with a 400-neuron network with different timesteps, datasets, and

Fig. 4: The neuronal dynamics of a LIF neuron model.

Fig. 3: An overview of our novel contributions (shown in blue boxes).
learning rules as employed in Section III-A, while considering different values of neuron parameters. Here, we investigate threshold potential (\(V_{th}\)), refractory period (\(T_{ref}\)), and adaptation potential (\(\theta\)) since we employ the LIF neuron model. We reduce the values of these parameters with the following settings: (1) \(V_{th}^{1}\) = \(V_{th}^{0}-1\); (2) \(T_{ref}=1\); and (3) \(\theta=0\). Index-\(0\) denotes a parameter with an original value, while index-\(1\) denotes a parameter with an adjusted value. The experimental results are presented in Fig. 7, from which we derive the following key observations.
* **Reduced \(V_{th}\):** We observe that \(V_{th}^{1}\) = \(V_{th}^{0}-1\) leads to better accuracy than the direct timestep reduction in most of the timesteps, and leads to competitive accuracy compared to the baseline in small timesteps, as shown by 3 and 4. The reason is that, a smaller \(V_{th}\) can make the corresponding neuron produces post-synaptic spikes easier than the original \(V_{th}\), thus increasing the post-synaptic spike and learning activities that lead to better accuracy. Therefore, _the idea of threshold potential (\(V_{th}\)) reduction can be exploited for devising an effective solution_.
* **Reduced \(T_{ref}\):** We observe that \(T_{ref}=1\) leads to comparable accuracy as the baseline in small timesteps (see 3 and 4) since this setting makes all neurons responsive to any input spikes, which leads to higher learning activities and relatively good accuracy. In high timesteps, this setting leads to highly responsive neurons that may encounter difficulties in distinguishing a specific class, hence leading to accuracy lower than the baseline and the direct timestep reduction; see 3. Therefore, _the idea of refractory period (\(T_{ref}\)) reduction should be exploited carefully if considered for developing an effective solution_.
* **Reduced \(\theta\):** We observe that, in general, \(\theta=0\) leads to a significant accuracy drop as compared to the baseline and the direct timestep reduction, as shown by 4. The reason is that, this setting may make some neurons dominate the spiking activity (i.e., spike generation), hence restricting the other neurons and their connecting synapses from learning and recognizing diverse input features, which in turn causes accuracy degradation [10]. Therefore, _the adaption potential (\(\theta\)) should be considered when developing an effective solution_.

### _Parameter Enhancements for Maintaining Accuracy_

Section III-B suggests that neuron parameters can be exploited to maintain accuracy in reduced timesteps. However, finding appropriate values for these parameters requires intensive searches, which restrict the SNN systems from efficient online learning/fine-tuning. Toward this, _we propose a set of simple policies that can enhance the neuron parameters with minimum overheads_, thereby enabling the SNN-based systems to employ adaptive timestep reduction for efficient online learning through training at run time.

Fig. 5: The overview of our TopSpark methodology, where the novel steps are highlighted in blue boxes. We first analyze the impact of timestep reduction on the accuracy profiles (Section III-A). We also identify the roles of neuron parameters in different timesteps (Section III-B). Then, we leverage previous observations to enhance the neuron parameters (Section III-C) as well as develop a strategy to trade-off accuracy, latency, and energy (Section III-D). Output of the TopSpark methodology is an optimized SNN model with optimized timestep, which is employed on autonomous mobile agents. Furthermore, the mobile agents can adjust the timestep of the SNN processing at run time to adaptively meet the power/energy requirements (e.g., to save battery life).

Fig. 6: The accuracy profiles of a 400-neuron network with reduced timesteps during training and inference phases, while considering different learning rules and datasets: (a) MNIST and (b) Fashion MNIST.
**Threshold potential (\(V_{th}\)):** We leverage \(V_{th}\) reduction to maintain accuracy for most of the timesteps by adjusting the gap between \(V_{th}\) and \(V_{reset}\), so that the neurons can have proportional and sufficient spiking (i.e., pre- and post-synaptic spikes) and learning activities for distinguishing different classes. To do this, _we propose to linearly scale down \(V_{th}\) from its original value considering the reduced timestep, as stated in Eq. 2._\(V_{th}^{0}\) and \(V_{th}^{1}\) are the threshold potentials for the original and the adjusted ones, respectively. \(V_{reset}\) is the reset potential, while \(T_{0}\) and \(T_{1}\) are the timesteps for the original and the adjusted ones, respectively.

\[V_{th}^{1}=V_{reset}+\left[\frac{T_{1}}{T_{0}}\cdot(V_{th}^{0}-V_{reset})\right] \tag{2}\]

**Refractory period (\(T_{ref}\)):** We leverage \(T_{ref}\) reduction to define the effective duration for a neuron to be unresponsive after generating spikes, so that the other neurons have a chance to process the input spikes and trigger the learning process. To do this, _we propose to proportionally decrease \(T_{ref}\) from its original value considering the reduced timestep, as stated in Eq. 3._\(T_{ref}^{0}\) and \(T_{ref}^{1}\) denote the refractory period for the original and the adjusted ones, respectively. In this manner, \(T_{ref}\) is set to a small value when the timestep is small, and vice versa. Furthermore, we also employ a ceiling function to discretize the refractory period into a timestep form and ensure that the minimum value of \(T_{ref}=1\).

\[T_{ref}^{1}=\left[\frac{T_{1}}{T_{0}}\cdot T_{ref}^{0}\right] \tag{3}\]

**Adaptation potential (\(\theta\)):** We keep \(\theta\) in the neural dynamics and carefully adjust its value so that the spiking and learning activities are increased while avoiding the domination of some neurons, thereby maintaining good accuracy. To do this, _we propose to linearly reduce \(\theta\) from its original value, as stated in Eq. 4._ Here, \(\theta_{0}\) and \(\theta_{1}\) are the adaptation potentials for the original and adjusted ones, respectively.

\[\theta_{1}=\frac{T_{1}}{T_{0}}\cdot\theta_{0} \tag{4}\]

### _Trade-Off Strategy for Accuracy, Latency, and Energy_

Sections III-A and III-B show that timestep reduction improves the latency and energy efficiency of SNN systems. However, at the same time, their accuracy may be degraded below the acceptable threshold. Hence, the accuracy level, latency, and energy consumption of SNN systems should meet the design constraints. It is especially important for applications that need adaptive adjustments at run time for better battery life, such as smart mobile agents/robots.

Toward this, _we propose a strategy to trade-off accuracy, latency, and energy consumption to meet the constraints (i.e., acceptable accuracy, acceptable latency, and energy budget)_. Our strategy is to quantify the trade-off benefit for a given model using our proposed multi-objective trade-off function in Eq. 5, which considers accuracy, latency, and energy consumption. \(S\) is the score of trade-off benefit, which is useful for design space exploration considering different trade-offs between accuracy, latency, and energy consumption. \(A\) is the accuracy and \(L_{n}\) is the normalized latency, i.e., the ratio between the latency after timestep reduction and the original latency. Meanwhile, \(E_{n}\) is the normalized energy, i.e., the ratio between the energy consumption after timestep reduction and the original one. \(\tau\) and \(\varepsilon\) are the adjustment factors for latency and energy consumption, respectively. The adjustment factor should be set higher than the others if the respective metric is more important than the others, and vice versa. Here, \(\tau\) and \(\varepsilon\) are the non-negative real numbers.

\[S=A-(\tau\cdot L_{n}+\varepsilon\cdot E_{n})\ \ \text{with}\ \ L_{n}=\frac{L_{1}}{L_{0}}\ \ \ \text{and}\ \ \ E_{n}=\frac{E_{1}}{E_{0}} \tag{5}\]

**The use of our TopSpark methodology in autonomous mobile agents:** The output of TopSpark is an optimized SNN model with enhanced parameters and optimized timestep, which can be employed directly for performing energy-efficient SNN inference on mobile agents/robots. If the mobile agents consider online learning for adapting to different operational environments, they can also employ the TopSparks' output model, since this model can be trained under reduced timestep settings. Furthermore, the mobile agents can adjust the timestep of SNN processing at run time to adaptively meet the power/energy requirements through TopSparks' parameter enhancements. In this manner, mobile agents/robots can save their battery life on-the-fly without significantly/noticeably sacrificing accuracy.

## IV Evaluation Methodology

To evaluate our TopSpark methodology, we use the same evaluation scenarios that are employed widely in the SNN community with the experimental setup shown in Fig. 8. We use a Poisson-based rate coding for converting data into spikes. We employ the fully-connected network architecture (as shown in Fig. 1) with a different number of neurons. For brevity, we consider the term M_n_ for an SNN model with _n_-number of neurons. We also employ different STDP-based learning rules, i.e., a pair-based weight-dependent STDP (STDP1) [10] and an adaptive learning rate-based STDP (STDP2) [8]. We consider the MNIST and Fashion MNIST datasets as the workloads. For each timestep setting, we perform both the training and inference phases. These experimental scenarios aim at highlighting the generality of TopSpark methodology. For comparison partners, we consider the original SNN models without timestep reduction as the _baseline_, and the SNNs with _direct_ timestep reduction technique. Furthermore, for both comparison partners, we consider the original parameter values from work of [10], as shown in Table I.

**Evaluation:** We employ Python-based simulations [19] which run on GPU machines (i.e., Nvidia GeForce RTX 2080 Ti) to evaluate the accuracy. Afterward, we leverage the simulation time to evaluate the latency. We also obtain the power consumption using the _nvidia-smi_ utility, following the approach used in work [20]. These recorded simulation time and operational power are then leveraged to estimate energy consumption in the training and inference phases.

## V Results and Discussion

### _Maintaining Accuracy_

Experimental results for the accuracy are provided in Fig. 9. In general, the direct timestep reduction technique achieves comparable accuracy profiles in large timesteps, but suffers from a significant degradation in small timesteps due to the loss of information (i.e., spikes) for maintaining the learning quality;

Fig. 8: Experimental setup for evaluating TopSpark methodology.
see 1. Meanwhile, our TopSpark achieves competitive accuracy profiles for all timestep settings across different learning rules and workloads, as shown in 1 and 2. For instance, if we consider an acceptable 2% accuracy loss from the baseline (i.e., original SNN without timestep reduction) for M400 with the MNIST, our TopSpark achieves the accuracy of 86% in timestep 30 (STDP1) and 90% in timestep 100 (STDP2). Meanwhile, the direct reduction technique achieves the accuracy of 85% in timestep 50 (STDP1) and 90% in timestep 150 (STDP2). If we need to save more battery life, we can further reduce the timestep while relaxing the accuracy constraint. For instance, TopSpark can achieve accuracy of 77% (STDP1) and 75% (STDP2) in timestep 10 for M400 with the MNIST, while the direct reduction technique achieves only accuracy of 52% (STDP1) and 14% (STDP2); see 1. The reason is that, our TopSpark employs parameter enhancements that proportionally scale down the values of neuron parameters to (1) make the neurons preserve the spiking and learning activities in large timesteps for maintaining high accuracy, and (2) increase the spiking and learning activities to compensate the loss of spikes for improving the learning quality in small timesteps and the accuracy.

### _Latency Improvements_

Fig. 10 shows the experimental results for latency. In general, the direct reduction technique and our TopSpark effectively reduce the processing latency as compared to the baseline, since they employ smaller timesteps. For instance, if we consider an acceptable 2% accuracy loss from the baseline for M400 with the MNIST, the direct reduction technique improves latency by 3.9x in training and 4.2x in inference for STDP1, and by 2.3x in training and inference for STDP2, as compared to the baseline. Meanwhile, our TopSpark can further improve latency by 10.8x in training and 10.9x in inference for STDP1, and by 2.5x in training and 3.5x in inference for STDP2, as compared to the baseline; see 1. In all experimental scenarios, our TopSpark improves latency by 3.9x on average across different network sizes, learning rules, workloads, and processing phases (i.e., training and inference). The reason is that, parameter enhancements in our TopSpark enable more timestep reduction while preserving the learning quality through appropriate spiking and learning activities.

### _Energy Efficiency Improvements_

The experimental results for energy consumption are provided in Fig. 10. The direct reduction technique and our TopSpark effectively improve the energy efficiency as compared to the baseline, since they have smaller latency and operational power. For instance, if we consider an acceptable 2% accuracy loss from the baseline for M400 with the MNIST, the direct reduction technique improves energy efficiency by 4x (STDP1) and by 2.3x (STDP2) in both the training

Fig. 10: Latency and energy consumption of SNNs during (a) training and (b) inference, considering different learning rules (STDP1 and STDP2), network sizes, timestep settings, and workloads. The experimental results for MNIST and Fashion MNIST are similar due to the same number and size of samples.

Fig. 9: Accuracy profiles of SNN models across different timestep settings, learning rules, and workloads: (a) MNIST and (b) Fashion MNIST.
and inference phases, as compared to the baseline. Meanwhile, our TopSpark further improves energy efficiency by 10x (STDP1) and by 2.5x-3.5x (STDP2) in both the training and inference phases, as compared to the baseline; see. In all experimental scenarios, our TopSpark improves energy efficiency by 3.5x (training) and by 3.3x (inference) on average across different network sizes, learning rules, and workloads. The reason is that, our TopSpark employs effective parameter enhancements that preserve the learning quality across different network sizes, timesteps, learning rules, workloads, and processing phases. Therefore, the reduced timesteps lead to reduced latency and operational power, and hence the energy consumption.

### _Design Trade-Offs_

Experimental results for design trade-offs are provided in Fig. 11. The results show that, we can set the adjustment factors to meet the design constraints. If we need to prioritize accuracy over the other metrics, then we may set \(\tau=0\) and \(\varepsilon=0\). As a result, the trade-off benefit leads to design points that achieve high accuracy as potential solutions, as pointed out by. If we set a higher priority to latency over the other metrics (e.g., \(\tau=10\) and \(\varepsilon=0\)), the trade-off benefit is shifted to a design point that has a significant timestep reduction; see. Similar results are observed if we set higher priority to energy consumption, as a significant timestep reduction also effectively improves energy efficiency; see. We also observe that, there may be a change of trade-off benefit when we change the adjustment factors (\(\tau\) and \(\varepsilon\)); see. The reason is that, when we prioritize one metric above the others, the benefit of the other metrics will decrease, and vice versa. These results also show that the SNN-based systems can employ our strategy to trade-off their accuracy, latency, and energy consumption.

The above results and discussion show that the TopSpark methodology is applicable for enabling energy-efficient SNNs with STDP-based learning rules in training and inference phases, across different timesteps, network sizes, and workloads, hence making it amenable to autonomous mobile agents/robots.

## VI Conclusion

We propose a novel TopSpark methodology that leverages adaptive timestep optimizations to enable energy-efficient SNNs via analysis of accuracy in different timesteps, parameter enhancements, and trade-offs for accuracy-latency-energy. Our TopSpark saves latency by 3.9x and energy consumption by 3.5x (training) and 3.3x (inference) on average, while keeping accuracy within 2% of SNNs without timestep reduction. Therefore, our work may enable low-latency and energy-efficient SNN training and inference for autonomous mobile agents/robots, including their efficient online learning process.
