Skip navigation
1/4 LLMs solve research grade math problems but struggle with basic calculations.
0:00 / 0:21

1/4 LLMs solve research grade math problems but struggle with basic calculations.

Christos Tzamos

@ChristosTzamos24K followers

Visit on X
6,033 likesDownloadOriginal post

1,833,206 views

1/4 LLMs solve research grade math problems but struggle with basic calculations. We bridge this gap by turning them to computers. We built a computer INSIDE a transformer that can run programs for millions of steps in seconds solving even the hardest Sudokus with 100% accuracy

54 Comments

Comments from the original post on X (Twitter)

  • Andrej Karpathy's profile picture

    @karpathy

    Wait this is so awesome!! Both 1) the C compiler to LLM weights and 2) the logarithmic complexity hard-max attention and its potential generalizations. Inspiring!

    1,404 likes

  • Christos Tzamos's profile picture

    @ChristosTzamos

    2/4 The key limitation of LLMs is that standard attention is too slow for any practical computation. We bypass this limitation with a new decoding path that allows for exponentially faster attention enabling almost constant work per token generation.

    741 likes

  • Christos Tzamos's profile picture

    @ChristosTzamos

    3/4 Instead of using an external tool, the model executes the program directly via its transformer weights, producing an execution trace token by token and streaming results at more than 30k tokens/sec on a CPU. All computation is done autoregressively inside the transformer!

    800 likes

  • Christos Tzamos's profile picture

    @ChristosTzamos

    4/4 Read more at our blog post:

    1,123 likes

  • Alman Gonzaleshvili's profile picture

    @gonzaleshvili

    33,000 tokens per second. Brother what kind of rocket powered spaceship is that? My macbook m2-pro barely spits 27tokens/s

    136 likes

  • Christos Tzamos's profile picture

    @ChristosTzamos

    That's what our fast-attention decoding mechanism gets you! This was also run on my macbook which is possibly older than yours. With regular decoding I would also get similar 27toks/s and decreasing as time goes by.

    228 likes

  • Alman Gonzaleshvili's profile picture

    @gonzaleshvili

    this is where the money's at. fast-attention decoding mechanism 💎

    20 likes

  • Cavit Erginsoy's profile picture

    @caviterginsoy

    I’m so sorry to say but I really dislike seeing these sorts of totally unnecessary implementations of a transformer. You can literally do same or better for a fraction of the compute deterministically. and any frontier LLM can give you script for it pretty much 1 shot.

    69 likes

  • Christos Tzamos's profile picture

    @ChristosTzamos

    Solving a Sudoku this way seems unnecessary but the deeper question is what this can unlock if LLMs can own their own computation internally+have the capacity to understand it. Can we optimize the whole problem solving process end-to-end without being restricted to a code syntax?

    412 likes

  • Cavit Erginsoy's profile picture

    @caviterginsoy

    I see what you’re saying but I’m trying to imagine a fully scaled frontier variant of what you did and still can’t see why tool use isn’t inevitably always better on both compute efficiency and on quality of response. There is an anthropomorphic view that calculators are much better at maths than humans but we still learn arithmetic, but just don’t see how that logic applies to a transformer. Though I agree if you only train on tool-use data, the model never learns to maintain a consistent search tree inside its own weights. It keeps needing the ‘crutch’’. You do show you can fix that and once fixed, the model can decide when to call a tool more intelligently instead of reflexively. But frontier size models do not ONLY train on tool use anyway..

    27 likes

  • phyrooo's profile picture

    @phyrooo

    @ChristosTzamos Imagine an intelligent system always having to offload computation to an external (permissioned?) tool call vs being able to execute it inside its own mind. It might be a way to get to a permissionless reasoning + computation. Whether that's good or bad is a different question.

    36 likes

  • Cavit Erginsoy's profile picture

    @caviterginsoy

    @ChristosTzamos It’s all about when to use tool call. You as an intelligent system constantly offload computation externally don’t you?

    19 likes

  • willowdesk's profile picture

    @willowdesk

    @phyrooo @ChristosTzamos This is a great point but I think this research seems pretty interesting.

    2 likes

  • Cavit Erginsoy's profile picture

    @caviterginsoy

    @phyrooo @ChristosTzamos It does, I was too hasty to call it out in the harsh way I did

    16 likes

  • Bobby Price's profile picture

    @yungrichbobby

    I was working on doing exactly this can we please dm?

    53 likes

  • Tau Net's profile picture

    @Tau_Net

    Nice! Here is Tau's Sudoku Solver doing the same Sudoku. Our approach is to express the Sudoku as logical constraints, and our SMT solver does the rest.

    43 likes

  • CriptoSHAman's profile picture

    @cript0shaman

    When the program understands the rules, brute force isn't necessary...

    22 likes

  • Yechan Do's profile picture

    @doyc_1

    I like the idea of turning transformers into actual computers. But how do you convince people this works 100%? They operate on probability.

    18 likes

  • Christos Tzamos's profile picture

    @ChristosTzamos

    @yechan_ai This uses a handcrafted construction for the weights of the transformer that comes with a proof of correctness. It is specifically constructed to match the spec of webassembly.

    116 likes

  • Christos Tzamos's profile picture

    @ChristosTzamos

    @yechan_ai In particular, there is nothing random in the construction or the decoding process.

    47 likes