Earlier quoted context omitted.
More ELI5 than the other comments. Considering the softmax network: During quantization we find that values in the network vary from 0->5000, but 95% of values are This is where exotic encodings come into play. We might try to use a logarithmic scheme, for example. This would result in higher value densities at lower values - but we would probably still waste bits and it would require more APU cycles. Now switch to t…
If I'm following correctly, does this mean that with this change along with a model being quantized, we could see models that are 5% the size (on file system) and memory usage but almost identical in output?
Attention Is Off By One
311–320 of 347 posts
Re: Attention Is Off By One
#312Earlier quoted context omitted.
More ELI5 than the other comments. Considering the softmax network: During quantization we find that values in the network vary from 0->5000, but 95% of values are This is where exotic encodings come into play. We might try to use a logarithmic scheme, for example. This would result in higher value densities at lower values - but we would probably still waste bits and it would require more APU cycles. Now switch to t…
No one quantizes blindly without accounting for data. If 95% of your values are in 0-100 you’ll probably do something like have 20 values for 0-100 and the remaining 12 for 101-5000. You don’t have to apply a uniform distribution and shouldn’t when your data is that concentrated.
Re: Attention Is Off By One
#313Earlier quoted context omitted.
More ELI5 than the other comments. Considering the softmax network: During quantization we find that values in the network vary from 0->5000, but 95% of values are This is where exotic encodings come into play. We might try to use a logarithmic scheme, for example. This would result in higher value densities at lower values - but we would probably still waste bits and it would require more APU cycles. Now switch to t…
> During quantization we find that values in the network vary from 0->5000, but 95% of values are Instead of using an 8bit integer with even step size quantification, wouldn't they still use an 8bit float?
Either way you would still only have 256 discrete values.
Re: Attention Is Off By One
#314Earlier quoted context omitted.
It’s useful but it’s less used than dummy tokens.
Are dummy tokens just tokens that don't have an associated input/output token? Like, a way to give more computational power to the model without splitting the text into more actual tokens?
An example here with an actual algorithm, although it's been a couple of years so my explanation might be a bit wrong in places. and/or i might have gotten the completely wrong end of the stick with the current thread.
--
The CTC (Connectionist Temporal Classification [0]) algorithm maps a sequence x with length X -> sequence y with length Y.
i.e. in speech to text we might have some audio features that correspond to the following class predictions (post softmax classification)
x -> hellllloooooooooo wwwooorrrllld
we want to get this as the output y -> hello world
we have the alphabet as classes we try to predict for each sequence item in x.we could just removed all the duplicate in the first long sequence, but we would end up with `helo world` ... we need to preserve one of the early `l` characters in `hello` somehow
CTC uses a blank token (aka dummy) token to handle potentially deliberately repeated items in sequence x.
By adding the blank token to the classes predictions, we can get the model to predict something like this (post softmax classification)
y* -> hel~l~~oooo~~~~~~ w~~o~~r~~l~~d
The CTC decoder (non-ML decoding algo) heuristically removes repeated tokens. Turning the above into ... y -> hello world
... the duplicate `o` and `~` characters are removed.It was a decent enough algorithm for speech-to-text prior to attention/transformers etc.
However, it makes CTC vulnerable to well designed adversarial example attacks because there is a massive bias within models to predict the blank token -- meaning it's very easy to modify input sequence x to switch the output sequence y to include blank tokens for nefarious purposes (the subject of my unfinished phd).
[0]: www.cs.toronto.edu/~graves/preprint.pdf
Re: Attention Is Off By One
#315Re: Attention Is Off By One
#316While not about AI or the algorithm mentioned, on the subject of little errors that you can't convince anyone are errors.... In 2011, I wanted to copy the reddit ranking algorithm in a project of my own, so I went to source code to look at it... the algorithm in the source code I found wasn't doing anything at all sensible with negative-sum voted posts. I thought I discovered the error, some terms swapped in the simp…
Wow, that must have been frustrating. I just looked at the code and it's just so clearly wrong.
And the response was just like "We disagree, we think it makes sense the way it is and the product is correct"
That's kind of the end of the argument, there's nothing more one can say!
It didn't help that I came in assuming that of course everyone would see which version was correct (as you just did! although i didn't find it obvious, it took me lots of study to figure out), instead of producing a narrative designed to gently persuade them that. (That's on me -- I think I've learned something about technical communications around bugs and disagreements since then, although I'm still far from perfect).
The real answer, I think was given in one of the reddit thread comments -- the way it's broken for the most part _doesn't matter_ in the usual operations of reddit, it matters only in edge cases, and not very important ones, so really people mostly don't notice and we don't care.
Fair enough, I guess? But they did fix it three years later? I forget how I even found out they had fixed it; I can't at this point find any context for _why_ they fixed it, or who with power finally noticed/agreed it could use fixing why.
(And if it had happened three years after that, it would not have been in public source, and my gloating satisfaction would have been stolen!)
Re: Attention Is Off By One
#317Earlier quoted context omitted.
Is he? A surface level reading suggests he's asking "how would you know".. and the answer is... by looking at the parameters. People do that. >> because no one has yet looked at whether the trick helps reducing outliers in very large models Given a softmax version doing exactly as the blog post says is baked into a google library (see this thread), and you can set it as a parameter in a pytorch model (see this thread…
This would seem like a really good argument as to why failures should be written up, otherwise where is the list of what has been tried before?
Re: Attention Is Off By One
#318Earlier quoted context omitted.
> The Qualcomm AI researchers found that 97%+ of outlier activations in LLMs occur in whitespace and punctuation positions. This is striking. If true, why not try to ignore whitespace and puctuation? In old Latin, scripto continua [1] was a way to write continuously, for the exact same reason : to save space. Other modern languages still do that, and are no less parseable. Granted, it's unlikely a commercial LLM woul…
> This is striking. If true, why not try to ignore whitespace and puctuation? It is initially, but thinking about it some more, there's a lot of information packed in whitespace and punctuation choice. Scripto continua may have worked because the few readers who lived back then expected it to encode some form of legal or religious prose, but even then they could learn things from the overall shape of the document. LL…
The Latin literature was extremely rich, from Cicero to Tacitus, and was certainly not limited to legal information.
Here's part of your comment with white space and punctuation stripped:
scriptocontinuamayhaveworkedbecausethefewreaderswholivedbackthenexpectedittoencodesomeformoflegalorreligiousprosebuteventhentheycouldlearnthingsfromtheoverallshapeofthedocumentllmsareworkinginamuchricherdomainofdocumenttypesbuttheonlythingtheycanseeisastreamoftokenstheresnospatialorgeometricdataattachedtheresowhitespaceandpunctuationaretheonlythinganllmhastomakeinferencesaboutotherwisetextuallyidenticalinputs
It's a little hard to read, but not that hard. I think one would get used to it.
Also, for creative use of LLM, it may be a feature, as trying to find the words could be inspiring.
I think it would be worth a try.
Re: Attention Is Off By One
#319Earlier quoted context omitted.
Yes, but also, wrapping the handwaving and bullshitting in a layer of obfuscation: "Michel Foucault’s biopolitics is a faccid premonition of cyborg politics, a very open feld. By the late twentieth century, our time, a mythic time, we are all chimeras, theorized and fabricated hybrids of machine and organism—in short, cyborgs. The cyborg is our ontology; it gives us our politics. The cyborg is a condensed image of bo…
> (donna was woke before woke was a thing) Donna Haraway was born 6 years after “stay woke” in its sense as an admonition to maintain alertness to the racist context was coined. Leaving aside a debate over whether her work is a good match for “woke”, she very much cannot have been woke before woke was a thing. (Before its recent replacement of “politically correct” as the American Right’s preferred, meaning-stripped,…
A game of being pedantic is always welcome:
She very well could have been "woke before woke was a thing", because "woke" as the parent means it in her case, refers to the modern usage (of like, 2 decades), not the original term of the 40s that might have preceeded her birth.
So take the parent's comment to mean:
"She was woke, in the modern, circa-2000s+ sense, before woke, in the modern circa-2000s+ sense was a thing, not in the 1950s namesake sense".
Similar to how somebody could have been a hipster (in the 2000s+ sense [1]) before a hipster was a thing (before 2000s), even if they have been born in the 70s. Sure, the term already existed before the 70s, but it referred to a different thing.
[1] https://en.wikipedia.org/wiki/Hipster_(contemporary_subcultu...
Re: Attention Is Off By One
#3201. Summary The author is suggesting that we add 1 to the denominator of the softmax that is used within attention mechanisms (not the final output softmax). The softmax inside an attention unit allows it to see key/query matches as probabilities; those probabilities support a continuous-valued version of a key-value lookup (instead of 1/0 output of a lookup, we get weights where a high weight = the desired key-value…
OP calling it a "bug that's been overlooked for 8+ years" is click bait.