Architecture Hyperparameters › Architecture Hyperparameters
Language AI HandbookAll chapters Architecture Hyperparameters › Architecture HyperparametersOne section · Sections in this chapter1 / 10 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Building a transformer is like designing a building: you must decide how tall to make it, how wide each floor should be, and how to allocate space between different rooms. These architectural decisions, the hyperparameters of transformer design, determine everything from model capacity to training dynamics to inference speed. Get them wrong, and your model might train slowly, underperform, or consume excessive memory. Get them right, and the model can reach its target performance without wasting compute or memory.
This chapter explores the key architectural hyperparameters: model depth versus width trade-offs, the number of attention heads, feed-forward network dimensions, and how these choices interact. We'll derive formulas for calculating total parameters, examine how successful models like GPT and BERT, along with LLaMA, made these decisions, and develop intuition for designing architectures tailored to specific constraints.