M01 · LLM foundations and evaluation basics01-0221 min read

Lesson 7 of 106 · Module 2 of 14 · Week 1

Threads:The measurement threadThe weights threadThe core-concepts thread

LLM Parameters: What They Are and Where Knowledge Is Stored

An LLM's parameters are the numbers learned during training — the weight matrices and biases inside every layer — and they are the only place the model stores anything it "knows." Nothing in a prompt, a retrieved document or a system message ever becomes a parameter, which is why prompting and RAG change behaviour and output while only fine-tuning changes what the model knows.

01

What LLM parameters are

Identity statement: a parameter is a single number whose value was learned by training — adjusted by gradient descent to reduce prediction error. "A 7-billion-parameter model" means 7 billion such numbers.

When the term matters: whenever you need to answer "will this fit on my GPU?", "does this technique update the model?", or "why does the model still not know our internal product names?"

Parameters are not scattered randomly. They live in named structures:

StructureWhat it holdsRough share of total
Embedding matrixOne learned vector per vocabulary tokenSmall in large models, significant in small ones
Attention projections (Q, K, V, output)How tokens attend to one anotherAbout one third of each transformer block
Feed-forward / MLP layersThe per-position transformation after attentionAbout two thirds of each transformer block
Layer-norm scales and biasesPer-layer scalingNegligible
Output / unembedding matrixHidden state back to vocabulary scoresSame order as the embedding matrix

The distinctive number for this page: in the standard transformer block where the feed-forward inner dimension is 4× the hidden size, the four attention projections contribute 4·d² parameters and the two feed-forward matrices contribute 8·d², so the feed-forward layers hold roughly two thirds of a transformer block's parameters and attention holds one third. Attention gets the attention; the MLP holds the bulk of the storage. You will not be asked to derive that, but it usefully corrects the common mental picture that "the knowledge is in the attention."

Weights, biases, and what "trainable" means

Two vocabulary items get used interchangeably and should not be. A weight is a multiplicative parameter — an entry in a matrix that scales an input. A bias is an additive parameter — a per-output offset. "Parameters" is the umbrella term covering both, and it is what a model's advertised size counts. Many modern LLM architectures drop most biases entirely for efficiency, which is why you will see "weights" used as a loose synonym for "parameters" in practice.

Trainable is the other word to pin down. A parameter is trainable if the current training run is allowed to update it. The same number can be trainable in one run and frozen in the next — that is precisely the mechanism behind parameter-efficient fine-tuning, where the base checkpoint is marked frozen and only a small added set is trainable. So "the model has 7B parameters and we fine-tuned 0.1% of them" is a coherent sentence: 7B is the storage, 0.1% is the trainable subset for that run.

02

How knowledge gets into parameters and how it comes back out

L1 — Weights as compressed regularities

Training exposes the model to text and adjusts parameters so predictions improve (01-01). Regularities that repeat across the corpus — that Paris follows "the capital of France is," that Python functions start with def, that a polite reply follows a polite question — get baked into weight values. The model is not a database with rows; it is a lossy compression of statistical structure in its training data. That is why it recalls widely repeated facts reliably and rare ones badly, and why it cannot cite where a fact came from.

If you take one image away, take this one: the weights are a lossy compression of the training corpus, not an index into it. Lossy explains the failure modes. Compression explains why a 14 GB file can discuss almost any topic. Not an index explains why it cannot tell you its source.

L2 — Frozen at inference

Once training ends, parameters are frozen. Serving a model is a read-only operation over those numbers. Nothing you send at inference writes back. Consequences the exam cares about:

  • The knowledge cutoff is a property of the weights. No amount of prompting adds post-training knowledge; you must supply it in the context, which is precisely what RAG does.
  • Conversation "memory" is re-sent text. A chatbot that appears to remember earlier turns is being handed those turns again inside its context window on every request.
  • Two identical requests to a frozen model differ only through decoding randomness, not through the model having changed.
  • The same checkpoint on two different GPUs is the same model. Behaviour differences at that point come from precision, kernel implementation or decoding settings, not from knowledge.

Frozen also has an operational meaning worth carrying: because the file does not change, a checkpoint is a versionable artefact. You can hash it, store it, roll back to it, and state exactly which weights produced a logged output. That property is what makes model versioning and reproducibility possible at all, and it is why the evaluation discipline in 01-08 insists on recording which checkpoint produced a score.

L3 — Precision, and the memory arithmetic

Each parameter is stored in a numeric format, and the format sets its byte cost:

PrecisionBytes per parameterWeight memory for a 7B model
FP324~28 GB
FP16 / BF162~14 GB
INT8 / FP81~7 GB
INT40.5~3.5 GB

The rule to memorise: weight memory ≈ parameter count × bytes per parameter. At the widely used FP16/BF16 serving default that collapses to a two-second estimate — double the billions and read the answer in gigabytes: 7B → ~14 GB, 13B → ~26 GB, 70B → ~140 GB.

Two honesty notes. First, units: 7 × 10⁹ × 2 bytes is 14 GB decimal but 13.0 GiB, and a GPU advertised as "16 GB" is typically 16 GiB. The gap is about 7% and it decides whether a model fits — this is the arithmetic set up in M0.4. Second, weights are not the whole footprint. Serving also needs the KV cache (which grows with batch size and sequence length) and activation working space; training needs optimizer state and gradients on top, which is why training a model takes several times the memory of serving it. Capacity planning gets its own treatment later in the course; here you only need the weights term and the reason the other terms exist.

The lesson stops at L3 deliberately. You do not need to know how BF16's exponent range differs from FP16's, or which kernels are available at which precision. What you need is that precision is a bytes-per-parameter choice, that lowering it is the standard lever for fitting a model into less memory, and that the cost of lowering it is accuracy you have to measure rather than assume.

03

Parameters vs hyperparameters vs context vs decoding settings

Four things are routinely blurred, and distractors exploit all four.

ParametersHyperparametersContext (the prompt)Decoding settings
Who sets the valueLearned by trainingChosen by a human before/around trainingSupplied by the caller at request timeSupplied by the caller at request time
ExamplesAttention weights, embedding vectorsLearning rate, batch size, epochs, layer countSystem prompt, user question, retrieved passages, few-shot examplesTemperature, top-k, top-p, max tokens
Persists after the request?Yes — stored in the checkpointYes, as a training recipeNo — discarded when the request endsNo
Changed by prompting?NoNoYes, that is what prompting isSeparately configurable
Counted in "7B parameters"?YesNoNoNo
Affects what the model knows?YesIndirectly, via how training wentNo — adds what it can seeNo

The fourth column is the one people get wrong in casual speech. Temperature and top-p are neither parameters nor training hyperparameters — they are decoding settings applied at inference to an already-frozen model. Calling temperature a "model parameter" is a common informal slip and a clean distractor.

And the pairing that matters most for scenario questions:

TechniqueChanges parameters?What it actually changesTypical data volume
Prompt engineeringNoThe input textA handful of examples
RAGNoThe input text, augmented with retrieved evidenceA corpus to index, no labels
Prompt tuning / p-tuningAdds a small set of new trainable vectors; base weights frozenA learned soft prefixHundreds to thousands of examples
LoRA / adapters (PEFT)Yes, a small added set; base weights frozenA low-rank update applied to the baseThousands of examples
Full fine-tuningYes, all of themThe whole checkpointTens of thousands and up
Alignment / RLHFYesThe whole policy's weightsLarge preference-labelled set

Read the table top to bottom and it is a ladder of increasing cost, increasing data requirement, and increasing commitment. Read the "changes parameters" column on its own and it is the single test that resolves most scenario items.

04

Parameters vs the other things measured in a model spec

A model card lists several numbers and they measure unrelated properties. Mixing them up is a reliable way to answer a sizing question wrong.

QuantityWhat it measuresUnitsChanged by
Parameter countHow much learned storage the model hasCount (7B, 70B)Choosing a different model
Context windowHow many tokens the model can read at onceTokens (8k, 128k)Choosing a different model, or a long-context variant
PrecisionBytes used to store each parameterBytes (4, 2, 1, 0.5)Quantisation
Vocabulary sizeHow many distinct tokens existCount (32k, 128k)The tokenizer, fixed with the model
Hidden sizeWidth of each token's internal vectorCount (4096)Architecture
Layer countDepth of the stackCount (32)Architecture

Two of these interact in a way worth knowing. Vocabulary size and hidden size together determine the embedding table's parameter count (vocabulary × hidden size), which is why a small model with a large vocabulary can spend a surprising fraction of its parameters just on embeddings. And context window is a runtime memory question, not a storage question: doubling the context you actually use roughly doubles the KV cache, while leaving the weight file byte-identical.

05

Worked example: sizing a 13B model for a 40 GB GPU

A team wants to serve a 13-billion-parameter model on a single 40 GB accelerator.

text
FP32:      13e9 × 4 bytes = 52 GB   → does not fit
FP16/BF16: 13e9 × 2 bytes = 26 GB   → weights fit, ~14 GB left for KV cache + activations
INT8:      13e9 × 1 byte  = 13 GB   → comfortable headroom for larger batches

Read it as an engineer, not an arithmetician. FP32 is eliminated outright. BF16 fits the weights with roughly 14 GB of working room — enough for a modest batch, and the batch size and context length you can then serve depend on how much of that the KV cache consumes. INT8 roughly doubles your headroom, at the cost of some accuracy that must be measured rather than assumed. (Quantisation methods and the accuracy question are their own topic later; here the point is that the decision is driven by a multiplication you can do in your head.)

Now do the units check that M0.4 set up, because it changes the BF16 answer's comfort level:

text
26 GB decimal = 26e9 / 2^30 GiB = 24.2 GiB
A "40 GB" accelerator is typically 40 GiB = 42.9 GB decimal
Headroom = 42.9 - 26 = 16.9 GB decimal ≈ 15.7 GiB

The direction of the correction matters. Because the card is measured in the larger binary unit and the weights in the smaller decimal one, this particular comparison comes out slightly better than the naive subtraction suggested. Reverse the situation — a decimal-advertised file against a binary-advertised card in the other direction — and it comes out worse. The habit, not the answer, is what you carry: convert both sides to the same unit before you conclude anything fits.

Now the same reasoning in reverse. If the team's real complaint is "the model does not know our internal API," no precision choice helps, because that fact was never in the weights. The options are: put the API docs in the context via retrieval, or change the weights via fine-tuning. Which one you pick is a parameters-versus-context decision — the exact distinction this lesson exists to make automatic.

06

Worked example: where the parameters of an illustrative 7B model actually sit

Take a deliberately illustrative configuration — these are round numbers chosen to make the arithmetic legible, not a spec sheet for any named model:

text
hidden size        d = 4096
layers             L = 32
FFN inner size         4d = 16384
vocabulary         V = 32000

Per transformer block:

text
attention projections   4 × (d × d)      = 4 × 4096 × 4096  ≈ 67.1M
feed-forward matrices   2 × (d × 4d)     = 2 × 4096 × 16384 ≈ 134.2M
layer norms                                                 ≈ negligible
--------------------------------------------------------------------
per block                                                   ≈ 201.3M

Across the stack and the embeddings:

text
32 blocks × 201.3M                       ≈ 6.44B
embedding table  V × d = 32000 × 4096    ≈ 0.13B
output projection (if untied) V × d      ≈ 0.13B
--------------------------------------------------------------------
total                                    ≈ 6.7B  → "a 7B model"

Three things to take from the arithmetic. First, the two-thirds/one-third split is visible: 134.2M versus 67.1M per block. Second, the embeddings are about 2% of this model's parameters — real, but not where the storage is. In a much smaller model with the same vocabulary, that fraction becomes large, which is why small models sometimes tie the input embedding and output projection to the same matrix to avoid paying twice. Third, "7B" is a marketing round number; the actual count is whatever the configuration produces.

Then apply the memory rule:

text
6.7e9 × 2 bytes (BF16) = 13.4 GB decimal = 12.5 GiB of weights

Which is the number that decides whether this checkpoint loads on a 16 GiB card with room left for a KV cache. It does — barely, and only at small batch sizes.

07

Why LLM parameters are on the NCA-GENL exam

Objective 1.5 (ML fundamentals) and objective 1.7 (reading research papers to spot emerging LLM trends) both assume this vocabulary — the official study guide's suggested-reading list includes LoRA, which is unreadable if you do not know what a parameter is. Core ML is 30% of the blueprint, the largest single domain.

The concept is questioned indirectly, in four recurring shapes:

  1. Customisation-choice scenarios. "A team needs the assistant to answer from a document set updated daily." The keyed answer is retrieval, not fine-tuning, because retrieval changes context while fine-tuning changes weights — and daily-changing facts should not be baked into weights.
  2. Sizing and deployment items. Anything that asks whether a model fits, or why quantisation helps, runs on the weight-memory rule above. Candidate reports say GPU spec-sheet depth did not appear; the arithmetic identity still does, because it is conceptual rather than product trivia.
  3. Terminology discrimination. Parameter vs hyperparameter, weights vs context, training vs inference. Cheap points if the vocabulary is precise.
  4. Knowledge-cutoff reasoning. "The model confidently describes a product feature released last month that does not exist." The keyed answer names the cutoff and points at grounding.

How the question tends to be phrased

You will typically see a short scenario naming a business need, four plausible technical responses, and one that respects the weights-versus-context boundary. The phrasings to recognise:

  • "…knowledge that changes frequently…" → retrieval. Weights are the wrong store for volatile facts.
  • "…must adopt our house tone and output format…" → fine-tuning territory, because style is a behaviour you want persisted.
  • "…must cite the source document…" → retrieval, because weights cannot attribute.
  • "…must run on a smaller GPU without changing models…" → quantisation, a bytes-per-parameter change.
  • "…must not retain user data…" → note that inference does not write to weights at all, which is often the point of the item.

What the distractors typically look like

The standard traps are: fine-tune on the daily-changing corpus (technically possible, operationally wrong, and it still cannot cite); increase the context window offered as a fix for missing knowledge (a bigger window with nothing in it changes nothing); raise the temperature offered as a fix for factual gaps; and the model learns from the conversation offered as a mechanism, which contradicts frozen weights. Notice that each distractor is a real technique misapplied — that is the exam's house style, and the weights-versus-context test cuts through all four.

Calibration note, and it is calibration rather than fact: published candidate reports say the exam sits at a general level — know what each thing is and when to use it. NVIDIA publishes no per-item detail and no official passing score, so treat those reports as a study-planning aid only. For this lesson the practical reading is that the identity statements and the decision table earn more marks than any deeper numerical fluency would.

08

Common mistakes about parameters and where knowledge is stored

MistakeSymptom you would actually observeFix
Believing a prompt "teaches" the modelThe behaviour you demonstrated in one request is gone in the next sessionIn-context learning changes output for that request only; nothing persists
Believing a long conversation accumulates knowledgeQuality degrades once the window fills and early turns get truncatedIt accumulates context, re-sent each turn, then dropped
Confusing parameter count with context-window sizeYou size a GPU from the context length, or expect a 7B model to read a bookStorage capacity versus how much text can be read at once — unrelated numbers
Assuming more parameters always means betterYou over-provision and still miss the task metricData quality, alignment and retrieval frequently beat raw size at a fixed task
Forgetting optimizer state when sizing trainingThe job OOMs at step 1 despite the weights fitting easilyTraining holds gradients and optimizer state on top of weights
Mixing decimal GB with binary GiBA model that "should fit" fails to load by a few percentA 14 GB weight file is 13.0 GiB and a "16 GB" card is 16 GiB, per M0.4
Saying "the knowledge is in the attention layers"You misattribute where capacity lives and mis-answer a mechanism itemAttention routes information between positions; feed-forward layers hold about two thirds of the parameters
Treating quantisation as freeThroughput improves and a subtle quality regression ships unnoticedLower precision costs accuracy that must be measured on your own eval set
09

When to change weights and when to change context

A decision rule you can apply directly to scenario items.

The symptomRoot causeReach forDo not reach for
Model does not know a fact that exists in your documentsFact never entered the weightsRetrieval (RAG)Fine-tuning; higher temperature
Model does not know a fact that changes dailyVolatile knowledge in a frozen storeRetrievalFine-tuning of any kind
Answers must cite a sourceWeights cannot attributeRetrieval with citationAny weight change
Output format is inconsistentBehaviour, not knowledgePrompt constraints first, then fine-tuning if it must persistRetrieval
Model uses the wrong house tone everywherePersistent behaviour requirementFine-tuning / PEFTRetrieval
Model needs a new specialised skill with plenty of examplesCapability gapPEFT, then full fine-tune if PEFT plateausPrompting alone
Outputs vary too much between runsSamplingLower temperature, or greedy decodingAny weight change
Model will not fit on the available GPUBytes per parameterQuantisation, or a smaller modelReducing the context window and hoping
Model must stop producing unsafe contentPolicy layerGuardrails plus alignmentPrompt-only patching

The reason this table is worth memorising in shape rather than in detail is that the exam does not ask you to build any of these. It asks you to recognise which one a described situation calls for — exactly the posture the job-role frame describes, where the associate contributes under supervision and is expected to make correct tool choices.

10

Does fine-tuning add knowledge or just change style?

Both, but not equally reliably, and the honest answer is the one the exam rewards.

Fine-tuning demonstrably changes behaviour: format, tone, task framing, willingness to answer in a particular shape. It does that with relatively little data because you are steering something the model can already do.

Fine-tuning can also add knowledge, but it is a poor mechanism for the kind of knowledge business applications usually need. Facts learned this way are diffuse rather than addressable, cannot be cited, go stale the moment the source changes, and need a retraining cycle to update. Worse, fine-tuning a small factual set into a large model risks degrading the surrounding behaviour without a matching evaluation set to catch it.

So the practical rule: fine-tune for behaviour, retrieve for knowledge. Where a scenario needs both — house tone and current facts — the correct answer is usually both techniques together, and an option offering that combination is worth a second look.

11

Why can't an LLM tell you where a fact came from?

Because there is nowhere for the provenance to live. A fact in the weights is not a row with a source column; it is a diffuse pattern distributed across many parameters, contributed to by many documents and reinforced by repetition. There is no pointer back to a document because no document was ever stored.

When a model does produce a citation without retrieval, it is generating text that has the shape of a citation, sampled from a distribution over plausible-looking references. That is the mechanism behind fabricated URLs and invented paper titles: the objective in 01-01 rewards plausible continuations, and a citation is just more text to continue.

Which is why provenance is an architectural property rather than a model property. Retrieval supplies the document, the pipeline passes it in the context, the prompt asks the model to answer only from it, and the citation points at something that actually exists on your side of the system. The model did not gain the ability to attribute; the system gained a source to attribute to.

12

Do parameters and hyperparameters ever swap roles?

Not within one training run, but the boundary is a design choice rather than a law, and knowing that stops the distinction from feeling arbitrary.

Architecture choices — layer count, hidden size, attention head count — are hyperparameters: a human sets them, and they determine how many parameters exist. Optimisation choices — learning rate, batch size, epoch count, weight decay — are hyperparameters that determine what values the parameters end up with. Neither is learned by gradient descent on the training loss, which is the defining test.

The edge cases are worth one sentence each. Learning-rate schedules change a hyperparameter over time by rule, not by learning. Learned positional embeddings are genuine parameters even though "position" feels like a configuration detail. And soft prompts in prompt tuning are new parameters that behave like a prompt — which is exactly why the customisation table above lists them in their own row rather than in either bucket.

13

Glossary recap: the terms this lesson introduced

TermOne-line definition
ParameterA number learned by training; the umbrella term for weights and biases
WeightA multiplicative parameter, an entry in a learned matrix
BiasAn additive per-output parameter; often omitted in modern LLMs
TrainableWhether the current run is permitted to update a given parameter
FrozenNot updated — the state of all parameters at inference, and of base weights under PEFT
CheckpointThe stored file of parameter values; the versionable model artefact
HyperparameterA value a human sets, not learned by gradient descent — learning rate, batch size, layer count
ContextThe text supplied at request time; consumed and discarded, never stored
PrecisionThe numeric format of each parameter, measured in bytes per parameter
QuantisationReducing precision to cut memory, at a measurable accuracy cost
Knowledge cutoffThe point beyond which nothing is in the weights, because training stopped
Embedding matrixThe learned vector per vocabulary token; size is vocabulary × hidden
Unembedding / output projectionThe matrix mapping a hidden state back to vocabulary scores
KV cacheRuntime memory holding attention keys and values, growing with batch and sequence length
14

Key takeaways on LLM parameters

  • Parameters are learned numbers; they are the model's only knowledge store. Prompts and retrieved text are inputs, not knowledge.
  • Parameters are frozen at inference. Nothing a user sends writes back into them.
  • Weight memory ≈ parameters × bytes per parameter. FP16/BF16 at 2 bytes gives the double-the-billions shortcut: 7B ≈ 14 GB, 70B ≈ 140 GB. Weights are the floor, not the total.
  • Parameters vs hyperparameters vs context vs decoding settings are four distinct things; only the first is counted in a model's size.
  • Feed-forward layers hold roughly two thirds of a transformer block's parameters, attention roughly one third.
  • Sort every customisation technique by does it change weights — that single test resolves a large class of scenario questions.
  • Fine-tune for behaviour, retrieve for knowledge, and expect the best scenario answers to combine them when both are required.
  • Weights cannot cite. Provenance is a property of the system you build around the model.
15

Next: tensor shapes in transformers — batch, sequence, and hidden size

You know what the numbers are and how many of them there are. You do not yet know what shape the data flowing through them takes, and that shape is the vocabulary you need to read any model config, error message or architecture diagram for the rest of the course.

Next: 01-03 Tensor shapes in transformers: batch, sequence, and hidden size — the (batch, sequence, hidden) triple that every layer in the stack consumes and returns, and the reason a shape mismatch is the most common error you will ever see in this work.