Gradient Flow Decoding for LDPC Codes
Abstract
The power consumption of the integrated circuit is becoming a significant burden, particularly for large-scale signal processing tasks requiring high throughput. The decoding process of LDPC codes is such a heavy signal processing task that demands power efficiency and higher decoding throughput. A promising approach to reducing both power and latency of a decoding process is to use an analog circuit instead of a digital circuit. This paper investigates a continuous-time gradient flow-based approach for decoding LDPC codes, which employs a potential energy function similar to the objective function used in the gradient descent bit flipping (GDBF) algorithm. We experimentally demonstrate that the decoding performance of the gradient flow decoding is comparable to that of the multi-bit mode GDBF algorithm. Since an analog circuit of the gradient flow decoding requires only analog arithmetic operations and an integrator, future advancements in programmable analog integrated circuits may make practical implementation feasible.
I Introduction
Recently, Moore’s law, which states that the number of transistors in an integrated circuit doubles every 24 months, is facing challenges due to the power consumption of the integrated circuit. The power consumption is becoming a significant burden to prevent handling large scale signal processing tasks requiring extremely high throughput such as multi-Gbits per second.
The decoding of low-density parity-check (LDPC) codes, first introduced by Gallager [1], is a heavy signal processing task requiring high throughput. In various fields, such as storage systems including solid-state drives and next-generation wireless systems beyond 5G or 6G, there is a demand for high-throughput decoding algorithms. As a result, power efficiency and higher decoding throughput are becoming crucial topics for further research.
One promising approach to reducing power consumption is to reduce circuit size. Bit flipping (BF) decoding algorithms meet this demand, as they require fewer flip-flops in a circuit compared to conventional belief propagation (BP) decoding or min-sum decoding. Specifically, variations of the gradient descent bit flipping (GDBF) algorithm [2] have been extensively studied for implementation.
An alternative approach to reducing both power and latency of a decoding process is to use an analog circuit instead of a digital circuit. An analog computer [3][4] capable of simulating nonlinear ordinary differential equations (ODE) is composed of analog adders, multipliers, integrators, and other nonlinear devices. In the field of optical computation, optical adders and multipliers have been realized and used for solving ODEs [5]. A recent example is a neural network implemented in the optical domain [6]. Optical analog integrated circuits are currently under intensive study [7], with reports showing that optical signal processing achieves both fast processing and extremely low power consumption. Although it is too early to evaluate their competitiveness against the digital circuits, we believe that there is plenty of room for further studies on the fully-analog implementation of decoding algorithms for LDPC codes. Furthermore, from a theoretical point of view, the development of continuous-time error-correcting dynamical systems appears to be an interesting topic to pursue [8].
This paper investigates a gradient flow-based approach for decoding LDPC codes. The gradient flow dynamics is a continuous-time system that evolves the state to reduce a predefined potential energy. We will employ a potential energy function that is similar to the objective function used in the GDBF algorithm.
II Preliminaries
II-A Notation
The code length is denoted by . A binary sparse matrix over , , is a parity check matrix for an LDPC code. The binary linear code is defined by
(1) |
A binary to bipolar transform defined as and transforms into the bipolar code defined by
(2) |
The index sets and are defined as
(3) | ||||
(4) |
respectively, where denotes the -element of . The notation denotes the set of consecutive integers . The multivariate Gaussian distribution with mean vector and covariance is denoted by .
II-B Related works
The focus of current research lies in optimization-based approaches. Several works have been developed in this category, with the celebrated work by Feldman [9] on linear programming decoding providing a clear demonstration that the decoding problem can be viewed as an optimization problem.
Applications of interior point methods for solving a convex problem to decoding problems have been studied [10] [11]. A gradient descent formulation of a non-convex objective function leads to the GDBF algorithm [2].
Some variants of the GDBF algorithm, such as the noisy GDBF algorithm [12], have shown considerable improvement in decoding performance. Additionally, recent works have presented ADMM-based decoding algorithms for LDPC codes, including those by Zhang, Liu, and Wang [13][14][15][16], which have shown promising results. Although the advancement of these optimization-based decoding algorithms is significant, all of them are discrete-time algorithms.
Research on continuous-time dynamical systems for signal processing is a relatively new field and still in its early stages. However, it has shown promise in solving optimization problems and signal recovery tasks. For example, a MIMO MMSE detector based on continuous-time dynamics was proposed in [17], and a sparse signal recovery dynamics was studied in [18]. Further studies in this field, including the proposed work on LDPC decoding using gradient flow dynamics, can help to clarify the benefits and limitations of signal processing based on continuous dynamics.
III Potential energy function
III-A Code potential energy function
To define the gradient flow, we need an appropriate potential energy function. The code potential energy function for is a multivariate polynomial defined as
(5) |
where . The parameters and control the strength of the constraints. In the right-hand side of this equation, the first term represents the bipolar constraint for , and the second term corresponds to the parity constraint induced by , i.e., if , we have for any . The code potential energy function was first introduced in the work on proximal decoding algorithm [19].
Since the polynomial has a sum-of-squares form, the polynomial can be regarded as a penalty function that yields a positive penalty value for non-codeword vectors in . The code potential energy is inspired by the non-convex parity constraint function used in the GDBF objective function [2]. The sum-of-squares form directly implies the most important property of , i.e., the inequality holds for any . The equality holds if and only if .
III-B Gradient
In the following discussion, we need the gradient of . The first-order derivative of with respect to is given by
(6) |
The gradient is thus given by
(7) |
The point satisfying the equality is a stationary point of . For any codeword , for any and holds for any . This means , i.e., a codeword vector is a stationary point of .
IV Gradient Flow Decoding
IV-A Gradient flow dynamics
The gradient flow dynamics, also known as steepest descent dynamics, is a continuous-time dynamics defined by an ODE:
(8) |
where is a potential energy function. The system’s state evolves to reduce the potential energy as the time variable increases. This continuous dynamical system can be viewed as the continuous counterpart of the gradient descent method. If the potential function is strictly convex, the equilibrium point of the dynamics coincides with the minimum point of . Therefore, the gradient flow dynamics can be seen as a continuous-time minimization process of the potential energy. If is a non-convex function, then the gradient flow dynamics finds a stationary point of as .
IV-B Gradient flow decoding
We assume an AWGN channel in this paper. A transmitter send a codeword and a receiver obtain a received word
(9) |
where .
Let be a potential energy function defined by
(10) |
The first term of the potential energy function can be regarded as the negative log likelihood function for an AWGN channel. The second term is a penalty term attracting to a codeword of .
The gradient flow decoding is simply a gradient flow dynamics based on the potential energy function that is given by This ODE can be rewritten as follows.
Definition 1 (Gradient flow decoding)
The gradient flow (GF) decoding is defined by the ODE:
(11) | ||||
(12) |
where is the code potential energy and is an initial point.
In the above ODE, the notation is abbreviated to for simplicity. If we have a suitably powerful analog circuit or analog computer, we can simulate the dynamics of this ODE. This simulation process is equivalent to a decoding process, where the equilibrium point represents the decoding result. A possible choice for the initial point is to set . Alternatively, for certain cases, a small-norm vector or a random vector could be used as the initial point.
IV-C Euler method
To evaluate the decoding performance of the GF decoding (11), a numerical method is required to solve the ODE. The simplest numerical method for solving simultaneous nonlinear differential equations is the Euler method [20]. While the convergence order of the Euler method is lower than that of higher-order methods, it is straightforward to use and can provide sufficiently accurate solutions if the time interval is sufficiently fine discretized. Therefore, in the present study, we will use the Euler method to solve the ODE (11).
Suppose that we require to simulate the dynamics defined by the above ODE (11) in the time interval . The interval is divided into bins where denotes the number of discretized intervals. The discrete-time ticks defines the boundaries of the bins where the width of a bin is given by It should be noted that the choice of the bin width is crucial in order to ensure the stability and the accuracy of the Euler method. By using the Euler method, the ODE (11) can be approximated by
(13) |
for . The initial condition of this recursion is .
IV-D Example of Decoding Process
Here, we present a small example to illustrate a decoding process. Suppose that we have a repetition code of length 2, i.e., . The code potential energy function for is given by:
(14) |
where the parameters and are set to 1.

Assume that a transmitted word is and that the corresponding received word is . In this case, the ODE (11) for the GF decoding becomes
The initial condition for the ODE is set to . Figure 1 shows the solution curve of the ODE, with the white small circle representing the initial point and the black small circle indicating the equilibrium point . The solution curve is obtained numerically using the Euler method. In Fig. 1, the contour curves of the potential energy function are also plotted. We can observe that the solution curve is orthogonal to the contour curves because the solution path follows the negative gradient vector field of the potential energy. This means that the curve is a steepest descent curve for . By rounding the equilibrium point, we obtain , which is the correct estimated word.
V Gradient Flow Dynamics
This section focuses on observing the behavior of the gradient flow dynamics defined by (11), which provides insights into the decoding process of the GF decoding. The experiments in this section use a (3,6)-regular LDPC code with and . The signal-to-noise ratio (SNR) is set to dB, and the standard deviation of the Gaussian noise is given by
(15) |
where is the design code rate. For example, equals for a (3,6)-regular LDPC code. For the numerical results presented in this section, we used the Euler method with or . The parameters and were both set to 1.
V-A Observation on potential energy
If the state follows a gradient flow dynamics, the potential energy should decrease as the state evolves. To confirm the evolution of potential energy, we conducted an experiment as follows. For each trial, a random bipolar codeword of a (3,6)-regular LDPC code was generated. The received word was also randomly sampled as , where . The received vector was then provided to the gradient flow decoder. We conducted 50 trials in total.
Figure 2 plots the potential energy as a function of time . As expected, we observed that the value of potential energy rapidly decreased. In the regime , the decrement of the potential energy was invisible, likely because the state vector was sufficiently close to the equilibrium point in such a regime.

V-B Decoding process
It may be informative to observe a decoding process of the GF decoding. Figure 3 presents a decoding process of the (3,6)-regular LDPC code. The dashed line represents the transmitted word where the horizontal axis represents the index of a vector from to . The solid line in Fig. 3 indicates the value of in . The upper panel corresponds to time and lower panel corresponds to time . At the beginning of the decoding process (upper panel), the magnitude of in the state vector are fairly small. They are not sufficient to yield the final estimation. When (lower panel), the values of are significantly close to the original vector. The state vector may be close to the equilibrium point. This decoding result corresponds to successful decoding.

V-C Solution curves
Figure 4 displays the solution curves of each element in the state vector , where (for ) represents the solution of the ODE (11) plotted as a function of time . Notably, all solution curves are smooth and continuous. The left panel illustrates the solution curves for dB, where the equilibrium point is in proximity to a bipolar vector. Conversely, in the right panel (dB), the solution curves are more widely dispersed.

VI Decoder Architecture
Our proposed scheme for decoding LDPC codes does not rely on any specific analog hardware technology for its implementation. We aim for a simple analog circuit to simulate the ODE (11) to facilitate easier implementation. In this section, we show a possible architecture of a GF decoder suitable for hardware implementation. We assume that analog domain integrators exist and that basic real arithmetic operations, such as addition, subtraction, multiplication, and division, can be performed in the analog domain.
If for any , then the partial derivative of can be rewritten as
(16) |
Let be intermediate variable defined by We will introduce another intermediate variable that is defined by
(17) |
where is given by
(18) |
The function defined by
(19) |
is used to generate where
(20) |
By using the vector obtained in the above way, we can rewrite the ODE (11) by
Figure 5 presents a configuration of a circuit having the gradient flow dynamics of (11). The parity check matrix
(21) |
is assumed in this example. The vector is entered to the circuit from the left. According to the Tanner graph of the parity check matrix , the intermediate variables and are evaluated. Applying the function to , we finally obtain By integrating the vector with respect to time , we have and the vector is fed back to the input as in Fig. 5. An analog domain integrator can converts to .

There are several remarks on the the analog circuit depicted in Fig. 5. Notably, the circuit lacks a component for initializing the value of at the beginning. Given that the function involves division by , an initial point of is not feasible. An alternative solution is to use an initial vector of where is a sufficiently small real number.
VII BER Performance
We evaluated the bit error rate (BER) of GF decoding through computer simulations on LDPC codes with design rate 1/2, the -regular LDPC codes (96.33.964, 204.33.484, PEGReg252x504, PEGReg504x1008) [21]. We used BP decoding as the baseline and set the maximum iteration of BP to 100. The parameter setting of GF decoding is summarized in Table I.
Figure 6 displays the BER performance of the proposed GF decoding. Compared to BP, the GF decoding has a BER performance that is approximately 2dB worse. Notably, for PEGReg504x1008, the GF decoding performance is almost on par with the multi-mode GDBF algorithm using 100 iterations ([2], Fig. 3). Overall, GF decoding’s BER performance is comparable to that of bit flip-type decoding algorithms.
Potential energy parameters | |
---|---|
Parameters of Euler method | |
Sampling time | |
Encoding | Uniformly random codeword |

VIII Concluding summary
We presented continuous-time dynamical systems for decoding LDPC codes. Specifically, the GF decoding is based on the gradient flow dynamics of the potential energy function (10). We demonstrated that the decoding performance of the GF decoding is comparable to that of the multi-bit mode GDBF algorithm [2]. Advancements in programmable analog integrated circuits may make practical implementation feasible in the near future.
Acknowledgment
This work was supported by JSPS KAKENHI Grant Number JP22H00514.
References
- [1] R. G. Gallager, Low density parity check codes. MIT Press, 1963.
- [2] T. Wadayama, K. Nakamura, M. Yagita, Y. Funahashi, S. Usami, and I. Takumi, “Gradient descent bit flipping algorithms for decoding LDPC codes,” IEEE Transactions on Communications, vol. 58, no. 6, pp. 1610–1614, 2010.
- [3] B. Ulmann, Analog and hybrid computer programming. Walter de Gruyter, 2020.
- [4] S. Köppel, B. Ulmann, L. Heimann, and D. Killat, “Using analog computers in today’s largest computational challenges,” Advances in Radio Science, vol. 19, pp. 105–116, 2021.
- [5] L. Lu, J. Wu, T. Wang, and Y. SU, “Compact all-optical differential-equation solver based on silicon microring resonator,” Frontiers of Optoelectronics, vol. 5, pp. 99–106, 2012.
- [6] H. Zhang, M. Gu, X. D. Jiang, and et al., “An optical neural chip for implementing complex-valued neural network,” Nature Commun., vol. 12, 2021.
- [7] J. Capmany and D. Pérez, Programmable Integrated Photonics. Oxford University Press, 2020.
- [8] T. Wadayama, “Fully analog noise-resilient dynamical systems storing binary sequence,” IEEE International Symposiumn on Information Theory (ISIT), 2022.
- [9] J. Feldman, “Decoding error-correcting codes via linear programming,” Massachusetts Institute of Technology, Ph. D. thesis, 2003.
- [10] P. O. Vontobel, “Interior-point algorithms for linear-programming decoding,” in IEEE Information Theory and Applications Workshop, 2008.
- [11] T.Wadayama, “Interior point decoding for linear vector channels based on convex optimization,” IEEE Transactions on Information Theory.
- [12] G. Sundararajan, C. Winstead, and E. Boutillon, “Noisy gradient descent bit-flip decoding for LDPC codes,” IEEE Transactions on Communications, vol. 62, no. 10, pp. 3385–3400, 2014.
- [13] X. Zhang and P. H. Siegel, “Efficient iterative LP decoding of LDPC codes with alternating direction method of multipliers,” in IEEE International Symposium on Information Theory (ISIT), 2013.
- [14] X. Liu and S. C. Draper, “The ADMM penalized decoder for LDPC codes,” IEEE Transactions on Information Theory, vol. 62, no. 6, pp. 2966–2984, 2016.
- [15] ——, “ADMM LP decoding of non-binary LDPC codes in ,” IEEE Transactions on Information Theory, vol. 62, no. 6, pp. 2985–3010, 2016.
- [16] Y. Wang and J. Bai, “Proximal-ADMM decoder for nonbinary LDPC codes,” arXiv preprint arXiv:2010.09534, 2020.
- [17] A. Nakai-Kasai and T. Wadayama, “MMSE signal detection for MIMO systems based on ordinary differential equation,” IEEE Global Communications Conference (GLOBECOM), 2022.
- [18] T. Wadayama and A. Nakai-Kasai, “Ordinary differential equation-based sparse signal recovery,” International Symposium on Information Theory and Its Applications (ISITA), 2022.
- [19] T. Wadayama and S. Takabe, “Proximal decoding for LDPC-coded massive MIMO channels,” IEEE International Symposiumn on Information Theory (ISIT), 2021.
- [20] D. F. Griffiths and D. J. Higham, Numerical Methods for Ordinary Differential Equations. Springer, 2010.
- [21] D. J. C. MacKay, “Encyclopedia of sparse graph codes [online],” Available: http://www.inference.phy.cam.ac.uk/mackay/codes/data.html.