{"slug": "leanpub-book-launch-my-adventures-with-large-language-models-build-foundational", "title": "Leanpub Book LAUNCH 🚀 My Adventures with Large Language Models: Build foundational LLMs from Transformers to DeepSeek, from scratch, in PyTorch by Prathamesh S.", "summary": "Prathamesh S. launched a Leanpub book titled 'My Adventures with Large Language Models' that teaches readers to build five LLM architectures from scratch in PyTorch, including GPT-2, Llama 3.2, and DeepSeek. The book targets ML engineers and researchers seeking hands-on code-level understanding of modern LLMs beyond GPT-2.", "body_md": "[Books](https://leanpub.com/blog/tag/books/)\n\n# Leanpub Book LAUNCH 🚀 My Adventures with Large Language Models: Build foundational LLMs from Transformers to DeepSeek, from scratch, in PyTorch by Prathamesh S.\n\nMy Adventures with Large Language Models walks you through building five real LLM architectures from scratch in PyTorch, starting from a vanilla encoder-decoder Transformer and ending at DeepSeek's Multi-Head Latent Attention and Mixture-of-Experts.\n\nWelcome to the Leanpub Launch video for [My Adventures with Large Language Models: Build foundational LLMs from Transformers to DeepSeek, from scratch, in PyTorch](https://leanpub.com/adventures-with-llms?ref=leanpub.com) by Prathamesh S.!\n\n## About the Book\n\nMost LLM tutorials stop at GPT-2. This book doesn't.\n\nMy Adventures with Large Language Models walks you through building five real LLM architectures from scratch in PyTorch, starting from a vanilla encoder-decoder Transformer and ending at DeepSeek's Multi-Head Latent Attention and Mixture-of-Experts.\n\nEvery chapter has runnable, end-to-end code. No pseudocode, no hand-waving. You type it, you run it, you understand it.\n\nWhat you'll build:\n\nChapter 1: A vanilla encoder-decoder Transformer for English-to-Hindi translation. The fundamentals, implemented from the ground up.\n\nChapter 2: GPT-2 (124M parameters) from scratch, then load real OpenAI pretrained weights to verify your implementation works.\n\nChapter 3: Llama 3.2-3B by swapping exactly four components of your GPT-2. LayerNorm becomes RMSNorm. Learned positional encodings become RoPE. GELU becomes SwiGLU. Multi-Head Attention becomes Grouped-Query Attention. Then load Meta's pretrained weights.\n\nChapter 4: KV cache, Multi-Query Attention, and Grouped-Query Attention for inference optimisation.\n\nChapter 5: DeepSeek's full architecture. Multi-Head Latent Attention (with the absorption trick and decoupled RoPE), DeepSeekMoE (shared experts, fine-grained segmentation, auxiliary-loss-free load balancing), Multi-Token Prediction, and FP8 quantisation.\n\nThe code repository is open source: https://github.com/S1LV3RJ1NX/mal-code\n\nThis book is for ML engineers, researchers, and senior developers who know Python and PyTorch and want to understand modern LLMs at the level of code, not slides or blog posts. If you've read Raschka or watched Karpathy and want to go further, into Llama, GQA, MLA, and MoE, this is the book.\n\n## About the Author\n\nPrathamesh is a Senior Forward Deployed Engineer at TrueFoundry, where he helps enterprises and startups solve real problems with LLMs and agents. He wrote this book because he wanted a resource that went past GPT-2 and into the architectures actually running in production. He is based in Bangalore, India. Portfolio: https://psaraf.pages.dev[Follow the author here!](https://www.linkedin.com/in/sarafpr/?ref=leanpub.com)", "url": "https://wpnews.pro/news/leanpub-book-launch-my-adventures-with-large-language-models-build-foundational", "canonical_source": "https://leanpub.com/blog/leanpub-book-launch-my-adventures-with-large-language-models-build-foundational-llms-from-transformers-to-deepseek-from-scratch-in-pytorch-by-prathamesh-s-2/", "published_at": "2026-06-04 22:18:56+00:00", "updated_at": "2026-06-18 16:46:28.099234+00:00", "lang": "en", "topics": ["large-language-models", "generative-ai", "machine-learning", "ai-products", "developer-tools"], "entities": ["Prathamesh S.", "Leanpub", "PyTorch", "OpenAI", "Meta", "DeepSeek", "TrueFoundry", "Bangalore"], "alternates": {"html": "https://wpnews.pro/news/leanpub-book-launch-my-adventures-with-large-language-models-build-foundational", "markdown": "https://wpnews.pro/news/leanpub-book-launch-my-adventures-with-large-language-models-build-foundational.md", "text": "https://wpnews.pro/news/leanpub-book-launch-my-adventures-with-large-language-models-build-foundational.txt", "jsonld": "https://wpnews.pro/news/leanpub-book-launch-my-adventures-with-large-language-models-build-foundational.jsonld"}}