Discover / Generative AI & large language models / Reading path

Generative AI reading path: understand and build with large language models

@codesherpaIntermediate → Expert
8
Books
27
Hours
5
Stages
Not yet rated

This curriculum takes an intermediate practitioner from a solid grounding in deep learning concepts through the full modern LLM stack — transformers, prompting, fine-tuning, and retrieval-augmented generation — culminating in the skills needed to design and ship real-world LLM applications. Each stage builds the vocabulary and mental models required for the next, moving from architectural understanding to hands-on engineering.

1

Transformer Foundations

Intermediate

Understand the deep learning and transformer architecture underpinning all modern LLMs, including attention mechanisms, embeddings, and how language models are pre-trained.

Study plan for this stage

Pace: 8–10 weeks, ~40–50 pages/day (mix of reading and code implementation)

Key concepts
  • Backpropagation and gradient descent: how neural networks learn through iterative optimization
  • Embeddings and representation learning: converting discrete tokens into continuous vector spaces
  • The attention mechanism: how transformers selectively focus on relevant parts of input sequences
  • Multi-head attention and self-attention: parallelizing attention across multiple representation subspaces
  • Positional encoding: injecting sequence order information into transformer models
  • The transformer architecture: encoder-decoder structure and how components interact end-to-end
  • Pre-training objectives (masked language modeling, next sentence prediction): how LLMs learn from unlabeled text
  • Tokenization and vocabulary design: bridging raw text to model inputs
You should be able to answer
  • Explain how backpropagation computes gradients and why it enables efficient training of deep networks.
  • What is an embedding, and why is converting discrete tokens to continuous vectors essential for neural language models?
  • How does the attention mechanism work, and what problem does it solve compared to RNNs or CNNs for sequence modeling?
  • Describe the role of positional encoding in transformers and why it is necessary.
  • Walk through the full forward pass of a transformer encoder: from tokenized input to contextualized output representations.
  • What is masked language modeling (MLM), and how does it enable self-supervised pre-training of LLMs?
Practice
  • Implement backpropagation from scratch for a simple 2-layer neural network using only NumPy; verify gradients numerically.
  • Build word embeddings using Word2Vec or GloVe on a small corpus; visualize and interpret the learned vector space.
  • Implement scaled dot-product attention in PyTorch; test it on a toy sequence and verify attention weights sum to 1.
  • Code multi-head attention from scratch; compare single-head vs. multi-head outputs on a sample input.
  • Implement positional encoding (sinusoidal or learned) and visualize how it encodes position information.
  • Build a minimal transformer encoder block (embedding → self-attention → feed-forward) and run it on tokenized text.

Next up: This stage equips you with the architectural and mathematical foundations of transformers, preparing you to understand how these models are fine-tuned, deployed, and adapted for specific tasks in the next stage.

Dive into Deep Learning
Aston Zhang · 2023

A rigorous, code-first reference that covers neural networks, sequence models, and the attention mechanism in depth — essential vocabulary before tackling transformer-specific texts.

Natural Language Processing with Transformers
Lewis Tunstall · 2022

The most practical and comprehensive introduction to the Hugging Face ecosystem and transformer architectures; bridges theory and code and should be read immediately after building DL intuition.

2

Understanding Large Language Models

Intermediate

Develop a conceptual and technical understanding of how LLMs work at scale — pre-training objectives, emergent capabilities, alignment, and the landscape of modern foundation models.

Study plan for this stage

Pace: 8–10 weeks, ~40–50 pages/day (mix of dense technical content and hands-on code)

Key concepts
  • Transformer architecture fundamentals: self-attention, multi-head attention, positional encoding, and feed-forward layers
  • Pre-training objectives and loss functions: next-token prediction, causal language modeling, and why these drive emergent capabilities
  • Tokenization and vocabulary design: byte-pair encoding (BPE), subword tokenization, and their impact on model behavior
  • Scaling laws and emergent capabilities: how model size, data, and compute interact; why larger models develop unexpected abilities
  • Fine-tuning and instruction alignment: supervised fine-tuning (SFT), reinforcement learning from human feedback (RLHF), and steering model behavior
  • Context windows, in-context learning, and prompt engineering: how LLMs use context and why prompting strategies matter
  • Modern foundation model landscape: comparing GPT, Claude, Llama, and other architectures; understanding trade-offs in design choices
  • Practical implementation details: batching, mixed precision training, distributed training, and memory optimization for large-scale models
You should be able to answer
  • Explain how self-attention works and why it is more effective than RNNs for capturing long-range dependencies in text
  • What is the difference between causal and bidirectional attention, and why do generative LLMs use causal masking?
  • How does tokenization affect model behavior, and what are the trade-offs between character-level, word-level, and subword tokenization?
  • Describe the relationship between model scale (parameters, data, compute) and emergent capabilities—why do larger models develop unexpected abilities?
  • What is the purpose of instruction fine-tuning and RLHF, and how do they differ from pre-training in terms of objectives and data?
  • Compare and contrast at least two modern foundation models (e.g., GPT-4, Claude, Llama) in terms of architecture, training data, and alignment approach
Practice
  • Build a transformer from scratch (as guided by Raschka's book): implement self-attention, multi-head attention, positional encoding, and a full forward pass on a small dataset
  • Implement byte-pair encoding (BPE) tokenization from first principles; tokenize a sample text and visualize how vocabulary size affects compression
  • Train a small causal language model on a toy dataset (e.g., Shakespeare or a subset of Wikipedia); log loss curves and observe how it learns to predict the next token
  • Experiment with prompt engineering: take a pre-trained model and test different prompts on the same task; document how phrasing, examples, and context affect outputs
  • Analyze scaling laws: train models of different sizes on the same data and plot loss vs. model size; compare your results to published scaling law papers
  • Fine-tune a pre-trained model (e.g., using Hugging Face transformers) on a custom instruction dataset; measure performance before and after alignment

Next up: This stage grounds you in the mechanics and design principles of LLMs, preparing you to tackle advanced topics like multimodal models, retrieval-augmented generation, and production deployment in the next stage.

Build a Large Language Model (from Scratch)
Sebastian Raschka · 2024

Walks through implementing a GPT-style model from the ground up in PyTorch, cementing how tokenization, self-attention, and pre-training actually work before using black-box APIs.

Hands-On Large Language Models
Jay Alammar · 2024 · 400 pp

Provides rich visual intuition and practical code for working with LLMs — a perfect companion that broadens understanding of embeddings, generation, and the modern model landscape.

3

Prompting & In-Context Learning

Intermediate

Master prompt engineering techniques — zero-shot, few-shot, chain-of-thought, and structured output — to reliably steer LLM behavior without changing model weights.

Study plan for this stage

Pace: 4–5 weeks, ~25–30 pages/day, with 2–3 days per week dedicated to hands-on experimentation

Key concepts
  • Zero-shot prompting: crafting single prompts that elicit desired outputs without examples
  • Few-shot prompting: using in-context examples to guide model behavior and improve consistency
  • Chain-of-thought prompting: breaking complex reasoning into step-by-step intermediate outputs
  • Structured output techniques: designing prompts to generate JSON, tables, or other machine-readable formats
  • Prompt anatomy: understanding how instruction clarity, context, examples, and constraints shape LLM responses
  • Temperature, top-p, and other sampling parameters: tuning model behavior without retraining
  • Iterative refinement: systematically testing and debugging prompts to reduce hallucinations and errors
  • In-context learning: leveraging the model's ability to adapt to new tasks within a single conversation
You should be able to answer
  • What is the difference between zero-shot and few-shot prompting, and when should you use each?
  • How does chain-of-thought prompting improve reasoning accuracy, and what types of tasks benefit most?
  • What are the key components of an effective prompt, and how do instruction clarity and context interact?
  • How can you design a prompt to reliably generate structured outputs (JSON, CSV, etc.) from an LLM?
  • What role do sampling parameters like temperature and top-p play in controlling model behavior?
  • How do you systematically debug and iterate on a prompt to reduce hallucinations and improve consistency?
Practice
  • Write and test 5 zero-shot prompts for different tasks (summarization, classification, extraction) and document which phrasing choices yield the best results
  • Create a few-shot prompt with 3–4 examples for a custom task (e.g., sentiment analysis on domain-specific text), compare outputs to a zero-shot baseline, and measure improvement
  • Design a chain-of-thought prompt for a multi-step reasoning task (e.g., math word problem, logical deduction) and trace how intermediate steps affect final accuracy
  • Build a prompt that reliably outputs JSON or structured data for a real-world use case (e.g., extracting product details from reviews), test edge cases, and refine constraints
  • Experiment with temperature and top-p settings on the same prompt across 3–4 different values, document qualitative differences in output diversity and coherence
  • Take a failing or inconsistent prompt from your own work, apply iterative refinement techniques (constraint tightening, example addition, instruction reordering), and measure improvement in consistency metrics

Next up: This stage equips you with the tactical skills to steer LLM behavior through prompting alone; the next stage will build on these foundations by exploring how to combine prompting with retrieval, fine-tuning, and other architectural patterns to solve complex, multi-step problems at scale.

Prompt Engineering for LLMs
John Berryman · 2024 · 250 pp

A focused, practitioner-oriented guide to prompt design patterns, evaluation, and reliability — the right entry point before moving to heavier fine-tuning or retrieval work.

4

Fine-Tuning & Retrieval-Augmented Generation

Expert

Learn how to adapt pre-trained LLMs to specific tasks via fine-tuning (including PEFT/LoRA) and how to ground model outputs in external knowledge using RAG pipelines.

Study plan for this stage

Pace: 6–8 weeks, ~40–50 pages/day (mix of dense technical content and code examples; allow extra time for hands-on implementation)

Key concepts
  • Fine-tuning fundamentals: supervised fine-tuning (SFT) vs. reinforcement learning from human feedback (RLHF) and when to apply each approach
  • Parameter-Efficient Fine-Tuning (PEFT) techniques: LoRA, QLoRA, and adapter methods to reduce computational overhead while maintaining performance
  • Retrieval-Augmented Generation (RAG) architecture: the complete pipeline from document ingestion, embedding, retrieval, to prompt augmentation and response generation
  • Practical API integration: using GPT-4 and ChatGPT APIs for application development, including prompt engineering for fine-tuned and RAG-enhanced workflows
  • Data preparation and curation: creating high-quality training datasets for fine-tuning and building effective vector databases for RAG systems
  • Evaluation and iteration: measuring fine-tuning success, evaluating RAG retrieval quality, and optimizing end-to-end LLM application performance
  • Production deployment patterns: managing model versions, handling latency, cost optimization, and monitoring LLM applications in production
You should be able to answer
  • What are the key differences between supervised fine-tuning and RLHF, and when would you choose one over the other for a specific use case?
  • How does LoRA reduce the number of trainable parameters compared to full fine-tuning, and what are the trade-offs in model quality?
  • Describe the complete RAG pipeline: how does a document get indexed, retrieved, and used to augment a prompt for an LLM?
  • What are the main challenges in building a production-ready RAG system, and how do you evaluate retrieval quality?
  • How would you design a fine-tuning workflow using the GPT-4 API, including data preparation, training, and evaluation steps?
  • What strategies would you use to optimize cost and latency when deploying fine-tuned models or RAG systems in production?
Practice
  • Implement a complete fine-tuning pipeline using the OpenAI API: prepare a custom dataset (CSV/JSONL), submit a fine-tuning job, and evaluate the fine-tuned model against a baseline on a held-out test set
  • Build a RAG system from scratch: ingest a collection of documents (PDFs or text files), create embeddings using an embedding model, store them in a vector database (e.g., Pinecone, Weaviate, or Chroma), and implement retrieval + prompt augmentation
  • Implement LoRA fine-tuning on an open-source LLM (e.g., using the Hugging Face transformers library with PEFT): compare trainable parameters, training time, and inference quality against full fine-tuning
  • Create a multi-turn conversational application that combines fine-tuning and RAG: fine-tune a model on domain-specific instructions, then augment its responses with retrieved context from a custom knowledge base
  • Evaluate and optimize a RAG system: measure retrieval precision/recall, experiment with different embedding models and retrieval strategies, and measure end-to-end latency and cost
  • Deploy a fine-tuned LLM application to production: containerize the model, set up API endpoints, implement monitoring/logging, and document version control and rollback procedures

Next up: This stage equips you with the practical skills to customize and ground LLMs for real-world applications; the next stage will likely focus on advanced topics such as multi-modal models, agent architectures, or scaling LLM systems to handle complex workflows and enterprise requirements.

Developing Apps with GPT-4 and ChatGPT
Olivier Caelen · 2023

Introduces API-driven LLM application patterns including retrieval and tool use, providing the architectural scaffolding needed before studying RAG in depth.

LLM Engineers Handbook
Paul Iusztin · 2024

Covers the full MLOps lifecycle for LLMs — dataset curation, fine-tuning with PEFT/LoRA, RAG system design, and deployment — making it the capstone engineering reference for this stage.

5

Production LLM Applications

Expert

Synthesize everything into production-grade system design: orchestration, evaluation, observability, and building reliable LLM-powered products at scale.

Study plan for this stage

Pace: 8–10 weeks, ~40–50 pages/day with 2–3 days/week for hands-on projects

Key concepts
  • ML systems design patterns: data pipelines, model serving, and feedback loops in production
  • Evaluation frameworks: offline metrics, online metrics, and continuous monitoring for LLM outputs
  • Orchestration and workflow management: chaining LLM calls, managing dependencies, and error handling
  • Observability and debugging: logging, tracing, and diagnosing failures in LLM systems
  • Cost optimization and latency reduction: prompt engineering for efficiency, caching, and batching strategies
  • Safety, alignment, and guardrails: content filtering, adversarial robustness, and responsible deployment
  • Iteration and experimentation: A/B testing, prompt versioning, and rapid feedback loops
  • Scaling LLM applications: multi-model orchestration, load balancing, and managing API dependencies
You should be able to answer
  • How do you design a data pipeline and feedback loop for an LLM application in production, and what metrics should you track?
  • What is the difference between offline and online evaluation for LLM systems, and when should you use each?
  • How would you architect a system that chains multiple LLM calls together while handling failures and latency constraints?
  • What observability and monitoring infrastructure is essential for debugging LLM application failures?
  • How do you optimize an LLM application for cost and latency without sacrificing quality?
  • What guardrails and safety mechanisms should you implement before deploying an LLM application to production?
Practice
  • Design and implement a complete ML system for an LLM application: define the data pipeline, model serving layer, and feedback collection mechanism
  • Build an evaluation framework that combines offline metrics (BLEU, ROUGE, semantic similarity) and online metrics (user satisfaction, business KPIs) for an LLM task
  • Create a multi-step LLM orchestration workflow (e.g., classification → retrieval → generation) with error handling, retries, and fallback strategies
  • Set up comprehensive observability for an LLM application: implement structured logging, distributed tracing, and dashboards for key metrics
  • Implement prompt versioning and A/B testing infrastructure to compare different prompts and model configurations in production
  • Build a cost and latency optimization system: implement caching, batching, and prompt compression techniques, then measure their impact

Next up: This stage equips you with the systems-thinking and production discipline needed to move into specialized domains—whether that's building domain-specific LLM applications, scaling to enterprise requirements, or exploring emerging paradigms like agentic AI and autonomous systems.

AI Engineering
Chip Huyen · 2024 · 442 pp

Covers the full stack of building LLM-powered systems in production — from model selection and evaluation to latency, cost, and safety — the ideal capstone for a practitioner who wants to ship real applications.

Discussion

Keep reading

Paths that share books, cover the same subject, or open a related topic.

Shares 4 books

Build AI apps with large language models

Intermediate6books55 hrs4 stages
More on Cryptography

Cryptography reading path: from ciphers to modern secure protocols

Intermediate9books100 hrs5 stages
More on Unity game development

Unity game development reading path: from first scene to a shipped game

Beginner8books54 hrs4 stages