Fewer than one billion Toffoli gates now needed for RSA-2048 factoring

Researchers at Intelligent Quantum Inception Co., Ltd. and Tsinghua University have achieved a reduction in the computational cost of breaking RSA-2048 encryption. Their work demonstrates RSA-2048 factoring now requires fewer than one billion Toffoli gates, a key threshold previously estimated to be 2.7 billion. The team lowered expected factoring Toffolis by up to 78.6% by using a large language model to redesign quantum circuits and build a deterministic compiler, bringing practical quantum code-breaking closer to reality.

LLM-Driven Search Redesigns RNS Pipeline for RSA-2048

The redesign of residue number system (RNS) pipelines for RSA-2048 factoring now uses large language models to achieve verifiable quantum compilation, a process that reorganizes the entire four-stage pipeline rather than optimizing individual subroutines. This approach focuses on sharing exponent-window lookups across batches of up to 24 primes, a significant departure from serial processing used in previous methods. Sustaining these larger batches without increasing ancilla qubit requirements or introducing uncertified wraparound errors necessitated coordinated changes throughout the pipeline, including aligning numerical representations between stages.

These changes also involved localizing measurement-based uncomputation within each window and prime, and analytically bounding the probabilities of rare overflows. The team verified the resulting elementary gate sequences across all constituent RNS primes on representative circuits, ensuring accuracy and reliability. Stratified full-width compilation, performed over five representative batches, recovered peak qubit counts with zero error and matched exact Toffoli counts across all primes within 0.10%.

Dual-backend verification on three additional milestones, using 1,359, 2,822, and 2,919 qubits, further validated the 30-circuit frontier generated by the LLM-driven search. The work builds on recent advances in approximate RNS, which reduce the number of logical qubits needed for factoring, but still require substantial numbers of Toffoli gates. Previous optimization attempts were hampered by the tight coupling of arithmetic stages due to shared ancilla qubits and measurement-based uncomputation, as well as the infrequent occurrence of overflows in compressed registers, making them difficult to detect through random simulation.

The LLM-driven search addresses these challenges by systematically exploring the design space and identifying configurations that minimize both qubit and Toffoli gate counts. During the preparation of their manuscript, the researchers noted a concurrent independent preprint from Sharma and Lau studying shared QROM lookups and lazy modular residues for RSA-2048, using between 1,432 and 1,806 qubits.

They have included architectural and quantitative comparisons to this work in Section III. 2 and Appendix E of their paper. The internal search harness and cluster driver are available through a public repository, allowing for reproducibility of the results and further research. The team’s methodology combines analytical verification with computational validation, ensuring the reliability of the optimized circuits. This approach differs from previous attempts that relied heavily on simulation, which can be unreliable when dealing with rare events like overflows.

By bounding overflow probabilities analytically, the researchers can confidently predict the behavior of the circuits and verify their correctness. This combination of analytical and computational techniques represents a step forward in the development of practical quantum algorithms for cryptography. The resulting circuits demonstrate a substantial reduction in the resources required for RSA-2048 factoring, bringing the total number of Toffoli gates needed below one billion for the first time. The code and data supporting this research are publicly available on GitHub at https://github. com/ZhangTao1999/LLM-Driven-Verifiable-Quantum-Compilation-for-RSA, facilitating further investigation and development in this rapidly evolving field.

RNS Framework and Prior Toffoli Gate Counts for RSA-2048

Analytical verification of elementary gate sequences across all constituent residue number system (RNS) primes confirms the reduction in computational cost for factoring RSA-2048, a key step towards practical quantum computation. This optimization is particularly significant given that modular exponentiation dominates the logical cost within Shor’s algorithm, pinpointing the specific area of improvement.

The newly designed circuits bring RSA-2048 factoring below one billion Toffoli gates for the first time, a threshold previously considered a barrier to practical quantum code-breaking. This reduction was accomplished by using a large language model to drive verifiable quantum compilation, a technique that allows for the exploration of a vast design space and the identification of circuits with optimal performance.

Analytical Overflow Bounds for Compressed Registers

Compressed registers, important for reducing qubit demands in quantum factoring algorithms, present a challenge due to the possibility of rare arithmetic overflows that are difficult to detect through standard simulation methods. The work detailed here addresses this issue by establishing analytical bounds on the probability of these overflows, specifically for 27-bit lanes where probabilities fall around 10 to the power of negative ten. By certifying these rare overflow tails, the researchers circumvent the need for exhaustive simulation, a computationally expensive process.

The methodology extends phase-tracked trajectory simulation, originally developed by Khattar and colleagues, with exact symbolic tracking of all possible mid-circuit measurement outcomes. Stratified screening during the search process further refines the analysis, ensuring a robust assessment of potential errors. Beyond overflow analysis, the team achieved substantial reductions in resource requirements by combining several optimizations.

Large-batch lookup sharing, with up to 24 parallel computations, and aligned representations across stages contribute to qubit savings. Localized measurement-based uncomputation further streamlines the arithmetic processes. These improvements, when combined, resulted in a 70% reduction. The gains are not isolated to individual subroutines, but stem from a comprehensive approach to circuit design.

This methodology provides a template for scaling LLM-driven circuit discovery to full fault-tolerant algorithms, combining automated search with analytical error bounds and symbolic measurement-phase checks. The ability to transfer these cross-stage ideas to other arithmetic-heavy tasks, such as elliptic-curve discrete logarithms and windowed QROM pipelines, further expands the potential impact of this research.

Pareto Frontier of Compiled Modular Exponentiation Circuits

The compiled circuits now require fewer than one billion Toffoli gates to factor RSA-2048, a reduction confirmed across 29 Pareto-optimal points generated by a new deterministic compiler. This achievement represents an advance beyond previous attempts that struggled to reduce logical gate counts below 4.5 to 11 billion Toffolis. The new circuits operate with between 1,306 and 2,919 logical qubits while maintaining a batch size of 24 or less, demonstrating a balance between qubit overhead and computational cost.

This optimization isn’t simply a matter of refining existing techniques. The approach yields a “Pareto frontier” of circuits, meaning further improvements in one area, such as reducing qubit count, would necessarily increase the number of Toffoli gates required. The team’s compiler systematically explores this trade-off, identifying circuits that represent the best possible performance under given constraints.

Several key mechanisms contribute to this performance gain, and each is described as indispensable to the overall result. Rolling ANF and lane compression, for example, keep the qubit count below 2,500 even with a batch size of 24, while non-restoring division and dyadic CRT eliminate deferred Toffolis and save logical qubits. “Every mechanism is indispensable,” the researchers state, emphasizing the thorough nature of their approach. The team verified the accuracy of these circuits across all constituent residue number system primes, confirming results through dual-backend verification on batch 0.

Verification of Quantum Circuits with Phase-Tracked Simulation

Phase-tracked simulation extended existing tools to rigorously verify newly designed quantum circuits for RSA-2048 factoring, addressing a key challenge in scaling these computations. While approximate residue number systems reduce qubit requirements, the inherent difficulty lies in detecting rare overflows within compressed registers, events too infrequent for standard random simulation to catch. To overcome this, the team implemented exact symbolic tracking of all mid-circuit measurement outcomes, a technique that allows for comprehensive verification across all 2M possibilities.

This detailed analysis was coupled with stratified screening during the search process, ensuring the reliability of candidate circuit designs. Analytical tail bounds were also developed to predict and limit the probability of these rare overflows, providing a mathematical guarantee of circuit correctness. This analytical approach complements the simulation, offering a dual layer of validation. The meticulous verification process directly enabled a reduction in the computational resources needed to factor RSA-2048.

This improvement is coupled with a lowering of expected factoring Toffoli gates by up to 78%. The team’s work demonstrates that the combination of LLM-guided design and rigorous verification is a powerful strategy for advancing the field of quantum computation.

Reduction to Under One Billion Toffoli Gates for RSA-2048 Factoring

This reduction in gate count, detailed in recent work, represents a step toward practical quantum code-breaking capabilities by addressing the dominant logical cost of modular exponentiation within Shor’s algorithm. The team’s approach focused on optimizing the arithmetic stages of the algorithm, where shared ancilla qubits and measurement-based uncomputation previously created tight coupling and computational bottlenecks.

The team’s work demonstrates that this frontier not only reduces gate count but also improves simultaneously in qubit requirements over full-width modular multiplication, and strictly dominates serial RNS baselines. Mapping this logical frontier onto planar surface-code hardware introduces practical tradeoffs, as detailed in an appendix to their work, but the reduction in computational resources is nonetheless substantial.

Stay current

See today’s quantum computing news on Quantum Zeitgeist for the latest breakthroughs in qubits, hardware, algorithms, and industry deals.

Avatar of Futurist

Futurist

Futurist is a pen name Quantum Zeitgeist uses for full-time coverage of quantum computing. The beat spans quantum hardware, superconducting, trapped-ion, photonic and neutral-atom qubits, alongside quantum error correction, quantum algorithms and post-quantum cryptography, as well as the companies, funding rounds and national programs shaping the industry. The writing favours careful, technically grounded reporting over hype, and is aimed at readers who want the detail behind the headlines rather than a surface summary. Quantum Zeitgeist has tracked the field daily for years, and articles under the Futurist byline are part of that continuing record.

Latest Posts by Futurist: