When AI Approaches the Riemann Hypothesis: A Practical Guide to Formal Verification

    As AI models are increasingly claimed to reach math problems that have stood open for over a century, this article separates conjecture from verifiable proof and lays out a practical engineering approach to formal verification. It explains a decoupled architecture in which generation and verification run in fully independent processes, four common technical pitfalls, a reproducible and auditable pipeline, five metrics that replace subjective judgment, four frequent failure modes, and a pre-launch checklist for turning "AI in mathematical research" into an evidence-backed engineering practice.

    1. First, Separate Two Things: Offering a Conjecture vs. Offering a Proof

    The recent hype is that “some intelligent model has reached a problem that has been open in mathematics for over a hundred years.” Before discussing this, we have to separate two distinct concepts.

    The first is problem-level insight: the model points out that a direction is worth attention, proposes a possible construction, offers candidate counterexamples, or provides clues from numerical experiments. The value of this kind of output is that it compresses the exploration space, but it is inherently probabilistic and must not be circulated as a conclusion.

    The second is a verifiable proof: starting from explicit axioms and definitions, the target proposition is reached through a finite sequence of valid inference steps, and every step can be independently re-checked by a third party. Only the second category counts as “solving” the problem.

    Propositions like the Riemann Hypothesis belong to a domain with extremely high requirements of the second kind. Any claim of “reaching the finish line” should first answer an engineering question: can the inference artifact be verified automatically by a machine? If it cannot, then it is only a hypothesis awaiting verification, not a result. This is precisely the fundamental reason formal methods enter the AI reasoning pipeline.

    2. Core Architecture: Fully Decouple “Generation” from “Adjudication”

    The reliable approach is to keep the creative part and the adjudicating part completely separate, and in no case should the generation module endorse itself.

    1. Input: proposition statement (natural language + formalization target)
    2. │
    3. ├─ 1. Semantic normalization ── extract definitions, restrict domains, remove ambiguity
    4. │
    5. ├─ 2. Knowledge retrieval ───── relevant theorems, existing lemmas, isomorphic problems
    6. │
    7. ├─ 3. Search-based generation ─ candidate proof-step sequences (multi-sample)
    8. │
    9. ├─ 4. Formalization assembly ── write into an interactive proof assistant script
    10. │
    11. └─ 5. Independent verification ─ proof kernel checks item by item, pass / fail
    12. │
    13. fail → feed back error location, return to 3

    The key point is that step 5 must run in a separate process and a separate image, consuming only the static files produced by step 4, without network access and without reading any intermediate state from the generation side. A proof that passes verification is the deliverable; anything that does not pass is labeled a “draft.”

    The search loop expressed in pseudocode:

    1. def prove(target, budget):
    2. for attempt in range(budget.max_attempts):
    3. lemma_set = retriever.query(target, top_k=budget.top_k)
    4. draft = generator.propose(target, lemma_set, temperature=schedule(attempt))
    5. proof = assemler.build(draft, lemma_set) # generate proof assistant script
    6. report = verifier.run_in_sandbox(proof) # independent verification
    7. logger.emit(attempt, report.gaps, report.elapsed)
    8. if report.accepted:
    9. return artifact(proof, report, attempt) # preserve the full evidence chain
    10. return None

    3. Four Technical Details That Are Easy to Get Wrong

    1. Retrieval quality sets the ceiling. A model’s weakness is usually not logical reasoning but not knowing which existing lemma to invoke. If you chunk the theorem library into embeddable entries that retain the name, type signature, preconditions, and usage examples, and then do hybrid retrieval by type-match score, the hit rate is often improved more effectively than by scaling up the model.

    2. Step granularity must match verification feedback. Generating hundreds of lines of proof at once makes errors almost impossible to locate. In practice, it is better to split the goal into several subgoals and generate only a small, independently verifiable fragment each time, so that a failure can precisely feed back “which step did not pass.”

    3. Strictly hold the “no unproven assertion” red line. The interactive environment of a proof assistant usually allows temporarily skipping a subgoal to continue writing (the “open hole” state). Once such placeholders flow into the final artifact, the entire proof degrades into a pseudo-proof. Verification must treat “whether any unclosed goal remains” as a hard rejection condition, not a warning.

    4. Axiom assumptions must be explicitly registered. Introducing additional assumptions may make a proof hold instantly, but this is a conditional result. The artifact must carry a list of assumptions, displayed alongside the original proposition, for a human to judge its significance.

    4. Engineering Implementation: Make Experiments Reproducible and Auditable

    A single trial is not a result; you need a stable pipeline to carry a large number of repeated attempts.

    • Compute scheduling: wrap each attempt as a stateless task, group and queue by GPU memory and CPU ratio, and let the scheduling layer uniformly handle retry on failure and timeout circuit-breaking.
    • Sandbox isolation: generation and verification each run on a one-time instance of a container platform, with the proof script mounted read-only and output written to a restricted directory.
    • Artifact retention: the proof script, logs, intermediate drafts, and verification reports are all written to object storage, organized by path as “problem ID + attempt number,” so that any historical result can be traced and reproduced.
    • Pipeline orchestration: retrieval, generation, assembly, and verification are decoupled with a message queue, so scaling one stage does not affect the others.
    • Observability: a logging service aggregates the distribution of failure reasons, and monitoring/alerting watches signals such as a sharp drop in verification pass rate, abnormal per-task latency, and exhausted resource quotas.

    The artifact directory can be conventionally arranged as:

    1. /{problem_id}/{attempt:04d}/
    2. draft.txt # raw generation-side output
    3. proof.script # formalization script
    4. verify.log # full verifier output
    5. status.json # accepted / rejected + list of unclosed goals

    5. Evaluation: Replace Subjective Judgment with Five Metrics

    Metric Meaning Purpose
    Formal verification pass rate Share of attempts that pass verification Measures real output capability
    Average number of attempts Retries before the first pass Measures search efficiency
    Retrieval hit rate Share of retrieved lemmas actually cited by the final proof Locates knowledge-base quality
    Cost per success Compute and time for a single pass Determines whether it can scale
    Unclosed goal rate Share of placeholder goals remaining in drafts Early risk warning

    It is worth emphasizing that these five metrics should be compared horizontally on a fixed benchmark, and the benchmark must include three kinds of samples: known-solvable, known-unsolvable, and extremely hard. This avoids a distorted conclusion in which “only solving easy problems is judged as a breakthrough.”

    6. Four Common Failure Modes

    • Citing nonexistent theorems: the name looks plausible, but there is no corresponding entry in the library. Countermeasure: require that all citations must hit a retrieval result, otherwise reject directly.
    • Condition mismatch: a theorem is applied without its applicability conditions being met. Countermeasure: perform a static check of preconditions at the assembly stage.
    • Circular dependency: the proof process indirectly relies on the goal-to-be-proven itself. Countermeasure: build a dependency graph and detect cycles.
    • Semantic drift: the formalized proposition is not equivalent to the original natural-language statement. This is the hardest problem to detect automatically and requires manual comparison; it is recommended to keep paired “natural-language original sentence—formalized statement” records for review.

    7. Conclusion and Checklist

    “AI reaches the finish line earlier than humans” is a communication-friendly statement, but it is not an engineering conclusion. The more valuable engineering statement is: on a clearly defined formalization target, an automated pipeline produced, after N attempts, a proof that can independently pass verification, with the following list of assumptions. The former relies on trust; the latter relies on re-checking.

    Checklist before launch:

    1. Is the verifier completely independent of the generation pipeline?
    2. Are there any remaining unclosed goals or extra assumptions, and have they been explicitly disclosed?
    3. Are the draft, script, logs, and report of each attempt fully archived?
    4. Does the evaluation benchmark cover easy, hard, and unsolvable samples?
    5. Is the cost per pass acceptable, and can it be reproduced stably?

    Only by treating “AI participating in mathematical research” as an engineering project that requires an evidence chain do the conclusions hold up. As for how to carry this pipeline in the cloud, Baidu AI Cloud’s general capabilities across container platforms, object storage, message queues, logging services, and monitoring/alerting are sufficient to cover the resource scheduling, artifact retention, and observability needs described above; specific specs and configurations should be based on the official documentation and actual load-testing results.