What is inside an open-weights LLM?
The model file, the Transformer block and attention, explained on a model running on a laptop.
An open-weights large language model (LLM) is one file full of numbers that you can download and run yourself. The numbers are called weights. A program reads your text, turns the text into numbers, passes the numbers through the same small procedure dozens of times, and gets back a score for every word piece the model knows. The program picks one word piece, adds it to the text, and starts again.
In plain words
- WeightsThe numbers inside the model file. Training produced them. Running the model only reads them.
- TokenA word or a piece of a word. The model reads and writes tokens, not letters and not whole sentences.
- BlockOne round of the model’s procedure: attention first, then feed-forward. A model stacks many blocks.
- AttentionThe step where each token looks back at the earlier tokens and takes what it needs from them.
- Open weightsThe maker publishes the file. You can download it, run it and fine-tune it. You do not get the training data or the recipe.
Every number and picture on this page comes from one real model, qwen3:8b, running on an Apple laptop with 16 GB of memory.
A model is one file

The file for qwen3:8b is 5.23 GB. The file holds 8,190,735,360 numbers. The numbers sit in 399 tables. A table is a grid of numbers, which a mathematician calls a matrix.
The “8b” in the name means 8 billion numbers. The numbers started at 32 bits each during training. The file stores them at about 5 bits each, which is why 8 billion numbers fit in 5 GB. This squeezing is called quantization.
The file does nothing by itself. A runner program such as Ollama loads the file into memory and does the arithmetic.
Text becomes tokens, and tokens become numbers

The model knows exactly 151,936 tokens. A token can be a whole word, a piece of a word, a Chinese word, a punctuation mark or a piece of code. The name “Jensen” is two tokens in this model: J and ensen.
The first table in the file has one row for every token. Each row holds 4,096 numbers. Turning a token into numbers is a lookup: the token’s id is the row number. Nothing is calculated at this step.
Those 4,096 numbers are the token for the rest of the trip. Every later step reads them and adds something to them.
One block: ask the other tokens, then think alone

A block does two things. Attention lets a token collect information from the tokens before it. Feed-forward then reworks that token on its own. The result of each step is added back to the token’s 4,096 numbers.
qwen3:8b has 36 blocks, one after another. Every block has the same shape and its own tables. This stack is the Transformer, the design from the 2017 paper “Attention Is All You Need”.
| In the 2017 paper | On this page | What it does |
|---|---|---|
| Embedding | token rows | Swaps each token for its row of 4,096 numbers. |
| Multi-head attention | query, key, value, result | Each token takes information from earlier tokens. |
| Feed forward | gate, widen, narrow | Each token is reworked on its own. |
| Add | added back | The result of a step is added to the token’s numbers. |
| Norm | steady | Brings the numbers back to a normal size. Carries no meaning. |
| Linear | scores | Gives every token in the vocabulary a score. |
| Softmax | chances | Turns the scores into chances that add up to 1. |
The paper drew two stacks, an encoder that reads and a decoder that writes. A chat model keeps only the decoder, because its whole job is to write the next token.
Attention, on one sentence
Who is “he”? A reader knows it is Elon Musk. The model has to work that out from the tokens before “he”.
Attention uses three tables, and each has one job.
query
“I am a pronoun. Which earlier person am I?”
What the token “he” is looking for.
key
“I am a person, and the latest subject.”
What each earlier token offers to be found by. “Elon Musk” matches the question best.
value
“Elon Musk, who runs Tesla.”
What a token hands over once it is found. The result table mixes it into “he”.
The model compares the query of “he” with the key of every earlier token. The best matches pass on the most of their value. After this step the numbers for “he” carry something of Elon Musk.
The quoted lines are a way to picture the step. Inside the model the query, the key and the value are rows of numbers, and the comparison is a multiplication. Nobody can read a sentence off them.
A block does not run attention once. qwen3:8b runs 32 copies at the same time in every block. Each copy is called a head, and each head learns to look for something different. One head may track who “he” is while another tracks which verb comes next. That is the “multi-head” in multi-head attention.
Feed-forward: room to think
After attention, each token is reworked on its own. Three tables do it.
widen
4,096 numbers become 12,288.
Room to work: the model checks thousands of small things about this one token at once.
gate
Which of those results pass.
Gate runs at the same time as widen. The two are multiplied.
narrow
12,288 back to 4,096.
Folded back down and added to the token’s numbers. Then the next block starts.
Attention asks the other tokens. Feed-forward thinks alone. A block does both, and the model does that 36 times.
The way out: a score for every token

After the last block, one more table gives each of the 151,936 tokens a score. A calculation called softmax turns the scores into chances that add up to 1.
Figure 5 shows the moment the model is about to write the name. Its top candidates were J at 87.6%, Jim at 7.9%, Jennifer at 1.6%, Jensen as one token at 1.1% and Lisa at 0.6%. It picked J, then ensen, then Huang.
The model draws one token from those chances. The top candidate usually wins, but not every time, which is why the same question can get two different answers. The chosen token is added to the text and the whole trip runs again for the next token. On this laptop that happened about 23 times a second.
Open weights is not open source
| Kind | What you get | Examples |
|---|---|---|
| Closed weights | Answers through the maker’s service. No file. | Claude, GPT, Gemini |
| Open weights | The file. You can run it and fine-tune it. | Qwen, Llama, DeepSeek, gpt-oss, Mistral |
| Open source AI | The file, the training code and the data recipe. | Rare. Mostly research models. |
Open does not mean a model fits at home. An 8-billion-number model takes 5 GB and runs on a laptop. A 120-billion-number model takes about 65 GB and needs a server GPU, so most people run it through an inference cloud.
Look inside a model yourself
The pictures on this page are from the LLM page of Waku Agent, an open-source always-on agent. The page reads the model file that Ollama keeps on your disk. You can click any of the 399 tables, step through a run one token at a time, and use the same local model in the agent’s chat.
The code is at github.com/ShenSeanChen/waku-agent.
Glossary
- Weights
- The numbers in a model file. Training sets them and running the model reads them.
- Token
- A word or a piece of a word. The unit a model reads and writes.
- Vocabulary
- The fixed list of tokens a model knows. 151,936 for qwen3:8b.
- Embedding
- The row of numbers that stands for one token.
- Block
- One round of attention and feed-forward. Also called a Transformer layer.
- Head
- One of the attentions that run at the same time inside a block.
- Normalization
- A step that brings a token’s numbers back to a normal size.
- Quantization
- Storing each number in fewer bits so the file is smaller.
- Inference
- Running a trained model to get an answer. Nothing is learned during inference.
Questions people ask
What are open weights in one sentence?
Open weights are the numbers of a trained model, published as a file that anyone can download and run.
Is a block the same thing as a head?
No. Blocks run one after another, and qwen3:8b has 36 of them. Heads run at the same time inside one block, and each block has 32.
Does the model translate Chinese into English first?
No. Chinese words and characters have their own tokens and their own rows in the first table.
Why does the same question get different answers?
The model draws the next token from a set of chances. The most likely token usually wins, and sometimes another one does.
Can I run an open-weights model on my own computer?
Yes, if the file fits in memory. A model with 8 billion numbers needs about 5 GB and runs on a recent laptop.
Numbers read from the qwen3:8b file and measured on an Apple M2 Pro with 16 GB on 29 Nov 2026. Screenshots are from Waku Agent’s LLM page. The Transformer design is from Vaswani et al., “Attention Is All You Need”, 2017.