Efficient nonlinear function approximation in analog resistive crossbars for recurrent neural networks

Junyi Yang, Ruibin Mao, Mingrui Jiang, Yichuan Cheng, Pao-Sheng Vincent Sun, Shuai Dong, Giacomo Pedretti, Xia Sheng, Jim Ignowski, Haoliang Li, Can Li, Arindam Basu

Abstract

Analog In-memory Computing (IMC) has demonstrated energy-efficient and low latency implementation of convolution and fully-connected layers in deep neural networks (DNN) by using physics for computing in parallel resistive memory arrays. However, recurrent neural networks (RNN) that are widely used for speech-recognition and natural language processing have tasted limited success with this approach. This can be attributed to the significant time and energy penalties incurred in implementing nonlinear activation functions that are abundant in such models. In this work, we experimentally demonstrate the implementation of a non-linear activation function integrated with a ramp analog-to-digital conversion (ADC) at the periphery of the memory to improve in-memory implementation of RNNs. Our approach uses an extra column of memristors to produce an appropriately pre-distorted ramp voltage such that the comparator output directly approximates the desired nonlinear function. We experimentally demonstrate programming different nonlinear functions using a memristive array and simulate its incorporation in RNNs to solve keyword spotting and language modelling tasks. Compared to other approaches, we demonstrate manifold increase in area-efficiency, energy-efficiency and throughput due to the in-memory, programmable ramp generator that removes digital processing overhead. © The Author(s) 2025.

The Recurrent Efficiency Bottleneck

Analog In-Memory Computing (IMC) excels at performing vector-matrix multiplication (VMM) with extreme speed and low power by leveraging the physical properties of resistive memory (memristor) arrays. While this has revolutionized feedforward networks, Recurrent Neural Networks (RNNs) like LSTMs present a unique challenge. RNNs are dense with non-linear activation functions (NLs) such as sigmoid and hyperbolic tangent.

In traditional IMC architectures, the analog VMM result must be converted to digital, processed by a separate digital unit to calculate the activation, and often buffered. This creates a massive bottleneck. As shown in the figure below, while IMC has boosted feedforward networks, a significant "efficiency gap" remains for RNNs because the time and energy spent on these digital NL operations can be 2–5x longer than the VMM itself.

The efficiency gap in throughput and energy efficiency between standard IMC and RNN implementations.

Integrated Non-Linear ADC (NL-ADC)

To address this, we introduce an in-memory NL-ADC technique. Instead of using a standard linear ramp voltage in a ramp-ADC, we utilize an extra column of memristors to generate a "pre-distorted" non-linear ramp.

  1. Inverse Mapping: We mathematically determine the inverse of the desired activation function (e.g., $f(t) = \text{sigmoid}^{-1}(t)$).
  2. Programmable Ramp: A dedicated column of memristors is programmed with specific conductances such that, when activated row-by-row, they produce a voltage ramp that follows this inverse function.
  3. Direct Computation: When the VMM result from the main array is compared against this non-linear ramp, the time at which the comparator flips directly represents the digitized value of the non-linear activation.

This effectively merges the "digitization" and "activation" steps into a single operation within the memory periphery, eliminating the need for external digital processors.

Comparison between traditional IMC pipelines and the proposed NL-ADC approach which integrates non-linear processing into the ADC.

Experimental Evaluation and Key Results

The system was evaluated on two primary tasks: the Google Speech Commands Dataset (GSCD) for keyword spotting (KWS) and the Penn Treebank (PTB) for character-level language modeling.

  • Efficiency Gains: For an LSTM layer, the NL-ADC achieved a ~9.9x improvement in area efficiency and a ~4.5x improvement in energy efficiency compared to conventional digital processing methods.
  • High Accuracy: On the KWS task, the hardware achieved 88.5% accuracy, closely matching the software baseline (91.6%) and outperforming previous memristive LSTM implementations.
  • Scalability: Simulations on the larger PTB dataset showed that the NL-ADC maintains software-equivalent accuracy even as the model size scales up to millions of parameters.
  • Intrinsic Robustness: Because the same type of memristive cells are used for both weights and ramp generation, the system is naturally robust to global variations like read voltage fluctuations.

Conclusion

By repurposing the ADC as a programmable non-linear computer, we demonstrate a path toward highly efficient RNN hardware. This approach provides significant area savings over traditional SRAM-based solutions and mitigates the digital processing overhead that has historically limited IMC for recurrent architectures. Future work will focus on expanding this method to non-monotonic functions and addressing memristor programming noise for higher precision applications.

Summary updated

BibTeX
@inproceedings{yang2025efficient,
  author = {Junyi Yang and Ruibin Mao and Mingrui Jiang and Yichuan Cheng and Pao-Sheng Vincent Sun and Shuai Dong and Giacomo Pedretti and Xia Sheng and Jim Ignowski and Haoliang Li and Can Li and Arindam Basu},
  title = {{Efficient nonlinear function approximation in analog resistive crossbars for recurrent neural networks}},
  booktitle = {Nature Communications},
  year = {2025},
  url = {https://openreview.net/forum?id=PGejX7RWuy},
}
Figure