Sebastian Raschka 2f53bf5fe5 Link the other KV cache sections (#708) 5 months ago
..
01_main-chapter-code c21bfe4a23 Add PyPI package (#576) 8 months ago
02_performance-analysis c21bfe4a23 Add PyPI package (#576) 8 months ago
03_kv-cache 2f53bf5fe5 Link the other KV cache sections (#708) 5 months ago
README.md 2af686d70b Add KV cache (#671) 5 months ago

README.md

Chapter 4: Implementing a GPT Model from Scratch to Generate Text

 

Main Chapter Code

 

Bonus Materials

  • 02_performance-analysis contains optional code analyzing the performance of the GPT model(s) implemented in the main chapter
  • 03_kv-cache implements a KV cache to speed up the text generation during inference
  • ch05/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 (it might be interesting to look at alternative architectures after completing chapter 4, but you can also save that for after reading chapter 5)

In the video below, I provide a code-along session that covers some of the chapter contents as supplementary material.



Link to the video