2.8 Learning With Rounding
What happens when you delete the noise distribution from LWE and let the rounding do the work instead.
Learning With Errors needs an error distribution. Every sample draws a fresh error from a discrete Gaussian or a centred binomial, and that sampling step has to be correct, unbiased, and constant-time. Three of the most serious implementation problems in deployed lattice cryptography — KyberSlash timing, biased Falcon sampling, and faulty nonces in signature schemes — live in exactly that code.
Learning With Rounding asks whether the sampling can be removed. It can, if the noise is allowed to be produced by rounding a scaled inner product instead. What makes LWR interesting is not that it is simpler — it is that the resulting “noise” is a deterministic function of the secret, which changes both the proof and the implementation.
Definition
Fix a dimension , a modulus , and a smaller modulus dividing . Write the scaled rounding function as
where rounds to the nearest integer. For a secret , the LWR distribution produces pairs by:
- Sample uniformly at random.
- Output .
Compare the two side by side. LWE has three steps and two sampled values; LWR has two steps and one.
| Sample value | Modulus of the output | Randomness used per sample | |
|---|---|---|---|
| LWE | , with | For and for | |
| LWR | For only |
Both problems come in decision and search forms, and the decision form is the one that gives pseudorandomness: distinguishing LWR samples from uniform pairs in is assumed hard. Because lives in the smaller ring , an LWR public key or ciphertext can also be shorter than an LWE one at the same dimension, which is the other half of the appeal.
Worked example: n = 2, q = 8, p = 2
Take the smallest parameters that still show the structure: , , , so , and the secret . Each row is one sample.
| Rounded | Rounding error | ||||
|---|---|---|---|---|---|
| (1, 2) | 13 | 3.25 | 3 | 1 | +0.25 |
| (2, 1) | 11 | 2.75 | 3 | 1 | −0.25 |
| (3, 3) | 24 | 6.00 | 6 | 0 | 0 |
| (1, 0) | 3 | 0.75 | 1 | 1 | −0.25 |
| (0, 1) | 5 | 1.25 | 1 | 1 | +0.25 |
Download the Python example to recompute the table with exact rational arithmetic and to regenerate the comparison below.
Two things are worth noticing. The third row lands exactly on an integer, so its rounding error is zero — with that happens whenever is a multiple of 4, which is one sample in four here. And the error never exceeds half a step in the scaled domain, , which is the bound that makes decryption work at all.
The error is a function of the secret
This is the single most important difference from LWE, and it is easy to miss because the samples look identical in shape. Hold fixed and change the secret:
| Rounding error | ||||
|---|---|---|---|---|
| (3, 5) | 13 | 3.25 | 1 | +0.25 |
| (1, 1) | 3 | 0.75 | 1 | −0.25 |
| (7, 2) | 11 | 2.75 | 1 | −0.25 |
All three secrets produce , but the underlying rounding errors differ. In LWE the same three secrets would also produce values of drawn from an error distribution that says nothing about which secret was used, because is sampled independently. In LWR the remainder carries information about beyond the rounded bit: knowing where a value sits within its rounding bin is knowing something about the inner product, and hence about .
Why that makes the reduction harder, not easier
A first instinct is that LWR should be at least as hard as LWE, since rounding throws information away. That intuition is right and useless as a proof: an LWE solver gets to see with independent of , and an LWR instance gives it a value whose distance from an integer is a deterministic function of the secret. Turning one into the other means showing the rounding remainders behave like the independent noise, which requires the ratio to be small enough that the remainders are spread finely relative to the modulus.
That is the content of the Banerjee–Peikert–Rosen result, and it is why their theorem carries conditions on the parameters rather than being a clean equivalence like the search-to-decision reduction for LWE.
Hardness
Banerjee, Peikert and Rosen introduced LWR at EUROCRYPT 2012 and proved that LWE reduces to it: an efficient solver for decisional LWR at modulus yields an efficient solver for decisional LWE at a larger modulus , for polynomial in and suitably larger than . Combined with Regev's quantum reduction from worst-case lattice problems to LWE, that places LWR under the same worst-case umbrella — with the same caveats about approximation factors that apply to every lattice hardness claim.
Two consequences matter in practice. First, the reduction runs in the direction LWE-hard implies LWR-hard, so LWR inherits a lower bound on its difficulty rather than offering an independent assumption. Second, because the modulus ratio appears in the reduction, an implementation that picks too close to is not covered by the same statement. Parameter sets are chosen to sit inside the theorem, not merely to decrypt correctly.
The same paper used LWR to build pseudorandom functions and deterministic encryption directly from lattices, which is a construction LWE does not give as cleanly: a PRF needs a keyed function that is deterministic, and rounding supplies the determinism for free.
What you gain
- No noise sampler
Encryption and key generation draw randomness only for the public matrix , which is usually expanded from a seed by a standard hash or XOF. There is no Gaussian, no binomial, no rejection loop with a secret-dependent branch. That removes the entire category of sampling side channels — the timing leak in KyberSlash, the floating-point and CDT hazards in Falcon sampling, and the bias bugs that appear when a discrete Gaussian is approximated.
See lattice side channels and faults for what those bugs cost in practice.
- Deterministic, and easier to make constant-time
- Rounding is a shift, an add and a mask when and are powers of two. That is a handful of instructions with no data-dependent branch, versus a rejection sampler whose iteration count depends on secret values. Constant-time correctness becomes a property of the arithmetic rather than a property you must prove about a loop.
- Smaller public material
- Because lives in rather than , each sample costs bits instead of . At and that is a 23% saving per coefficient before any further compression.
What it costs
- The modulus stops being free
- Clean rounding wants , and the schemes that reached the later NIST rounds used powers of two for both. That is incompatible with the design point of ML-KEM, whose is prime specifically so that splits completely and the NTT applies. An LWR scheme gives up that trick, or gives up clean rounding.
- Correctness analysis is less forgiving
- In LWE the decryption failure probability follows from a tail bound on independent noise, which is well understood and easy to tune. In LWR the rounding remainders accumulate through a polynomial product and are correlated with the secret, so the bound has to be argued rather than sampled. A scheme can decrypt correctly on every test vector and still have a failure rate that is worse than claimed.
- No standard adopted it
- SABER and Round2 both reached the third and fourth rounds of the NIST PQC competition on Module-LWR assumptions. ML-KEM was selected for standardisation as FIPS 203, and HQC was selected in 2025 as the backup from a different family. LWR remains a well-analysed alternative without a FIPS number, which for most organisations settles the question regardless of its technical merits.
ML-KEM rounds, but it is not LWR
This confusion is common because both schemes contain a rounding step and both use moduli that are close to powers of two. They are doing different jobs.
ML-KEM forms a ciphertext as , where is sampled from a centred binomial distribution and . The noise is sampled; the rounding is a lossy encoding applied afterwards purely to reduce the byte count from bits per coefficient to bits. See what happens to one ML-KEM coefficient for the full path.
LWR deletes the . The rounding is the noise, and the hardness argument has to explain why a deterministic function of the secret is indistinguishable from uniform. The superficial similarity — a floor-bracket in the formula — hides a different assumption, a different proof and a different failure analysis.
A related detail: is not divisible by any power of two, so ML-KEM's compression is not the clean case at all. Its correctness analysis has to bound the extra rounding term explicitly, which is part of why the FIPS 203 failure probabilities are stated per parameter set rather than derived from a single formula.
When LWR is the right answer
- Constrained or hostile execution environments. Where a sampler cannot be made reliably constant-time — smart cards, some microcontrollers, or a codebase you do not control — removing the sampler removes the risk rather than mitigating it.
- Pseudorandom functions and deterministic primitives. This is LWR's original application and remains its cleanest one. A keyed rounding function is deterministic by construction.
- A deliberately different assumption for a hybrid. The same reasoning that put HQC next to ML-KEM applies within the lattice family: an LWR component does not fail when an LWE component does. This is a design argument, not a standards-compliance one.
- Not where a FIPS number is a procurement requirement. For that, use ML-KEM and ML-DSA, and put the engineering effort into deploying them correctly.
Check Your Understanding
Q1. In LWR the value differs from by a rounding error. How does that error differ from LWE noise?
Q2. Why does LWR constrain the choice of modulus more than LWE does?
Q3. ML-KEM compresses ciphertext coefficients by computing . Is ML-KEM therefore an LWR scheme?
References and further reading
- Abhijit Banerjee, Chris Peikert, Anup Rosen, Pseudorandom Functions and Lattices (EUROCRYPT 2012) — the definition of LWR, the reduction from LWE, and the PRF constructions.
- Andrea Castryck, Ilia Iliashenko, Frederik Vercauteren, SABER NIST round 3 submission — Module-LWR key encapsulation with , and module ranks 2, 3, 4.
- Joppe Bos et al., Round2 NIST submission — Module-LWR KEM and public-key encryption.
- NIST, FIPS 203 — ML-KEM, for the compression arithmetic compared above. See 3.1 Kyber / ML-KEM.
- See also Ring-LWE and Module-LWE for how the module setting changes the same comparison, and SIS for the other non-LWE lattice assumption behind the standards.