Tron | The Asylum
86 subscribers
110 photos
13 videos
1 file
47 links
Emandoyesus | Developer | 22| MU | Software Engineering

Building projects | Sharing lessons | Growing daily
Download Telegram
Channel name was changed to «Tron | The Asylum»
Have you ever wondered how LLMs work at low level?
NIPS-2017-attention-is-all-you-need-Paper.pdf
556.1 KB
This is the research paper that laid the foundation for modern LLM architectures.
šŸ‘3
Tron | The Asylum
NIPS-2017-attention-is-all-you-need-Paper.pdf
It is recommended to us by our instructor, and we're going to understand every bit of it part by part !
Tron | The Asylum
NIPS-2017-attention-is-all-you-need-Paper.pdf
PART 1: UNDERSTANDING MODERN AI


In 2017, a team of researchers introduced a new neural network architecture called the Transformer.
This research fundamentally changed Natural Language Processing (NLP) and laid the foundation for modern Large Language Models (LLMs), including GPT.

1. What existed before Transformers?

Before Transformers, many NLP systems relied on recurrent neural network architectures such as: RNN (Recurrent Neural Networks), LSTM (Long Short-Term Memory), GRU (Gated Recurrent Units).

These models generally processed text sequentially, one token at a time. For example: "The student is learning AI."

The model would process:
The → student → is → learning → AI

āš ļø The limitations:
• Sequential processing made parallel computation difficult.
• Capturing relationships between distant words was challenging.
• Training on long sequences could be computationally demanding.

2. What did the researchers introduce?

The researchers proposed the Transformer architecture, which relies on attention mechanisms instead of recurrence or convolution for modeling relationships between tokens.

The key innovation was Self-Attention. Unlike recurrent models, which process tokens sequentially, the original Transformer's encoder can process all input tokens simultaneously.

This makes training more parallelizable and allows the model to capture relationships between tokens regardless of their distance in the sequence.

3. How does a Transformer work?

Consider this sentence:
"The animal didn't cross the street because it was tired."

How do we know that "it" refers to "the animal" rather than "the street"? We understand it through context.
Transformers use Self-Attention to learn relationships between tokens and determine which parts of a sequence are relevant to one another.

At a high level, the process involves:
1ļøāƒ£ Tokenization: Text is divided into smaller units called tokens.
2ļøāƒ£ Embedding: Tokens are converted into numerical representations.
3ļøāƒ£ Positional Encoding: Information about token positions is incorporated.
4ļøāƒ£ Self-Attention: Tokens exchange information based on learned attention weights.
5ļøāƒ£ Feed-Forward Networks: The resulting representations are further transformed.

These operations are repeated across multiple Transformer layers.

4. Why does this matter?

The Transformer architecture became the foundation for many influential AI models, including: GPT (Decoder-only Transformer), BERT (Encoder-only Transformer), T5 (Encoder-Decoder Transformer).

Today, Transformers are central to many modern AI systems, including large language models (LLMs).

#ArtificialIntelligence #MachineLearning #Transformers #LLM

@MrDevEm
⚔3
PART 2: UNDERSTANDING MODERN AI (FINAL)

In Part 1, we explored how Transformers replaced recurrence with attention-based processing. Now, let's look deeper into Self-Attention and how modern LLMs use it.

1. Understanding Self-Attention

Self-Attention allows a model to learn relationships between tokens by assigning different attention weights to them.
It uses three components:
šŸ”¹ Query (Q): What information is a token looking for?
šŸ”¹ Key (K): What information does a token offer for matching?
šŸ”¹ Value (V): What information does a token contribute?
Each token is transformed into Q, K, and V vectors using learned weight matrices.

The model compares Queries with Keys, calculates attention weights, and uses those weights to combine Values.
The mathematical formula is:
Attention(Q, K, V) = softmax(QKįµ€ / √dā‚–)V
This is called Scaled Dot-Product Attention.

2. Multi-Head Attention


Instead of using a single attention mechanism, Transformers use multiple attention heads in parallel.
Each head learns different projections of the input, allowing the model to capture different relationships, such as grammatical patterns, contextual meaning, and long-distance dependencies.
The outputs are combined to produce richer representations.

3. How Do Modern LLMs Use Transformers?


Different models use different Transformer architectures:
šŸ”¹GPT: Decoder-only Transformer.
šŸ”¹BERT: Encoder-only Transformer.
šŸ”¹T5: Encoder-Decoder Transformer.

Let's take GPT as an example. When you ask GPT a question:
1ļøāƒ£ Your text is converted into tokens and numerical embeddings.
2ļøāƒ£ The tokens pass through multiple Transformer layers containing masked Self-Attention and Feed-Forward Networks.
3ļøāƒ£ The model calculates probabilities for possible next tokens.
4ļøāƒ£ A token is selected, and the process repeats until the response is complete.

This process is called Autoregressive Generation.
Unlike the parallel processing of input sequences during training, GPT generates output tokens sequentially.

The key takeaway: LLMs don't simply retrieve predefined answers. They generate text using patterns and relationships learned during training.

#ArtificialIntelligence #MachineLearning #Transformers #LLM

@MrDevEm
Good night
🌚2
Please open Telegram to view this post
VIEW IN TELEGRAM
ā¤1
Forwarded from Tech Nerd (yeab)
when building consumer products, follow the 3 S rule:

• Simple: Easy to use and understand.
• Slightly addictive: Give users reasons to keep coming back.
• Sharable: Create moments and experiences users naturally want to share.

@selfmadecoder
šŸ‘2
This media is not supported in your browser
VIEW IN TELEGRAM
7 years old me when my teacher says "Ozone layer įŠ„į‹Øįˆ³įˆ³ įŠį‹‰" 🤣
😁3šŸ’Æ1