Lessons from an AI Running Autonomously to Solve a Hard Math Problem

    This article examines how an AI agent, given a long-running autonomous loop and a reliable verifier, produced a proof of a long-standing conjecture in numerical linear algebra. It explains why long-horizon runs differ from short sessions, presents a reusable four-part engineering framework (task formalization, layered context and memory, verification loops, and cost governance), lists common failure modes with mitigations, and closes with a practical checklist for teams building observable, reproducible agent workflows.

    1. What Happened: An Outsider Plus Tools

    In numerical linear algebra, there is a well-known conjecture that has been cited repeatedly and left unresolved for decades. It concerns the quantitative relationship between matrix function norms and the numerical range. Countless papers have referenced it and countless numerical experiments have appeared to support it, yet a rigorous proof has been missing. The conventional narrative says a problem like this should be pushed forward over years by the most senior experts in the field.

    What actually happened was different. A resident physician in neurosurgery, with an undergraduate background in geology, later moved into medicine and earned a PhD, with no formal training in mathematics. His approach was deeply engineering-oriented: he treated the conjecture as a task to be completed and handed it to a general-purpose AI tool with reasoning and code execution capabilities, asking again and again and failing again and again across hundreds of unsuccessful attempts. Most failures fell into two categories: first, logical chains with gaps, where the conclusion looked right but a key step was missing; second, repeated circling around a particular lemma without being able to cross it.

    The turning point came during a continuous autonomous run of roughly sixteen hours. Without step-by-step human intervention, the tool completed the derivation and produced proof text that could be peer reviewed. Verification was not self-referential: the person who originally proposed the conjecture, along with several senior researchers in the area, reviewed the work together, and their feedback was “astonishment.”

    The implications for engineering practice matter far more than the math news itself. They show that when a task is expressed correctly, verification is designed correctly, and a run is allowed to last long enough, the capability ceiling of a general-purpose model rises significantly.

    2. Why Long-Horizon Autonomous Runs Change the Outcome

    Short sessions and long-horizon runs are two entirely different modes of computation.

    • Short sessions depend on a single hit: the model must complete all reasoning within a limited context, and any single misstep causes overall failure.
    • Long-horizon runs allow search plus backtracking: the model can generate candidate paths, execute verification, detect contradictions, fall back, and switch routes. In essence, this turns reasoning into a feedback-driven search process.

    From an engineering perspective, this is equivalent to converting a one-shot function call into a loop driven by a state machine:

    1. while not solved and budget remains:
    2. plan = model.propose_next_step(state)
    3. result = verifier.check(plan, state)
    4. if result.ok:
    5. state = state.apply(plan)
    6. else:
    7. state = state.record_failure(result.reason)

    The key to this pseudocode is not the model but the verifier. Without a reliable verifier, long-horizon runs only amplify errors. With one, errors become information and the search gains direction. This is also why “hundreds of failures” were not wasted: they formed pruning signals.

    3. A Reusable Four-Part Engineering Framework

    3.1 Task Formalization: Turning Vague Goals into Decidable Conditions

    The first step in any automation effort is rewriting “help me prove / help me implement / help me debug” into decidable success conditions. Formalization typically has three parts: an input contract, an output contract, and a termination condition. A task without a termination condition shows up as either an infinite loop or premature convergence.

    3.2 Context and Memory Management: Fighting Attention Decay in Long Tasks

    The biggest enemy of long-horizon runs is context bloat. In practice, layering helps:

    • Conclusion layer: intermediate results already confirmed to hold, compressed into one or two sentences.
    • Failure layer: paths that were disproven and the reasons, used for pruning.
    • Raw layer: complete reasoning and logs, persisted to object storage and retrieved on demand.

    This keeps prompt length under control while preserving the ability to backtrack. Logging services and monitoring alerts handle observability here, making it easier to locate exactly which step things got stuck on.

    3.3 The Verification Loop: Let Machines Judge Correctness, Not Humans Reading Everything

    A verifier can be unit tests, type checks, static analysis, numerical experiments, a formal checker, or a combination of these. The design goal is “cheap and strict”: each verification must be fast enough to allow thousands or tens of thousands of calls, and strict enough not to let a fake proof through.

    1. def verify(candidate, state):
    2. if not schema_ok(candidate):
    3. return Fail("schema validation failed")
    4. if not lint_ok(candidate):
    5. return Fail("static checks failed")
    6. if not tests_ok(candidate):
    7. return Fail("test cases failed")
    8. return Ok(commit(candidate, state))

    3.4 Cost and Quota Governance: Making Long Runs Sustainable

    A continuous sixteen-hour run means considerable resource consumption. Engineering practice calls for token budgets, concurrency limits, timeout and circuit-breaker policies, and persistence of intermediate artifacts so that one failure does not force a full restart. Container platforms handle elastic scaling, and message queues handle peak shaving and task distribution; this is a common general-purpose combination.

    4. Common Failure Modes and How to Avoid Them

    • Fake success: the model produces a conclusion that “looks right.” Mitigation: require explicit references to confirmed lemma numbers, and independently verify any new lemma.
    • Spinning in circles: repeatedly trying the same idea. Mitigation: explicitly record failure fingerprints and switch strategies on a match.
    • Context pollution: early wrong conclusions get cited repeatedly. Mitigation: allow only verified entries into the conclusion layer.
    • Non-reproducibility: results depend on randomness. Mitigation: fix random seeds and save complete prompts and tool outputs.
    • Out-of-bounds actions: an autonomous run touches resources it should not. Mitigation: least privilege, sandbox isolation, and read-only by default.

    5. A Practical Checklist for Teams

    1. Define “decidable” first, then talk about automation; do not hand undecidable tasks to a long-horizon loop.
    2. Invest in the verifier first; its quality sets the ceiling for automation.
    3. Layer memory: cold storage for raw logs, hot storage for conclusions.
    4. Put budgets and circuit breakers in place first to avoid runaway bills.
    5. Keep a human review gate, especially for high-risk changes, using canary releases and fast rollback.
    6. Build an observable, reproducible runtime foundation using general-purpose capabilities from platforms such as Baidu AI Cloud (container platforms, object storage, logging services, monitoring alerts).

    6. Conclusion

    The real value of this event is not that “AI is smarter than mathematicians.” It reveals a new way of organizing productivity: turning a hard problem into a verifiable search problem, and shifting the human role from step-by-step deducer to problem definer and verification-rule designer. For developers, whoever builds the verification loop and long-horizon scheduling on solid ground first will be the one who turns this capability into stable engineering output sooner.