Introduction
As quantum computers threaten to break classical encryption like RSA, the cryptography world is migrating to Post-Quantum Cryptography (PQC). The US National Institute of Standards and Technology (NIST) recently standardized PQC algorithms based on a mathematical puzzle called the Learning with Errors (LWE) problem. LWE also forms the basis for Homomorphic Encryption (HE), which allows computation on encrypted data.
To make HE and other LWE-based schemes run efficiently, practitioners often use secret keys that are sparse (mostly zeros) and small (entries are binary $\{0,1\}$, ternary $\{-1, 0, 1\}$, or drawn from a narrow Gaussian distribution). The critical question is: Are these small, sparse secrets actually secure?
Previous machine learning-based attacks, such as SALSA and PICANTE, proved that sparse binary secrets could be recovered using Transformers. However, they struggled to scale to larger dimensions ($n$), failed on non-binary secrets, and required large moduli ($q$). Counter-intuitively in LWE, a smaller modulus $q$ makes the problem harder to crack.
SALSA VERDE is a novel machine learning-based attack that overcomes these limitations. By combining highly optimized lattice reduction preprocessing with Transformer models, VERDE successfully recovers sparse binary, ternary, and Gaussian secrets at larger dimensions and smaller moduli than previous ML attacks, even outpacing classical lattice attacks in specific regimes.
The VERDE Attack Pipeline
VERDE follows a three-stage pipeline: eavesdrop LWE samples, preprocess the data, and train a Transformer to recover the secret.
- Optimized Data Preprocessing: VERDE uses classical lattice reduction (BKZ) to reduce the variance of the eavesdropped LWE samples. The authors heavily optimized this step—reordering matrix rows, lowering floating-point precision, and using interleaved algorithms—making it 40x faster than the previous state-of-the-art.
- Transformer Training: The preprocessed data is fed into a Transformer (either a seq2seq model or a novel encoder-only DeBERTa-based model with an Earth Mover's Distance loss). The model is trained to predict the LWE output $b$ from the input vector $a$.
- The "Two-Bit Distinguisher": To recover non-binary secrets (like ternary or Gaussian), VERDE introduces a clever new secret recovery technique. The model swaps or alters coordinates in the input vector $a$. If the model's prediction for $b$ doesn't change, it implies the corresponding secret bits are identical. This allows the model to group and identify $-1$s, $0$s, and $1$s.
Key Insights: The "NoMod" Phenomenon
Why do Transformers learn to crack LWE at all? The authors discovered that the attack succeeds only if a large portion of the training data doesn't actually require modular arithmetic.
If the dot product $a \cdot s$ doesn't "wrap around" the modulus $q$ (an event they call NoMod), the Transformer can learn it. The authors found that if the NoMod proportion in the training data is greater than roughly 67%, the secret is recoverable. This provides a crucial insight: Transformers are currently bad at modular arithmetic.
Based on this NoMod discovery, the authors derived a heuristic formula showing that successful secret recovery depends entirely on the square root of the sparsity ($\sqrt{h}$) and the standard deviation of the input data. Because the standard deviation of a ternary secret is the same as a binary secret with the same sparsity, VERDE recovers ternary secrets just as easily as binary ones—a surprising finding that perfectly matches their new scaling law.
Experimental Results
The authors evaluated VERDE on synthetic datasets of LWE problem instances defined by dimension $n$, modulus $q$, and secret sparsity $h$. For each training epoch, the model processed 2 million LWE samples, augmented via lattice reduction to a training set of 4 million samples.
- Scaled to Larger Dimensions: VERDE successfully recovered secrets up to dimension $n=512$ (up from PICANTE's limit of 350), recovering binary and ternary secrets with up to 12% sparsity.
- Conquered Smaller Moduli: VERDE pushed the attack down to $\log_2 q = 12$ (for $n=256$). This is a massive leap, as smaller moduli are significantly harder to break and are much closer to real-world cryptographic parameters.
- Outperformed Classical Attacks: In concrete runtime comparisons, VERDE recovered secrets in hours (e.g., 4.5 hours for $n=256, \log_2 q=12$) that classical unique Shortest Vector Problem (uSVP) attacks failed to find even after weeks of computation.
Limitations and Future Work
While VERDE represents a significant step forward, it does not yet break standardized NIST PQC schemes, which use larger parameters and different structures. Furthermore, the attack's preprocessing step still relies on classical lattice reduction algorithms, which scale exponentially and will eventually become a bottleneck for larger dimensions.
Future research should focus on developing neural network architectures that are natively good at modular arithmetic. This would bypass the "NoMod" limitation and allow attacks on smaller $q$ without relying as heavily on preprocessing. Additionally, the community needs new data preprocessing techniques to concentrate the distribution of random vectors without relying on slow, classical lattice reduction.
Summary updated