---
title: "What is inside an open-weights LLM? The model file, Transformer blocks and attention explained"
author: Sean Chen
publisher: Waku.One
updated: 2026-11-29
canonical: https://www.waku.one/blog/open-weights-llm
---

Concept page

# What is inside an open-weights LLM?

The model file, the Transformer block and attention, explained on a model running on a laptop.

By Sean Chen
Updated 29 Nov 2026
9 min read

Short answer

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

- **Weights**: The numbers inside the model file. Training produced them. Running the model only reads them.
- **Token**: A word or a piece of a word. The model reads and writes tokens, not letters and not whole sentences.
- **Block**: One round of the model’s procedure: attention first, then feed-forward. A model stacks many blocks.
- **Attention**: The step where each token looks back at the earlier tokens and takes what it needs from them.
- **Open weights**: The 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.

## 01 A model is one file

![A grid of numbers from the first table in the model file. Negative numbers are blue and positive numbers are red.]

_The first table in the file. The picture shows the top-left corner and the last two rows and columns. The dots stand for everything in between._

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.

## 02 Text becomes tokens, and tokens become numbers

![A list of tokens with their ids. Many of them are Chinese words. The token for hello in Chinese is marked.]

_Part of the model’s vocabulary near token 108,386. The number beside each token is the token’s id._

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.

## 03 One block: ask the other tokens, then think alone

![One block of the model. The attention row has a steady step, then query, key and value stacked, then result. The feed-forward row has a steady step, then gate and widen stacked, then narrow.]

_One block. Tables that run at the same time are stacked. The dashed boxes only keep the numbers in range._

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.

## 04 Attention, on one sentence

Take this sentence:

**Jensen Huang runs NVIDIA and Elon Musk runs Tesla, but he also runs SpaceX.**
Who is “he”? A reader knows it is Elon Musk. The model has to work that out from the tokens before “he”.

![The token "he" looks back at the earlier tokens. The thickest line goes to Elon Musk, a thin line to Jensen Huang.]

_The token “he” looks back. A thicker line means it takes more from that token. The line weights are drawn to explain the idea. They are not measured from the model._

Attention uses three tables, and each has one job.

- **Query**: What the token is looking for. For “he” it is close to: which earlier person does the next verb belong to?
- **Key**: What each earlier token offers to be found by. “Elon Musk” offers: a person, the most recent one, the subject of the last clause.
- **Value**: What a token hands over once it is found. “Elon Musk” hands over who he is.

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 questions 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.

## 05 Feed-forward: room to think

After attention, each token is reworked on its own. Three tables do it.

- **Widen**: Spreads the token’s 4,096 numbers into 12,288 numbers. This gives the model room to check thousands of small things about the token at once.
- **Gate**: Decides which of those 12,288 results pass. Gate runs at the same time as widen.
- **Narrow**: Folds the 12,288 numbers back down to 4,096 and adds them to the token.

Attention moves information between tokens. Feed-forward works on what one token now holds. A block does both, and the model repeats the block 36 times.

## 06 The way out: a score for every token

![The Run page. The prompt is The CEO of NVIDIA is. The top five candidates for the next token are J at 87.6 percent, Jim, Jennifer, Jensen and Lisa.]

_The model has written “the CEO of NVIDIA is” and is choosing the next token. These are its real top five._

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](https://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.
