Part I · Foundations
Chapter 02
Core Foundations of Generative AI
Four quantities decide what is architecturally possible: the token, the context window, the quadratic cost of attention, and the geometry of embedding space.
Deliverable: A custom BPE tokenizer built from scratch, and a context-window budget with overflow as an observable event.
What's inside
12 topics
- 2.1Understanding Large Language Models
- 2.2How LLMs Work Under the Hood
- 2.3Deep Dive into the GPT Architecture
- 2.4Fundamentals of Tokenization in NLP
- 2.5Implementing a Custom Tokenizer in Python
- 2.6The Transformer Breakthrough: Attention
- 2.7Role of Positional Encodings in Transformers
- 2.8Understanding Multi-Head Attention
- 2.9Deep Diving into Vector Embeddings
- 2.10The Context Window Is a Budget
- 2.11Prefill, Decode and the Cost of Long Context
- 2.12What Chapter Two Constrains
Preparing PDF viewer…
A note on this content
The book and its chapters are my personal learning notes — compiled from online research and hands-on practice, with most of the content AI-generated from that research and learning. It is not a peer-reviewed publication, and I make no claim that it is 100% error-free. If you spot a mistake, I'd genuinely appreciate hearing about it — contact me.