Deep Learning-Based Decoding of Linear Block Codes for Spin-Torque Transfer Magnetic Random Access Memory (STT-MRAM)
Abstract
Thanks to its superior features of fast read/write speed and low power consumption, spin-torque transfer magnetic random access memory (STT-MRAM) has become a promising non-volatile memory (NVM) technology that is suitable for many applications. However, the reliability of STT-MRAM is seriously affected by the variation of the memory fabrication process and the working temperature, and the later will lead to an unknown offset of the channel. Hence, there is a pressing need to develop more effective error correction coding techniques to tackle these imperfections and improve the reliability of STT-MRAM. In this work, we propose, for the first time, the application of deep-learning (DL) based algorithms and techniques to improve the decoding performance of linear block codes with short codeword lengths for STT-MRAM. We formulate the belief propagation (BP) decoding of linear block code as a neural network (NN), and propose a novel neural normalized-offset reliability-based min-sum (NNORB-MS) decoding algorithm. We successfully apply our proposed decoding algorithm to the STT-MRAM channel through channel symmetrization to overcome the channel asymmetry. We also propose an NN based soft information generation method (SIGM) to take into account the unknown offset of the channel. Simulation results demonstrate that our proposed NNORB-MS decoding algorithm can achieve significant performance gain over both the hard-decision decoding (HDD) and the regular reliability-based min-sum (RB-MS) decoding algorithm, for cases without and with the unknown channel offset. Moreover, the decoder structure and time complexity of the NNORB-MS algorithm remain similar to those of the regular RB-MS algorithm.
Index Terms:
Spin-torque transfer magnetic random access memory (STT-MRAM), deep learning (DL), linear block code, reliable-based min-sum (RB-MS) decoding.I Introduction
Spin-torque transfer magnetic random access memory (STT-MRAM) is an advanced non-volatile memory (NVM) technology with high endurance, fast read/write access time, and low switching energy [1]. However, process variation and thermal fluctuation lead to widened distributions of the low and high resistance states of STT-MRAM and their overlapping, and hence the memory sensing errors [2]. Furthermore, the increase of temperature will also cause the high resistance to decrease, while the low resistance remains unchanged [3], leading to a channel offset unknown during the readback process and a degradation of the error rate performance.
To be compatible with the fast read/write speed of STT-MRAM, error correction codes (ECCs) with short codeword lengths of less than a few hundred bits are employed. A (71,64) Hamming code with single-error correction capabilities is used for Everspin’s 16Mb MRAM [4]. To further improve the memory storage density, multiple-error-correcting Bose-Chaudhuri-Hoquenghem (BCH) codes are proposed [5]. However, so far both the Hamming codes and BCH codes are decoded using hard-decision decoding (HDD) through the standard bounded distance decoders [6]. The regular soft-decision decoding (SDD) decoders for these codes are the standard belief propagation (BP) decoders [6], such as the sum and product algorithm (SPA) based decoder, the min-sum (MS) decoder, and the reliability-based min-sum (RB-MS) decoder [7], which are performed over the Tanner graph of the codes. They provide little to no performance gain over the HDD decoders for short codes.
To tackle the variation of the STT-MRAM channel such as the unknown channel offset caused by the temperature change, the state of the art approach is to introduce reference cells with known data to the memory array to estimate the channel dynamically [8]. However, a frequent insertion of reference cells will lead to a high redundancy and hence degrade the information storage efficiency. Furthermore, the reference cell itself may also suffer from the non-uniformity issue caused by fabrication imperfection which may affect the accuracy of channel estimation.
On the other hand, in recent years, the deep learning (DL) techniques have achieved great success in many areas, such as speech recognition and image processing [9]. It has also been shown that DL methods [10, 11] can be used to improve the performance of standard SDD decoders, for high-density and short algebraic codes. However, in these works, the channel must be symmetric to ensure that the decoding error rate is independent of the transmitted codeword, otherwise the neural network (NN)-based decoder cannot be trained using a single codeword [10, 11]. Besides that, to the best of our knowledge, no work has been reported on DL-based channel decoding for STT-MRAM.
In this work, we propose novel DL-based algorithms to improve the decoding performance of linear block codes with short codeword lengths for STT-MRAM. A prerequisite for NN-based decoding is that the channel must be symmetric while the STT-MRAM channel is asymmetric by nature. Therefore, we adopt an independent and identically distributed (i.i.d.) channel adapter [12] to ‘symmetrize’ the STT-MRAM channel, and hence only the all-zero codeword is needed during the training of the NN decoder. Another obstacle for applying SDD is that it is difficult to obtain the channel soft information in the presence of the unknown channel offset. In this work, we present a novel NN-based soft information generation method (SIGM), which can estimate the channel soft information by using a few bits of uniform quantization. It only needs to be activated when the ECC decoder fails, and hence avoids a significant increase of the read latency and power consumption. We further formulate the BP decoding as a NN, and propose a novel neural normalized-offset reliability-based min-sum (NNORB-MS) decoding algorithm. We demonstrate that it can significantly outperform both the HDD and the regular RB-MS algorithm [7], for cases without and with the unknown channel offset. Moreover, the decoder structure and time complexity of the NNORB-MS algorithm remain similar to those of the regular RB-MS algorithm.
The rest of the paper is organized as follows. In Section II, we describe the STT-MRAM channel model and its symmetrization. In Section III, we present a novel NN-based SIGM which can estimate the channel soft information without the prior knowledge of the channel. A NNORB-MS algorithm for the STT-MRAM channel is proposed in Section IV and the simulation results are illustrated in Section V. Finally, Section VI concludes the paper.
II System Modeling
II-A STT-MRAM Channel Model
An STT-MRAM cell consists of a magnetic tunneling junction (MTJ) as the data storage element and an nMOS transistor as the access control device. The MTJ has a tunneling oxide layer sandwiched between a free layer and a reference layer. While the magnetization direction of the free layer can be switched by passing write currents of different directions through the MTJ, that of the reference layer is always fixed. When the magnetization direction of the free layer is different from that of the reference layer, the MTJ has a high resistance, which can be used to denote a binary input bit ‘1’. Otherwise if the magnetization direction of the free layer is the same as that of the reference layer, the MTJ has a low resistance, which can be used to denote an input bit ‘0’.
It has been widely observed that the reliability of data stored in the STT-MRAM cell is affected by the process imperfection, which causes variations of both the MTJ geometry and the nMOS transistor size, leading to widened distributions of the two resistance states and their overlapping [2, 13]. Moreover, the working temperature also affects the resistance distributions of STT-MRAM. It has been found that with the increase of the temperature, the high resistance decreases, while the low resistance remains almost the same [3]. The probability density functions (PDFs) of the resistances for STT-MRAM are shown in Fig. 1. Based on the stochastic characteristics of the two resistance states and by following [14], the vector of resistances read back from the STT-MRAM cell can be modeled as
(1) |
where are the nominal resistance values of the memory cells that store the user data bits , , , and is the length of the linear block code. Thus, for , and for . The noise vector in (1) accounts for the variations of the resistances and caused by process imperfection, with being i.i.d. with a zero-mean and a variance of , . Note that the distribution of can be non-Gaussian. Furthermore, denotes the unknown offset caused by the temperature change . The offset only occurs with the high resistance state when , and for . Moreover, as STT-MRAM suffers from the process variation induced variations of the access transistor size and the magnetic tunneling junction geometry, the influence of temperature on each memory cell is random. Hence we assume that the offset associated with is i.i.d, and it follows a Gaussian distribution with a mean of and standard deviation of .
We remark that although there are papers in the literature investigated the thermal impact on STT-MRAM theoretically or experimentally [3], due to the complication of memory physics, it is difficult to predict the offset over different temperatures accurately. Hence the actual amount of the offset is unknown to the channel detector and decoder. The channel model of (1) is only used to carry out channel simulations and to generate data for training and testing the NN based detector and decoder, since it is difficult to obtain the practical data of STT-MRAM.

II-B Symmetrization of the STT-MRAM Channel
The error rate performance of the standard SDD decoders can be improved by using the recently proposed NN-based decoders [10, 11]. The corresponding decoding algorithms satisfy the message passing symmetry conditions, and their error rates are independent of the transmitted codeword when transmitting over a binary memoryless symmetric channel [6]. As a result, it is sufficient to train the NN decoder using a single codeword (e.g. the all-zero codeword), thus avoiding the curse of dimensionality for NN-based decoding [10, 11].
A binary-input channel is symmetric if , with and being the output and input of the channel, respectively [12]. The STT-MRAM channel is obviously asymmetric. In this work, we adopt an i.i.d. channel adapter [12] to force the STT-MRAM channel to be symmetric. It mainly involves the following steps. In the first step, generate binary symbols from an i.i.d. source with equiprobable distribution. After that, these symbols are mod-2 added with the channel input bits and transmitted over the channel. At the receiver, adopt a sign adjuster which performs the operation , with being the log-likelihood ratio (LLR) of the channel output bits, being the input of the SDD decoder, respectively. The generation of channel soft information will be discussed in the next section. It can be proved that the newly augmented channel with input bit and output bit is a binary-input symmetric channel [12], and hence the original STT-MRAM channel is transformed into a ‘symmetrized channel’ .
III A NN-based Soft Information Generation Method
The accuracy of the channel soft information sent to the decoder will significantly affect the decoding performance. For the STT-MRAM channel with unknown offset, it is difficult to derive the channel soft information directly. Although signals read back from reference cells can be used to estimate the mean of the offset , the accuracy of soft information will still degrade since the variance of cannot be taken into account. In this work, we propose a novel NN-based SIGM, which can accurately estimate the channel soft information of the STT-MRAM channel in the presence of unknown channel offset.
Since more errors will occur near the overlapping region of the PDFs of the two resistance states, quantization should be concentrated around this region. In the presence of unknown channel offset, our key idea is to first use the outputs of an NN-based detector developed by [14] to find an appropriate hard detection threshold of the channel, which indicates the center of the overlapping region of the two resistance states. Optimum boundaries of a multiple-bit quantizer for SDD can then be determined subsequently.
To determine an appropriate hard detection threshold for the STT-MRAM channel with unknown channel offset, we follow the approach presented in [14]. That is, we first develop an recurrent neural network (RNN) based channel detector, which can achieve better error rate performance than the multilayer perceptron (MLP) detector with smaller size of training data. The details of the RNN structure can be found in [14]. The inputs to the NN are the resistance values y read back from the memory cells, and the outputs of the NN are the soft estimates of the binary bit sequence x stored in the memory array. We can obtain the hard estimation of x based on the following hard decision rule: if , ; otherwise . Moreover, with an assumed detection threshold , we can get the hard estimation for a given y. Therefore, an adjusted detection threshold can be obtained by searching for a threshold that minimizes the Hamming distance between and .
Once we obtain the adjusted detection threshold using the RNN detector presented by [14], we propose the following scheme to further design a multiple-bit quantizer that can generate the channel log likelihood ratios (LLRs) for SDD. As shown by Fig. 2, with and , , and , we define a quantizer that uniformly divides the quantization range into quantization intervals, with being the number of quantization levels, being the total number of the quantization bits, respectively. Next, to facilitate the usage of reliability-based soft-decision decoders, we set the LLR of the channel received bit to be the integer index of the quantization region that the corresponding channel readback signal falls in. Furthermore, if the quantization region is closer to , it is more difficult to differentiate between ‘0’ and ‘1’; while as the quantization region is getting away from , we are more likely to distinguish between ‘0’ and 1’. Based on these observations, the quantization index of the -th quantization interval is set to be , for .
In this way, the LLRs of the channel received bits can be determined for given values of and . To determine the optimum values of and , we adopt a computer exhaustive search approach to tune and such that the corresponding LLRs generated lead to the best error rate performance of the RB-MS decoder. Simulation results show that by using only a bits quantizer, we can achieve decoding performance similar to that with the full channel soft information (i.e. ). We have also explored the non-uniform quantizer within the quantization range , and found that its performance gain over the uniform quantizer is negligible. Note that the above proposed NN-based SIGM only needs to be activated when the ECC decoder fails and can be terminated once the updated quantizer is determined, and hence it avoids a significant increase of the read latency and power consumption compared to the case of applying the NN-based SIGM for every input data block. Note also that the LLRs generated by the proposed NN-based SIGM can be used by any SDD decoders, including the RB-MS and the NNORB-MS decoders that will be discussed in the next section.

IV NNORB-MS Algorithm for STT-MRAM
The RB-MS algorithm [7] takes the integer index of the quantization interval that the received signal falls in as the channel LLR for decoding. It requires only integer and logic operations, and hence has a lower computational complexity and can meet the low latency requirement of STT-MRAM. In this work, we first set-up a trellis that corresponds to an NN to represent the regular RB-MS decoding with full iterations instead of using the conventional Tanner graph. For an ECC of length bits, the input layer of the trellis is a vector of size , consisting of the LLRs of the channel output bits generated by the NN-based SIGM described in the previous section. The nodes in the hidden layer correspond to edges in the Tanner graph, and the associated processing elements carry out the check nodes (CNs) and variable nodes (VNs) operations for decoding. The output layer has processing elements that output the decoded codeword.
We further propose a novel NNORB-MS algorithm to improve the decoding performance of ECCs with short codeword lengths for STT-MRAM. In particular, we introduce two decoding parameters to the RB-MS algorithm, namely the offset for edge connecting the -th CN to the -th VN and the normalization factor for the -th VN. These parameters can correct the amplified magnitude of the message introduced by the MS algorithm, and also compensate for the small cycles of the short linear block codes. We propose to set these two key decoding parameters as the learnable weights of the NN. Through the training of the NN, we can obtain the optimum values of and that lead to the best error rate performance of decoding. Except for the introduction of and , the corresponding operations of the NNORB-MS algorithm at the CN and VN are similar to those of the RB-MS algorithm, which are summarized as follows.
(a) Check-node update:
(2) |
where is the message from the -th CN to the -th VN at the -th iteration, is the set of VNs connected to CNs excluding the -th VN, and denotes the offset to be learned from the NN. Here, is a “rectifier” activation function [11] that can prevent the subtraction in (2) from flipping the sign of the message. In (2), is the input message from the -th VN to the -th CN for the previous -th iteration, given by:
(3) |
where is the a posteriori integer information for iteration and denotes the input message from the -th CN to -th VN for the -th iteration.
(b) Variable-Node update:
(4) |
where represents the message from the -th VN for iteration , is a priori information of bit , denotes the normalization factor to be learned from the NN, is the set of CNs connected to VNs, and is the operation of rounding the number inside the bracket to the closest integer.
(c) Generation of soft version of the hard decision:
(5) |
where is a sigmoid function that enables the cross-entropy loss function and multiloss function to be used in the training process of the NN. Finally, after the complete NN processing, the decoded bits can be derived as the simple hard decisions.
In our experiments, we adopt an RNN structure, as we found that it can reduce the total number of NN parameters. By applying the deep unfolding technique [15], the RNN is chosen to have 10 hidden layers corresponding to 5 full decoding iterations. The NN is trained according to the Adam update rule [10, 11] with a learning rate of 0.01 and 10000 minibatches of 100 codewords each. Due to the symmetrization of the STT-MRAM channel described by Section II.B, only the all-zero codeword is used for training. We also reduce the training set by just collecting the data around a given resistance spread level . In this way the structure and time complexity of our proposed NNORB-MS decoder after training are similar to those of the regular RB-MS decoder, and the decoding also only involves integer/logic operations.
V Simulation Results
The system parameters for our simulations are taken from [16], with and . We further assume according to the features of the memory fabrication process. We vary the resistance spread (and hence ), the mean , and the normalized spread of the unknown channel offset, to account for the influence of different process variations and the change of temperature. In our experiments, we implement and train the NNORB-MS algorithm by using the Tensorflow library and an NVIDIA Tesla K40c GPU. Moreover, the (71,64) Hamming code [4] is used to validate our proposed decoder.

For the case without channel offset, Fig. 3 shows that at bit error rate (BER) of , our proposed NNORB-MS decoder () outperforms the HDD () and the regular RB-MS decoder () by by and , respectively, in terms of the maximum affordable resistance spread .
Next, we investigate the cases of the channel with unknown offset. Fig. 4 and Fig. 5 illustrate the performance that the channel has an offset with a fixed mean of , and different variations of of and , respectively. In both figures, we observe that the BERs of is poor even with the NNORB-MS decoder, if the decoder is trained and tested using the soft information without taking into account the channel offset (i.e. the decoder only knows the original channel without offset). By using the reference cell [8] scheme, the approximate mean value of the channel offset can be obtained from the readback signals of the reference cells and used in the calculation of channel soft information. However, both figures show that the BER improvement with the reference cell scheme (i.e. ) is very limited since the variance of the channel offset has not been taken into account. On the other hand, by using our proposed NN-based SIGM, accurate channel soft information can be generated. Fig. 4 and Fig. 5 show that the NNORB-MS decoder trained and tested using the SIGM ( ) significantly outperform and , and approaches the performance of where the decoder is trained and tested by assuming the full knowledge of the channel with offset is available (which is an ideal case and not practical). For this ideal case, we derive the corresponding channel soft information by using the quantization scheme presented in [17]. The NNORB-MS decoder also provides an obvious BER gain over the HDD () and the regular RB-MS decoder ( ), whose inputs are also generated for the ideal case that the full knowledge of the channel is available. The NNORB-MS decoder outperforms the RB-MS decoder using the soft information generated by the NN-based SIGM () as well. This demonstrates thoroughly the potential of our proposed NNORB-MS decoding for improving the reliability of STT-MRAM.


VI Conclusions
We have developed novel DL-based algorithms and techniques to improve the decoding performance of linear block codes for STT-MRAM. Since the STT-MRAM channel is asymmetric, we have first symmetrized the channel using an i.i.d. channel adapter so that only the all-zero codeword is needed for training the NN decoder. In view of the unknown offset of the channel caused by the temperature change, we have presented a novel NN-based SIGM to estimate the channel soft information without any prior knowledge of the channel. We have further proposed a novel NNORB-MS algorithm for decoding short linear block codes. We have demonstrated that it can significantly outperform both the HDD and the regular RB-MS algorithms over the STT-MRAM channel, with similar decoder structure and time complexity of the regular RB-MS decoder.
Acknowledgement
This work is supported by Singapore Ministry of Education Academic Research Fund Tier 2 MOE2016-T2-2-054 and RIE2020 Advanced Manufacturing and Engineering (AME) programmatic grant A18A6b0057.
References
- [1] S. Yu and P.-Y. Chen, “Emerging memory technologies: Recent trends and prospects,” IEEE Solid State Circuits Mag., vol. 8, no. 2, pp. 43–56, 2016.
- [2] K. Cai, Z. Qin, and B. Chen, “Channel capacity and soft-decision decoding of LDPC codes for spin-torque transfer magnetic random access memory (STT-MRAM),” J. Commun., vol. 8, no. 4, pp. 225–232, 2016.
- [3] B. Wu, Y. Cheng, J. Yang, A. Todri-Sanial, and W. Zhao, “Temperature impact analysis and access reliability enhancement for 1t1mtj stt-ram,” IEEE Trans. Rel., vol. 65, no. 4, pp. 1755–1768, 2016.
- [4] https://www.everspin.com/sites/default/files/MR4A16BDatasheet.pdf.
- [5] B. Del Bel, J. Kim, C. H. Kim, and S. S. Sapatnekar, “Improving STT-MRAM density through multibit error correction,” in Proc. the Design, Automation and Test in Europe Conference and Exhibition (DATE), Dresden, Germany, Mar. 2014, pp. 1–6.
- [6] T. Richardson and R. Urbanke, Modern coding theory. Cambridge university press, 2008.
- [7] H. Chen, K. Zhang, X. Ma, and B. Bai, “Comparisons between reliability-based iterative min-sum and majority-logic decoding algorithms for ldpc codes,” IEEE Trans. Commun., vol. 59, no. 7, pp. 1766–1771, 2011.
- [8] T. Na, J. Kim, J. P. Kim, S. H. Kang, and S.-O. Jung, “Reference-scheme study and novel reference scheme for deep submicrometer stt-ram,” IEEE Trans. Circuits Syst. I, Reg. Papers, vol. 61, no. 12, pp. 3376–3385, 2014.
- [9] M. Egmont-Petersen, D. de Ridder, and H. Handels, “Image processing with neural networks : a review,” Pattern recognition, vol. 35, no. 10, pp. 2279–2301, 2002.
- [10] E. Nachmani, Y. Be’ery, and D. Burshtein, “Learning to decode linear codes using deep learning,” in Proc. of the 2016 54th Annual Allerton Conference on Communication, Control, and Computing (Allerton). IEEE, 2016, pp. 341–346.
- [11] L. Lugosch and W. J. Gross, “Neural offset min-sum decoding,” in Proc. IEEE International Symposium on Information Theory (ISIT), Aachen, Germany, Jun. 2017, pp. 1361–1365.
- [12] J. Hou, P. H. Siegel, L. B. Milstein, and H. D. Pfister, “Capacity-approaching bandwidth-efficient coded modulation schemes based on low-density parity-check codes,” IEEE Trans. Inf. Theory, vol. 49, no. 9, pp. 2141–2155, 2003.
- [13] K. Cai and K. A. S. Immink, “Cascaded channel model, analysis, and hybrid decoding for spin-torque transfer magnetic random access memory,” IEEE Trans. Magn., vol. 53, no. 11, pp. 1–11, 2017.
- [14] Z. Mei, K. Cai, and X. Zhong, “Neural network-based dynamic threshold detection for non-volatile memories,” in Proc. IEEE International Conference on Communications (ICC), Shanghai, China, May. 2018, pp. 1–6.
- [15] J. R. Hershey, J. L. Roux, and F. Weninger, “Deep unfolding: Model-based inspiration of novel deep architectures,” arXiv preprint arXiv:1409.2574, 2014.
- [16] Y. Zhang, X. Wang, and Y. Chen, “Stt-ram cell design optimization for persistent and non-persistent error rate reduction: A statistical design view,” in Proc. International Conference on Computer-Aided Design (ICCAD), San Jose, California, USA, Nov. 2011, pp. 471–477.
- [17] Z. Mei, K. Cai, L. Shi, and X. He, “On channel quantization for spin-torque transfer magnetic random access memory,” IEEE Trans. Commun., vol. 67, no. 11, pp. 7526–7539, 2019.