Skip to main content
QUICK REVIEW

[Paper Review] SNNLP: Energy-Efficient Natural Language Processing Using Spiking Neural Networks

R. Knipper, Kaniz Mishty|arXiv (Cornell University)|Jan 31, 2024
Advanced Memory and Neural ComputingEngineering3 citations
TL;DR

This paper proposes SNNLP, a novel spike-based encoding method for natural language processing using spiking neural networks (SNNs), achieving 13% higher accuracy than Poisson rate-coding on sentiment analysis tasks. It demonstrates up to 60x energy savings during training and 32x during inference compared to traditional ANNs, while maintaining competitive performance with a latency reduction of 3.7x to 7x.

ABSTRACT

As spiking neural networks receive more attention, we look toward applications of this computing paradigm in fields other than computer vision and signal processing. One major field, underexplored in the neuromorphic setting, is Natural Language Processing (NLP), where most state-of-the-art solutions still heavily rely on resource-consuming and power-hungry traditional deep learning architectures. Therefore, it is compelling to design NLP models for neuromorphic architectures due to their low energy requirements, with the additional benefit of a more human-brain-like operating model for processing information. However, one of the biggest issues with bringing NLP to the neuromorphic setting is in properly encoding text into a spike train so that it can be seamlessly handled by both current and future SNN architectures. In this paper, we compare various methods of encoding text as spikes and assess each method's performance in an associated SNN on a downstream NLP task, namely, sentiment analysis. Furthermore, we go on to propose a new method of encoding text as spikes that outperforms a widely-used rate-coding technique, Poisson rate-coding, by around 13\% on our benchmark NLP tasks. Subsequently, we demonstrate the energy efficiency of SNNs implemented in hardware for the sentiment analysis task compared to traditional deep neural networks, observing an energy efficiency increase of more than 32x during inference and 60x during training while incurring the expected energy-performance tradeoff.

Motivation & Objective

  • To explore the viability of spiking neural networks (SNNs) for natural language processing (NLP) tasks.
  • To address the challenge of encoding text into spike trains for neuromorphic hardware.
  • To compare various encoding techniques for SNNs in NLP, focusing on accuracy, energy efficiency, and latency.
  • To demonstrate that SNNs can achieve competitive performance with traditional deep learning models while significantly reducing energy consumption.

Proposed method

  • Proposes a deterministic rate-coding method for converting word embeddings into spike trains, improving upon stochastic Poisson rate-coding.
  • Employs a time-continuous SNN architecture that processes sequential text data using binary spike trains.
  • Uses a fixed inference window size (50ms) for evaluation, with ablation studies on window sizes from 10ms to 100ms.
  • Applies SNNs to two benchmark NLP tasks: IMDb 2-class sentiment classification and Twitter Emotion 6-class classification.
  • Implements energy modeling to compare SNNs with traditional ANNs during both training and inference.
  • Validates results on hardware platforms to measure real-world energy efficiency and latency.
Figure 1: Overall encoding/training pipeline for both SNN and ANN. Text gets encoded into a continuous representation, converted into a spike train (for SNN usage), and sent to the downstream neural network for training/testing. During training/testing, operation counts are recorded so we can calcul
Figure 1: Overall encoding/training pipeline for both SNN and ANN. Text gets encoded into a continuous representation, converted into a spike train (for SNN usage), and sent to the downstream neural network for training/testing. During training/testing, operation counts are recorded so we can calcul

Experimental results

Research questions

  • RQ1Which encoding method—binary embedding or rate-coding—performs better in SNN-based NLP tasks?
  • RQ2Does deterministic rate-coding improve accuracy over stochastic (Poisson) rate-coding in SNNs for NLP?
  • RQ3Is the expected energy-accuracy tradeoff observed in SNNs for NLP tasks, as seen in prior SNN literature?
  • RQ4To what extent can SNN inference latency be reduced while maintaining competitive performance compared to ANNs?

Key findings

  • The proposed deterministic rate-coding method outperforms Poisson rate-coding by approximately 13% in accuracy on benchmark NLP tasks.
  • SNNs achieve up to 32x energy efficiency gain during inference and 60x during training compared to traditional ANNs.
  • The performance gap between SNNs and ANNs is narrowed to less than 5% accuracy when using the proposed encoding method.
  • SNN inference latency is reduced to 3.7x to 7x that of ANNs, with a performance drop of about 7–10%, representing a favorable tradeoff.
  • The energy-accuracy tradeoff observed in prior SNN research is confirmed in the context of NLP tasks.
  • The study demonstrates that SNNs are viable for NLP with competitive performance and substantial energy savings, especially in low-power environments.
Figure 2: Illustrated “Self-Accumulate-and-Fire” (SAF) neuron. Takes in a floating-point value and self-accumulates it over time, spiking similarly to a standard LIF neuron.
Figure 2: Illustrated “Self-Accumulate-and-Fire” (SAF) neuron. Takes in a floating-point value and self-accumulates it over time, spiking similarly to a standard LIF neuron.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.