An unofficial, read-only Hacker News reader.

Much shorter version of GRH Lean verification from Anthropic (opens external site)

570 points by nb-t 3 days ago | github.com | 371 comments on HN

View full thread · View on Hacker News

Comment thread (50)

  1. From ~17M lines to just ~76k lines, a 99.56% reduction.
    Replies (6)
    1. 76k lines sounds like it would just about fit into a 1m token context window. Cool.
      Replies (1)
      1. It doesn't quite fit with the o200k tokenizer, I just checked.
    2. Meanwhile, the community-driven compression with a hundred contributors and thousands of pull requests sits at a mere 33% reduction.

      Why this huge discrepancy?

      https://riemann.verifytask.cn/

      Replies (6)
      1. The internal models are smarter.
        Replies (1)
        1. Or they just have access to way more compute.
          Replies (1)
          1. Nah, you can see how little progress that project has been making recently. Even with 1000x compute I doubt it'd hit 80%

            These hill climb-y tasks tends to hit a limit based on model capability (and getting stuck making tiny improvements in bad directions)

            Replies (1)
            1. When hill climbing gets stuck, you can always wheel out beam search.
      2. 1. That chinese website might be the wrong dashboard, I think there's a chinese group that's doing the same thing. The main Lean community work is at https://github.com/leanprover-community/riemann-hypothesis

        2. I disagree with the methods used by the Lean community repo, which is to try and shrink the original 17 million line Lean proof down. Instead, I believe it was much better to try and formalize the proof from scratch.

        I was in the process of doing that greenfield formalization by myself. I am about maybe ~70% done, and I am currently at ~35k lines of Lean right now. Unfortunately, I do not have access to Anthropic's compute; this is all done with a $100 ChatGPT plan running GPT-6.2 Sol. Since Anthropic has the resources to beat me to the punch, I guess I will just publish my current progress here: https://github.com/jamesyc/riemann-hypothesis

        Note that this is not my first rodeo; I have previously formalized a proof of the smallest Turing Machine that cannot be proven to halt in ZFC https://github.com/jamesyc/BusyBeaver/tree/main/ZF192

        Replies (2)
        1. I praise people like you!
        2. As somebody who tried the other way around, I think you made the right decision. I was able to condense down the proof by a lot, but in retrospect, it would have been much faster to just build it from scratch again.
      3. The "obvious" thing is a mathematician with a proper understanding of both the tooling, math in itself, and good strategies.

        Useful tactics and thought processes are still a helpful skill. Maybe the model can come up with those, but if you already have a strategy with high chances of success then you can already do that!

        Replies (1)
        1. There’s someone in this thread who is doing it on a $100 per month plan and claims to be under the Anthropic size so far. It looks like they are a software developer
          Replies (1)
          1. Sure, I just mean like.... someone who isn't just asking a robot to "make it smaller and cleaner".

            Like just a bit of direction can make you spend an order of magnitude less time on this kind of stuff

            Replies (1)
            1. Fortunately, lots of people can have a go.

              And the go with the robot and no understanding doesn't interfere with the mathematician with a robot and more understanding.

      4. The community-driven one is here: https://rh-shrink.github.io/

        Edit: they just switched to the version in this repo.

      5. I unfortunately can't recall the exact source but I saw some Lean experts early on commenting that those efforts appeared to be a poorly organized dead end that were focusing on cheap "easy wins" that don't actually reduce the fundamental complexity of the proof, like inlining imports.
        Replies (1)
        1. This does bring all sorts of weirdos out of the woodwork making it seem like anyone can do math. I mean yes it's more accessible now, but you need some skill. It has gone the other extreme towards pseudo intellectualism, or maybe a kind of anti-academic populism.
          Replies (1)
          1. Yes anyone can do it just like anyone can decompile GTA6. Humans are doing very little in all of this.
      6. I assume the in house models are significantly more powerful.
    3. That's interesting. If the method used to reduce is applicable to arbitrary software libraries, we could be able to simplify a lot of cruft that may help making some systems easier to understand.
    4. Does anyone have any tips for simplifying llm output like this using LLMs? I’ve never had any luck getting Claude to simplify code unless I just reprompt.
      Replies (2)
      1. Consider: https://news.ycombinator.com/item?id=50611593

        Left a comment under it that may be more directly relevant for you: https://news.ycombinator.com/item?id=50648003

        Also relevant are the topic-specific comments from the Lean Zulip thread (linked elsewhere here) on how this was done:

        Luke Sernau:

        > Yes, it's based on the same proof. I'm not able to say very much about methods, unfortunately, but I had some luck with unrolling definitions to get a long, flat proof, looking for simplifications there, and then rolling them back up again. That way I could simplify across boundaries. Some stuff just needed entirely new arguments though, like getting rid of Vandiver.

        Devin Watson:

        > For RH I took the millions of lines of Lean from Alpöge and fully decomposed it into atomic binary math functions. Decomposing it to the atomic functions enabled structural deduplication, hash-consing, direct binary term reduction, DAG theorem inlining, and shift-aliasing and binary packing. I am sure there are other strategies for essentially compression that could be applied. Using a custom framework on top of Lean I have gotten it down to 528,681 lines of Lean since starting around lunch yesterday. Obviously I haven't been dumping this directly into the main GitHub repo but it has been guiding my work. I was hoping to have a fully condensed RH Lean package and paper some time tomorrow.

        Luke Sernau:

        > sounds cool! And way more aggressive than what I was doing. I would bet that there are some big wins still to be had doing that on the shorter version.

      2. Show Claude the before and after and then get it to work out a repeatable method :)
    5. That is some ratio! I picture Alpoge just hacking like crazy on Claude and not looking at the code! I guess he has a strong intuition and just keeps piling stuff on in parallel.

      Then he makes it "go green", and doesn't care about cleaning it up

      I only did CTF once or twice, long ago, pre-AI ... but that's how I felt: just keep writing code and trying things. No cleanup. Whereas when I write code I plan to maintain, I probably do too much cleanup and refactoring.

      Replies (1)
      1. He admitted to including a bunch of crap to troll people. It was unprofessional, especially with how much attention this got and the amount of people’s time he wasted.

        Still an incredible result! Not taking away from it. And with how much he poured into it, I can understand going a bit crazy and not empathizing with the eventual reviewers.

        But, it’s able to be optimized to such an extent because it was purposefully long before.

        Replies (1)
        1. > He admitted to including a bunch of crap to troll people.

          I don't think he said that.

          He admitted to publish the fist version that compiled (or something close to that) instead of taking a few days/weeks to cleanup it. Not ideal, but I don't mind it.

          IIUC he notice the English proof he would get was going to be too long and no human would be able to read it, so he decided to drop the English version and publish only the Lean version. The "joke" was pretending that the Lean version printed in A4 paper counts as an English version.

          Note: I expect that after some cleanup and a few years of study, we will get a "short" proof that enters in one or two books. But the guy didn't have a few years to sit on the proof and clean it.

          Replies (1)
          1. Publishing the first version that compiled opened the rest of the process to the entire community. In this case that's probably better than the alternative.

            The process by which math is done is being redefined in real time. It's fascinating to watch, and think about what this means for the field going forward.

    6. It's worth noting that the 76k line version is heavily "golfed" (e.g., cramming the same content into fewer lines), which heavily hurts readability for the sake of a smaller line count. A more sane version is around 300k lines. Still, a massive reduction!

      The proof also still contains a few unused intermediate results. Sounds like these were neat findings where the proof of RH ultimately only needed a weaker version of the result, but folks at Anthropic thought it would be worthwhile to finish fleshing out the details.

      Replies (1)
      1. > The proof also still contains a few unused intermediate results.

        This is exactly the type of thing that moves a field forward, that many people were (inexplicably IMHO) saying we wouldn't get with an AI proof

        Replies (2)
        1. To be fair, since it’s only a few days later, it would have been better if Anthropic did that simplification before releasing it to the public. It was massive ammo that fed the trolls to just call it “slop” and a trash proof.
          Replies (5)
          1. So why did they feel like rushing it? Was OpenAI close?
            Replies (1)
            1. Alpöge was personally impatient and they’d already made him wait until after the IPO.

              Continue this thread (1 replies) →

          2. Maybe there are more important things in that "slop". It can be a gold mine.
          3. Ultimately it's more egg on their face. People were certain the proof couldn't be shortened or be made sense of. Now what? The goalposts are in orbit at this point.
            Replies (2)
            1. > People were certain the proof couldn't be shortened or be made sense of.

              Who was certain of that?

              I can just about see how someone might hold the latter position, maybe. But the former seems pretty silly?

            2. No it sounds to me like your strawman is in orbit.

              There was already a proof that was shortened by 20% so your position is untenable. I was literally waiting for them to publish a reasonable proof.

          4. > To be fair, since it’s only a few days later, it would have been better if Anthropic did that simplification before releasing it to the public.

            Why? Let the public have some fun!

          5. >It was massive ammo that fed the trolls to just call it “slop” and a trash proof.

            Good. Shows who to ignore.

        2. Makes you think that maybe the ‘let’s shorten the original 17M lean loc’ community rally should rather be ‘let’s mine the original 17M for new mathematics’
          Replies (2)
          1. You can have more than one community rally. Both are fun and important!
          2. A lot of people are doing both things at the moment. This proof is being studied very widely and very seriously, and for a long time will be attacked from all possible angles.

            The overwhelming goal of most mathematicians is to advance human understanding of mathematics. This is a tremendous opportunity to do that.