✨ Visual Editor

close

Thread Truncated

Only the first 20 tweets are shown to ensure high-quality rendering and prevent image size issues.

palette Canvas & Background

Gradient:arrow_forward
Text Color:
135°

style Card Style

40px
16px

text_fields Typography

16px
Khairallah AL-Awady
@eng_khairallah1
Most people use ChatGPT and Claude every single day and have no idea how they were actually built.
Thread image
Khairallah AL-Awady
@eng_khairallah1
Save this :)
Khairallah AL-Awady
@eng_khairallah1
A small group of people understand the exact pipeline that turns raw internet text into a model that can write, reason, and code. And understanding that pipeline changes how you use these tools forever, because you finally see what's happening under the hood instead of treating it as magic.
Khairallah AL-Awady
@eng_khairallah1
The difference between those two groups is not a math degree.
Khairallah AL-Awady
@eng_khairallah1
It is one clear mental model.
Khairallah AL-Awady
@eng_khairallah1
Here is the truth almost nobody explains simply: every frontier model, GPT, Claude, all of them, is built through the same five-stage pipeline. The companies differ in scale, data, and a thousand engineering details, but the shape of the process is the same everywhere. Learn the shape and you understand how all of them are made.
Khairallah AL-Awady
@eng_khairallah1
Let me set expectations honestly before we start. You are not going to train a model that rivals GPT or Claude from scratch on your laptop. Those models cost tens of millions of dollars in compute and require enormous engineering teams. That's not the goal here. The goal is to understand the pipeline so deeply that you could build a tiny working version yourself, reason about how the big ones behave, and stop being mystified by any of it. That understanding is worth far more than most people realize, and it's completely within reach.
Khairallah AL-Awady
@eng_khairallah1
Here are the five stages, in order, exactly as they happen.
Khairallah AL-Awady
@eng_khairallah1
## Stage 1: Data — The Foundation Everything Is Built On
Khairallah AL-Awady
@eng_khairallah1
Before there is a model, there is text. An enormous amount of it.
Khairallah AL-Awady
@eng_khairallah1
The first stage is gathering and preparing the data the model will learn from. For a frontier model this means a staggering quantity of text: a large fraction of the public internet, books, code repositories, and more. But raw text is messy, so most of the work in this stage is not collecting, it's cleaning.
Khairallah AL-Awady
@eng_khairallah1
The data gets filtered to remove junk, duplicated content is stripped out (the same paragraph appearing a thousand times would warp what the model learns), and low-quality or harmful material is filtered down. This cleaning matters more than people think. The old principle holds: garbage in, garbage out. A model trained on cleaner, higher-quality data learns better than one trained on more but messier data. Data quality is one of the most important and least glamorous levers in the entire field.
Khairallah AL-Awady
@eng_khairallah1
Then comes the step that surprises beginners: tokenization. The model can't read text directly. The text gets broken into tokens, which are chunks roughly the size of a word-part. The phrase "tokenization" might become three or four tokens. Every piece of training data gets converted into these tokens, and from that point on the model only ever sees numbers representing tokens, never letters. This is why models sometimes miscount the letters in a word: they never saw the letters, only the token.
Khairallah AL-Awady
@eng_khairallah1
The output of this stage is a massive, clean, tokenized dataset. Nothing has been learned yet. You've just prepared the raw material.
Khairallah AL-Awady
@eng_khairallah1
What to Do to Learn This Stage
Khairallah AL-Awady
@eng_khairallah1
• Learn what a tokenizer actually does by running text through one and watching it split into tokens
Khairallah AL-Awady
@eng_khairallah1
• Take a small text dataset and practice cleaning it: removing duplicates, filtering junk, normalizing format
Khairallah AL-Awady
@eng_khairallah1
• Understand why data quality beats data quantity by comparing what a small model learns from clean versus messy data
Khairallah AL-Awady
@eng_khairallah1
• Read about how the major labs describe their data filtering, and notice how much effort goes into it
Khairallah AL-Awady
@eng_khairallah1
## Stage 2: Pretraining — Where the Model Actually Learns Language
Generated by Thread Navigator
100%
view_carousel Carousel Studio NEW
Press + S to quick-export