# A deep understanding of AI large language model mechanisms

The code repository for a paid Udemy course on large language model internals, covering transformer architecture, tokenization, training, fine-tuning, inference and PyTorch implementations from scratch.

This repository holds all of the Python and PyTorch code for a Udemy course on the mechanics behind large language models such as those powering ChatGPT, Claude and Gemini. It includes lecture code organized by course section, code-challenge solutions with full explanations, custom PyTorch implementations of core LLM building blocks, and data preprocessing and visualization utilities.

The course itself covers transformer architecture and self-attention, tokenization and embeddings, training LLMs from scratch and fine-tuning pre-trained ones, decoding strategies, optimization and scaling laws, and evaluation metrics. The code in this repository is free; the associated Udemy course adds over 90 hours of video walkthroughs and mathematical derivations.

Website: https://github.com/mikexcohen/LLM_course
