rasbt-LLMs-from-scratch/ch05
2025-08-01 19:58:18 -05:00
..
01_main-chapter-code Fix some wording issues in the notes (#695) 2025-06-22 13:46:16 -05:00
02_alternative_weight_loading Alt weight loading code via PyTorch (#585) 2025-03-27 20:10:23 -05:00
03_bonus_pretraining_on_gutenberg fixed plot_losses (#677) 2025-06-19 18:55:43 -05:00
04_learning_rate_schedulers Add and link bonus material (#84) 2024-03-23 07:27:43 -05:00
05_bonus_hparam_tuning Remove unused params for hparam script (#710) 2025-06-25 12:50:32 -05:00
06_user_interface Add PyPI package (#576) 2025-03-23 19:28:49 -05:00
07_gpt_to_llama Interleaved Q and K for RoPE in Llama 2 (#750) 2025-07-23 08:02:02 -05:00
08_memory_efficient_weight_loading get rid of redundant memory profiler import (#744) 2025-07-16 07:36:51 -05:00
09_extending-tokenizers Add PyPI package (#576) 2025-03-23 19:28:49 -05:00
10_llm-training-speed Fix issue 724: unused args (#726) 2025-07-08 06:37:39 -05:00
11_qwen3 MoE Nb readability improvements (#761) 2025-08-01 19:58:18 -05:00
README.md Qwen3 Coder Flash & MoE from Scratch (#760) 2025-08-01 19:13:17 -05:00

Chapter 5: Pretraining on Unlabeled Data

 

Main Chapter Code

 

Bonus Materials

  • 02_alternative_weight_loading contains code to load the GPT model weights from alternative places in case the model weights become unavailable from OpenAI
  • 03_bonus_pretraining_on_gutenberg contains code to pretrain the LLM longer on the whole corpus of books from Project Gutenberg
  • 04_learning_rate_schedulers contains code implementing a more sophisticated training function including learning rate schedulers and gradient clipping
  • 05_bonus_hparam_tuning contains an optional hyperparameter tuning script
  • 06_user_interface implements an interactive user interface to interact with the pretrained LLM
  • 07_gpt_to_llama contains a step-by-step guide for converting a GPT architecture implementation to Llama 3.2 and loads pretrained weights from Meta AI
  • 08_memory_efficient_weight_loading contains a bonus notebook showing how to load model weights via PyTorch's load_state_dict method more efficiently
  • 09_extending-tokenizers contains a from-scratch implementation of the GPT-2 BPE tokenizer
  • 10_llm-training-speed shows PyTorch performance tips to improve the LLM training speed
  • 11_qwen3 A from-scratch implementation of Qwen3 0.6B and Qwen3 30B-A3B (Mixture-of-Experts) including code to load the pretrained weights of the base, reasoning, and coding model variants


Link to the video