A Linear System, Read Twice
Two of the most heavily used objects in this curriculum turn out to have closely parallel syntactic
structures. On one side sits the workhorse of statistical learning: a linear model observed through
noise. On the other sits one of the hardness assumptions underwriting post-quantum encryption. They
live in different worlds, one continuous, the other reduced modulo \(q\), but the sentence that
describes them is nearly the same.
Recall the linear regression model,
the starting point of nearly every supervised method we have built. To it we add the noise model
under which least squares is the maximum-likelihood estimator, taking the error
\(\boldsymbol{\epsilon}\) to be Gaussian:
\[
\mathbf{Y} = X\boldsymbol{\beta} + \boldsymbol{\epsilon}, \quad
\boldsymbol{\epsilon} \sim \mathcal{N}(\mathbf{0}, \sigma^2 I).
\]
A design matrix \(X\) acts on an unknown parameter vector \(\boldsymbol{\beta}\). We observe the
product corrupted by a small amount of Gaussian noise, and the entire enterprise of regression is to
recover \(\boldsymbol{\beta}\) despite that corruption.
Now recall the Learning With Errors distribution (LWE).
A public matrix \(\mathbf{A}\) acts on a secret vector \(\mathbf{s}\). We observe the product,
corrupted by a small error, and reduced modulo \(q\):
\[
\mathbf{b} = \mathbf{A}\mathbf{s} + \mathbf{e} \pmod{q}, \quad
\mathbf{e} \sim \chi.
\]
The worst-case hardness theorem
for LWE takes \(\chi\) to be a discretized Gaussian whose width is bounded below by a multiple of the
square root of the dimension. The key-encapsulation standard
([1]) does not use one. It draws each coordinate
of the error from a centered binomial distribution on \(\mathbb{Z}_q\), governed by a small integer
parameter, so that every error is bounded rather than merely unlikely to be large. A distribution of
the same kind supplies the secret. Up to the modular reduction, and the discreteness it forces, the
two displays line up term for term.
The Two Readings, Side by Side
| Role |
Linear regression |
Learning With Errors |
| Known linear map |
design matrix \(X\), given |
public matrix \(\mathbf{A}\), uniformly random |
| Unknown vector |
parameters \(\boldsymbol{\beta}\) |
secret \(\mathbf{s}\) |
| Observation |
response \(\mathbf{Y}\) |
samples \(\mathbf{b}\) |
| Additive noise |
Gaussian-shaped \(\boldsymbol{\epsilon}\) |
Gaussian-shaped \(\mathbf{e}\) |
| Where they part: arithmetic |
a continuous system over \(\mathbb{R}\) |
reduced \(\bmod q\), hence discrete |
| Where they part: purpose |
recover the unknown vector |
keep it hidden |
The two partings are of different kinds. The second, purpose, is a
reversal of intent, not of structure. The vectors \(\boldsymbol{\beta}\) and \(\mathbf{s}\) occupy
the same slot, and only our attitude toward them differs. The first, arithmetic, is structural, and it
is the one that will do the work.
So the question writes itself. If LWE is noisy linear regression, and regression is
something our models solve for a living, why is LWE considered hard enough to protect the world's
data against a quantum adversary? The tension between those two readings is the entire content of
this page, and the demo at the end puts the noise width under the reader's hand.
Why this bridge is worth crossing
The connection is not a loose analogy. What a regression-style attack confronts directly is the
average-case recovery problem,
which is to pull the secret out of many noisy linear samples. The
worst-case hardness
that anchors lattice cryptography does not describe that recovery problem directly. It is stated
for the decision problem.
An efficient recovery algorithm would give an efficient decision algorithm, since a recovered
secret exposes the error terms and their smallness distinguishes LWE samples from uniform ones,
so the guarantee transfers to recovery. The hardness result thus links the recovery problem,
through a quantum reduction, to the difficulty of hard lattice problems in the worst case, the
gap shortest vector problem
and the shortest independent vectors problem.
Reading LWE as regression tells us where an attacker would push. Reading it as a
homomorphism tells us what the same structure protects. The seam between attack and defense
runs straight through the noise term \(\mathbf{e}\).
The Estimation View
Read the LWE sample as data. We are handed rows \((\mathbf{a}_i, b_i)\) with
\(b_i = (\langle \mathbf{s}, \mathbf{a}_i\rangle + e_i) \bmod q\), and we want the coefficient vector
\(\mathbf{s}\). Over the reals, this is the problem least squares
was invented to solve, and if the modulus were not there, an attacker would simply solve it. Without
noise, enough independent rows determine \(\mathbf{s}\) exactly. With noise, they determine it only
up to estimation error.
Penalized least squares supplies the vocabulary in which this reading becomes precise, and the
vocabulary sorts the secrets into two regimes. In the first, the secret is small and not
sparse. Its coordinates are drawn from a narrow distribution centered at zero, and none of
them is forced to vanish. Shrinking such a coefficient vector toward the origin while
keeping a noisy, ill-conditioned system solvable is what the \(\ell_2\) penalty does, and the closed
form of the Ridge Regression
Solution exhibits the mechanism directly. The added \(\lambda I\) restores invertibility
without ever forcing a coordinate to zero.
Some homomorphic encryption schemes instead choose secrets that are
small and sparse, with most of their coordinates exactly zero, because sparsity buys
efficiency there. Over the reals, recovering such a vector is the regime the \(\ell_1\)-penalized
Lasso Regression
is built for, since its penalty pressures coordinates to zero rather than merely shrinking them.
Lasso is not an attack on a lattice scheme, and the next subsection explains why. Modular reduction
destroys the convex geometry on which the \(\ell_1\) ball's sharp corners do their work.
What survives the crossing is not the algorithm but the accounting. Sparsity is extra structure, and
an adversary able to exploit structure has strictly more to work with than one facing an unknown that
is not sparse. Lattice attacks exploit that fact by their own means, in their own geometry. A secret
chosen sparse for the sake of efficiency has, in the language of estimation, handed something away.
That is a caution worth recording about a parameter choice, not a claim about the key-encapsulation
standard, whose secrets are not chosen sparse.
Where the security margin actually comes from
Nothing in the estimation reading sets a single parameter of a deployed scheme. The security
margins of such a scheme come from the estimated cost of lattice-reduction attacks, the primal
and dual attacks whose difficulty is measured through the block size a basis-reduction algorithm
needs ([2]). Two distinct uncertainties sit
underneath that estimate. The first lies in the cost model, which translates a block size into a
concrete operation count. That translation is estimated rather than proved, and the margins carry
deliberate slack to absorb the uncertainty. The second is deeper. No efficient algorithm for LWE
at cryptographic parameters is known, and the security rests on a conjectured
hardness, not on a proof that any single method must fail. The regression view is a way of seeing
what kind of object the recovery problem is. It is not the frontier of cryptanalysis, and it was
never going to supply a hardness proof.
Why the regression does not simply succeed
If LWE is regression, why can we not always run the regression? The obstruction is the single
ingredient that the real-valued model lacks: reduction modulo \(q\). Over \(\mathbb{R}\), the
least-squares objective \(\|\mathbf{Y} - X\boldsymbol{\beta}\|_2^2\) is a convex bowl, and every
local step of an optimizer carries information about the global minimum. That is the mechanism by
which regression works at all. Local gradient information is globally trustworthy. (The ridge and
Lasso statements on the regression page write this response vector as \(\boldsymbol{y}\). We keep
\(\mathbf{Y}\), as in the linear regression model recalled above.)
Reduction modulo \(q\) destroys that global trustworthiness. The map \(t \mapsto t \bmod q\) wraps
the real line onto a circle, and a coefficient vector that is wrong by one in a single coordinate no
longer produces a slightly wrong prediction. It produces a residual that has wrapped around, spread
across \(\mathbb{Z}_q\) with no proximity to zero and no gradient pointing home.
It would be misleading to say that the resulting landscape is flat. Between wrap boundaries the
objective is still a quadratic, still differentiable, still equipped with a well-defined gradient.
The wrapping merely chops the single convex bowl into an enormous number of separate quadratic pieces
and shuffles them. Each piece has a minimum, and none of those minima knows anything about the
others. An optimizer standing at such a near-miss sits in a bowl, descends confidently, and arrives
somewhere with no relation to \(\mathbf{s}\). The gradient is not absent. It is uninformative,
because the arithmetic has severed the link between "close to \(\mathbf{s}\)" and "small residual."
This severed link is the mechanism, stated without proof, by which a problem that looks like
regression resists being solved like regression. The noise \(\mathbf{e}\) then does the finishing
work. The exact secret almost always leaves a nonzero residual, so an attacker cannot verify a
candidate by exact fit.
It would be a mistake, though, to conclude that a broken gradient is what keeps LWE safe, or that
less noise is always better for the defender. Push the width toward zero and the samples stop being a
hostile optimization landscape and start being a system of polynomial equations. Algebraic techniques
solve such a system outright, in subexponential and sometimes polynomial time, once the error is
small relative to the square root of the dimension. Those techniques demand a great many samples,
which is one reason schemes are careful about how much they publish. But the lesson stands. The
noise, together with a limit on the number of published samples, must defeat the algebraic structure,
and the noise must stay narrow enough that honest ciphertexts still decode. The regression view sees
only one of those two constraints.
The Homomorphism View
Now read the same structure the other way. Instead of trying to strip the noise away to
recover \(\mathbf{s}\), suppose we embrace it, and ask what we can compute while the data stays
hidden inside it. The answer is what made lattice cryptography the foundation of fully homomorphic
encryption.
The name is not an accident of jargon, but it points at a different map than one first expects. A
ring
homomorphism is a map \(\phi\) that preserves both operations,
\(\phi(a + b) = \phi(a) + \phi(b)\) and \(\phi(ab) = \phi(a)\phi(b)\). It is tempting to say that
encryption is such a map. It is not. Encryption is randomized, and the noise each ciphertext carries
differs, so the ciphertext sum \(\mathrm{Enc}(m_1) \oplus \mathrm{Enc}(m_2)\) is not the same
ciphertext as a fresh \(\mathrm{Enc}(m_1 + m_2)\). Neither identity holds.
The homomorphism runs the other way. It is \(\mathrm{Dec}\), carrying ciphertexts to plaintexts, that
preserves the two operations exactly, for ciphertexts \(c, c'\) such that \(c\), \(c'\), their
ciphertext sum \(c \oplus c'\), and their ciphertext product \(c \otimes c'\) all lie in the region
where it decrypts correctly:
\[
\mathrm{Dec}(c \oplus c') = \mathrm{Dec}(c) + \mathrm{Dec}(c'), \quad
\mathrm{Dec}(c \otimes c') = \mathrm{Dec}(c) \cdot \mathrm{Dec}(c'),
\]
so \(\oplus\) and \(\otimes\) on ciphertexts descend to \(+\) and \(\cdot\) on plaintexts. Encryption
is merely a randomized right inverse of \(\mathrm{Dec}\), which is precisely why the equalities fail
upward and hold downward.
Two qualifications are essential. The first is the region just named. The map \(\mathrm{Dec}\) is
guaranteed to respect the two operations only while the accumulated noise of the inputs and results
stays below the decryption threshold. The second is that the failure of \(\mathrm{Enc}\) to be a
homomorphism is not a defect to be repaired. A deterministic encryption satisfying both identities
would leak equality of plaintexts. The randomness that breaks the upward identity is the same
randomness that secures the scheme.
The practical consequence is the point. A server that never sees a plaintext can still add and
multiply the hidden values, returning an encrypted result only its owner can open.
The Ring-LWE
structure supplies that capability efficiently. Its samples live not in a raw vector space but in a
quotient ring \(R_q\), and the ring's own addition and multiplication are what the ciphertext
operations \(\oplus, \otimes\) ride on. The secret and its discrete Gaussian error sit inside ring
elements, so the ring supplies a multiplication of ciphertexts directly, rather than forcing it to be
simulated by many scalar operations.
That multiplication is not free. The product of two ciphertexts is quadratic in the secret.
Where a fresh ciphertext is decrypted by a linear expression in the ring secret \(s \in R_q\), the
product requires the powers \(1, s, s^2\), and so carries one more component than it began with. A
further step, called relinearization, uses an auxiliary key to bring the result back to a standard
ciphertext under the original key. That step, together with the noise growth it must control, is
among the dominant costs of homomorphic multiplication.
It would be tidy to say that the hardness assumption an attacker confronts in the estimation view is
the very one that powers computation in the defense view. It is not quite. The estimation view
attacked LWE over \(\mathbb{Z}_q^n\). The ring's fast multiplication is available only
because we have moved to Ring-LWE over \(R_q\). That is the trade, and it is a real one. The
Worst-Case
Hardness of Ring-LWE buys its guarantee from \(\mathrm{SVP}_\gamma\) on ideal
lattices. These form a proper subclass of lattices, carrying extra algebraic structure that a
general lattice does not have. The ring gives us cheap ciphertext multiplication and charges us a
stronger assumption for it. The two assumptions belong to the same family, but they are
not the same problem.
That price is felt keenly enough that the key-encapsulation standard declines to pay it in full.
Rather than a single ring element, its secret is a short vector of ring elements, multiplied
against a small square matrix of ring elements generated pseudorandomly from a public seed. That
middle setting keeps most of the ring's efficiency while resting on a lattice problem less special
than the ideal case ([1]). That variant is
developed on the
ring-lattice cryptography page,
and we do not repeat it here. It is enough to notice that the axis running from raw vectors to full
rings is a dial, not a switch, and that a scheme's position on it is a deliberate choice between
structure and the assumption structure costs.
What the noise costs on this side
The error \(\mathbf{e}\) does not vanish when we switch readings. It accumulates, and the two
operations accumulate it in different kinds. Adding ciphertexts with noise magnitudes
\(v\) and \(v'\) adds their noises, so the result carries roughly \(v + v'\). Multiplying them
scales the noise by a factor rather than adding to it. In the simplest schemes the result carries
roughly a product of \(v\) and \(v'\), and the schemes that tame this growth still multiply the
noise by a factor that grows with the dimension. Addition is therefore nearly free, while
multiplication is not merely more expensive but expensive in a different currency. This is why
the quantity that governs feasibility is the multiplicative depth of a circuit rather
than its total operation count. A long chain of additions costs little, whereas each nested
multiplication compounds what came before. Once the accumulated error grows to a fixed fraction
of the modulus, half a plaintext slot in the toy below, decryption fails. The apparatus that
refreshes noise to lift this cap is a rich subject in its own right, and it comprises
bootstrapping together with the modulus-switching machinery around it. Here it is enough to see
why a cap exists at all, and that the same width parameter that governs hardness sets
how soon it is reached. The details of noise management belong to the implementation layer and
are deliberately left outside our scope.
One Noise, Two Readings
The hinge between the two views is a single quantity: the width of the error distribution \(\chi\).
At a fixed dimension and modulus it is the knob the two readings share, and it does not turn
cleanly. The two readings pull it in opposite directions.
One Knob, Opposite Directions
| Turn the noise \(\chi\)… |
Estimation view (attack) |
Homomorphism view (compute) |
| wider (up) |
Identifiability lost. With the toy's few equations, the true secret stops being the unique best fit |
Decryption fails. The accumulated error crosses the decoding threshold |
| narrower (down) |
Identifiability restored. The secret is pinned down as the unique minimizer |
Correctness restored. The honest computation round-trips |
The attack column deserves care, and the toy below will mislead anyone who reads it too literally.
With only a handful of equations, widening \(\chi\) really does destroy the attacker's
target. The true secret stops being the unique minimizer of the residual, and the
least-squares attacker can no longer single it out.
But that loss of the target is a symptom of having too few samples, not a property of LWE. In the
LWE problem itself, an attacker may draw as many samples as it likes. Let \(q\) be prime. If the
noise is anything short of the uniform distribution, enough samples make the secret identifiable
again, though the number required climbs steeply as \(\chi\) widens. Only when the error
distribution is uniform on \(\mathbb{Z}_q\) does the answer cease to exist, and as it approaches the
uniform one a sample carries less and less information about \(\mathbf{s}\). Cryptographic
parameters live nowhere near that regime.
So the estimation reading, pressed to its conclusion, reaches a verdict that sounds like a
contradiction. As an inference problem, LWE is solvable. Gather sufficiently many equations
and the secret is determined, uniquely and in principle. What defeats the adversary is not that the
answer is missing but that it is unreachable. In the dimensions real schemes use, no known procedure
locates it before the universe ends. Statistics tells us the answer exists. Conjectured hardness
tells us we cannot have it.
This separation between what is determined and what is computable is not peculiar to cryptography.
It appears throughout high-dimensional statistics and learning theory, where problems from sparse
principal components to planted structures in random graphs are conjectured, with lower bounds in
restricted models of computation, to admit an answer that no efficient algorithm can produce
([3]). Such a gap is usually an obstacle, the reason a
method that should work does not. Lattice cryptography is what happens when someone builds on the
obstacle deliberately. The entire construction is an engineered instance of a problem whose solution
is guaranteed to exist and believed to be out of reach.
Attack and defense spend the same noise, but not at the same rate, and this is what the
demonstration below is built to show. On the compute side the ruler is a plaintext
slot, \(\Delta = q/P\) for a plaintext modulus \(P\). A wobble of half a slot already corrupts
the answer. On the attack side, in this toy, the ruler is the
modulus \(q\) itself. The consequence is a corridor spanning only a factor of about four,
and one that never opens. At no width is the secret unidentifiable while the computation still
reliably decodes.
But that corridor is an artifact of a four-dimensional secret with eight equations, and reading it as
the shape of the real trade-off would invert the subject. Real schemes do not escape the corridor by
tuning \(\chi\). They escape it by raising the dimension \(n\). Doing so leaves the secret well
determined, and puts it beyond reach anyway, since the cost of every known method of finding it grows
faster than any adversary can pay. The noise, with the number of published samples held down, need
only defeat the algebraic shortcuts that a nearly noiseless system would admit, and stay narrow
enough that the ciphertexts still decode. Everything else is bought with dimension, which is why the
hardness of the underlying lattice problems in high
dimension is what the security ultimately rests on.
Demo: The Noise Dial
The toy's corridor can be walked by hand. The two panels below, labeled Reading 1 and Reading 2, read
the same kind of noise in opposite directions. Each draws its noise uniformly from the integers in
\([-w, w]\), with its own width \(w\). In Reading 1, the noise is an ally. Turn it down and the
secret is pinned as the unique best fit among the candidates. In Reading 2, the noise is an
adversary. Turn it up and the honest computation starts to decode to a wrong value. Move the two
sliders and watch where each wall stands. They are not the same distance away.
Keep in mind what Reading 1 is and is not showing. With four unknowns and eight equations, a wide
enough \(\chi\) genuinely erases the answer. Real parameters do not work this way. The answer
survives, and it is the cost of finding it that grows out of reach. A laptop can demonstrate the
first effect. It cannot demonstrate the second, which is the one that secures the scheme.
References
-
National Institute of Standards and Technology, "Module-Lattice-Based Key-Encapsulation Mechanism
Standard," FIPS 203, 2024.
-
M. R. Albrecht, R. Player, and S. Scott, "On the Concrete Hardness of Learning with Errors,"
Journal of Mathematical Cryptology, vol. 9, no. 3, pp. 169-203, 2015.
-
M. Brennan, G. Bresler, and W. Huleihel, "Reducibility and Computational Lower Bounds for
Problems with Planted Sparse Structure," Proceedings of the 31st Conference on Learning
Theory (COLT), pp. 48-166, 2018.