---
title: 'BiD Codes: Unified Algebraic Code Constructions'
url: https://www.emergentmind.com/topics/bid-codes
type: topic
---

# BiD Codes: Unified Algebraic Code Constructions

BiD codes, short for Berman–intersection–dual Berman codes, are a recently introduced family of binary abelian codes defined via the row span of Kronecker powers of a 3×3 binary kernel. These codes unify and generalize constructions central to algebraic coding—namely Berman codes, their duals, and their intersections—with direct implications for error correction on memoryless channels, distributed computation, and algebraic code structure. In the context of gradient coding theory, "BiD codes" may also denote codes constructed from Balanced Incomplete Block Designs (BIBDs) and their generalizations, which possess combinatorial and probabilistic structure optimized for straggler mitigation in distributed systems. This entry focuses on algebraic BiD codes and their principal properties, with forward references to related combinatorial and bidirectional distance profile codes only for nomenclature clarity.

## 1. Algebraic Construction: 3×3 Kernel and Abelian Code Families

Let $A_3 \in \mathbb{F}_2^{3 \times 3}$ be the full-rank binary matrix
\[
A_3 = \begin{pmatrix}
1 & 1 & 1 \\
1 & 1 & 0 \\
1 & 0 & 1
\end{pmatrix}
\]
The $m$-fold Kronecker power $A_N = A_3^{\otimes m}$, with $N = 3^m$, serves as the foundational structure for BiD codes. Rows of $A_N$ are indexed by $w \in \{0,1,\dots,m\}$ and each has weight $2^w3^{m-w}$ for $w$ times weight-2 rows and $m-w$ times weight-3 rows in the tensor product. The multiplicity of rows of weight $2^w3^{m-w}$ is exactly $\binom{m}{w}2^w$.

Given $W \subseteq \{0,1,\dots,m\}$, the associated abelian code is
\[
C(m,W) = \mathrm{span}_{\mathbb{F}_2}\{ \text{rows of } A_N : \text{row weight}=2^w3^{m-w},\;w\in W \}
\]
The dimension of $C(m,W)$ is $\sum_{w \in W} \binom{m}{w}2^w$. Its dual is $C(m,W)^\perp = C(m, W^c)$ with $W^c = \{0,\dots,m\}\setminus W$, so parity checks arise from the complementary row subcollection.

Berman codes and dual Berman codes correspond respectively to $C(m,\{r+1,\dots,m\})$ and $C(m,\{0,\dots,r\})$. The Berman–intersection–dual Berman ("BiD") code with parameters $0 \leq r_1 \leq r_2 \leq m$ is
\[
\mathrm{BiD}(m, r_1, r_2) = C(m, \{r_1, r_1+1, \dots, r_2\}) = \text{Ber}_{r_1-1}(m) \cap \text{Ber}_{r_2}(m)^\perp = \bigoplus_{w=r_1}^{r_2}C(m,\{w\})
\]
with dimension $k = \sum_{w=r_1}^{r_2} \binom{m}{w}2^w$ [2507.10068].

## 2. Parameters, Distance Bounds, and Weight Spectra

For $\mathrm{BiD}(m, r_1, r_2)$ of length $n=3^m$, generator rows have only $m+1$ possible weights $\{2^w3^{m-w} : w = r_1,\dots,r_2\}$ with explicit multiplicity. Known bounds and exact values for minimum distance include:
- $\mathrm{BiD}(m,1,1)$: $d_\mathrm{min} = 4 \cdot 3^{m-2}$.
- $\mathrm{BiD}(m,m-1,m-1)$: $d_\mathrm{min} = 3 \cdot 2^{m-2}$.
- General bound:
\[
d_\mathrm{min}[\mathrm{BiD}(m, r_1, r_2)] \geq \lceil \max\{ 4^{r_1}3^{m-r_1-r_2},\; 3^{m - r_2}2^{r_1+r_2-m} \} \rceil
\]

As $m \to \infty$, for fixed rate $R$ and $r_1,r_2 \sim (2/3)m$, the normalized distance exponent satisfies
\[
\lim_{m \to \infty} \frac{\log d_\mathrm{min}}{\log n} \geq \frac{\log 6}{\log 27} \approx 0.543
\]
surpassing the $0.5$ exponent achieved by Reed–Muller (RM) codes.

These codes fill out a denser set of rate–distance tradeoff points at practical blocklengths than RM codes and their variants [2507.10068, 2601.09390].

## 3. Decoding Algorithms: Algebraic and Inference Approaches

For first-order BiD codes $(m,1,1)$, fast maximum-likelihood (ML) and max-log-MAP decoding can be implemented via recursive subproduct code algorithms. Let $c \in (m,1,1)$ correspond to data $(d, a)$ with $d \in (m-1,1,1)$ and $a \in \mathbb{F}_2^2$. Decoding proceeds by recursively decoding $d$ after soft-marginalizing over the $(a_1, a_2)$ parameters. The complexity is $O(n^{1.26})$ for $n = 3^m$ [2601.09390].

Second-order BiD codes $(m,2,2)$ exploit a large set of explicit weight-6 parity checks as well as an algebraic "projection" property (in the sense of RM decoding), allowing the design of a belief-propagation decoder. The factor graph features $3^m$ variables, $m \cdot 2^{m-2}3^{m-1}$ degree-6 check nodes, and projection-based generalized check nodes. Iterative message passing (sum-product for degree-6 nodes, specialized algorithms for projections) yields block error rate within $\approx 1$ dB of ML at moderate blocklengths, with per-iteration complexity $O(N^{1.63} \log N)$ [2601.09390].

## 4. Performance: Tradeoffs and Empirical Results

Simulation studies, primarily at $n=243$ ($m=5$), establish that BiD codes nearly match or slightly outperform RM, RM–Polar, and CRC-aided Polar codes under ML and near-ML decoding on the binary-input AWGN and erasure channels. For example, BiD(5,2,2) $[243,40,d=48]$ achieves similar BLER to RM(8,2) $[256,37,64]$ and both approach finite-blocklength converse bounds (Polyanskiy–Poor–Verdú) for erasures. Under ML, SNR required for BLER=$10^{-3}$ is 2.8 dB (BiD) versus 3.3 dB (RM) at $N=243$. Belief-propagation decoding for second-order BiD codes further narrows the gap to ML, offering near-optimal empirical performance with moderate complexity [2507.10068, 2601.09390].

## 5. Encoding, Decoding Complexity, and Practical Construction

Encoding in BiD codes follows Arıkan-style polar encoding with $A_3$ replaced for the classic $2 \times 2$ kernel. Input vector $u \in \mathbb{F}_2^N$ is mapped to $x = uA_N$, selectively "freezing" bits whose corresponding generator row weight lies outside $[2^{r_2}3^{m-r_2}, 2^{r_1}3^{m-r_1}]$. The complexity is $O(N \log N)$. ML decoding leverages Successive-Cancellation Ordered-Search (SCOS) adapted to $A_3^{\otimes m}$, with practical average node-visits (ANV) notably lower than RM list decoders at similar rates.

BiD codes’ algebraic structure, including projection and explicit check construction, underpins the implementation of specialized decoders (belief propagation, SCOS, and recursive subproduct decoders) that combine quasi-linear complexity with scalability to large blocklengths [2507.10068, 2601.09390].

## 6. Broader Context: Connections to Other BiD, BIBD, and BDP Codes

In distributed computing, "BiD codes" or BIBD-based gradient codes represent a distinct line wherein combinatorial block designs (BIBDs) are used to construct gradient codes for straggler-resilient distributed machine learning. Here, the incidence matrix of a $(v, b, r, k, \lambda)$-BIBD provides an encoding where each worker computes $k$ gradients and each data point is assigned to $r$ workers, with worst-case error performance given in closed form as a function of $l, \lambda, n, k, s$ (number of stragglers). Extensions include Soft-BIBD (probabilistic relaxation via a linear program, guaranteeing performance as good as combinatorial BIBDs whenever feasible) and Kronecker-product codes enabling scalability to massive systems via tensor products of smaller codes [2105.05231].

In convolutional coding, the "bidirectional distance profile" (BDP) measures the minimum of the code and its time-reversal’s distance profiles and underlies the construction of Optimum BDP (OBDP) codes for minimizing the complexity of bidirectional sequential decoding [2210.15787]. Though the terminology overlaps, these BDP codes are not derived from the 3×3 kernel framework central to algebraic BiD codes.

## 7. Asymptotic Properties and Channel Capacity Results

Generalizing the KCP "beyond double-transitivity" argument, BiD codes with contiguous $W = \{r_1, \dots, r_2\}$ and fixed rate $R \in (0,1)$ achieve BEC (binary erasure channel) capacity under bit-MAP decoding. The minimum distance exponent at fixed rate is $\Omega(N^{0.543})$, exceeding that of RM codes ($O(\sqrt N)$). This property, combined with provable and empirical ML and iterative decoding performance, positions BiD codes as competitive candidates for future applications in both classical channel coding and straggler-resilient distributed systems [2601.09390, 2507.10068, 2105.05231].

Source: https://www.emergentmind.com/topics/bid-codes