A language model predicts language from context. A large language model (LLM) is a neural model trained on extensive text collections to process and generate language. Think of it as autocomplete with much greater capacity: instead of consulting a small probability table, it learns patterns in language through adjustable parameters. section 11.1 section 1.5
From autocomplete to generation
Type “Hey, what are” into a phone keyboard, and it might suggest “you,” “we,” or “the” as the next word. A simple language model can make this choice using learned probabilities. An LLM extends the idea with many more parameters, much more training data, and a more complex architecture, enabling it to generate paragraphs, answer questions, translate, and write code. section 11.1
Modern LLMs commonly use the Transformer architecture. Its attention mechanism helps the model focus on relevant earlier words when predicting what comes next, much as a reader highlights important phrases. Transformer blocks also use feed-forward neural networks to process information and normalization layers. section 11.1
Figure 11.24 A simplistic overview of the Transformer framework
The overview shows the main parts of the Transformer framework used to design a language model. section 11.11
Designing an LLM involves practical trade-offs:
- Memory: Larger models can capture more nuance, but their parameters require more memory and potentially specialized hardware. section 11.11
- Compute: Training a large model on a huge dataset can require substantial processing power, energy, time, and expense. section 11.11
- Latency: Larger models may take longer to respond, which matters in applications such as chatbots. section 11.11
A model is the trained artifact, not the training algorithm itself. Once trained, it can be used to generate responses; its architecture and size influence the resources needed to do so. section 1.5 section 11.11




































































