270-Digit Integer Factorization in 10 Days: Porting GNFS to GPUs with an AI Coding Assistant and Idle Cloud Compute
A security researcher used an AI coding assistant to port a mature open-source Number Field Sieve implementation to GPUs, then ran the job on fragmented idle cloud capacity to factor a 270-digit integer (about 896 bits) into two 135-digit primes in roughly 10 days. This article explains the result, why large-integer factorization matters, how the GNFS stages map to GPUs, the porting and validation workflow, the use of schedulable idle compute, and the engineering lessons for developers.
270-Digit Integer Factorization in 10 Days: Porting GNFS to GPUs with an AI Coding Assistant and Idle Cloud Compute
Event Overview: An Atypical Factorization
In mid-September, a security researcher publicly disclosed a notable result: a 270-digit decimal integer (about 896 bits) was successfully factored into two 135-digit prime factors, p and q. Multiplying p and q exactly reproduces the original number.
What made this factorization unusual was not a mathematical breakthrough—factoring 270-digit integers is already academically feasible—but how it was completed:
- No quantum computer was used. The work used the classical Number Field Sieve (NFS).
- No dedicated large-scale cluster was provisioned. Most computation came from fragmented idle capacity in cloud data centers, available in gaps between regular task scheduling.
- The core engineering work was performed by an AI coding assistant. The researcher had the assistant port a mature open-source NFS implementation to run on GPUs. The whole factorization cycle took about 10 days.
The most important takeaway from the announcement is simple: an AI assistant was responsible for porting NFS software to a GPU architecture. This deserves attention from anyone interested in security engineering and compute utilization.
Why Large-Integer Factorization Matters
Integer factorization is one of the trust foundations of modern public-key cryptography. RSA-style encryption relies on an asymmetry: multiplying two large primes is easy, but reversing the product back into the primes is extremely difficult.
The academic community established graded challenge numbers, from RSA-100 (100 decimal digits) upward. Each solved challenge marks another advance in computational capability. Historically notable factorizations include:
- RSA-129: factored in 1994 using the globally distributed compute available at the time, taking about eight months.
- RSA-250 (250 digits): factored in 2020 by a French research team using an open-source NFS software package refined for nearly 20 years, running for months on thousands of CPU cores.
The trend is clear: each step up in digit count brings exponential growth in required compute and engineering complexity. This 270-digit factorization followed a very different route—using other people’s idle compute plus AI-written GPU code.
GNFS: The Mainstream Tool for Large Factorizations
For integers above 100 digits, the widely accepted mainstream algorithm is the General Number Field Sieve (GNFS). It is also the core algorithm used by the open-source software that the French researchers had refined for nearly two decades.
The GNFS process generally has several stages:
- Polynomial selection: find a suitable pair of polynomials, which directly determines downstream sieving efficiency.
- Sieving: search a large number of numeric points for “smooth” relations. This is the most time-consuming stage, usually accounting for more than 70% of total time.
- Linear algebra: build a sparse matrix and solve it to find dependencies.
- Square root: recover the actual prime factors from the solution.
The key point is that the sieving stage is highly parallel and has regular branching, making it well suited to GPUs. Traditional implementations, however, are mostly optimized for multicore CPUs, and mature production-grade GPU ports are lacking. That gap is what this engineering effort filled.
The Role of the AI Coding Assistant: Moving Nearly Two Decades of Code to GPUs
Porting a number theory software package that has existed for nearly 20 years and contains extremely complex logic sounds reckless, but it proved feasible. The core workflow can be summarized as:
Input: mature CPU implementation of NFS source code (C/C++)↓Analyze: identify the sieving main loop, memory access patterns, and data dependencies↓Rewrite: hot loops → GPU kernels (for example, using a general GPU compute framework such as CUDA)↓Tune: coalesced memory access, shared memory, batched work queues↓Validate: compare intermediate results and final factors with the CPU implementation
Several engineering details stand out:
- It was a port, not a rewrite. The algorithm logic had already been validated for two decades. The AI’s job was to map it faithfully to the GPU execution model, not to invent a new algorithm.
- Validation came first. Every rewritten step had to be compared against the CPU reference implementation to ensure numerical semantics remained consistent.
- The gains were concentrated. GPU acceleration mainly benefited the sieving stage; the linear algebra stage still partly relied on the existing pipeline.
Idle Compute: An Overlooked Free Lunch
Another notable feature of this factorization was its compute source: scheduling gaps between regular workloads in data centers. Utilization in large cloud data centers often fluctuates. Task switching, autoscaling, and batch queuing create many fragmented windows of idle capacity.
For workloads that can be divided, checkpointed and resumed, and have no strict deadline—large-integer factorization is a typical example—this fragmented capacity has near-zero marginal cost. With containerized scheduling and elastic resource pools, such offline computing tasks can be placed into idle windows at low priority, maximizing overall resource utilization. This follows the same cloud-native ideas of mixed deployment and off-peak computing, and aligns with the direction of elastic scaling and batch processing capabilities generally offered by mainstream cloud platforms.
Three Takeaways for Developers
- Classic algorithms plus new hardware still leave substantial room. Many numerically intensive software packages remain CPU-era designs, and porting them to GPUs or NPUs is a rich area for engineering work.
- AI coding assistants are changing the division of engineering labor. Tedious, mechanical, but rigor-demanding porting work is being compressed from person-months to days, shifting human value toward algorithm selection and result validation.
- Fragmented compute deserves serious treatment. Sensible task partitioning and fault tolerance can let “scavenged” compute complete work that previously required a dedicated cluster.
The arms race in integer factorization continues. In the next decade, the compute may not come only from larger data centers. It may also come from smarter scheduling and smarter code.
