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)
Lagrange Coded Computing (LCC)
Let be a multivariate polynomial function of vector inputs, of total degree . The goal: given inputs , compute using distributed workers.
LCC construction. Pick distinct interpolation points (one per input). Define the Lagrange polynomial where are the Lagrange basis polynomials with the property . Each worker is assigned an evaluation point and stores .
Worker computation. Worker computes , a single evaluation of . By construction, where is a polynomial in of degree .
Master decoding. The master receives any worker responses and Lagrange-interpolates . Evaluating at the interpolation points gives β wait, this isn't quite right. Properly: if all inputs are provided as for , then the target is , not separate function evaluations. See the following construction note.
The exact LCC construction is subtler than the pseudocode suggests: is a function of inputs jointly, and for each . The master interpolates the polynomial 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 be a multivariate polynomial of vector-valued inputs with total degree . The Lagrange Coded Computing scheme with workers over () satisfies:
- Correctness. Any responses suffice to recover .
- Optimality. This matches the information-theoretic lower bound: no scheme can achieve smaller at the same per-worker storage for polynomial functions of degree .
- Per-worker storage. Each worker stores one "input-sized" evaluation () β the same as the standard polynomial code.
Specializing recovers earlier results:
- Matrix multiplication: (bilinear), . For -partitioned matmul with , β matching the standard polynomial code.
- Convolution: , same formula. For -partitioned convolution with , β matching the entangled code.
- Higher-degree polynomials: require more responses, linearly in .
LCC reduces arbitrary polynomial computations to polynomial interpolation. The encoding lifts input vectors to a polynomial whose evaluation at recovers input . The function , being polynomial of degree in its inputs, becomes a polynomial of degree in when evaluated on . This higher-degree polynomial is interpolated from worker responses, and the target output is read off at a specific -value.
The framework's power is its generality: any polynomial function gets an optimal recovery threshold without specialized design.
Correctness
The polynomial has degree at most (since has degree and has total degree ). Any evaluations determine uniquely (Lagrange interpolation), and evaluating at the interpolation point appropriate to the target combination recovers .
Optimality
A counting argument: has at least degrees of freedom as a polynomial on , so the master needs at least that many independent observations. Matching achievability closes the rate region.
Specializations
Matmul: , , gives . Wait β this is not the standard polynomial-code exactly; LCC is tight up to constants. For convolution with , , larger than entangled's .
The subtlety: for specific structured operations (matmul, convolution), specialized codes can beat LCC by exploiting the output structure beyond raw polynomial degree. LCC is "optimal for generic polynomials" but structured variants can do better. See Yu et al. 2019 Cor. 1.
Example: LCC for a Quadratic Function
Use LCC to distribute the computation of (quadratic form) with data split into partitions. Compute the recovery threshold.
Degree of $f$
is quadratic in β total degree .
LCC recovery threshold
.
Interpretation
With workers, the master can recover from any 7 responses. Straggler tolerance: .
Comparison
A naive "compute each partition's quadratic independently" would require responses but only handles diagonal contributions; the cross-partition terms require additional structure. LCC handles this transparently.
LCC Recovery Threshold vs. Function Degree
Plot the LCC recovery threshold as a function of the function degree for several input-count values . 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
Number of input partitions
Lagrange Coded Computing: The Unified Framework
LCC vs. Specialized Coded-Computing Schemes
| Target operation | Specialized scheme | LCC | ||
|---|---|---|---|---|
| Matrix mult | Polynomial code (Ch. 5) | General | ||
| Convolution | Entangled polynomial (Β§8.2) | General | ||
| Cubic / quartic polynomial | No specialized scheme | β | LCC | |
| Tensor contraction (order 3) | Entangled variant | General | ||
| Arbitrary multivariate polynomial | No specialized scheme | β | LCC |
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 being a polynomial of bounded degree. For non-polynomial operations, LCC does not apply directly. Approaches:
-
Polynomial approximation. Approximate the non-polynomial by a low-degree polynomial , apply LCC to , tolerate the approximation error.
-
Hybrid coding. Apply LCC to the polynomial layers of a network (convolutions, matmuls) and compute the non-polynomial layers redundantly / with replication.
-
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.
LCC in Production: A Niche Tool
LCC has seen limited production adoption, primarily because:
- Overhead. The recovery threshold is constant-factor worse than specialized schemes for common operations.
- 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).
- 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).
- β’
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
Key Takeaway
Lagrange Coded Computing unifies the coded-computing framework for arbitrary multivariate-polynomial functions. Recovery threshold is . 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βpresentQian 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 (-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 () with inputs, what is the LCC recovery threshold?
.