Language Models with Python
An Objective Approach · by Giseldo Neo and Alana Neo

From the token to the Transformer: tokenization, embeddings, attention, the GPT model, training, inference, fine-tuning and evaluation, with Python examples.
Contents
- 1. Introduction to LLMs
- 2. Setting Up the Development Environment
- 3. Mathematical Foundations
- 4. Tokenization and Vocabularies
- 5. Vector Representation: Embeddings and Positional Encoding
- 6. The Attention Mechanism (Self-Attention)
- 7. Multi-Head Attention and Linear Projections
- 8. The Transformer Block Architecture
- 9. Assembling the Complete Model (GPT Style)
- 10. The Training Loop and Optimization
- 11. Inference Strategies and Text Generation
- 12. Fine-Tuning and Customization
- 13. Evaluation, Checkpoints, and Scale
- 14. Limitations, Ethics, and Responsible Use
- 15. The Future of LLMs
- 16. Glossary