# Analog Signal Processing Using Stochastic Magnets

###### Abstract

We present a low barrier magnet based compact hardware unit for analog stochastic neurons and demonstrate its use as a building-block for neuromorphic hardware. By coupling circular magnetic tunnel junctions (MTJs) with a CMOS based analog buffer, we show that these units can act as leaky-integrate-and fire (LIF) neurons, a model of biological neural networks particularly suited for temporal inferencing and pattern recognition. We demonstrate examples of temporal sequence learning, processing, and prediction tasks in real time, as a proof of concept demonstration of scalable and adaptive signal-processors. Efficient non von-Neumann hardware implementation of such processors can open up a pathway for integration of hardware based cognition in a wide variety of emerging systems such as IoT, industrial controls, bio- and photo-sensors, and Unmanned Autonomous Vehicles.

## I Introduction

Temporal inferencing and learning form the next frontier in the discipline of Artificial Intelligence. Development of hardware that can implement these tasks in-situ can revolutionize the rapidly emerging era of smart-sensors, self-driving automotives, Unmanned Autonomous Vehicles (UAVs), and the Internet of Things (IoTs) by opening a pathway for self-contained, energy-efficient, highly scalable, and secure machine intelligence. In this work we propose a hybrid unit consisting of a low-barrier magnet based tunnel-junction (MTJ) coupled with a conventional CMOS based analog buffer as a building block for neuromorphic hardware that is particularly suited for temporal learning based signal processing tasks.

MTJs lie at the heart of the Spin Transfer Torque based Magnetic Random Access Memory (STT-MRAM), a rapidly emerging commercial non-volatile memory technology, and can be built with semiconductor fabrication facilities available today Xie et al. (2017). The dynamics of our proposed hardware unit has a one-to-one mapping with the physical behavior of biological neurons, in particular stochastic leaky-integrate-and fire (LIF) neurons. We further show how networks assembled from these building-blocks can successfully learn and reproduce a chaotic signal by building temporal generative models, and work as adaptive filters by inverse modeling a communication channel with non-linear distortions.

The ultra-compact footprint of these building-blocks with built-in neuron like behavior enables the design of reconfigurable large scale analog neuromorphic hardware that is more energy-efficient and highly scalable compared to present day practice, where neural networks are emulated as software models on Boolean algebra based hardware typically in cloud, with its associated inefficiencies, as well as concerns with cybersecurity and high communication bandwidth consumption.

## Ii Stochastic Neural Network Nodes using Magnetic Tunnel Junctions

In magnets the state retention time is given by the Arrhenius relation Kent and Worledge (2015):

(1) |

For memory technology, the energy-barrier targeted for the MTJ free layer is at least , to maintain a high state retention ( years) with typical . The is determined by material properties such as saturation magnetization (), anisotropy field strength (), and geometrical volume (). However, in this work we use low energy-barrier magnets achieved by ultra-scaling Debashis et al. (2016) (fig. 1a) to enable fast dynamics in the reservoir and to leverage the built-in stochasticity provided by such magnets. In this case, the free layer magnetization stays randomized between the two energy minima states when no current is provided. A large spin-torque from a large driving input current biases towards one of its minima directions, as shown in fig. 1b. We can utilize this controllable stochastic behavior to build noisy hardware neurons, both analog and digital versions.

### ii.1 Analog and Binary Stochastic Neurons

#### ii.1.1 Analog Stochastic Neuron (ASN)

The core of the proposed hardware unit is a 1-MTJ 1-T in a pull-up, pull-down configuration as shown in fig. 1c. We then add a Wilson current mirror based analog buffer to this unit to generate a noisy analog output, while preventing any loading effects on the transfer characteristics of the unit from high fan-out at the output end. In this unit, the MTJ’s intrinsic resistance (, area , ), is chosen to be equal to the transistor resistance () in the linear mode, while the resistance is 0.2 times this value. When the input transistor is in saturation or cut-off mode, the voltage appearing at output (drawn from the drain on the transistor) is closer to or (where ) respectively due to high bias voltage. In the linear mode of operation, the output of the unit goes through intermediate voltages as shown in fig. 1d. The response is inherently noisy due to the thermal noise’s effect on the free layer magnetization as described before. Both the averaged signal and its upper and lower bounds show a (or logistic function) like excitation. The overall response of the unit can be modeled by the following equation:

(2) |

where the parameters depend on the particulars of device design. It can be be shown that a transistor’s turn off and turn on depends on the deposition of a critical amount of switching charge on the gate terminal of the transistor Datta, Diep, and Behin-Aein (2014); Ganguly, Camsari, and Datta (2016). This switching charge, in our design, is supplied by the net current from preceding neurons flowing in to the resistive-capacitive metallic interconnects and then into the gate capacitor, where it automatically gets weighted, summed, and integrated over time (). The use of a low-barrier magnet in this structure inherently introduces volatility due to thermal noise, resulting in leakiness of the input current integration. Therefore, this unit behaves as a stochastic leaky-integrate-and-fire (sLIF) neuron. Additionally, adjustment of barrier height of the magnets () allows for tuning the dynamical rates of sLIF neural networks built from this unit.

#### ii.1.2 Binary Stochastic Neuron (BSN or p-bit)

A binary stochastic neuron can be built from the same 1-MTJ 1-T unit. However, instead of a analog current mirror, we use a digital CMOS buffer (e.g. two cascaded NOT gates) as the output stage. This turns the output of the unit digital, i.e. is either or , probability of which is dictated by a law, unlike ASN whose response is continuous between and . The response of the BSN is shown in fig. 1d inset and given by:

(3) |

This BSN design, presented elsewhere and called “p-bit” Camsari, Salahuddin, and Datta (2017), has been used in a variety of optimization problems (see refs. Sutton et al. (2017); Camsari et al. (2017)). These two related but distinct units, ASN and BSN, could form building blocks for a variety of neural networks, depending on the behavioral requirements. Controllability of behavioral noise through device design and electrical control make these units particularly useful in cases where stochasticity is an integral feature Turchetti (2004) in the computation (e.g. stochastic gradient descentLeCun et al. (2012), Boltzmann machinesCoughlin and Baran (1995)).

It should be noted that it is possible to build even more compact versions of these stochastic neurons by leveraging emerging phenomena and devices such as Giant Spin Hall Effect or Magneto-Electric based switching (e.g. see Ganguly, Camsari, and Datta (2016) for a few example designs). However, such devices are still in their research phase and their integration into larger circuits is still an open problem.

## Iii Computing Using Dynamical States: Computing Model and Hardware Implementation

### iii.1 Reservoir Computing: A Short Overview

Reservoir Computers (RC) are models of biological neural networksDominey (1995); Pascanu and Jaeger (2011) that have been used for various signal processing tasks Jaeger and Haas (2004); Triefenbach et al. (2010); Jalalvand, Wallendael, and Walle (2015); Ganguly et al. (2018). In these networks, the computation is performed by a collection of randomly coupled non-linear units with recurrent network topology (fig. 2a). Such networks: (a) provide a huge expansion of the dynamical phase-space, increasing the distance between the signal-class centroids; and (b) give rise to memory states in the network LukoÅ¡eviÄius (2012) allowing a signal to be temporally correlated, resulting in better signal classification. The nodes of the network are leaky; therefore, the network memory is short term and fading - a feature critical to avoid overtraining.

RC Dynamics: Let be the collective state vector of the reservoir, be the input vector and the output vector. Also let be the matrices representing the synaptic connections between the input-reservoir, reservoir-reservoir, reservoir-output, and output-reservoir nodes respectively. The most general form of the RC dynamical equations is given by:

(4) | |||||

(5) |

Here and are system constants representing the leaking rate and the strength of the activation in the reservoir, is a non-linear function, usually , and is the noise. This dynamical equation is equivalent to a model for a network of stochastic LIF neurons whose synaptic strengths are given by the various matrices.

RC Learning: We use a weighted linear sum on for time-series pattern learning and classification. The only synaptic weights adjusted during the training are the reservoir-output connection which involves minimizing the norm: by finding the optimal (for example see Weiner-Hopf methodLukoÅ¡eviÄius (2012)) .

### iii.2 Reservoir Computer Hardware Implementation

The RC dynamical equation (eq. 4) on a discretized temporal grid equispaced by in normalized time units (i.e., the magnet’s dynamical time-scale ) and , can be written as follows:

(6) |

where denotes an additional factor of , and . Eq. 6 can be interpreted as describing a blackbox, whose output () is the sum of three terms: a) a transduction function given by a type nonlinear activation, b) “leaked” past state , where the leakiness arises from small state-retention times of ASN, c) noise inherent to the unit, both of which are naturally provided by the low-barrier magnets. The ASN’s electrical response directly corresponds with the behavior described by eq. 6 and therefore it can be used to build compact reservoir computing nodes. For hardware based reservoir computing proposals using other material systems please see Schrauwen et al. (2008); Kulkarni and Teuscher (2012); Larger et al. (2012); Van der Sande, Brunner, and Soriano (2017); Vandoorne et al. (2014); Torrejon et al. (2017); Du et al. (2017); Canaday, Griffith, and Gauthier (2018); Opala et al. (2018); Prychynenko et al. (2018).

### iii.3 Programmable Hardware Synapses

A fully hardware based neural network necessitates that the physical interconnections or synaptic-weights be controllable in strength. In the presented hardware unit, the input signal is the net current flowing in the unit, while the output signal is the resulting voltage level. Therefore a resistor network can implement the synaptic weighing using Kirchoff’s current law at each neuron’s input, i.e. , where interconnect conductances ’s are proportional to synaptic weights of the interconnection with other neurons (fig. 2b). Optionally, a small p-n junction diode can be introduced to ensure uni-directionality of current flow within the synaptic network with an added circuit cost of adjusting bias voltage ranges, since ASN and BSN require bipolar voltage range for operation.

These programmable resistor networks could be implemented using a MOSFET in linear mode, whose channel resistance is controlled by the gate voltage. Compact memristor cross-bar arrays Jo et al. (2010); Kim et al. (2012) might be even better suited for this task since memristors are non-volatile and therefore more energy efficient than transistor networks.

## Iv Signal Processing Using Analog Stochastic Neuron (ASN) networks

### iv.1 Chaotic Time-Series Predictor

The Mackey-Glass (MG) equationMackey and Glass (1977) is a time series generator with periodic but subtly chaotic characteristics. The generating equation is given by:

(7) |

We train our ASN network to generate an MG system with a chaotic datastream for training, and then tested it on a test signal from the same generator. The ASN learns to reproduce the generator signal purely from its previously self-generated output. We found that for small number of nodes, the network fails to match the MG signal, but starts to generate better match for larger networks (see highlighted areas in fig. 3). This happens because of the substantially richer dynamics and phase-space volume possible in a larger network.

This task illustrates the possibility of creating temporal sequence-predictors and temporal auto-encoders using ASNs. Such temporal predictors and auto-encoders can find applications in temporal data modeling and reconstruction, and early-warning systems in bio-physical signal monitors by distinguishing out-of-the-norm patterns and beats, such as cardiac arrhythmia and seizures.

### iv.2 Filtering Using Learning

We now demonstrate a task at the heart of signal processing and digital wireless communication, i.e. signal filtering and channel equalization. The task is to recover a bitstream after it passes through a medium or channel that introduces non-linear distortions, inter-symbol interference, and noise which cannot be fully compensated using a linear filter Diniz (2013). The principal idea behind our implementation of channel equalizer is to use an ASN network to reverse the effect of the channel, by learning the inverse of the underlying model of the channel’s transfer function.

Let be the original signal which goes through a channel (fig.4.a.) whose transfer function produces and is given by:

(8) |

The function asymmetrically and non-linearly amplifies , introduces phase distortions, inter-symbol interference, as well as a random noise to generate . We train the network the function , so that it can recover from . After training, we test the network and find that for even small size networks (), the signal can be extracted with high fidelity from severely distorted signals (Fig. 4b). In the presented simulation, the Symbol Recovery Rate () was . From multiple simulations on a wide variety of models for , we have found the to lie in the range. More complex filter designs with stacked networks may help increase the performance of such filters.

This task shows the possibility of building highly compact and energy-efficient dynamically trainable neuro-adaptive filters using ASNs. Such filters can find wide applications in SWaP (size-weight-and-power) constrained environments such as IoT, sensor networks, and self-driving automotives and UAVs.

## Acknowledgment

This work was partially supported by the NSF I/UCRC on Multi-functional Integrated System Technology (MIST) Center IIP-1439644, IIP-1738752 and IIP-1439680.

## References

- Xie et al. (2017) Y. Xie, J. Ma, S. Ganguly and A. W. Ghosh, Journal of Computational Electronics 16, 1201–1226 (2017) .
- Kent and Worledge (2015) A. D. Kent and D. C. Worledge, Nature Nanotechnology (2015), 10.1038/nnano.2015.24.
- Debashis et al. (2016) P. Debashis, R. Faria, K. Y. Camsari, J. Appenzeller, S. Datta, and Z. Chen, in Electron Devices Meeting (IEDM), 2016 IEEE International (IEEE, 2016) pp. 34–3.
- Datta, Diep, and Behin-Aein (2014) S. Datta, V. Q. Diep, and B. Behin-Aein, arXiv:1404.2254 [cond-mat] (2014), arXiv: 1404.2254.
- Ganguly, Camsari, and Datta (2016) S. Ganguly, K. Y. Camsari, and S. Datta, IEEE Journal on Exploratory Solid-State Computational Devices and Circuits 2, 51 (2016).
- Camsari, Salahuddin, and Datta (2017) K. Y. Camsari, S. Salahuddin, and S. Datta, IEEE Electron Device Letters 38, 1767 (2017).
- Sutton et al. (2017) B. Sutton, K. Y. Camsari, B. Behin-Aein, and S. Datta, Scientific Reports 7, 44370 (2017).
- Camsari et al. (2017) K. Y. Camsari, R. Faria, B. M. Sutton, and S. Datta, Physical Review X 7, 031014 (2017).
- Turchetti (2004) C. Turchetti, Stochastic Models of Neural Networks (IOS Press, 2004) .
- LeCun et al. (2012) Y. A. LeCun, L. Bottou, G. B. Orr, and K.-R. MÃ¼ller, in Neural Networks: Tricks of the Trade: Second Edition, Lecture Notes in Computer Science, edited by G. Montavon, G. B. Orr, and K.-R. MÃ¼ller (Springer Berlin Heidelberg, Berlin, Heidelberg, 2012) pp. 9–48.
- Coughlin and Baran (1995) J. P. Coughlin and R. H. Baran, Neural Computation in Hopfield Networks and Boltzmann Machines (University of Delaware Press, 1995).
- Dominey (1995) P. F. Dominey, Biological cybernetics 73, 265 (1995).
- Pascanu and Jaeger (2011) R. Pascanu and H. Jaeger, Neural networks 24, 199 (2011).
- Jaeger and Haas (2004) H. Jaeger and H. Haas, Science (New York, N.Y.) 304, 78 (2004).
- Triefenbach et al. (2010) F. Triefenbach, A. Jalalvand, B. Schrauwen, and J.-P. Martens, in Advances in neural information processing systems (2010) pp. 2307–2315.
- Jalalvand, Wallendael, and Walle (2015) A. Jalalvand, G. V. Wallendael, and R. V. D. Walle, in 2015 7th International Conference on Computational Intelligence, Communication Systems and Networks (2015) pp. 146–151.
- Ganguly et al. (2018) S. Ganguly, Y. Gu, M. R. Stan, and A. W. Ghosh, in Image Sensing Technologies: Materials, Devices, Systems, and Applications V, Vol. 10656 (International Society for Optics and Photonics, 2018) p. 106560Z.
- LukoÅ¡eviÄius (2012) M. LukoÅ¡eviÄius, in Neural networks: tricks of the trade (Springer, 2012) pp. 659–686.
- Schrauwen et al. (2008) B. Schrauwen, M. DâHaene, D. Verstraeten, and J. Van Campenhout, Neural networks 21, 511 (2008).
- Kulkarni and Teuscher (2012) M. S. Kulkarni and C. Teuscher, in Nanoscale Architectures (NANOARCH), 2012 IEEE/ACM International Symposium on (IEEE, 2012) pp. 226–232.
- Larger et al. (2012) L. Larger, M. C. Soriano, D. Brunner, L. Appeltant, J. M. Gutierrez, L. Pesquera, C. R. Mirasso, and I. Fischer, Optics Express 20, 3241 (2012).
- Van der Sande, Brunner, and Soriano (2017) G. Van der Sande, D. Brunner, and M. C. Soriano, Nanophotonics 6, 561 (2017).
- Vandoorne et al. (2014) K. Vandoorne, P. Mechet, T. Van Vaerenbergh, M. Fiers, G. Morthier, D. Verstraeten, B. Schrauwen, J. Dambre, and P. Bienstman, Nature communications 5 (2014).
- Torrejon et al. (2017) J. Torrejon, M. Riou, F. A. Araujo, S. Tsunegi, G. Khalsa, D. Querlioz, P. Bortolotti, V. Cros, K. Yakushiji, A. Fukushima, H. Kubota, S. Yuasa, M. D. Stiles, and J. Grollier, Nature 547, 428 (2017).
- Du et al. (2017) C. Du, F. Cai, M. A. Zidan, W. Ma, S. H. Lee, and W. D. Lu, Nature Communications 8, 2204 (2017).
- Canaday, Griffith, and Gauthier (2018) D. Canaday, A. Griffith, and D. Gauthier, arXiv:1807.07627 [cs, stat] (2018), arXiv: 1807.07627.
- Opala et al. (2018) A. Opala, S. Ghosh, T. C. H. Liew, and M. Matuszewski, arXiv:1808.05135 [cond-mat] (2018), arXiv: 1808.05135.
- Prychynenko et al. (2018) D. Prychynenko, M. Sitte, K. Litzius, B. KrÃ¼ger, G. Bourianoff, M. KlÃ¤ui, J. Sinova, and K. Everschor-Sitte, Physical Review Applied 9, 014034 (2018).
- Jo et al. (2010) S. H. Jo, T. Chang, I. Ebong, B. B. Bhadviya, P. Mazumder, and W. Lu, Nano Letters 10, 1297 (2010).
- Kim et al. (2012) K.-H. Kim, S. Gaba, D. Wheeler, J. M. Cruz-Albrecht, T. Hussain, N. Srinivasa, and W. Lu, Nano Letters 12, 389 (2012).
- Mackey and Glass (1977) M. C. Mackey and L. Glass, Science 197, 287 (1977).
- Diniz (2013) P. S. R. Diniz, in Adaptive Filtering: Algorithms and Practical Implementation, edited by P. S. R. Diniz (Springer US, Boston, MA, 2013) pp. 467–499.