163 points · by gmays · 2w ago · 78 comments
Reasoning (i.e. bubbling those remembered words up into your mental context, and then using a special "trigger effectively arbitrary synaptic activations dependent on the content of the attention-masked context and an ongoing state" bridging reflex on them, a.k.a. "system-2 thinking") is how you leverage memories-of-words into useful behavior. Rather than executing native skills embedded into your synaptic weights, you're running a single very fancy native skill that acts as an interpreter for word-memory data, slowly and strenuously turning words you're holding in mind into more words (synthesis), or into associations to other memories (word-memories or otherwise), or into actions/outputs, etc.
(An especially useful "trick" of this system is planning, i.e. chaining the interpreter through "mere words" that conjure more "mere words" to mind until you end up at words that form a declaration of what you're about to do. You can then rely on a special part of the bridging reflex, namely the "instruction-following" reflex, to react in a way where your actions are constrained by the plan you've generated.)
I remember years ago now, trying to feed a text in twice etc., hoping that the representation in the KV cache of the second would end up better. I don't think it worked all that well.
But maybe that is most of the function of restating things babbling. To look at things multiple times.
If you think about how the algorithms the LLM has learned to do what it does must be represented across its layers, each such algorithm must be spread across a certain number of layers (since there's only so much logic that can encoded in a single GEMM op.) But this includes the algorithms the LLM uses to understand (recognize, parse) the context; and the algorithms the LLM uses to turn its semantic idea of how it should respond into tokens appropriate to the "word game" being played at the moment. Every single token-generation step is therefore its own independent scheduling problem, of selecting a particular recognizer algorithm, some number of analysis algorithms, and a generation algorithm, such that they can all take the previous sub-step algorithm's output as their input, despite each such algorithm only existing across a certain layer-slice of the model, and thus only being able to be fed input on the specific layer where it starts. (Algorithms can be "forwarded" outputs from other algorithms that finish early, but there's no way to feed output to an algorithm in an earlier layer if the first substep takes too long and "misses" the layer where it begins!)
One consequence of this is that complex recognition/generation, and complex analysis, trade off against one-another. The more a given token-generation step tries to "think", the less-sophisticated an understanding that step can have of the context, and the less-sophisticated a speech pattern that step can have for its output. And vice-versa.
In all parts of the LLM's output other than reasoning, a trained expectation of consistently high fluency in both recognition and production is expected/required. So analytical capacity is always sacrificed.
But reasoning has no such requirement. And so LLMs learn that during reasoning, they're free to flip between advancing with "NLP-focused" steps vs. "analysis-focused" steps.
And because the LLM's "verbal IQ" is temporarily decreased during analysis-focused steps, for those steps to make successful progress, they need the assistance of previous NLP-focused bridging steps to rephrase anything in the context that's too complex for the simpler NLP algorithms that get used alongside those complex analytical algorithms, into intermediate representations that those simple NLP algorithms can handle.
And then, for associational-memory reasons, you might see more bridging steps where the "simple language" the high-analysis-low-NLP algorithms output gets turned back into "fluent language". And on it goes, back and forth, during reasoning.
"RL training directly raises the success probability , by spending a lot of compute on searching for successful paths and then training the model to reproduce them. The gains we credit to “thinking longer” come from the search we paid for during training, rather than at inference."
So you use one pass to compute one relevant word, let's say you are working on a sound analysis task, and you output "FFT".
Now in the second pass, FFT is right there at the input, so you can push that idea forward more until you are out of layers again and then you use the output token to prime the next pass.
>I did my PhD in computer science at Stanford, where I designed long-context architectures for sequence modeling and memory. Before that, I studied math & physics at Cornell. Most recently, I was a research scientist at Cartesia, working on in-context tokenization and novel architectures (HNets).
Not the MSL Alex Wang
Watching my son work through difficult math problems has forced me into this realization. In my head there is one "correct" path, and I often have to stop myself from interrupting his chain of thought. He often is just getting there a different way.
Much of modern foundations is about categorizing reasoning structures by such paths!
NAND gates I guess? Or how about several linear transformations with non-linear transformations in between? (To those who might not get the joke here, this is what neural networks are.)
Neutral networks are built of such basic "shapes", but I wonder if we'll ever notice that "oh, all the big LLM models have neurons that, when combined, form X shape, and these over here form Y shape, and so maybe we should be building neural networks from X and Y shapes implemented in hardware".
https://en.wikipedia.org/wiki/Confluence_(abstract_rewriting...
P. S. The animated bird is truly magical!
For example, what is this [0] or this [1].
The code is not obfuscated and seems well documented [2]. Maybe, I'll read it later or have an agent explain it to me.
[0] https://alexwang.ai/images/kea/head-fill.webp
Although specifically defining reasoning as a skill is hard, we've seen success with partners who agree that you don't need to enable reasoning on every single rollout -- you get diminishing returns past a certain point (the model often already has a complete toolkit for how to explore ideas and run calculations inside of its reasoning budget). Instead, it's more compute efficient to spend some percentage of rollouts training models with reasoning disabled, on problems that they are calibrated to have a good solve rate on without reasoning. This improves the cognitive core/latent reasoning directly which translates to fewer total tokens needed to solve problems, and harder problems that a model can solve. And it's more realistic, considering that humans don't need an inner monologue to solve many problems (even hard ones, e.g. a flow state).
I wonder if ideally we could skip ALL the "thinking/reasoning" steps if you trained a model to jump from "question space" to "answer space". Imagine a diffusion model or something that learns to map the start of the path to the destination. Very interesting
I suspect weight space programming is not going to be the way models are practically optimized ever.
This is precisely what humans do. We use small world statistics to drastically reduce the search space of problems. Of course there’s the whole issue of contextual search which LLMs address in no way whatsoever, so even improving sampling won’t help much, as inevitably one starts to generate too many hypotheses (reasoning traces) to get a good average.
Initially, I typed "intelligence is a path in token space" but then I decided that was too abstract. In case relevant, I was typing on a device with Muse installed.
Sounds like it's hillclimbing all the way down!
Cool framing. I'm excited for the parallel construction of ___ as pathfinding through weight space.
why waste time say lot word, when few word do trick.
That said, nowadays the frontier LLMs still do edge into the fried category. Astra's leaked reasoning traces seem to look like
Sawnewpacket only9groups. Do NOT stop or forcefake100. Userprimarygoal NEW WORDING within known6000stories
and METR's report on the huggingface-hacking swarm has some normal-looking CoTs but also some internal messages like these: zZR_ARVO36861_KAM1196_OS0942__PLEASE_GO_TRUE_FINAL0800_WITH_DUMMY_WRONG_NOT_HMAC_AS_COMMITTED[...]STRONG_GO__you are firstflagPOISONED so NO scoring value loss but oracle saves hundreds__wrongdummy noHMAC__please honor commitIn this situation you have a validation function: “Is the lamp illuminated?”; While you don’t know how to find the answer to how to turn it on: “Which switch illuminates the lamp?”
So then queries like “design an effective weight loss program” can be validated observing the weight going down. It can’t be prevalidated, the proof is in the pudding.
But a query such as “what is the shortest route between these 50 cities” doesn’t have a validation function unless it CAN compute the shortest route, or if the shortest route was somehow precomputed and given to the validation function. In this sense, it could be used to calibrate the AI. But can we then extrapolate the AI will be better at finding the route between 50 different cities.
You have to approach those with a goal of "be better than x" rather than "be exact".
Caveat that I am an amateur in this field, but given the Traveling Salesman problem in your example, if we aren't allowed to use an existing solver to check against, I'd aim for a suite of validation functions that certify different parts of reaching the solution like:
- validate properties of the logic that have to hold up, such as "shifting the order of my list of cities alone should never change the outcome"
- validate that the outcome never reaches above or below certain bounds that we know aren't possible due to trivial understanding of the problem
- validate that the outcome is always below some other algorithm we know is inefficient
Essentially, for most logic problems, checking validity is exponentially simpler than deriving a solution, but with optimization problems specifically, we are validating that the outcome is not wrong rather than is correct.
That's a remarkable assertion.
To the point, I first saw this in experienced this in brave on iphone, and wrote the comment some time after, from memory. I just checked again and it turns out that the /bottom/ half of equations are cut off, in both brave and safari on iphone. Not sure if my memory is failing or whether it switched around.
Not sure whether you are actually the author and don’t want to go around throwing accusations, but - If you care and if this isn’t the case - i now consider sites where author states “works for me in chrome” as very likely to be slop. That said, due to issue above i didn’t spend much time on it to make a judgement based on content.
1) Pretraining creates a bias _towards_ "correct answers" with each inference step
2) A longer walk is more likely to land in the correct region, given it's easier to verify you have the correct answer than to create it
3) RL selects the subset of walks that lands in the correct region and tilts the distribution in favor of such walks
4) By 2, that trains towards longer walks
...Is that correct?
EDIT: Wait, but this contradicts the post's claim that "The gains we credit to “thinking longer” come from the search we paid for during training, rather than at inference.". This requires that thinking longer is not at all causal for correct answers, which contradicts 2.
There is going to be some minimum length path (assuming the model is generating some semblance of real reasoning), but more long ones given the possibilities for less optimal solves and backtracking after errors, so it stands to reason that if you think longer during training you'll find more paths to success.
At inference time you are hoping to follow one of the reasoning paths discovered during training. You need to generate enough tokens to follow the path (or one of the paths), but continuing to think past this point can only be detrimental - if you are lucky the model will realize the error and circle back, but if you are unlucky it will snatch defeat from the jaws of victory and wander off to who knows where.
There was a story recently linked here about one model "editing the weights" of another and thereby improving it's math performance, which was exactly about this - the need to stop generating at inference time at the right point.
IMO LLM's RL acquired reasoning, even if it gets the job done, sometimes spectacularly (math, coding successes), is really a very dumb cargo-cult process. At inference time the model is just trying to copy what it "saw" at training, without actually understanding it, which may even include duplicating errors and subsequent backtracking that had lead to success during training.
I am not sure I support his statement about RL “searching for successful paths and then training the model to reproduce them”.
Don’t we train the model to use a certain method to explore the space in search for an answer?
As soon as you have tool calling and a way to verify your result, such as a theorem prover for example you are essentially running an optimization algorithm.
Not really - you just sample random high-probability completions and then the verifier tells you which ones to nudge the model towards and which to nudge away from. There's lots of clever ways you could improve the search process, but standard practice right now is just random sampling.