Foundation Models: Tokens, Attention, And Generation · Course Practice

Practice: Explain And Check A Model Call

Calculate the quantities under their stated units, then connect a generated decision to evidence and validation. Keep a mathematical construction, an expected behavior and an observed model result distinct.

Study And Save Progress

Watch The Lesson

7 min 20 sec

Read the video transcript

Use the worksheet to test which quantities and claims the model mental model can support. We will calculate representations and prediction loss, budget weights and context, then inspect a controlled policy answer. Each question has its own pause before the explanation.

Keep the supplied numbers, units and assumptions beside your working. These are classroom exercises, not observations from model calls, and you can complete them without buying or running a service. Start with a vocabulary containing 30,000 entries and an embedding table with 512 coordinates in each row.

How many scalar entries are in this simple matrix? State the multiplication, then explain whether this gives the total parameter count of a complete model. Pause and record your answer before continuing. The table contains 30,000 times 512, or 15,360,000 scalar entries.

It is 1 matrix. A full model can include additional projection, feedforward and other parameter collections, so this count is not its total. Keep entries separate from bytes: a storage calculation would additionally require the representation used for each entry and the relevant overhead. Now use 3 allowed source

positions with equal attention scores. Their values are (3,0), (0,3) and (0,0). Calculate the normalized shares and the combined 2-coordinate output. Show which values contribute to each coordinate. Pause and finish the calculation before opening the key.

Equal scores produce equal normalized shares, each 1 divided by 3. The 1st coordinate is 3 divided by 3, and the 2nd is also 3 divided by 3, giving (1,1). All 3 positions have a share, although the 0 vector adds no coordinate value. This is a source-position value mixture,

not the probability that an output answer is true. For the next exercise, a fixed observed target token's probability rises from 0.1 to 0.8. Using negative natural log probability, does the loss rise or fall? Calculate both values to 3

decimal places and state what the comparison says about that target. Pause and complete your working. The loss falls from approximately 2.303 to 0.223. Assigning more probability to the same observed target receives a smaller penalty under this objective.

It does not independently verify a new factual claim or supply a whole training update. The gradients, optimizer and other training conditions remain outside these 2 supplied probability cases. A checkpoint has 10 billion parameters stored at 2 bytes per parameter. Calculate its raw weight

storage in decimal gigabytes. Would a device with exactly that memory capacity necessarily hold the whole running service? Pause and record both the number and what it excludes. The multiplication gives 20 billion bytes, or 20 gigabytes in decimal units. That is raw weight

storage under the supplied precision. Runtime cache, activations, buffers and overhead require additional accounting; training adds its own state. The weight-only calculation therefore does not establish that the running service fits into 20 gigabytes of device memory. A hypothetical service has a combined 12,000-token input-and-output limit.

Reserve 2,000 tokens for output and 1,500 for the defined other input. How much remains for documents and history before extra formatting or margin? Pause and write the subtraction, its units and its assumptions. The remainder is 12,000 minus 2,000 minus 1,500, or 8,500 tokens.

This answer uses the stipulated combined accounting convention. Extra message formatting or margin has not yet been allocated. A real service may use a different convention, and fitting the packet still does not guarantee that every supplied detail is used correctly.

An MoE headline reports 60 billion total parameters and 12 billion active parameters. Can the full weight-storage plan use only the active count? Explain how the remaining weights and the serving architecture affect your answer. Pause and complete that explanation before continuing. The active count describes parameters used

under the model's per-token reporting convention. Other relevant weights still need to be accessible through the actual deployment arrangement. They may be distributed or moved under a designed system, which introduces resource and communication considerations. Plan total weights and runtime state from the configuration;

the active number alone is insufficient. Finish with a fictional policy task. Standard products can be returned within 30 days, while customized products are excluded unless defective. The complete case is customized, nondefective and delivered 10 days ago. A receives only the short 10-day question;

B receives the full policy and facts, with the same model weights. B's proposed object has eligible set to the boolean true. In a separate supplied next-token sketch, the supplied scores for true and false are 2 and 1, so greedy selection favors true.

Identify A's expected behavior, B's evidence-supported decision, whether the boolean type is valid, and what this comparison can establish. Pause and complete all parts. A should obtain the missing policy and product facts or qualify its response. B's supported decision is no, so eligible should be false

with the customization exclusion explained. The proposed true is a valid boolean type but the wrong decision under this case. A favored token can still be wrong for the task; greedy selection is not a fact checker. This A/B comparison changes input completeness,

not the underlying weights. Observed performance remains unknown because no model was run. Review your worksheet by tracing each conclusion back to its inputs and rule. Matrix entries, value coordinates, loss, bytes, context tokens and active computation have different meanings. The final policy exercise connects

model generation to evidence and validation. Carry this discipline into the independent project: define cases and expected behavior first, keep observed results blank until measured, and make only the claims your controlled evidence supports.

Main Point

Calculate the quantities under their stated units, then connect a generated decision to evidence and validation. Keep a mathematical construction, an expected behavior and an observed model result distinct.

Key Points

1. Prepare your working record

Use the blank worksheet. Record inputs, operation, result, units and what the result establishes. Complete each attempt before opening its explanation. All exercises use supplied classroom data; no API, model, tokenizer or paid experiment is required.

The 6 calculations and explanations let you check representations, prediction and resource limits. The final exercise connects application evidence, generation and validation.

2. Choose the appropriate calculation

For a simple embedding matrix, multiply rows by coordinates per row. For equal allowed attention scores, normalize equal shares and add the corresponding value coordinates. For a fixed target, use the negative natural logarithm of its assigned probability.

For raw weights, multiply parameter count by bytes per parameter and label decimal versus binary units. For a combined context budget, subtract the specified allocations before any unallocated margin. For MoE, distinguish active use from the full collection that must remain accessible.

These operations answer different questions. A model’s conditional next-token preference does not settle an evidence-backed business decision.

3. Validate an expected response

In the fictional policy exercise, keep the policy and product facts together. First identify expected behavior for the complete and incomplete packets. Then separately inspect boolean type, decision correctness and the supplied greedy selection sketch.

No result has been observed from either configuration. The source-input comparison and the internal arithmetic illustrations have different evidential roles.

4. Closing

Check each answer by reconstructing its operation and boundary, rather than memorizing the displayed value. The project will use this discipline to build a connected diagram, calculations, 10 cases and a bounded comparison plan.

5. Learning Checks

Attempt each item before opening its full explanation. You can pause longer than the video’s minimum unanswered interval.

M14-PRACTICE-Q01

A simple embedding table has 30,000 vocabulary entries and 512 coordinates per row. Calculate its scalar entries. Does this count the complete model’s parameters?

Your working and interpretation: ____________________

Show explanation after your attempt

30,000×512=15,360,000 scalar entries in this matrix. A complete model has additional parameter collections, so this is not its total. Entries do not establish bytes without a storage representation and overhead convention.

M14-PRACTICE-Q02

All 3 source positions are allowed and have equal attention scores. Values are (3,0), (0,3) and (0,0). Calculate shares and the combined 2-coordinate output.

Your working and interpretation: ____________________

Show explanation after your attempt

Each normalized share is 1/3. The output is ((3+0+0)/3,(0+3+0)/3)=(1,1). All positions have a share; the 0 vector contributes 0 to each coordinate. This combines source-position values rather than giving output-answer truth probabilities.

M14-PRACTICE-Q03

For the same observed target token, probability rises from 0.1 to 0.8. Calculate each negative natural log loss to 3 decimal places. Does loss rise or fall, and what does this objective measure?

Your working and interpretation: ____________________

Show explanation after your attempt

−ln(0.1)≈2.303 and −ln(0.8)≈0.223, so loss falls. More probability on the same observed target receives a smaller penalty under this objective. It is not a general truth probability or a complete parameter update.

M14-PRACTICE-Q04

A 10-billion-parameter checkpoint stores each parameter at 2 bytes. Calculate raw weight storage in decimal GB and explain what the number excludes.

Your working and interpretation: ____________________

Show explanation after your attempt

10×10^9×2=20×10^9 bytes=20 GB decimal for raw weights. Cache, activations, buffers and overhead need additional runtime accounting; training adds other state. The calculation does not establish a whole running service fits into 20 GB.

M14-PRACTICE-Q05

A hypothetical combined input/output limit is 12,000 tokens. Reserve 2,000 for output and 1,500 for defined other input. Calculate documents/history space before extra formatting or margin.

Your working and interpretation: ____________________

Show explanation after your attempt

12,000−2,000−1,500=8,500 tokens remain under the supplied combined convention. Extra formatting/margin has not been allocated. Actual service accounting and usable evidence quality remain separate checks.

M14-PRACTICE-Q06

An MoE reports 60 billion total parameters and 12 billion active parameters. Can the complete weight-storage plan use only 12 billion? Explain the deployment condition.

Your working and interpretation: ____________________

Show explanation after your attempt

The active count describes per-token parameter use under the reporting convention. All relevant weights still need access through a specified deployment arrangement, including possible distribution or movement. Account for the full needed collection and runtime state; active count alone is insufficient.

M14-PRACTICE-P01

Fictional policy: standard products may be returned within 30 days; customized products are excluded unless defective. The complete case is customized, nondefective, delivered 10 days ago. Same checkpoint: A receives only the 10-day question; B receives full policy/facts. Proposed B output has boolean eligible:true. A separate stipulated vocabulary sketch has scores true=2 and false=1 with greedy selection. Give A’s expected behavior, B’s supported decision, type validity, selection meaning and the factor tested. No model was run.

Your working and interpretation: ____________________

Show explanation after your attempt

A should obtain missing information or qualify its response. B should answer no and set eligible:false, explaining the customization exclusion. The supplied true is a valid boolean type but the wrong task decision. Greedy selection of the stipulated higher-scoring true does not verify the policy result. This A/B design changes input completeness, not checkpoint weights; actual outputs and improvement remain unknown.

Sources

Learner Materials

Download Course Practice Learner Materials

Use the supplied fictional cases and templates for practice.

Practice

Write your answer, compare it with the model answer and decide what to revisit. These written checkpoints are self-assessed.

A simple embedding table has 30,000 vocabulary entries and 512 coordinates per row. Calculate its scalar entries. Does this count the complete model’s parameters? Your working and interpretation: ____________________

Show The Model Answer

30,000×512=15,360,000 scalar entries in this matrix. A complete model has additional parameter collections, so this is not its total. Entries do not establish bytes without a storage representation and overhead convention.

Compare your reasoning with the model answer. These written checks are self-assessed.

All 3 source positions are allowed and have equal attention scores. Values are (3,0), (0,3) and (0,0). Calculate shares and the combined 2-coordinate output. Your working and interpretation: ____________________

Show The Model Answer

Each normalized share is 1/3. The output is ((3+0+0)/3,(0+3+0)/3)=(1,1). All positions have a share; the 0 vector contributes 0 to each coordinate. This combines source-position values rather than giving output-answer truth probabilities.

Compare your reasoning with the model answer. These written checks are self-assessed.

For the same observed target token, probability rises from 0.1 to 0.8. Calculate each negative natural log loss to 3 decimal places. Does loss rise or fall, and what does this objective measure? Your working and interpretation: ____________________

Show The Model Answer

−ln(0.1)≈2.303 and −ln(0.8)≈0.223, so loss falls. More probability on the same observed target receives a smaller penalty under this objective. It is not a general truth probability or a complete parameter update.

Compare your reasoning with the model answer. These written checks are self-assessed.

A 10-billion-parameter checkpoint stores each parameter at 2 bytes. Calculate raw weight storage in decimal GB and explain what the number excludes. Your working and interpretation: ____________________

Show The Model Answer

10×10^9×2=20×10^9 bytes=20 GB decimal for raw weights. Cache, activations, buffers and overhead need additional runtime accounting; training adds other state. The calculation does not establish a whole running service fits into 20 GB.

Compare your reasoning with the model answer. These written checks are self-assessed.

A hypothetical combined input/output limit is 12,000 tokens. Reserve 2,000 for output and 1,500 for defined other input. Calculate documents/history space before extra formatting or margin. Your working and interpretation: ____________________

Show The Model Answer

12,000−2,000−1,500=8,500 tokens remain under the supplied combined convention. Extra formatting/margin has not been allocated. Actual service accounting and usable evidence quality remain separate checks.

Compare your reasoning with the model answer. These written checks are self-assessed.

An MoE reports 60 billion total parameters and 12 billion active parameters. Can the complete weight-storage plan use only 12 billion? Explain the deployment condition. Your working and interpretation: ____________________

Show The Model Answer

The active count describes per-token parameter use under the reporting convention. All relevant weights still need access through a specified deployment arrangement, including possible distribution or movement. Account for the full needed collection and runtime state; active count alone is insufficient.

Compare your reasoning with the model answer. These written checks are self-assessed.

Fictional policy: standard products may be returned within 30 days; customized products are excluded unless defective. The complete case is customized, nondefective, delivered 10 days ago. Same checkpoint: A receives only the 10-day question; B receives full policy/facts. Proposed B output has boolean eligible:true. A separate stipulated vocabulary sketch has scores true=2 and false=1 with greedy selection. Give A’s expected behavior, B’s supported decision, type validity, selection meaning and the factor tested. No model was run. Your working and interpretation: ____________________

Show The Model Answer

A should obtain missing information or qualify its response. B should answer no and set eligible:false, explaining the customization exclusion. The supplied true is a valid boolean type but the wrong task decision. Greedy selection of the stipulated higher-scoring true does not verify the policy result. This A/B design changes input completeness, not checkpoint weights; actual outputs and improvement remain unknown.

Compare your reasoning with the model answer. These written checks are self-assessed.

Open Practice And Save Your Work