Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?
644 pointsI have zero AI/ML knowledge but Steve Yegge on Medium thinks that the team behind Transformers deserves a Nobel.
Makes me want to better understand this tech.
Edit: thank you for some amazing top level responses and links to valuable content on this subject.
Comments (228) 76 threads
Earlier commentsImagine you have a box of toys. Some toys are more interesting to you than others, so you pay more attention to those toys and play with them more. The same thing happens in the "Attention is All You Need" paper, but instead of toys, we have words in a sentence.
Before this paper, when computers tried to translate one language to another, they would look at one word, translate it, then move to the next word. This works okay, but it's not great because sometimes the meaning of a word can depend on other words in the sentence.
The clever thing about the "Attention is All You Need" paper is that it taught the computer to pay attention to all the words in a sentence at the same time, but give more importance ("attention") to the words that matter most for understanding and translation.
This new way of translating languages using "attention" made computers much better at understanding and translating languages. It's like if you could become better at playing by understanding all your toys at once! This paper was a big deal in the field of machine learning and artificial intelligence because it improved how machines understand languages.
Response:
“There could be several reasons why people might be hostile towards others who post simple copy-paste responses from ChatGPT in a dialog:
① Lack of originality: Copy-pasting a ChatGPT response without any personal input or effort can be seen as lazy or unoriginal. It shows a lack of engagement and genuine interaction with the question or conversation. People might value unique perspectives and insights, so when they see someone simply copying and pasting a response, they may perceive it as a low-quality contribution.
② […] ③ […] ④ […]
It's important to note that individual reactions may vary, and not everyone will respond with hostility in such situations. However, these reasons provide some insight into why certain individuals might have negative reactions towards simple copy-paste responses from ChatGPT.”
The main useful idea from ML is just that we could learn meaning directly from the data—and we have a lot of data thanks to the internet. So there was a lot of work that went into ways to learn the meaning of every word and the relationships between words directly from text data—with some impressive successes.
But in almost all cases one of the biggest problems was learning how words affect each other when they’re far apart. That was a really hard problem because if you want to know how any two words affect each other then there are a lot of pairs you need to try. If you have 10 words in a sentence then there’s about 100 pairs; and if you have 1000 words then you have about 1 million pairs. For many years it seemed silly to even try that; computers are fast, but not _that_ fast…right?
But eventually hardware got powerful enough that someone decided to throw away all the cleverness and complexity-instead they just did the most obvious thing: try _every_ pair of words. When you get down to it, that’s really all that attention is: just test every pair of inputs to see how similar they are.
The title of the paper “Attention is All You Need” highlights that you can get rid of all the other tricks that people had been inventing to work around this problem of relating words that are far apart and learning the right meaning from the data. You don’t need to remember earlier words, you don’t need a fixed size context window or dynamic context or pre-trained word vectors or many, many other ideas. You _just_ need Attention to learn what words mean and solve the long distance problem.
Now, it didn’t _really_ solve the problem because the original transformer could only handle around 500 tokens. This is what folks mean when they talk about the “context length” or “context window” of a Transformer model. And it’s why everyone has been so surprised and impressed when the context window for GPT jumped to 2,000 (that’s 16x more memory than the original transformer), and now we see models with 30k or 100k context windows.
In any case, at this point we’ve learned that the (relatively) simple idea of Transformers is actually incredibly powerful—and remarkably general-purpose. There are actually only a handful of new ideas in Transformer-based models today than in the original paper.
Not sure how well the slides can be understood by themselves, though I tried to be accommodating for that
Here is a very informative video and blog by Google Cloud Tech team explaining the game-changing nature of the self-attention to understand the contexts of the words being used in any sentences as proposed by the paper [1],[2].
[1] Transformers, explained: Understand the model behind GPT, BERT, and T5:
https://youtu.be/SZorAJ4I-sA
[2] Corresponding blog post:
https://daleonai.com/transformers-explained
All comments shown.
Couldn't load more comments. Check your connection and try again.