---
title: Berlekamp–Massey–Sakata Algorithm
url: https://www.emergentmind.com/topics/berlekamp-massey-sakata-algorithm
type: topic
---

# Berlekamp–Massey–Sakata Algorithm

The Berlekamp–Massey–Sakata algorithm is a multidimensional generalization of the classical Berlekamp–Massey algorithm. Introduced by Sakata, it is designed for decoding algebraic-geometry codes, especially one-point algebraic-geometry codes such as Hermitian codes, and it computes a Gröbner basis of the ideal of relations of a multidimensional linear recurrent sequence [1709.07168]. In coding-theoretic terms, it converts multidimensional syndrome data into locator polynomials; in algebraic terms, it constructs a finite Gröbner basis for a zero-dimensional ideal whose staircase encodes the recurrence structure of the sequence and, in decoding applications, the error support [0609162].

## 1. Multidimensional recurrences and the ideal of relations

A standard formal setting fixes a field \(K\) and a multidimensional sequence
\[
u = (u_i)_{i\in\mathbb{N}^n},\qquad i=(i_1,\dots,i_n).
\]
With multi-index notation \(x=(x_1,\dots,x_n)\) and \(x^i=x_1^{i_1}\cdots x_n^{i_n}\), a linear recurrence relation for \(u\) is given by a polynomial
\[
f = \sum_k \alpha_k x^k \in K[x_1,\dots,x_n]
\]
such that
\[
\forall i\in\mathbb{N}^n,\quad \sum_k \alpha_k\,u_{i+k}=0.
\]
Using the bracket notation
\[
[f]_u := \sum_k \alpha_k u_k,\qquad [x^i f]_u := \sum_k \alpha_k u_{i+k},
\]
the polynomial \(f\) is a relation for \(u\) exactly when \([x^i f]_u=0\) for all \(i\in\mathbb{N}^n\) [1709.07168].

The ideal of relations is
\[
I=\{f\in K[x]\mid \forall m\in K[x],\ [mf]_u=0\}.
\]
A sequence is called linear recurrent when \(I\) is zero-dimensional. In that case there is a finite staircase \(S\subset T=\{x^i\}\) such that every monomial outside \(S\) lies in \(\mathrm{LM}(I)\), and from finitely many initial values \((u_i)_{x^i\in S}\) and finitely many relations one can compute all terms \(u_i\) [1709.07168]. This staircase is the canonical monomial basis of the quotient \(K[x]/I\), and its border is the natural location of the leading monomials of a Gröbner basis.

This algebraic formulation is the common core of several domains. In coding theory the sequence is a syndrome array and the ideal of relations is an error-locator ideal. In sparse interpolation and polynomial system solving it is a recurrence ideal or multi-Hankel kernel. The BMS algorithm is the standard procedure that computes this ideal by exploiting the recurrence constraints monomial by monomial [1705.01328].

## 2. Algorithmic structure: discrepancies, fail, shift, and staircase growth

The non-adaptive BMS algorithm fixes a monomial ordering \(\prec\) that is a weight order, enumerates monomials \(m\) in increasing order, tests current candidate relations up to \(m\), computes discrepancies, and updates them via linear combinations as in the classical Berlekamp–Massey algorithm [1709.07168]. Its one-dimensional specialization behaves exactly like Berlekamp–Massey.

A polynomial \(f\in K[x]\) is valid up to \(m\) if
\[
\forall t\in T_0,\ \LM(tf)\preceq m \implies [tf]_u=0.
\]
If \(f\) is valid for all smaller shifts but fails at \(m\), then
\[
\fail(f)=m,\qquad \shift(f)=\frac{\fail(f)}{\LM(f)}.
\]
These notions generalize discrepancy location and span from the univariate case. A central update rule states that if two relations \(f_1,f_2\) fail with the same shift
\[
v=\frac{\fail(f_1)}{\LM(f_1)}=\frac{\fail(f_2)}{\LM(f_2)},
\]
and
\[
e_1=[v f_1]_u,\qquad e_2=[v f_2]_u\neq 0,
\]
then
\[
f=f_1-\frac{e_1}{e_2}f_2
\]
has strictly larger shift. This is the multidimensional Berlekamp step [1709.07168].

For each current bound \(m\), the set
\[
I_m=\{f\in K[x]\mid \fail(f)\succ m\}
\]
contains the relations valid up to \(m\). The corresponding staircase is
\[
S_m=\Staircase(G_m)=\{s\in T\mid \forall g\in G_m,\ \LM(g)\nmid s\},
\]
where \(G_m\) is a truncated Gröbner basis of \(I_m\). As \(m\) increases, the sets \(I_m\) decrease and the staircases \(S_m\) increase. For a linear recurrent sequence with true staircase \(S\), one has \(S_m=S\) for all \(m\succeq s_{\max}^2\), where \(s_{\max}=\max_\prec S\). If \(G\) is a minimal Gröbner basis of \(I\) and \(g_{\max}=\max_\prec\LM(G)\), then for
\[
m \succeq s_{\max}\cdot \max_\prec(g_{\max},s_{\max}),
\]
BMS returns \(G\) [1709.07168].

A complementary polynomial-division interpretation replaces discrepancy tests by conditions on a mirror of the truncated generating series. In that view, BMS is revisited through multivariate polynomial divisions modulo a monomial ideal, and an adaptive variant achieves complexity depending only on the output Gröbner basis [2107.02582].

## 3. One-point codes, order domains, and the generalized key equation

In one-point algebraic-geometry coding, the ambient object is a smooth irreducible projective curve \(X'\) over \(\mathbb{F}_q\) with a unique point \(Q\) at infinity. For distinct rational points \(P=\{P_1,\dots,P_n\}\subset X'\) away from \(Q\), and \(a\) satisfying
\[
2g-2 < a < n,
\]
the one-point code is
\[
C_L(P,aQ)=\big\{(\varphi(P_1),\dots,\varphi(P_n))\in \mathbb{F}_q^n \mid \varphi\in L(aQ)\big\},
\]
with dual
\[
C_L(P,aQ)^\perp=\Big\{(c_1,\dots,c_n)\in \mathbb{F}_q^n \,\Big|\, \sum_{j=1}^n c_j \varphi(P_j)=0\ \forall \varphi\in L(aQ)\Big\}
\]
[1906.01428].

The syndrome array is the generalized transform of the error vector:
\[
E(Y)=\mathrm{GT}(e)=\sum_{\alpha\in\mathbb{N}^r} E_\alpha Y^\alpha.
\]
The associated error-locator ideal is
\[
\mathcal{E}^-=\{F(\mathbf{X})\in D \mid F(\mathbf{X})\cdot E(Y)=0\},
\]
and this ideal coincides with the vanishing ideal of the error support:
\[
\mathcal{E}^- = I(\mathrm{Supp}(e)).
\]
Hence the syndrome array is a linear recurring sequence, and BMS constructs a Gröbner basis of \(\mathcal{E}^-\) from partial syndrome information [1906.01428].

The same framework can be phrased in Oberst’s language of dynamical systems. If \(G(\mathbf{X})\) is a column of Gröbner basis elements for \(\mathcal{E}^-\), then
\[
\mathcal{S}=\{W\in A \mid G(\mathbf{X})\cdot W=0\}
\]
is a dynamical system, and the syndrome array is the unique solution of the Cauchy-type homogeneous equations
\[
G(\mathbf{X})\cdot E=0,\qquad E|_{\Delta(\mathcal{G})}=V_0.
\]
Within this interpretation, the aim of BMS in the decoding process being the determination of the syndrome array, the algorithm solves the Cauchy’s homogeneous equations with respect to a dynamical system [1906.01428].

A parallel line of generalization places BMS inside order-domain theory. For evaluation codes defined by arbitrary subsets of monomials, order domains provide monomial subsets that can be chosen to optimize decoding performance using the Berlekamp-Massey-Sakata algorithm with majority voting, and for the families considered the dual codes are also defined by monomials [0609159]. In the one-point setting, the classical Reed–Solomon key equation, the Berlekamp–Massey algorithm, the Forney formula, and Horiguchi’s formula all generalize in a natural way to one-point codes, and the resulting algorithm is based on Kötter’s adaptation of Sakata’s algorithm [2108.02758].

## 4. Hermitian, Reed–Muller, and affine variety code applications

For Hermitian and related one-point codes, BMS is not only a decoder but also a design tool. Analysis of the Berlekamp-Massey-Sakata algorithm for decoding one-point codes leads to two methods for improving code rate. One method, due to Feng and Rao, removes parity checks that may be recovered by their majority voting algorithm. The second method is to design the code to correct only those error vectors of a given weight that are also geometrically generic. Formulae are given for the redundancies of Hermitian codes optimized with respect to these criteria as well as the formula for the order bound on the minimum distance; these results proceed from an analysis of numerical semigroups generated by two consecutive integers, and the formula for the redundancy of optimal Hermitian codes correcting a given number of errors answers an open question stated by Pellikaan and Torres in 1999 [0609162].

A closely related optimization occurs for Reed–Muller-type evaluation codes. Variations of Reed-Muller codes yield improvements to the rate for a prescribed decoding performance under the Berlekamp-Massey-Sakata algorithm with majority voting, and explicit formulas for the redundancies of the new codes are given [0609160]. In both Hermitian and Reed–Muller settings, the recurring theme is that redundancy can be matched to the actual correction capability delivered by BMS and majority voting rather than to a purely distance-based design criterion.

For affine variety codes, BMS is paired with multidimensional discrete Fourier transforms. An efficient procedure for error-value calculations based on fast discrete Fourier transforms in conjunction with Berlekamp-Massey-Sakata algorithm for a class of affine variety codes is proposed; the procedure is achieved by multidimensional DFT and linear recurrence relations from Gröbner basis and is applied to erasure-and-error decoding and systematic encoding [1210.0083]. In that framework, BMS performs error-location by computing a Gröbner basis of the error-locator ideal, while the DFT machinery computes error values. The total complexity of the decoding algorithm is bounded by
\[
O(dn^2 + n q^N),
\]
which improves the complexity of error-value calculations compared with solving systems of linear equations from error correcting pairs in many cases [1210.0083].

## 5. Comparisons, reformulations, and computational variants

A recurrent misconception is that BMS and Scalar-FGLM are merely different implementations of the same strategy. A detailed comparison shows that this is not the case. BMS and Scalar-FGLM both compute the ideal of relations of a multi-dimensional linear recurrent sequence, but their behaviors differ, and it is not possible to tweak one of the algorithms in order to mimic exactly the behavior of the other [1709.07168]. In particular, BMS always returns relations whose leading monomials cover the entire border of the staircase, whereas Scalar-FGLM may leave the staircase open and can produce a positive-dimensional ideal when the bound is too small. For a total-degree order, the cited complexity bound for BMS is
\[
O\big((\#S)^2\,\#\LM(G)\big)
\]
field operations [1709.07168].

Several later algorithms reinterpret or extend BMS. A polynomial-division-based approach computes the Gröbner basis of the ideal of relations of a sequence based solely on multivariate polynomial arithmetic; it revisits the Berlekamp-Massey-Sakata algorithm through the use of polynomial divisions and revises Scalar-FGLM without linear algebra operations [2107.02582]. Its adaptive variant has complexity and sequence-query counts depending only on the output Gröbner basis.

A border-basis viewpoint identifies multi-index sequences, multivariate formal power series, and linear functionals on polynomial rings, and describes recurrence relations as the kernel \(I_\sigma\) of the Hankel operator \(H_\sigma\). In that setting, the quotient algebra \(A_\sigma=K[x]/I_\sigma\) is Artinian Gorenstein when \(H_\sigma\) has finite rank, and the algorithm computes a border basis, pairwise orthogonal bases, and multiplication tables. It is presented as an extension of Berlekamp-Massey-Sakata with arithmetic complexity
\[
\mathcal{O}((r+\delta)\,r\,s),
\]
compared with about \(\mathcal{O}(\delta s^2)\) for classical BMS in the same notation [1705.01328].

BMS also appears outside coding theory. In sparse FGLM algorithms for changing Gröbner basis orderings from DRL to LEX, the general-case method is characterized by the Berlekamp-Massey-Sakata algorithm from coding theory to handle the multi-dimensional linearly recurring relations [1304.1238]. Here the multidimensional sequence is
\[
E:(s_1,\ldots,s_n)\longmapsto \langle r, T_1^{s_1}\cdots T_n^{s_n} e\rangle,
\]
and BMS is used to recover, with high probability, the target Gröbner basis under the new ordering [1304.1238].

## 6. Inverse-free decoding, missing syndromes, and incomplete tables

Hardware and implementation issues have generated a substantial subliterature. An inverse-free Berlekamp-Massey-Sakata algorithm eliminates division-calculations of finite fields from the BMS algorithm. This inverse-free algorithm provides full performance in correcting generic errors, which includes most errors, and can decode codes on algebraic curves without the determination of unknown syndromes. The same work proposes three different kinds of architectures, represents the control operation of shift-registers and switches at each clock-timing with numerical simulations, and estimates the performance in comparison of the total running time and the numbers of multipliers and shift-registers in three architectures with those of the conventional ones for codes on algebraic curves [0705.0286].

Recent work addresses a different implementation bottleneck: missing syndromes. One study investigates the problem of finding those missing syndrome values that are needed to implement the Berlekamp-Massey-Sakata algorithm as the Feng-Rao Majority Voting for algebraic geometric codes, and applies the resulting criteria to syndrome correction in abelian codes [2509.14835]. A companion development extends results about the implementation of the Berlekamp-Massey-Sakata algorithm on data tables having a number of unknown values [2509.17591].

The geometric language used there is that of hyperbolic sets. For amplitude \(\delta\), the hyperbolic set is
\[
B(\delta)=\left\{(l_1,l_2)\in I \mid (l_1+1)(l_2+1)\leq \delta\right\}\setminus \left\{(\delta-1,0),(0,\delta-1)\right\}.
\]
For \(t\le 4\), hyperbolic tables with known entries on \(\tau+B(2t+1)\) are sufficient for BMS-based reconstruction in the low-weight regime [2509.17591]. This fits the earlier result that, for hyperbolic-like abelian codes, one can find a set of indexes of the syndrome table such that no other syndrome contributes to implement the BMSa and, moreover, any of them may be ignored a priori; implementation on those indexes is sufficient to get the Gröbner basis and is also a termination criterion, yielding decoding up to 4 errors [2007.09039].

These developments underscore a persistent feature of the algorithm: BMS is simultaneously a recurrence-finding procedure, a Gröbner basis algorithm, a decoder for one-point and abelian codes, and a framework whose practical performance depends strongly on monomial order, syndrome availability, and the geometry of the index set on which the multidimensional sequence is observed.

Source: https://www.emergentmind.com/topics/berlekamp-massey-sakata-algorithm