Lagrange Coded Computing

One Framework for All Polynomial Computations

Sections 8.1–8.2 gave specialized codes for matrix multiplication and convolution. What about general tensor contractions? Polynomial evaluations on arbitrary structured inputs? Higher-order multilinear operations?

The answer is Lagrange Coded Computing (LCC), introduced by Yu, Raviv, Soleymani, and Avestimehr (2019). LCC provides a single framework that achieves information-theoretically optimal recovery thresholds for arbitrary multivariate-polynomial functions β€” polynomial codes and entangled polynomial codes are both special cases.

The point is that LCC unifies the coded-computing toolbox: one encoding scheme (Lagrange interpolation over polynomial-valued inputs), one decoding algorithm (Lagrange interpolation), one recovery-threshold formula. Section 8.3 gives the framework; Β§8.4 discusses its limitations and open research directions.

Definition:

Lagrange Coded Computing (LCC)

Let f:(Fqd)Kβ†’Fqdβ€²f: (\mathbb{F}_q^d)^K \to \mathbb{F}_q^{d'} be a multivariate polynomial function of KK vector inputs, of total degree dfd_f. The goal: given inputs x1,…,xK∈Fqd\mathbf{x}_1, \ldots, \mathbf{x}_K \in \mathbb{F}_q^d, compute f(x1,…,xK)f(\mathbf{x}_1, \ldots, \mathbf{x}_K) using Nβ‰₯KN \geq K distributed workers.

LCC construction. Pick distinct interpolation points Ξ²1,…,Ξ²K∈Fq\beta_1, \ldots, \beta_K \in \mathbb{F}_q (one per input). Define the Lagrange polynomial u(z)β€…β€Šβ‰œβ€…β€Šβˆ‘j=1Kxjβ‹…β„“j(z),u(z) \;\triangleq\; \sum_{j = 1}^{K} \mathbf{x}_j \cdot \ell_j(z), where β„“j(z)=∏iβ‰ j(zβˆ’Ξ²i)/(Ξ²jβˆ’Ξ²i)\ell_j(z) = \prod_{i \neq j} (z - \beta_i)/(\beta_j - \beta_i) are the Lagrange basis polynomials with the property β„“j(Ξ²i)=Ξ΄ij\ell_j(\beta_i) = \delta_{ij}. Each worker kk is assigned an evaluation point Ξ±k∈Fqβˆ–{Ξ²1,…,Ξ²K}\alpha_k \in \mathbb{F}_q \setminus \{\beta_1, \ldots, \beta_K\} and stores x~k=u(Ξ±k)\tilde{\mathbf{x}}_k = u(\alpha_k).

Worker computation. Worker kk computes y~k=f(x~k)\tilde{y}_k = f(\tilde{\mathbf{x}}_k), a single evaluation of ff. By construction, y~k=f(u(Ξ±k))=g(Ξ±k)\tilde{y}_k = f(u(\alpha_k)) = g(\alpha_k) where g(z)β‰œf(u(z))g(z) \triangleq f(u(z)) is a polynomial in zz of degree dfβ‹…(Kβˆ’1)d_f \cdot (K - 1).

Master decoding. The master receives any Krec=df(Kβˆ’1)+1K_{\text{rec}} = d_f (K - 1) + 1 worker responses and Lagrange-interpolates g(z)g(z). Evaluating at the interpolation points Ξ²j\beta_j gives g(Ξ²j)=f(u(Ξ²j))=f(xj)g(\beta_j) = f(u(\beta_j)) = f(\mathbf{x}_j) β€” wait, this isn't quite right. Properly: if all inputs are provided as xj\mathbf{x}_j for j=1,…,Kj = 1, \ldots, K, then the target is f(x1,…,xK)f(\mathbf{x}_1, \ldots, \mathbf{x}_K), not KK separate function evaluations. See the following construction note.

The exact LCC construction is subtler than the pseudocode suggests: ff is a function of KK inputs jointly, and u(Ξ²j)=xju(\beta_j) = \mathbf{x}_j for each jj. The master interpolates the polynomial gg and then evaluates at a specific point that encodes the target combination. See Yu et al. 2019 Β§III for the full formulation.

Theorem: LCC Recovery Threshold

Let ff be a multivariate polynomial of KK vector-valued inputs with total degree dfd_f. The Lagrange Coded Computing scheme with NN workers over Fq\mathbb{F}_q (qβ‰₯Nq \geq N) satisfies:

  1. Correctness. Any Krec=df(Kβˆ’1)+1K_{\text{rec}} = d_f (K - 1) + 1 responses suffice to recover f(x1,…,xK)f(\mathbf{x}_1, \ldots, \mathbf{x}_K).
  2. Optimality. This matches the information-theoretic lower bound: no scheme can achieve smaller KrecK_{\text{rec}} at the same per-worker storage for polynomial functions of degree dfd_f.
  3. Per-worker storage. Each worker stores one "input-sized" evaluation (Fqd\mathbb{F}_q^d) β€” the same as the standard polynomial code.

Specializing ff recovers earlier results:

  • Matrix multiplication: df=2d_f = 2 (bilinear), Krec=2(Kβˆ’1)+1=2Kβˆ’1K_{\text{rec}} = 2(K - 1) + 1 = 2K - 1. For (p,q)(p, q)-partitioned matmul with K=pqK = pq, Krec=pqK_{\text{rec}} = pq β€” matching the standard polynomial code.
  • Convolution: df=2d_f = 2, same formula. For (p,q)(p, q)-partitioned convolution with K=p+qβˆ’1K = p + q - 1, Krec=p+qβˆ’1K_{\text{rec}} = p + q - 1 β€” matching the entangled code.
  • Higher-degree polynomials: df=3,4,…d_f = 3, 4, \ldots require more responses, linearly in dfd_f.

LCC reduces arbitrary polynomial computations to polynomial interpolation. The encoding lifts KK input vectors to a polynomial u(z)u(z) whose evaluation at Ξ²j\beta_j recovers input xj\mathbf{x}_j. The function ff, being polynomial of degree dfd_f in its inputs, becomes a polynomial of degree df(Kβˆ’1)d_f(K - 1) in zz when evaluated on u(z)u(z). This higher-degree polynomial is interpolated from df(Kβˆ’1)+1d_f(K - 1) + 1 worker responses, and the target output is read off at a specific Ξ²\beta-value.

The framework's power is its generality: any polynomial function gets an optimal recovery threshold without specialized design.

Example: LCC for a Quadratic Function f(x)=xTAxf(\mathbf{x}) = \mathbf{x}^T \mathbf{A} \mathbf{x}

Use LCC to distribute the computation of f(x)=xTAxf(\mathbf{x}) = \mathbf{x}^T \mathbf{A} \mathbf{x} (quadratic form) with data split into K=4K = 4 partitions. Compute the recovery threshold.

LCC Recovery Threshold vs. Function Degree

Plot the LCC recovery threshold Krec=df(Kβˆ’1)+1K_{\text{rec}} = d_f(K - 1) + 1 as a function of the function degree dfd_f for several input-count values KK. Higher-degree functions require more responses. This scaling reflects the fundamental cost of coded-computing generality: the more complex the target function, the more responses the master needs.

Parameters
8

Number of input partitions

5

Lagrange Coded Computing: The Unified Framework

Animation of the LCC framework: inputs are lifted to a Lagrange polynomial, each worker computes ff on its encoded input, master interpolates the degree-df(Kβˆ’1)d_f(K-1) output polynomial from KrecK_{\text{rec}} responses.

LCC vs. Specialized Coded-Computing Schemes

Target operationSpecialized schemeKrecK_{\text{rec}}LCCKrecLCCK_{\text{rec}}^{\text{LCC}}
Matrix mult ATB\mathbf{A}^T \mathbf{B}Polynomial code (Ch. 5)K=pqK = pqGeneralKrec=2pqβˆ’1K_{\text{rec}} = 2pq - 1
Convolution aβˆ—b\mathbf{a} * \mathbf{b}Entangled polynomial (Β§8.2)K=p+qβˆ’1K = p + q - 1GeneralKrec=2(p+qβˆ’1)βˆ’1K_{\text{rec}} = 2(p+q-1) - 1
Cubic / quartic polynomialNo specialized scheme–LCCKrec=df(Kβˆ’1)+1K_{\text{rec}} = d_f(K-1) + 1
Tensor contraction (order 3)Entangled variantK=p+q+rβˆ’2K = p + q + r - 2GeneralKrec=3Kβˆ’2K_{\text{rec}} = 3K - 2
Arbitrary multivariate polynomialNo specialized scheme–LCCKrec=df(Kβˆ’1)+1K_{\text{rec}} = d_f(K-1) + 1

When to Use Which

The rule of thumb:

  • Specialized schemes (polynomial code, entangled polynomial, MatDot) are tighter for their target operations. Use them when the operation is well- specified and high straggler tolerance is critical.
  • LCC is more general but pays a constant-factor penalty in recovery threshold. Use it for arbitrary polynomial functions (especially higher-degree ones like polynomial activations in certain neural net designs) where no specialized code is available.
  • Hybrid: in production ML pipelines, use specialized schemes per-operation type (matmul, convolution) and LCC only for unusual operations that don't fit the standard patterns.

LCC's main value is generality: one algorithm for every polynomial computation. Its cost is that specialized knowledge (like convolution's reduced output structure) gets discarded.

Common Mistake: LCC Requires Polynomial Functions

Mistake:

Apply LCC to non-polynomial operations (ReLU, softmax, cross-entropy loss).

Correction:

LCC's correctness crucially depends on ff being a polynomial of bounded degree. For non-polynomial operations, LCC does not apply directly. Approaches:

  1. Polynomial approximation. Approximate the non-polynomial ff by a low-degree polynomial f^\hat f, apply LCC to f^\hat f, tolerate the approximation error.

  2. Hybrid coding. Apply LCC to the polynomial layers of a network (convolutions, matmuls) and compute the non-polynomial layers redundantly / with replication.

  3. Secure MPC. For operations like ReLU, use cryptographic MPC protocols instead of coded computing.

None of these is as clean as the polynomial LCC framework; non-polynomial coded computing remains an open research direction.

πŸ”§Engineering Note

LCC in Production: A Niche Tool

LCC has seen limited production adoption, primarily because:

  1. Overhead. The df(Kβˆ’1)+1d_f(K - 1) + 1 recovery threshold is constant-factor worse than specialized schemes for common operations.
  2. Typical ML doesn't need arbitrary polynomial computations. Most modern ML layers are either bilinear (matmul, convolution β€” handled by specialized codes) or non-polynomial (ReLU, softmax β€” not handled by LCC).
  3. Niche use. Quartic polynomial activations, some privacy-preserving deep-net architectures (where multiplications are squared for exact MPC compatibility), and certain cryptographic ML pipelines.

In research-level deployments, LCC has been used for privacy-preserving logistic regression (quadratic sigmoid approximation) and for federated computation of higher-order statistics (e.g., skewness, kurtosis in federated analytics).

Practical Constraints
  • β€’

    LCC overhead: constant-factor worse than specialized schemes

  • β€’

    Most modern ML operations not served by LCC directly

  • β€’

    Niche applications: privacy-preserving quadratic-activation models, federated analytics

πŸ“‹ Ref: Yu et al. 2019 Β§VI; TF-Encrypted research toolkit

Key Takeaway

Lagrange Coded Computing unifies the coded-computing framework for arbitrary multivariate-polynomial functions. Recovery threshold is Krec=df(Kβˆ’1)+1K_{\text{rec}} = d_f(K - 1) + 1. Specialized schemes (polynomial codes, entangled codes) are tighter for specific bilinear operations; LCC is the general fallback for arbitrary polynomial computations.

Historical Note: The LCC Paper

2019–present

Qian Yu, Netanel Raviv, Mahtab Soleymani, and A. Salman Avestimehr's 2019 paper "Lagrange Coded Computing: Optimal Design for Resiliency, Security, and Privacy" was a capstone on the polynomial-code research programme: it unified the various specialized schemes into a single framework and showed that Lagrange interpolation on polynomial-coded inputs is optimal for arbitrary polynomial functions. The paper won the IEEE IT Society's James L. Massey Research and Teaching Award and is considered a landmark in the coded-computing literature. Subsequent work has extended LCC to privacy (TT-private LCC, Soleymani et al. 2021) and to Byzantine robustness (Solanki et al. 2020), setting the stage for Part III's secure-computation chapters.

Quick Check

For a bilinear function (df=2d_f = 2) with K=10K = 10 inputs, what is the LCC recovery threshold?

Krec=19K_{\text{rec}} = 19

Krec=10K_{\text{rec}} = 10

Krec=100K_{\text{rec}} = 100

Krec=2K_{\text{rec}} = 2