# Folded Reed–Solomon code

In coding theory, folded Reed–Solomon codes are like Reed–Solomon codes, which are obtained by mapping ${\displaystyle m}$ Reed–Solomon codewords over a larger alphabet by careful bundling of codeword symbols.

Folded Reed–Solomon codes are also a special case of Parvaresh–Vardy codes.

Using optimal parameters one can decode with a rate of R, and achieve a decoding radius of 1 − R.

The term "folded Reed–Solomon codes" was coined in a paper by V.Y. Krachkovsky with an algorithm that presented Reed–Solomon codes with many random "phased burst" errors [1]. The list-decoding algorithm for folded RS codes corrects beyond the ${\displaystyle 1-{\sqrt {R}}}$ bound for Reed–Solomon codes achieved by the GuruswamiSudan algorithm for such phased burst errors.

## History

One of the ongoing challenges in Coding Theory is to have error correcting codes achieve an optimal trade-off between (Coding) Rate and Error-Correction Radius. Though this may not be possible to achieve practically (due to Noisy Channel Coding Theory issues), quasi optimal tradeoffs can be achieved theoretically.

Prior to Folded Reed–Solomon codes being devised, the best Error-Correction Radius achieved was ${\displaystyle 1-{\sqrt {R}}}$ , by Reed–Solomon codes for all rates ${\displaystyle R}$ .

An improvement upon this ${\displaystyle 1-{\sqrt {R}}}$  bound was achieved by Parvaresh and Vardy for rates ${\displaystyle R<{\tfrac {1}{16}}.}$

For ${\displaystyle R\to 0}$  the Parvaresh–Vardy algorithm can decode a fraction ${\displaystyle 1-O(R\log(1/R))}$  of errors.

Folded Reed–Solomon Codes improve on these previous constructions, and can be list decoded in polynomial time for a fraction ${\displaystyle (1-R-\varepsilon )}$  of errors for any constant ${\displaystyle \varepsilon >0}$ .

## Definition

${\displaystyle f(X)\mapsto {\begin{bmatrix}f(1)\\f(\gamma )\\\vdots \\f(\gamma ^{m-1})\end{bmatrix}},{\begin{bmatrix}f(\gamma ^{m})\\f(\gamma ^{m+1})\\\vdots \\f(\gamma ^{2m-1})\end{bmatrix}},\ldots ,{\begin{bmatrix}f(\gamma ^{n-m})\\f(\gamma ^{n-m+1})\\\vdots \\f(\gamma ^{n-1})\end{bmatrix}}}$

Consider a Reed–Solomon ${\displaystyle [n=q-1,k]_{q}}$  code of length ${\displaystyle n}$  and dimension ${\displaystyle k}$  and a folding parameter ${\displaystyle m\geq 1}$ . Assume that ${\displaystyle m}$  divides ${\displaystyle n}$ .

Mapping for Reed–Solomon codes like this:

${\displaystyle f\mapsto \left\langle f(1),f\left(\gamma ^{1}\right),f\left(\gamma ^{2}\right),\ldots ,f\left(\gamma ^{n-1}\right)\right\rangle }$

where ${\displaystyle \gamma \in \mathbb {F} _{q}}$  is a primitive element in

${\displaystyle \mathbb {F} _{q}=\left\{0,1,\gamma ,\gamma ^{2},\ldots ,\gamma ^{n-1}\right\}}$ .

The ${\displaystyle m}$  folded version of Reed Solomon code ${\displaystyle C}$ , denoted ${\displaystyle FRS_{\mathbb {F} ,\gamma ,m,k}}$  is a code of block length ${\displaystyle N=n/m}$  over ${\displaystyle \mathbb {F} ^{m}}$ . ${\displaystyle FRS_{\mathbb {F} ,\gamma ,m,k}}$  are just ${\displaystyle [q-1,k]}$  Reed Solomon codes with ${\displaystyle m}$  consecutive symbols from RS codewords grouped together.

### Graphic description

Folding of Reed–Solomon code with folding parameter m=3

The above definition is made more clear by means of the diagram with ${\displaystyle m=3}$ , where ${\displaystyle m}$  is the folding parameter.

The message is denoted by ${\displaystyle f(X)}$ , which when encoded using Reed–Solomon encoding, consists of values of ${\displaystyle f}$  at ${\displaystyle x_{0},x_{1},x_{2},\ldots ,x_{n-1}}$ , where ${\displaystyle x_{i}=\gamma ^{i}}$ .

Then bundling is performed in groups of 3 elements, to give a codeword of length ${\displaystyle n/3}$  over the alphabet ${\displaystyle \mathbb {F} _{q}^{3}}$ .

Something to be observed here is that the folding operation demonstrated does not change the rate ${\displaystyle R}$  of the original Reed–Solomon code.

To prove this, consider a linear ${\displaystyle [n,k,d]_{q}}$  code, of length ${\displaystyle n}$ , dimension ${\displaystyle k}$  and distance ${\displaystyle d}$ . The ${\displaystyle m}$  folding operation will make it a ${\displaystyle \left[{\tfrac {n}{m}},{\tfrac {k}{m}},{\tfrac {d}{m}}\right]_{q^{m}}}$  code. By this, the rate ${\displaystyle R={\tfrac {n}{k}}}$  will be the same.

## Folded Reed–Solomon codes and the singleton bound

According to the asymptotic version of the singleton bound, it is known that the relative distance ${\displaystyle \delta }$ , of a code must satisfy ${\displaystyle R\leqslant 1-\delta +o(1)}$  where ${\displaystyle R}$ is the rate of the code. As proved earlier, since the rate ${\displaystyle R}$  is maintained, the relative distance ${\displaystyle \delta \geqslant 1-R}$  also meets the Singleton bound.

### Why folding might help?

Decoding a folded Reed–Solomon code

Folded Reed–Solomon codes are basically the same as Reed Solomon codes, just viewed over a larger alphabet. To show how this might help, consider a folded Reed–Solomon code with ${\displaystyle m=3}$ . Decoding a Reed–Solomon code and folded Reed–Solomon code from the same fraction of errors ${\displaystyle \rho }$  are tasks of almost of the same computational intensity: one can unfold the received word of the folded Reed–Solomon code, treat it as an received word of the original Reed–Solomon code, and run the Reed–Solomon list decoding algorithm on it. Obviously, this list will contain all the folded Reed–Solomon codewords within distance ${\displaystyle \rho }$  of the received word, along with some extras, which we can expurgate.

Also, decoding a folded Reed–Solomon code is an easier task. Suppose we want to correct a third of errors. The decoding algorithm chosen must correct an error pattern that corrects every third symbol in the Reed–Solomon encoding. But after folding, this error pattern will corrupt all symbols over ${\displaystyle \mathbb {F} _{q}^{3}}$  and will eliminate the need for error correction. This propagation of errors is indicated by the blue color in the graphical description. This proves that the for a fixed fraction of errors ${\displaystyle \rho ,}$  the folding operation reduces the channel's flexibility to distribute errors, which in turn leads to a reduction in the number of error patterns that need to be corrected.

## How folded Reed–Solomon (FRS) codes and Parvaresh Vardy (PV) codes are related

We can relate Folded Reed Solomon codes with Parvaresh Vardy codes which encodes a polynomial ${\displaystyle f}$  of degree ${\displaystyle k}$  with polynomials ${\displaystyle f_{0}=f,f_{1},\ldots ,f_{s-1}(s\geqslant 2)}$  where ${\displaystyle f_{i}(X)=f_{i-1}(X)^{d}\mod E(X)}$  where ${\displaystyle E(X)}$  is an irreducible polynomial. While choosing irreducible polynomial ${\displaystyle E(X)=X^{q}-\gamma }$  and parameter ${\displaystyle d}$  we should check if every polynomial ${\displaystyle f}$  of degree at most ${\displaystyle k}$  satisfies ${\displaystyle f(\gamma X)=f(X)^{d}\mod E(X)}$  since ${\displaystyle f(\gamma X)}$  is just the shifted counterpart of ${\displaystyle f(X)}$  where ${\displaystyle \gamma }$  is the primitive element in ${\displaystyle \mathbb {F} _{q}.}$  Thus folded RS code with bundling together code symbols is PV code of order ${\displaystyle s=m}$  for the set of evaluation points

${\displaystyle \left\{1,\gamma ,\gamma ^{2m},\ldots ,\gamma ^{\left({\frac {n}{m}}-1\right)m}\right\}}$ .

If we compare the folded RS code to a PV code of order 2 for the set of evaluation points

${\displaystyle \left\{1,\gamma ,\ldots ,\gamma ^{m-2},\gamma ^{m},\gamma ^{m+1},\ldots ,\gamma ^{2m-2},\ldots ,\gamma ^{n-m},\gamma ^{n-m+1},\ldots ,\gamma ^{n-2}\right\}}$

we can see that in PV encoding of ${\displaystyle f}$ , for every ${\displaystyle 0\leq i\leq n/m-1}$  and every ${\displaystyle 0  appears at ${\displaystyle f(\gamma ^{mi+j})}$  and ${\displaystyle f_{1}(\gamma ^{-1}\gamma ^{mi+j})}$ ,

Relation between PV codes and FRS codes

unlike in the folded FRS encoding in which it appears only once. Thus, the PV and folded RS codes have same information but only the rate of FRS is bigger by a factor of ${\displaystyle 2(m-1)/m}$  and hence the list decoding radius trade-off is better for folded RS code by just using the list decodability of the PV codes. The plus point is in choosing FRS code in a way that they are compressed forms of suitable PV code with similar error correction performance with better rate than corresponding PV code. One can use this idea to construct a folded RS codes of rate ${\displaystyle R}$  that are list decodable up to radius approximately ${\displaystyle 1-R^{s/[s+1]}}$  for ${\displaystyle s\geq 1}$ . [2]

## Brief overview of list-decoding folded Reed–Solomon codes

A list decoding algorithm which runs in quadratic time to decode FRS code up to radius ${\displaystyle 1-R-\varepsilon }$  is presented by Guruswami. The algorithm essentially has three steps namely the interpolation step in which welch berlekamp style interpolation is used to interpolate the non-zero polynomial

${\displaystyle Q(X,Y_{1},Y_{2},\ldots ,Y_{s})=A_{0}(X)+A_{1}(X)Y_{1}+A_{2}(X)Y_{2}+\cdots +A_{s}(X)Y_{s},}$

after which all the polynomials ${\displaystyle f\in \mathbb {F} _{q}[X]}$  with degree ${\displaystyle k-1}$  satisfying the equation derived in interpolation are found. In the third step the actual list of close-by codewords are known by pruning the solution subspace which takes ${\displaystyle q^{s}}$ time.

## Linear-algebraic list decoding algorithm

Guruswami presents a ${\displaystyle n^{\Omega (1/\varepsilon ^{2})}}$  time list decoding algorithm based on linear-algebra, which can decode folded Reed–Solomon code up to radius ${\displaystyle 1-R-\varepsilon }$  with a list-size of ${\displaystyle {n^{O(1/\varepsilon ^{2})}}}$ . There are three steps in this algorithm: Interpolation Step, Root Finding Step and Prune Step. In the Interpolation step it will try to find the candidate message polynomial ${\displaystyle f(x)}$  by solving a linear system. In the Root Finding step, it will try to find the solution subspace by solving another linear system. The last step will try to prune the solution subspace gained in the second step. We will introduce each step in details in the following.

### Step 1: The interpolation step

It is a Welch–Berlekamp-style interpolation (because it can be viewed as the higher-dimensional generalization of the Welch–Berlekamp algorithm). Suppose we received a codeword ${\displaystyle y}$  of the ${\displaystyle m}$ -folded Reed–Solomon code as shown below

${\displaystyle \left({\begin{bmatrix}y_{0}\\y_{1}\\y_{2}\\\cdots \\y_{m-1}\end{bmatrix}},{\begin{bmatrix}y_{m}\\y_{m+1}\\y_{m+2}\\\cdots \\y_{2m-1}\end{bmatrix}},\ldots ,{\begin{bmatrix}y_{n-m}\\y_{n-m+1}\\y_{n-m+2}\\\cdots \\y_{n-1}\end{bmatrix}}\right)}$

We interpolate the nonzero polynomial

${\displaystyle Q(X,Y_{1},\ldots ,Y_{s})=A_{0}(X)+A_{1}(X)Y_{1}+\cdots +A_{s}(X)Y_{s},\qquad {\begin{cases}\deg(A_{i})\leqslant D&1\leqslant i\leqslant s\\\deg(A_{0})\leqslant D+k-1&\end{cases}}}$

by using a carefully chosen degree parameter ${\displaystyle D}$ .

${\displaystyle D=\left\lfloor {\frac {N(m-s+1)-k+1}{s+1}}\right\rfloor }$

So the interpolation requirements will be

${\displaystyle Q\left(\gamma ^{im+j},y_{im+j},y_{im+j+1},\ldots ,y_{im+j+s-1}\right)=0,\quad {\text{for}}\quad i=0,1,\ldots ,{\tfrac {n}{m}}-1,j=0,1,\ldots ,m-s.}$

Then the number of monomials in ${\displaystyle Q(X,Y_{1},\ldots ,Y_{s})}$  is

${\displaystyle (D+1)s+D+k=(D+1)(s+1)+k-1>N(m-s+1)}$

Because the number of monomials in ${\displaystyle Q(X,Y_{1},\ldots ,Y_{s})}$  is greater than the number of interpolation conditions. We have below lemma

Lemma 1. ${\displaystyle 0\neq Q\in \mathbb {F} _{q}[X,Y_{1},\ldots ,Y_{s}]}$  satisfying the above interpolation condition can be found by solving a homogeneous linear system over ${\displaystyle \mathbb {F} _{q}}$  with at most ${\displaystyle Nm}$  constraints and variables. Moreover this interpolation can be performed in ${\displaystyle O(Nm\log ^{2}(Nm)\log \log(Nm))}$  operations over ${\displaystyle \mathbb {F} _{q}}$ .[1]

This lemma shows us that the interpolation step can be done in near-linear time.

For now, we have talked about everything we need for the multivariate polynomial ${\displaystyle Q(X,Y_{1},\ldots ,Y_{s})}$ . The remaining task is to focus on the message polynomials ${\displaystyle f(X)}$ .

Lemma 2. If a candidate message polynomial ${\displaystyle f(X)\in \mathbb {F} [X]}$  is a polynomial of degree at most ${\displaystyle k-1}$  whose Folded Reed-Solomon encoding agrees with the received word ${\displaystyle y}$  in at least ${\displaystyle t}$  columns with
${\displaystyle t>{{D+k-1} \over {m-s+1}},}$
then ${\displaystyle Q(X,f(X),f(\gamma X),\ldots ,f(\gamma _{s-1}X))=0.}$ [2]

Here "agree" means that all the ${\displaystyle m}$  values in a column should match the corresponding values in codeword ${\displaystyle y}$ .

This lemma shows us that any such polynomial ${\displaystyle Q(X,Y_{1},\ldots ,Y_{s})}$  presents an algebraic condition that must be satisfied for those message polynomials ${\displaystyle f(x)}$  that we are interested in list decoding.

Combining Lemma 2 and parameter ${\displaystyle D}$ , we have

${\displaystyle t(m-s+1)>{\frac {N(m-s+1)+s(k-1)}{s+1}}}$

Further we can get the decoding bound

${\displaystyle t\geqslant {\frac {N}{s+1}}+{\frac {s}{s+1}}\cdot {\frac {k}{m-s+1}}=N\left({\frac {1}{s+1}}+{\frac {s}{s+1}}\cdot {\frac {mR}{m-s+1}}\right)}$

We notice that the fractional agreement is

${\displaystyle {\dfrac {1}{s+1}}+{\dfrac {s}{s+1}}\cdot {\dfrac {mR}{m-s+1}}}$

### Step 2: The root-finding step

During this step, our task focus on how to find all polynomials ${\displaystyle f\in {\mathbb {F} _{q}[X]}}$  with degree no more than ${\displaystyle k-1}$  and satisfy the equation we get from Step 1, namely

${\displaystyle A_{0}(X)+A_{1}(X)f(X)+A_{2}(X)f(\gamma X)+\cdots +A_{s}(X)f(\gamma ^{s-1}X)=0}$

Since the above equation forms a linear system equations over ${\displaystyle \mathbb {F} _{q}}$  in the coefficients ${\displaystyle f_{0},f_{1},\ldots ,f_{k-1}}$  of the polynomial

${\displaystyle f(X)=f_{0}+f_{1}X+\cdots +f_{k-1}X^{k-1},}$

the solutions to the above equation is an affine subspace of ${\displaystyle \mathbb {F} _{q}^{k}}$ . This fact is the key point that gives rise to an efficient algorithm - we can solve the linear system.

It is natural to ask how large is the dimension of the solution? Is there any upper bound on the dimension? Having an upper bound is very important in constructing an efficient list decoding algorithm because one can simply output all the codewords for any given decoding problem.

Actually it indeed has an upper bound as below lemma argues.

Lemma 3. If the order of ${\displaystyle \gamma }$  is at least ${\displaystyle k}$  (in particular when ${\displaystyle \gamma }$  is primitive), then the dimension of the solution is at most ${\displaystyle s-1}$ .[3]

This lemma shows us the upper bound of the dimension for the solution space.

Finally, based on the above analysis, we have below theorem

Theorem 1. For the folded Reed–Solomon code ${\displaystyle FRS_{q}^{(m)}[n,k]}$  of block length ${\displaystyle N={\tfrac {n}{m}}}$  and rate ${\displaystyle R={\tfrac {k}{n}},}$  the following holds for all integers ${\displaystyle s,1\leqslant s\leqslant m}$ . Given a received word ${\displaystyle y\in (\mathbb {F} _{q}^{m})^{N}}$ , in ${\displaystyle O((Nm\log q)^{2})}$  time, one can find a basis for a subspace of dimension at most ${\displaystyle s-1}$  that contains all message polynomials ${\displaystyle f\in \mathbb {F} _{q}[X]}$  of degree less than ${\displaystyle k}$  whose FRS encoding differs from ${\displaystyle y}$  in at most a fraction
${\displaystyle {\frac {s}{s+1}}\left(1-{\frac {mR}{m-s+1}}\right)}$
of the ${\displaystyle N}$  codeword positions.

When ${\displaystyle s=m=1}$ , we notice that this reduces to a unique decoding algorithm with up to a fraction ${\displaystyle (1-R)/2}$  of errors. In other words, we can treat unique decoding algorithm as a specialty of list decoding algorithm. The quantity is about ${\displaystyle n^{O(1/\varepsilon )}}$  for the parameter choices that achieve a list decoding radius of ${\displaystyle 1-R-\varepsilon }$ .

Theorem 1 tells us exactly how large the error radius would be.

Now we finally get the solution subspace. However, there is still one problem standing. The list size in the worst case is ${\displaystyle n^{\Omega (1/\varepsilon )}}$ . But the actual list of close-by codewords is only a small set within that subspace. So we need some process to prune the subspace to narrow it down. This prune process takes ${\displaystyle q^{s}}$  time in the worst case. Unfortunately it is not known how to improve the running time because we do not know how to improve the bound of the list size for folded Reed-Solomon code.

Things get better if we change the code by carefully choosing a subset of all possible degree ${\displaystyle k-1}$  polynomials as messages, the list size shows to be much smaller while only losing a little bit in the rate. We will talk about this briefly in next step.

### Step 3: The prune step

By converting the problem of decoding a folded Reed–Solomon code into two linear systems, one linear system that is used for the interpolation step and another linear system to find the candidate solution subspace, the complexity of the decoding problem is successfully reduced to quadratic. However, in the worst case, the bound of list size of the output is pretty bad.

It was mentioned in Step 2 that if one carefully chooses only a subset of all possible degree ${\displaystyle k-1}$  polynomials as messages, the list size can be much reduced. Here we will expand our discussion.

To achieve this goal, the idea is to limit the coefficient vector ${\displaystyle (f_{0},f_{1},\ldots ,f_{k-1})}$  to a special subset ${\displaystyle \nu \subseteq \mathbb {F} _{q}^{k}}$ , which satisfies below two conditions:

Condition 1. The set ${\displaystyle \nu }$  must be large enough (${\displaystyle |\nu |\geq q^{(1-\varepsilon )k}}$ ).

This is to make sure that the rate will be at most reduced by factor of ${\displaystyle (1-\varepsilon )}$ .

Condition 2. The set ${\displaystyle \nu }$  should have low intersection with any subspace ${\displaystyle S}$  of dimension ${\displaystyle s}$  satisfying ${\displaystyle S\subset \mathbb {F} _{q}^{k}}$  and ${\displaystyle |S\cap \nu |\leqslant L.}$  Such a subset is called subspace-evasive subset.

The bound for the list size at worst case is ${\displaystyle n^{\Omega (1/\varepsilon )}}$ , and it can be reduced to a relative small bound ${\displaystyle O(1/\varepsilon ^{2})}$  by using subspace-evasive subsets.

During this step, as it has to check each element of the solution subspace that we get from Step 2, it takes ${\displaystyle q^{s}}$  time in the worst case (${\displaystyle s}$  is the dimension of the solution subspace).

Dvir and Lovett improved the result based on the work of Guruswami, which can reduce the list size to a constant.

Here is only presented the idea that is used to prune the solution subspace. For the details of the prune process, please refer to papers by Guruswami, Dvir and Lovett, which are listed in the reference.

### Summary

If we don't consider the Step 3, this algorithm can run in quadratic time. A summary for this algorithm is listed below.

Steps InterpolationRoot findingPrune ${\displaystyle n^{\Omega (1/\varepsilon ^{2})}}$ ${\displaystyle 1-R-\varepsilon }$ ${\displaystyle n^{O(1/\varepsilon ^{2})}}$

## References

1. ^ For proof see Proposition 5.11 in Chapter 5 in Brander's thesis listed in the references.
2. ^ For the details of the proof, please refer to Guruswami's paper.
3. ^ For the details of the proof, please refer to Guruswami's paper.
1. Atri Rudra's Lecture Notes: Folded Reed–Solomon Codes
2. Atri Rudra's Lecture Notes: Bounds
3. A paper by Atri Rudra and Venkatesan Guruswami: Decoding Folded Reed–Solomon Codes
4. A chapter on List Decoding of folded Reed–Solomon codes: List Decoding of Folded Reed–Solomon Codes
5. Venkatesan Guruswami's lecture notes: Elementary bounds on codes
6. Venkatesan Guruswami's lecture notes: List Decoding Folded Reed–Solomon Code
7. Guruswami, Venkatesan. "Linear-algebraic list decoding of folded Reed–Solomon codes". 2011 IEEE 26th Annual Conference on Computational Complexity. arXiv:1106.0436. doi:10.1109/CCC.2011.22.
8. Dvirl, Zeev; Lovett, Shachar. "Subspace evasive sets". arXiv:1110.5696.
9. PHD Thesis by Kristian Brander: Interpolation and List Decoding of Algebraic Codes
10. Krachkovsky, V. Y. (2003). "Reed–Solomon codes for correcting phased error bursts". IEEE Trans. Inf. Theory. 49 (11): 2975–2984. doi:10.1109/TIT.2003.819333.