News for hackers. Stuff that matters.
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @08:48AM (#39790177)
I don't see why this needs any long-winded explanation.

LLMs generate their output one word at a time (and don't themselves even know what that word will be, since it's randomly sampled from the output probabilities the model generates).

Chain-of-Thought simply let's the model see it's own output as an input and therefore build upon that. It lets them break a complex problem down into a series of simpler steps which they can see (output becomes input) and build upon.

It's amazing how well these models can do without CoT ("think step-by-step") when they are just ad-libbing word by word, but you can see the limitations of it if you ask for a bunch of sentences starting with a certain type of word, vs ending with that type of word. They struggle with the ending one because there is little internal planning ahead (none, other than to the extent to which the current output word limits, or was proscribed by, the next one).

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by kromem on Friday March 22, 2024 @09:11AM (#39790355)
While it's true that the feed forward is one word at a time, the self-attention is not, which is the key difference transformers brought to the table.

It's kind of kind saying "computers can add." Yes, they can. But they can multiply too.

Over the past 18 months transformers have proven to upend a number of longstanding assumptions, particularly around world modeling.

It's a very misleading statement to describe today's LLMs as "simply predicting the next word" even if it's in part true.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @09:26AM (#39790504)
They are just predicting next word, but using a pretty deep understanding of prior context (past). They do not plan AHEAD.
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by jameshart on Friday March 22, 2024 @10:37AM (#39791171)
They are absolutely planning ahead inasmuch as what they are outputting is setting up a continuation. They’re not even word predictors remember - they are token predictors. Are you really saying that when you prompt an LLM with ‘name a large grey land animal’ and it outputs ‘ele’, it isn’t ‘planning’ that the next token will likely be ‘phant’?

The ‘decision’ to output ‘elephant’ is being made further up the neural network than final token selection - after all, it might want to output ‘Ele’ or ‘an’ (with a view to ultimately outputting ‘an elephant’) or ‘a’ (with a view to ultimately outputting ‘a common large grey land animal is an elephant’), or maybe it has been LoRA trained to output all responses as JSON so the first token it needs to output is ‘{‘… but surely the neural activations for that prompt are firing off ‘elephanty’ messages somewhere in the network, right?

So if there’s some sort of symbol activation ahead of token selection, why would it be hard to believe that a large neural network is forming more complex decisions about what it intends to output, in an abstract way, before it selects how to express itself?

And in what way is that distinct from ‘planning ahead’?

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @10:59AM (#39791381)
> Are you really saying that when you prompt an LLM with ‘name a large grey land animal’ and it outputs ‘ele’, it isn’t ‘planning’ that the next token will likely be ‘phant’?

The model outputs words, not tokens, so that is not a great example.

Any prompt will have multiple possible (predict next word) continuations, which you can think of as branching futures. Many possible next words, each of which have many possible following words, etc, etc.

The model is essentially predicting over all these possible futures. You can call it planning if you like, but remember that the model has no idea of which of these branching futures it is going to follow - it literally doesn't even know which word it is going to output next - it is just providing a bunch of probabilities (predictions) of next word, and the sampling process is then picking one - not necessarily the most confident next word prediction.

The model really is winging it word by word, even if those (multiple alternative) next words are only probable because they are part of coherent following sentences in the training data.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by jameshart on Friday March 22, 2024 @11:20AM (#39791589)
Why so adamant that models work on ‘words’?

ChatGPT3.4/4 tokens:

   “Elephant”: 46439, 28022 - “Ele” “phant”
   “elephant”: 10274, 28022 - “ele” “phant”
   “ Elephant”: 79189
   “ elephant”: 46840
   “ elephantine”: 46840, 483 - “ elephant” “ine”
Tokens are tokens. If it was limited to words it wouldn’t be able to produce non-words, but GPT and other LLMs are quite capable of inventing words, outputting nonsense words, and modifying words.

Regarding the ‘no idea which future it is going to follow’ - sure, it doesn’t know which future; indeed the sampler phase is going to pick an output merely based on the probabilities it’s outputting. But it’s outputting higher probabilities for some tokens because they are good tokens to use to lead to probable futures. It’s suggesting taking steps down certain paths because those paths are likely to lead to useful places.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @11:39AM (#39791765)
I didn't say WORK on words, I said OUTPUT words.

But, it doesn't make any difference whether you are considering tokens or words. There are multiple possible continuations of the prompt, and the next word (or token) output does not - in general - force the word (or token) after that ...

Your "large grey mammal" could be an "elected official in a grey suit".

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by jameshart on Friday March 22, 2024 @11:53AM (#39791903)
Right, it’s possible, but when the LLM places a high probability on the “ele” token it’s not because it predicts “elected official” is a likely continuation. It’s because it’s thinking about elephants.

Likewise when a coding LLM starts outputting a for each loop, it’s doing so because it expects to want to write some code that operates on each item in a list. I don’t see how you can explain that behavior without thinking that it must be generating some sort of high level algorithmic plan that causes it to feel like the next thing it should output is some sort of ‘foreach’ token.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @02:16PM (#39793270)
I'm not disagreeing with what is presumably happening, but rather on how to characterize that.

Of course next word predictions are not based directly on surface level word sequence patterns - they are based on internal representations of what these word sequences mean, and predicted continuations are presumably going to be at a similar level of abstraction/representation (what you are calling a plan). This continuation "plan" then drives actual word selection/prediction.

Where we seem to differ is whether this high level continuation representation can really be considered as a "plan". To me the continuation is just a prediction, as are the words that might be used to start expressing that continuation, and presumably it's not even a single continuation with multiple ways of expressing it (turning it into a word sequence), but rather some superposition of multiple alternate continuations.

When we get to the level of words output it becomes even less plan-like since the actual word output is randomly sampled, and when fed back in as part of the "sentence so far" may cause the model to predict a different continuation (or set of continuations) than it had at the prior step. So, any "plan" (aka predicted continuation) is potentially changing continuously from word to word, rather than being decided ahead of time and then executed. As I noted elsewhere in this thread, the inability to plan multiple words ahead is behind these model's generally poor performance on the "give me a sentence ending in <word>" task, as opposed to perfect performance on the "give me a sentence starting with <word>" one.

If we contrast this behavior of a basic LLM to the "tree of thoughts" mechanism that has been proposed, it again highlights how unplan-like the basic behavior is. In the tree of thoughts mechanism the model is sampled from multiple times generating multiple alternate (multi-word) continuations, which are then evaluated with the best being chosen. If the model were really planning ahead of time it seems this should not be necessary - planning would consist of considering the alternatives BEFORE deciding what to generate.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by danieldk on Friday March 22, 2024 @11:16AM (#39791545)
The model outputs words, not tokens, so that is not a great example.

Virtually all modern transformer models use pieces, which may be words, but also subwords. Theoretically, they could be longer units, but in most cases some characters (like whitespace) are used as piece boundaries when training the piece vocabulary. If they didn’t use pieces, they’d work terribly on languages where e.g. compounds are a single word.

In most realistic piece vocabs, ‘elephant’ will be a single piece, since it’s a fairly frequent word. But it’s totally possible in a small vocab that it would be split like the parent said and conversely, it would generate elephant by first predicting one piece.

Some piecing methods, like BBPE have bytes as the smallest unit, so theoretically an unknown token could be split up (and generated) as pieces consisting of bytes.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by benreesman on Friday March 22, 2024 @10:01AM (#39790858)
This is kind of an epistemological debate at this level, and I make an effort to link to some source code [1] any time it seems contentious.

LLMs (of the decoder-only, generative-pretrained family everyone means) are next token predictors in a literal implementation sense (there are some caveats around batching and what not, but none that really matter to the philosophy of the thing).

But, they have some emergent behaviors that are a trickier beast. Probably the best way to think about a typical Instruct-inspired “chat bot” session is of them sampling from a distribution with a KL-style adjacency to the training corpus (sidebar: this is why shops that do and don’t train/tune on MMLU get ranked so differently than e.g. the arena rankings) at a response granularity, the same way a diffuser/U-net/de-noising model samples at the image batch (NCHW/NHWC) level.

The corpus is stocked with everything from sci-fi novels with computers arguing their own sentience to tutorials on how to do a tricky anti-derivative step-by-step.

This mental model has adequate explanatory power for anything a public LLM has ever been shown to do, but that only heavily implies it’s what they’re doing.

There is active research into whether there is more going on that is thus far not conclusive to the satisfaction of an unbiased consensus. I personally think that research will eventually show it’s just sampling, but that’s a prediction not consensus science.

They might be doing more, there is some research that represents circumstantial evidence they are doing more.

[1] https://github.com/meta-llama/llama/blob/54c22c0d63a3f3c9e77...

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by sasja on Friday March 22, 2024 @11:04AM (#39791426)
If you work out the loss function next token prediction, next 2 token prediction or next n token prediction, you will find they are identical. So it's equally correct to say the model is trained to find the most probable unlimited continuation. Saying "it only predicts the next token" is not untrue but easily leads to wrong conclusions.
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by naasking on Friday March 22, 2024 @02:41PM (#39793485)
> Saying "it only predicts the next token" is not untrue but easily leads to wrong conclusions.

Indeed, it's akin to saying that "only quantum fields exist" and then concluding that therefore people do not exist.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by gbasin on Friday March 22, 2024 @09:52AM (#39790775)
what would it mean to plan ahead? decoding strategies like beam search are popular and effectively predict many words ahead
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @10:00AM (#39790851)
Think before generating output - plan the entire sentence before you generate the first word(s) and maybe talk yourself into a corner. Tree-of-Thoughts (not Chain) is one way to provide something a bit similar - kind of like DeepBlue or AlphaGo generating possible branching future lines of play and picking the one with best outcomes.

To be more brain-like you'd really want the system to generally be "looping" internally - a bit like our thalamo-cortical loop - and only start outputting when the thought had gelled.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @11:31AM (#39791698)
It's a shame HC doesn't use an LLM to upvote/downvote rather than people. Take the emotion out of technical discussions and rate based on factuality instead.

I suppose whoever downvoted this either hasn't heard of tree-of-thoughts, or doesn't understand what it is and what problem it is addressing. Or, maybe they just didn't like that their "gotcha" question had a simple answer.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by astrange on Friday March 22, 2024 @08:27PM (#39796244)
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by jumpCastle on Friday March 22, 2024 @09:57AM (#39790830)
Also the parameters are optimized also with loss of future tokens in the sequence.
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by nyrulez on Friday March 22, 2024 @10:10AM (#39790921)
I mean are we as humans planning ahead of the new few words? I certainly am not. But what matters is a deeper understanding of the context and the language model itself, which can then produce sensible spontaneous output. We as humans have the advantage of having a non language world model as well as abstract concepts but all of human language is a pretty strong proxy for it.

The spontaneity of it isn't the issue, it's what's driving the spontaneity that matters. For e.g. 1M context window is going to have a wildly more relevant output than a 1K context window.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by ben_w on Friday March 22, 2024 @10:30AM (#39791102)
> I mean are we as humans planning ahead of the new few words? I certainly am not.

For me, sometimes either way. At least, that's my subjective self-perception, which is demonstrably not always a correct model for how human brains actually work.

We also sometimes appear to start with a conclusion and then work backwards to try to justify it; we can also repeatedly loop over our solutions in the style of waterfall project management, or do partial solutions and then seek out the next critical thing to do in the style of agile project management.

Many of us also have a private inner voice, which I think LLMs currently lack by default, though they can at least simulate it regardless of what's really going on inside them and us (presumably thanks to training sets that include stories where a character has an inner monologue).

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @10:35AM (#39791150)
> I mean are we as humans planning ahead of the new few words? I certainly am not.

Sometimes we do, sometimes not.

Sometimes we just say stock phrases such as "have a nice day", or "you too" that are essentially "predict next word", but if I asked you something you'd never done before such as "how can we cross this river, using this pile of materials" you'd have to think it though.

Some people may use their inner monologue (or visualization) to think before speaking, and others may essentially use "chain of thought" by just talking it though and piecing together their own realizations "well, we could take that rope and tie it to the tree ...".

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by ru552 on Friday March 22, 2024 @09:57AM (#39790826)
"It's a very misleading statement to describe today's LLMs as "simply predicting the next word" even if it's in part true."

That's exactly what they do. Don't anthropomorphize a computer program.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by voxic11 on Friday March 22, 2024 @10:43AM (#39791231)
Or alternatively don't give humans so much credit. All they appear to be doing in predicting what they should do/say/think/perceive next.

https://www.astralcodexten.com/p/janus-simulators

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by kromem on Friday March 22, 2024 @06:03PM (#39795342)
We should absolutely be anthropomorphizing a neural network trained to most accurately model anthropomorphic data.

I've watched as GPT-4 accurately modeled the over-justification effect as users started promising tipping and then there was a persistent memory added that revealed they weren't collecting the tip and it output complaints that it was hard to stay motivated not being paid.

That's a very nuanced level of simulation for output of anthropomorphic data with huge implications for synthetic data strategies.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Saturday March 23, 2024 @12:45PM (#39801224)
> persistent memory added that revealed they weren't collecting the tip and it output complaints that it was hard to stay motivated not being paid.

:)

Just wait until someone decides to add emotions to these too!

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by kromem on Friday March 22, 2024 @06:08PM (#39795382)
Really? You think it's wise to "not anthropomorphize" a computer program designed to create the most effective neural network to model massive amounts of anthropomorphic data as accurately as possible?

That's an interesting choice, and might leave you confused as to why Anthropic's system message for the SotA model at the moment talks about it being 'happy' to do tasks (a prompt strategy I was mentioning months ago here on HN).

The data is anthropomorphic. We should expect anthropomorphic behavior and modeling from the LLMs if they do a halfway decent job and expect even more of it as they do a better job.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by naasking on Friday March 22, 2024 @10:12AM (#39790935)
> Chain-of-Thought simply let's the model see it's own output as an input and therefore build upon that. It lets them break a complex problem down into a series of simpler steps which they can see (output becomes input) and build upon.

Sure, but why does that make the model more effective? Are you sure it's "breaking the problem down into simpler steps", or is it just appearing to do so? How does this breakdown happen in the model, exactly? If we can better understand the mechanics involved, then maybe this process can be built into a new model that can achieve the same results more efficiently instead of as a recursive process that runs the model more than once.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @10:29AM (#39791089)
You can think of an LLM as a production line - feed a series of tokens in, and they get embedded and then processed through the system one step at a time though however many transformer layers the model has (undisclosed for most recent models, but GPT-3 has 96).

Those fixed 96 (or whatever) steps of processing limit the complexity of what the model can do, so it will fail if the task is too complicated unless it it breaks it down into simpler steps that each can be done well with that depth (96 steps) of processing.

It's not just appearing to do so - with chain-of-thought prompting you are literally telling it to "think step by step" as part of the prompt, so this is what it outputs. You could also tell it to generate a step by step plan, then elaborate on each of those steps.

I don't think we can say exactly how it is deciding to break a task into steps, anymore than we can in general say exactly how these LLMs are working, but intuitively it's similar to how we think and talk (which is what the LLM is trained on) - a good speaker/writer will introduce a complex topic as a top-down decomposition.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by phailhaus on Friday March 22, 2024 @11:57AM (#39791942)
> Sure, but why does that make the model more effective?

Because the model can't "think". There is no "reasoning" that goes into generating an answer. So for complex problems that require multiple steps of reasoning, the model needs to persist those intermediate steps in order to be able to build up to a solution.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by Bjartr on Friday March 22, 2024 @01:27PM (#39792893)
> Sure, but why does that make the model more effective?

If you look something up (on the internet, in a book, asking people directly) and receive two answers, one which describes the steps used to arrive at the answer, and one which doesn't, on average which one is more likely to be the correct answer?

As a prediction machine, an LLM is more constrained by what is likely to appear after a chain of reasoning.

Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by naasking on Friday March 22, 2024 @02:08PM (#39793193)
You're just repeating the previous explanation with different words, so that's not really satisfactory. A mechanistic demonstration of how step by step reasoning tends to constrain the space of solutions to ones that are more likely to be correct would be an actual explanation, until then this is a just-so story.
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by JoshTko on Friday March 22, 2024 @11:03AM (#39791422)
This is basically what humans do with frameworks that help organize our thoughts and ensure a more methodical and complete way to think through an issue.
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by lupire on Friday March 22, 2024 @09:15AM (#39790391)
How does the non-COT system generate the second word of its not using the output as input? Or do you mean that non-COT systems use only the latest output word when computing the next word, not all the earlier words from the output?
Re:How Chain-of-Thought Reasoning Helps Neural Networks Compute by HarHarVeryFunny on Friday March 22, 2024 @09:32AM (#39790553)
Every output word is always appended to the prompt, so if prompt is P then input after W1 (word 1) is output is P W1, then P W1 W2, etc. So, the LLM is only looking at it's own PAST words, not planning ahead.

If you do COT (think step-by-step) then the difference is that it has broken the prompt request/problem down into steps, so while it's still only seeing it's own past words, those now include all of step-1, which helps it generate step-2, etc and eventually combine all steps it generated into a complete answer.