Skip to content

Fix incorrect parameter count and remove duplicate cell in Lab 5.5#33

Closed
Yassir-249 wants to merge 1 commit into
google-deepmind:mainfrom
Yassir-249:fix/lab-5-5-param-count-and-dup-cell
Closed

Fix incorrect parameter count and remove duplicate cell in Lab 5.5#33
Yassir-249 wants to merge 1 commit into
google-deepmind:mainfrom
Yassir-249:fix/lab-5-5-param-count-and-dup-cell

Conversation

@Yassir-249

Copy link
Copy Markdown

Summary

Two minor edits to course_5/gdm_lab_5_5_implement_lora_for_parameter_efficient_fine_tuning.ipynb:

  1. The Recap markdown describes Gemma 3 1B as having "1.3 billion parameters". The Gemma 3 Technical Report, Table 1, gives 698M non-embedding + 302M embedding = ~1.0B total for the 1B variant, which matches the model.summary() output students see in the previous lab (Total params: 999,885,952). Updating the figure to match.
  2. The example-inputs code cell — the one that prints Output for ones only, Output for high 1st and 2nd input, and Output with input that reverses the sign — appears twice in a row in the "Intuition behind matrix decomposition" section. The two cells are functionally identical (only whitespace differs: x,delta_W vs x, delta_W) with no markdown between them. Removing the duplicate.

Changes

  • Recap markdown: 1.3 billion parameters1 billion parameters.
  • Cell removal: delete the second of the two identical example-inputs cells. The first remains in place, preserving reading order. delta_W is defined in the cell immediately above both copies, and the next markdown ("If you add an additional row to A...") moves to a new topic, so no downstream cell depends on the deleted one.

Verification

Tested on a Colab T4 GPU runtime against git+https://github.com/google-deepmind/ai-foundations.git@main:

  • All three coding activities pass: LoraDense.call() returns shape (1, 512) matching the pretrained model; pretrained_model.summary() reports 262,656 params; lora_model.summary() reports 270,848 total / 8,704 trainable / 262,144 frozen; feedback.check_loralab_answer(0.0331, num_units=512, rank=8) returns Nice! Your answer looks correct.
  • Removing the duplicate cell does not break the run — the surviving cell uses the delta_W defined immediately above it, and no later cell references a variable defined in the removed cell.

Related

The Recap markdown describes Gemma 3 1B as having "1.3 billion
parameters". The Gemma 3 Technical Report
(https://arxiv.org/abs/2503.19786), Table 1, gives 698M non-embedding
+ 302M embedding = ~1.0B total for the 1B variant, which matches the
model.summary() output students see in the previous lab
(Total params: 999,885,952). Updating the figure to match.

Also removes a duplicate code cell in the "Intuition behind matrix
decomposition" section. The example-inputs cell that prints
"Output for ones only", "Output for high 1st and 2nd input", and
"Output with input that reverses the sign" appears twice in a row,
with no markdown between the two copies. The cells are AST-equivalent
(only whitespace differs: x,delta_W vs x, delta_W). Removing the
second copy preserves reading order; delta_W is defined in the cell
above both copies, and no later cell references a variable defined
in the removed cell.
upaq pushed a commit that referenced this pull request Jun 18, 2026
, #32, #33, #34, #35 and #36 by @Yassir-249.

PiperOrigin-RevId: 934537389
Change-Id: I5f6035aa2fb1ed3c291e26f9058e537ee5394996
@Yassir-249

Copy link
Copy Markdown
Author

Resolved on main — the duplicate cell is gone and the parameter count is corrected. Closing, thanks!

@Yassir-249 Yassir-249 closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant