Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> "Antidepressants" I'd imagine tokenizes as "anti" "depress" "ant". But nope. And "antipsychotic" tokenizes differently from it too..

Tokens are symbols. You're thinking of them like embedding vectors. Tokens represent the step before a meaning is assigned to the text: it turns some unit of text into what's essentially an identifier.

Which is to say, two homonyms would have the same token id, even though they have different meanings. Tokens have no notion of context.



what is the benefit to such splitting of text based on seemingly meaningless lines? isn't there a better way to do it?


You could split on words instead of tokens, but then you need a large vocabulary, you can't deal with inputs that contain a word which is not in the vocabulary, and it's not so clear what a "word" even is.

Instead of coming up with more and more heuristics to chop a sequence of bytes up in "words" in a vocabulary, we could simply set a limit on the size of the vocabulary (number of tokens), put all bytes in there (so we can at least handle any input byte by byte), and pack the remaining space with the most common multi-byte byte sequences. Then you end up with tokens like here.


There is no 'meaning' inside these AI's. It's terribly confusing to think about these LLM's as having 'meaning' in the same way we humans do. It's all just statistics. Given a sequence of numbers (each representing some abstract token), what is most likely to come next. That's how 'simple' it is. It's also what makes it so amazing that these things work as well as they do. I giggle like a schoolgirl every time I get it to add some functionality to a function, or write an entire new function, and that's several times a day for what is now months on end. But the key to using them is seeing that there is no 'meaning' in them. It's all just streams of (to the machine) meaningless tokens.


There’s no meaning to the tokens, but research has shown that the models themselves capture meaning. Technically they are producing the next word but in order to do that for a dataset of a trillion words they actually have to develop internal models of how the world works. There was a post on HN a couple days ago that talked about the research done to show this.


You say that but we have models of meaning in humans too.

You can put people in an fMRI and ask them to think "car".

You can ask someone to think of objects and detect when they think "car".

What happened there pairing a bunch of tensors to meanings and matching them.

We can do something similar with embeddings.

To be clear I don't intend to give the impression that these LLMs are doing something miraculous. Just that we are increasingly peeling back the veil of how brains think.


> You can put people in an fMRI and ask them to think "car".

I don't know about other people, but when I think “car” really hard, I can feel the muscles in my throat adjust slightly to match the sound of the word “car”. Perhaps that sort of thing is what the MRI machines is picking up, rather than being able to pick up some kind of "internal representation" of car.


In fact it also picks up the parts of your brain to do with driving (if you're a driver). Maybe also the part to do with the smell of fuel in me, but not you.

It'll also light up in the parts of my brain to do with reading, writing, hearing the word in the languages I speak.

What does car mean to me if it doesn't connect to all the concepts that relate to cars?


Maybe they should do the same study on people that lack an internal monologue to see if they have the same results.


If it just decides on a single token at a time, can it backtrack and choose differently under that operation, given the next tokens? What I wonder is, how can it plan ahead and output meaningful (to us) responses, like working code or useful articles? How can it "reason" logically when it needs to solve a problem, a riddle etc, by only selecting a token at a time? Wouldn't that dumbed down approach prove myopic for complex compositions? Doesn't it need some over-ruling goal-based heuristic system?


There’s no planning, no reason. It’s all ‘what word is next…’

I found Stephen Wolframs explanation helpful. He has a YouTube video version which I enjoyed too. This blog post was on HN last month, but I never get good search results on hn

https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-...


If we get a bit quantum (or an act of God for some), then backtracking could happen by collapsing the dead-ends and "changing" history to stay with what turns out to be the solid plan. Could emergent conscience on AI's neurons do the planning and reasoning that it rather seems to be doing but ML experts will say it is not? If our conscience could by any chance reside not in the electrical currents of the wetware, could AI's reason also not reside in tokens? Is there some mysterious process possible to be taking place?


It seems that the output feels reasoned because of the reasoning implicit in language patterns. Which is enough to write code and essays, apparently.


N.B. to self: study more Foucault to grasp this.


It is wild that a process like that can generate working code. Humans speak their words in order, but they don't write their code in order. Why would writing code in order work?


With GPT-4 this process also allows it to understand what is inside a graphical image and talk intelligently and coherently about it.

Next token prediction produces the most head exploding emergent effects.


Bard at least produces multiple drafts. I believe that is preferred over backtracking.

Generation is ultimately deterministic (seeded prng) so backtracking wouldn't make sense.


ChatGPT models syntax, not semantics

There's no "better way" to do it because the tokens are all meaningless to ChatGPT, it only cares about how efficiently they can be parsed and processed.

The competing desires are to model all language with the biggest tokens possible, and the fewest tokens possible. The lines aren't meaningless, text is split into the largest possible chunks using a set of the most common tokens.

Common words, like "the", "fast", "unity", "flying" are all tokens, but it's not because they're words, it's because they're common letter clusters, undistinguished from "fl", "ing", "un", "ple"

"gadflying" is tokenized into [g, ad, flying], even though it's only loosely semantically related to "flying", it's just the most efficient way to tokenize it.


Breaking text into sub-word units...

1. Greatly reduces memory usage. Instead of memorizing every inflection of the word "walk", it memorizes the root (walk) and the modifiers (ing, ed, er, ...). These modifiers can be reused for other words.

2. Allows for word compositions that weren't in the training set. This is great for uncommon or new expressions like "googlification" or "unalive".


The walk example doesn't quite hold up.

If you put:

    test walk walker walking walked
into the tokenizer you will see the following tokens:

    [test][ walk][ walk][er][ walking][ walked]
Only walker is broken up into two different tokens.

I added "test" to that because walk at the start doesn't include the leading space and [walk] and [ walk] are different tokens.

For even more fun, [walker] is a distinct token if it doesn't include the leading space.

    test walker floorwalker foowalker
becomes:

    [test][ walk][er][ floor][walker][ fo][ow][alker]
How we think of words doesn't cleanly map to tokens.

(Late edit)

    walker floorwalker
becomes tokenized as:

    [walker][ floor][walker]
So in that case, they're the same token. It's curious how white space influences the word to token making.


There’s no syntax or structure to the token set. The actual tokens were algorithmically selected based on the training data to (putting things loosely) optimize compression of the training data given a token set size.


Sure, but what I'm hearing in the parent post is a question about why we don't use linguistically motivated subword units (of similar length/vocabulary size and thus memory usage) e.g. cutting across morpheme boundaries instead of whatever an algorithm like BPE caclulates.


Gratitudes for the explanatories, trousering this for rethinkalysing tomorn.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: