Waku.One/Blog/Models
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.

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

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

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.
Fig. 1The 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.
Fig. 2Part 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.
Fig. 3One 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 paperOn this pageWhat it does
Embeddingtoken rowsSwaps each token for its row of 4,096 numbers.
Multi-head attentionquery, key, value, resultEach token takes information from earlier tokens.
Feed forwardgate, widen, narrowEach token is reworked on its own.
Addadded backThe result of a step is added to the token’s numbers.
NormsteadyBrings the numbers back to a normal size. Carries no meaning.
LinearscoresGives every token in the vocabulary a score.
SoftmaxchancesTurns 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

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

Jensen HuangrunsNVIDIAand Elon MuskrunsTesla buthealso runs SpaceX key: a person, earlier key: a person, latest subject query: which person is this?
Fig. 4The 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

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

05

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.

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.
Fig. 5The 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

KindWhat you getExamples
Closed weightsAnswers through the maker’s service. No file.Claude, GPT, Gemini
Open weightsThe file. You can run it and fine-tune it.Qwen, Llama, DeepSeek, gpt-oss, Mistral
Open source AIThe 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.