Live data from Hacker News

Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

news.ycombinator.com

141–150 of 240 posts

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#141
There are some good explanations here of the self-attention architecture that makes Transformers unique.

However, most people gloss over other aspects of the "Attention is all you need" paper, which is a sense mis-titled.

For example, Andrej Karpathy pointed out that the paper had another significant improvement hidden in it: during training the gradients can take a "shortcut" so that the bottom layers are trained faster than in typical deep learning architectures. This enables very large and deep models to be trained in a reasonable time. Without this trick, the huge LLMs seen these days would not have been possible!

Andrej talks about it here: https://youtu.be/9uw3F6rndnA?t=238

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#142

The "Attention is All You Need" paper introduced a new way for AI to read and understand language, much like how we might read a comic book. As you read each panel of a comic book, you don't just look at the words in the speech bubbles, but you also pay attention to who's talking, what they're doing, and what happened in the previous panels. You might pay more attention to some parts than others. This is sort of like…

Explaining it for a slightly older audience, a transformer is a type of artificial neural network designed for processing sequences, like sentences in a text. It's especially known for its use in natural language processing (NLP), which is the field of AI that deals with understanding and generating human language. The Transformer is unique because it uses a mechanism called "attention" to understand the relationship…

Is there a way to have recuesively constructed attentional architectures? It would seem like the same process that you describe could be even more useful if it could be applied at the level of sentences, paragraphs, etc.

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#143

Earlier quoted context omitted.

Great explanation

It's chat-gpt generated. It's even leaked part of the prompt in the intro. I especially disagree with: > natural language processing (NLP), which is the field of AI that deals with understanding and generating human language.

Do you disagree with anything else? That sounds like a simplification and not too bad given the target audience.

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#144

The "Attention is All You Need" paper introduced a new way for AI to read and understand language, much like how we might read a comic book. As you read each panel of a comic book, you don't just look at the words in the speech bubbles, but you also pay attention to who's talking, what they're doing, and what happened in the previous panels. You might pay more attention to some parts than others. This is sort of like…

how is "attention" different from using tokens > vector database > cosine similarity?

It's orthogonal, right? How do you go from tokens to vector? Fully connected NN? lstm? Or transformer?

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#145

Earlier quoted context omitted.

The importance of the "Attention is All You Need" paper by Vaswani et al., in 2017 is that it introduced the Transformer type of model architecture. The model is so named because it "transforms" one sequence into another. For example, in a machine translation task, it can transform a sentence in one language into a sentence in another language. The key innovation of the Transformer model is the use of self-attention…

great explanation. thank you all for contributing to our learning! > in a machine translation task, it transforms a sentence in one language into a sentence in another language. here English is being translated to which language - I'm assuming vectors? might be a silly question, I'm assuming that's where the origin of the word "Transformer" lies

> in a machine translation task, it can transform a sentence in one language into a sentence in another language.

This means when it is translating between two human languages "a machine translation task".

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#146

Earlier quoted context omitted.

Explaining it for a slightly older audience, a transformer is a type of artificial neural network designed for processing sequences, like sentences in a text. It's especially known for its use in natural language processing (NLP), which is the field of AI that deals with understanding and generating human language. The Transformer is unique because it uses a mechanism called "attention" to understand the relationship…

Is there a way to have recuesively constructed attentional architectures? It would seem like the same process that you describe could be even more useful if it could be applied at the level of sentences, paragraphs, etc.

[deleted]

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#147

The "Attention is All You Need" paper introduced a new way for AI to read and understand language, much like how we might read a comic book. As you read each panel of a comic book, you don't just look at the words in the speech bubbles, but you also pay attention to who's talking, what they're doing, and what happened in the previous panels. You might pay more attention to some parts than others. This is sort of like…

how is "attention" different from using tokens > vector database > cosine similarity?

In the context of natural language processing, the attention mechanism used in Transformer models and the process of converting tokens to vectors and calculating cosine similarity have similarities but serve different purposes.

When you convert words (tokens) into vectors and calculate cosine similarity, you're typically doing what's called "word embedding". This process captures the semantic meaning of words in a high-dimensional space. Words that have similar meanings have vectors that are close to each other in this space. Cosine similarity is a measure of how similar two vectors are, which in this context equates to how similar the meanings of two words are.

On the other hand, the attention mechanism in Transformer models is a way to understand the relationships between words within a specific context. It determines how much each word in a sentence contributes to the understanding of every other word in the sentence. It's not just about the semantic similarity of words, but also about their grammatical and contextual relationships in the given sentence.

Here's an analogy: imagine you're trying to understand a conversation between a group of friends. Just knowing the meaning of their words (like word embeddings do) can help you understand some of what they're saying. But to fully understand the conversation, you also need to know who's speaking to whom, who's agreeing or disagreeing with whom, who's changing the topic, and so on. This is similar to what the attention mechanism does: it tells the model who's "talking" to whom within a sentence.

So while word embeddings and cosine similarity capture static word meanings, the attention mechanism captures dynamic word relationships within a specific context. Both are important for understanding and generating human language.

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#148

Earlier quoted context omitted.

how is "attention" different from using tokens > vector database > cosine similarity?

In the context of natural language processing, the attention mechanism used in Transformer models and the process of converting tokens to vectors and calculating cosine similarity have similarities but serve different purposes. When you convert words (tokens) into vectors and calculate cosine similarity, you're typically doing what's called "word embedding". This process captures the semantic meaning of words in a hi…

Just a guess: is this answer GPT output?

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#149

The "Attention is All You Need" paper introduced a new way for AI to read and understand language, much like how we might read a comic book. As you read each panel of a comic book, you don't just look at the words in the speech bubbles, but you also pay attention to who's talking, what they're doing, and what happened in the previous panels. You might pay more attention to some parts than others. This is sort of like…

Explaining it for a slightly older audience, a transformer is a type of artificial neural network designed for processing sequences, like sentences in a text. It's especially known for its use in natural language processing (NLP), which is the field of AI that deals with understanding and generating human language. The Transformer is unique because it uses a mechanism called "attention" to understand the relationship…

> For example, in the sentence "The cat, which is black, sat on the mat," the words "cat" and "black" would get high scores when trying to understand the word "black" because they are closely related.

So what does that actually mean in terms of looking at new text? How does it know the relationships? Does it have to be bootstrapped on labeled data for a specific language up front?

Is that something done in the training process - providing example sentences and illustrating the connections between words - or is that earlier?

Re: Ask HN: Can someone ELI5 transformers and the “Attention is all we need” paper?

#150

The "Attention is All You Need" paper introduced a new way for AI to read and understand language, much like how we might read a comic book. As you read each panel of a comic book, you don't just look at the words in the speech bubbles, but you also pay attention to who's talking, what they're doing, and what happened in the previous panels. You might pay more attention to some parts than others. This is sort of like…

Explaining it for a slightly older audience, a transformer is a type of artificial neural network designed for processing sequences, like sentences in a text. It's especially known for its use in natural language processing (NLP), which is the field of AI that deals with understanding and generating human language. The Transformer is unique because it uses a mechanism called "attention" to understand the relationship…

Someone who read the paper pointed out to me recently that there's an aspect to transformers/attention that uses the sin or cos function to determine which words to pay attention to or the spacing between them (I'm probably not expressing this correctly, so please correct me if I'm wrong). It seems really unintuitive that sin and/or cos would be a factor in human language - can you explain this?
Post reply on HN