Hands-On Large Language Models: Language Understanding and Generation

1st Edition
ISBN-13: 978-1098150969, ISBN-10: 1098150961
4.3 on Goodreads
(128)
Double-tap to zoom
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
Buy New
-37% $50.20
FREE delivery Monday, June 30
Ships from: Amazon.com
Sold by: Amazon.com
$50.20 with 37 percent savings
List Price: $79.99
FREE Returns
FREE delivery Monday, June 30
Or Prime members get FREE delivery Tomorrow, June 26. Order within 8 hrs 1 min.
In Stock
$$50.20 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$50.20
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Shipped & Sold by
Amazon.com
Amazon.com
Shipped & Sold by
Amazon.com
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
$38.73
Item in good condition. Textbooks may not include supplemental items i.e. CDs, access codes etc...
Only 16 left in stock - order soon.
$$50.20 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$50.20
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Access codes and supplements are not guaranteed with used items.
Ships from and sold by glenthebookseller.
Item couldn't be saved. Please try again later. This item could not be removed from your list. Please try again later
{"mobile_buybox_group_1":[{"displayPrice":"$50.20","priceAmount":50.20,"currencySymbol":"$","integerValue":"50","decimalSeparator":".","fractionalValue":"20","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"oZC9%2F3H%2BsECus9IQW7EkOu8aYwysw%2BlLNapXrHtGgii4QYroG5D4Un3Ls4aULlltdFEkcUdGJoEUHMibB0SNpBLxvuAg6bB9yU8kcZUqLgKcpHddvaeTroesCUSk1GFNMahr2XpeYzUm%2BvO04m1MYg%3D%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$38.73","priceAmount":38.73,"currencySymbol":"$","integerValue":"38","decimalSeparator":".","fractionalValue":"73","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"oZC9%2F3H%2BsECus9IQW7EkOu8aYwysw%2BlLdfByINN60Jxj2JNK9A6CDZUaMuqCprQGEFFecEz6t01KRKx4lLiu%2BTTuVbbhPZp84%2Fp6WnBhoNA%2BydcYsL5CrwY1n90FCbIve%2FFBmNok8f2UHYKLUuxOVbux9drfiNeKoH%2BanTs7QXwMDzxJHxy1DYSHoLVlTvbb","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Book details

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

AI has acquired startling new language capabilities in just the past few years. Driven by rapid advances in deep learning, language AI systems are able to write and understand text better than ever before. This trend is enabling new features, products, and entire industries. Through this book's visually educational nature, readers will learn practical tools and concepts they need to use these capabilities today.

You'll understand how to use pretrained large language models for use cases like copywriting and summarization; create semantic search systems that go beyond keyword matching; and use existing libraries and pretrained models for text classification, search, and clusterings.

This book also helps you:

  • Understand the architecture of Transformer language models that excel at text generation and representation
  • Build advanced LLM pipelines to cluster text documents and explore the topics they cover
  • Build semantic search engines that go beyond keyword search, using methods like dense retrieval and rerankers
  • Explore how generative models can be used, from prompt engineering all the way to retrieval-augmented generation
  • Gain a deeper understanding of how to train LLMs and optimize them for specific applications using generative model fine-tuning, contrastive fine-tuning, and in-context learning

Review

"Jay and Maarten have continued their tradition of providing beautifully illustrated and insightful descriptions of complex topics in their new book. Bolstered with working code, timelines, and references to key papers, their book is a valuable resource for anyone looking to understand the main techniques behind how large language models are built."
- Andrew Ng, Founder of DeepLearning AI

"I can't think of another book that is more important to read right now. On every single page, I learned something that is critical to success in this era of language models."
-Josh Starmer, StatQuest

"This is an exceptional guide to the world of language models and their practical applications in industry. Its highly-visual coverage of generative, representational, and retrieval applications of language models empowers readers to quickly understand, use, and refine LLMs. Highly recommended!"
-Nils Reimers, Director of Machine Learning at Cohere | creator sentence-transformers

"If you're looking to get up to speed in everything regarding LLMs, look no further! In this wonderful book, Jay and Maarten will take you from zero to expert in the history and latest advances in large language models. With intuitive explanations, great real-life examples, clear illustrations, and comprehensive code labs, this book lifts the curtain on the complexities of transformer models, tokenizers, semantic search, RAG, and many other cutting-edge technologies. A must read for anyone interested in the latest AI technology!"
- Luis Serrano, PhD, Founder and CEO - Serrano Academy

"This book is a must-read for anyone interested in the rapidly-evolving field of generative AI. With a focus on both text and visual embeddings, it's a great blend of algorithmic evolution, theoretical rigor, and practical guidance. Whether you are a student, researcher, or industry professional, this book will equip you with the use cases and solutions needed to level-up your knowledge of generative AI. Well done!"
- Chris Fregly, Principal Solution Architect, Generative AI at AWS

About the Author

Jay Alammar is Director and Engineering Fellow at Cohere (pioneering provider of large language models as an API). In this role, he advises and educates enterprises and the developer community on using language models for practical use cases). Through his popular AI/ML blog, Jay has helped millions of researchers and engineers visually understand machine learning tools and concepts from the basic (ending up in the documentation of packages like NumPy and pandas) to the cutting-edge (Transformers, BERT, GPT-3, Stable Diffusion). Jay is also a co-creator of popular machine learning and natural language processing courses on Deeplearning.ai and Udacity.

Maarten Grootendorst is a Senior Clinical Data Scientist at IKNL (Netherlands Comprehensive Cancer Organization). He holds master's degrees in organizational psychology, clinical psychology, and data science which he leverages to communicate complex Machine Learning concepts to a wide audience. With his popular blogs, he has reached millions of readers by explaining the fundamentals of Artificial Intelligence--often from a psychological point of view. He is the author and maintainer of several open-source packages that rely on the strength of Large Language Models, such as BERTopic, PolyFuzz, and KeyBERT. His packages are downloaded millions of times and used by data professionals and organizations worldwide.

About the authors

Follow authors to get new release updates, plus improved recommendations.
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Maarten Grootendorst is a Senior Clinical Data Scientist at IKNL (Netherlands Comprehensive Cancer Organization).

He holds three master’s degrees in organizational psychology, clinical psychology, and data science, which he leverages to communicate complex machine learning concepts to a wide audience. With his popular blogs, he has reached millions of readers by explaining the fundamentals of artificial intelligence—often from a psychological point of view.

He is the author of several open-source packages that rely on the strength of large language models, such as BERTopic, PolyFuzz, and KeyBERT. His packages are downloaded millions of times and used by data professionals and organizations worldwide.

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Through his popular AI/ML blog, Jay has helped millions of researchers and engineers visually understand machine learning tools and concepts from the basic (ending up in the documentation of packages like NumPy and pandas) to the cutting-edge (Transformers, BERT, GPT-3, Stable Diffusion).

Jay Alammar is Director and Engineering Fellow at Cohere (a pioneering provider of large language models as an API) and co-author of Hands-On Large Language Models, published by O'Reilly Media.

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Frequently bought together

Hands-On Large Language Models: Language Understanding and Generation
+
AI Engineering: Building Applications with Foundation Models
+
Build a Large Language Model (From Scratch)

Frequently bought together

Hands-On Large Language Models: Language Understanding and Generation
This item: Hands-On Large Language Models: Language Understanding and Generation
$50.20
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.
Total price: $00
Details
Added to Cart

From the brand

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

From the Publisher

From the Preface

Large language models (LLMs) have had a profound and far-reaching impact on the world. By enabling machines to better understand and generate human-like language, LLMs have opened new possibilities in the field of AI and impacted entire industries.

This book provides a comprehensive and highly visual introduction to the world of LLMs, covering both the conceptual foundations and practical applications. From word representations that preceded deep learning to the cutting-edge (at the time of this writing) Transformer architecture, we will explore the history and evolution of LLMs. We delve into the inner workings of LLMs, exploring their architectures, training methods, and fine-tuning techniques. We also examine various applications of LLMs in text classification, clustering, topic modeling, chatbots, search engines, and more.

With its unique blend of intuition-building, applications, and illustrative style, we hope that this book provides the ideal foundation for those looking to explore the exciting world of LLMs. Whether you are a beginner or an expert, we invite you to join us on this journey to start building with LLMs.

Hands-On Large Language Models: Language Understanding and Generation

Prerequisites

This book assumes that you have some experience programming in Python and are familiar with the fundamentals of machine learning. The focus will be on building a strong intuition rather than deriving mathematical equations. As such, illustrations combined with hands-on examples will drive the examples and learning through this book. This book assumes no prior knowledge of popular deep learning frameworks such as PyTorch or TensorFlow nor any prior knowledge of generative modeling.

If you are not familiar with Python, a great place to start is Learn Python, where you will find many tutorials on the basics of the language. To further ease the learning process, we made all the code available on Google Colab, a platform where you can run all of the code without the need to install anything locally.

Product information

Publisher O'Reilly Media
Publication date October 15, 2024
Edition 1st
Language ‎English
Print length 425 pages
ISBN-10 1098150961
ISBN-13 978-1098150969
Item Weight ‎1.49 pounds
Dimensions 7 x 0.87 x 9.19 inches
Best Sellers Rank
Customer Reviews 4.7 out of 5 stars 127Reviews
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Customers say

Customers appreciate the book's detailed explanations, with one noting how it makes abstract topics easy to grasp through diagrams. They find the content relevant for production applications, with one customer highlighting its coverage of modern workflows.

Customers appreciate the book's detailed explanations and diagrams that make complex topics understandable, with one customer noting how it provides a comprehensive view of the field.

"...What stood out for me: • ✅ Hands-on notebooks + code to reinforce each concept • ✅ Explains transformer internals without getting lost..." Read more

"Focused, concise, and to the point. Well-structured with thoughtfully chosen topics...." Read more

"...their explanation of transformer attention mechanisms, paired with intuitive diagrams, made an otherwise abstract topic remarkably easy to grasp...." Read more

"...But that's terrible, as the diagrams make no sense, until you understand the components...." Read more

Customers find the book relevant for production applications, with one customer noting it covers modern workflows.

"...transformer internals without getting lost in math • ✅ Covers modern workflows — from fine-tuning to inference • ✅ Clean visualizations..." Read more

"...The clarity and depth of the content make it an invaluable resource for anyone interested in LLMs...." Read more

"...By connecting the dots on the base rationale, better applications can be built. The graphics are amazing!" Read more

Submit a report

A few common reasons customers report reviews:
  • Harassment, profanity
  • Spam, advertisement, promotions
  • Given in exchange for cash, discounts
When we get your report, we'll check if the review meets our Community guidelines. If it doesn't, we'll remove it.
Sorry we couldn't load the review
Thank you for your feedback

Sorry, there was an error

Please try again later.

Top reviews from the United States

  • 5.0 out of 5 starsVerified Purchase
    🧠 Fantastic practical intro for serious ML folks diving into LLMs
    Reviewed in the United States on April 5, 2025
    Format: Paperback
    As someone who works in machine learning but mostly on CV problems, this book was a perfect bridge into the world of language models. It doesn’t assume you’re a total beginner, but it also doesn’t dump you in the deep end with dense theory and academic papers. The authors...
    As someone who works in machine learning but mostly on CV problems, this book was a perfect bridge into the world of language models. It doesn’t assume you’re a total beginner, but it also doesn’t dump you in the deep end with dense theory and academic papers. The authors do a great job of grounding concepts in clear explanations and walk-throughs you can actually run.

    What stood out for me:
    • ✅ Hands-on notebooks + code to reinforce each concept
    • ✅ Explains transformer internals without getting lost in math
    • ✅ Covers modern workflows — from fine-tuning to inference
    • ✅ Clean visualizations (if you know Jay Alammar’s style, you know)

    Also, Maarten’s sections on vector databases, embeddings, and RAG workflows were super relevant for production applications. You can tell both authors have experience teaching and shipping real-world stuff.

    ⚠️ Minor caveat: This isn’t a deep theoretical text — if you’re looking for the type of math found in something like “Deep Learning” by Goodfellow, this isn’t it. It’s much more about doing.

    If you’re a data scientist, ML engineer, or just a curious dev looking to go beyond ChatGPT and understand how to work with LLMs at a system level — grab this book. You’ll get a lot out of it.
  • 5.0 out of 5 starsVerified Purchase
    focused and concise
    Reviewed in the United States on May 22, 2025
    Format: Kindle
    Focused, concise, and to the point. Well-structured with thoughtfully chosen topics. I hope the book continues to be updated and expanded to cover more ground as the field evolves.
  • 5.0 out of 5 starsVerified Purchase
    Well explained and lots of pictures!
    Reviewed in the United States on March 7, 2025
    Format: Paperback
    This is an enjoyable and accessible read with many of the concepts behind LLMs covered. The code examples are fun and they've picked models that anyone can run on Colab (be warned - if you have an intel-era mac they won't often won't run locally since PyTorch...
    This is an enjoyable and accessible read with many of the concepts behind LLMs covered. The code examples are fun and they've picked models that anyone can run on Colab (be warned - if you have an intel-era mac they won't often won't run locally since PyTorch dropped support for non-Apple silicon). At the time of this review (mar 25) the book is pretty up to date too.
    Areas for improvement? I'd like to see a bit more attention (ha ha) paid to training.
    2 people found this helpful
  • 5.0 out of 5 starsVerified Purchase
    It's truly a gem
    Reviewed in the United States on October 19, 2024
    Format: Paperback
    I preordered "Hands-On Large Language Models" by Jay Alammar and Maarten Grootendorst as soon as it was available, and I've just received it. I've been eagerly anticipating this book, especially since Maarten is the author and maintainer of the BERTopic...
    I preordered "Hands-On Large Language Models" by Jay Alammar and Maarten Grootendorst as soon as it was available, and I've just received it. I've been eagerly anticipating this book, especially since Maarten is the author and maintainer of the BERTopic library, which has been crucial in many of my NLP projects. I'm grateful for his contributions, which have greatly supported my research efforts. This book captures that same spirit—it's truly a gem!

    I've dabbled with LLMs before, particularly in areas like fine-tuning models and developing autonomous agents, but this book has significantly deepened my understanding. The way they break down complex concepts with crystal-clear visuals is not just educational, but also inspiring. For instance, their explanation of transformer attention mechanisms, paired with intuitive diagrams, made an otherwise abstract topic remarkably easy to grasp. It's making me rethink how I communicate my own research—striving for a blend of depth, engaging visuals, and clear, relatable examples to make complex ideas accessible.

    When the authors say "hands-on," they're not kidding. Real datasets, practical coding projects, and digital resources—you're not just reading; you're doing. Jay and Maarten have managed to demystify the intricacies of large language models, particularly in chapters like the one on fine-tuning techniques, turning an intimidating topic (for those who had limited experience) into an engaging and approachable journey. Whether you're looking to cover the basics or explore the finer points, this one's a keeper.
    7 people found this helpful
  • 5.0 out of 5 starsVerified Purchase
    Gem of a book for Language AI and LLMs
    Reviewed in the United States on September 29, 2024
    Format: Kindle
    As a resident of Sweden, I was thrilled to discover the Kindle version of this book, allowing me to dive in immediately without waiting for international shipping. From the moment I started reading last week, I've been completely engrossed. The authors' approach is...
    As a resident of Sweden, I was thrilled to discover the Kindle version of this book, allowing me to dive in immediately without waiting for international shipping. From the moment I started reading last week, I've been completely engrossed. The authors' approach is brilliantly practical, seamlessly blending theoretical explanations of Language AI and LLMs with hands-on .ipynb exercises that bring concepts to life.

    The visuals are simply outstanding, offering incredibly detailed insights into the inner workings of LLMs. I particularly appreciate the balanced coverage of both open-source and licensed models, providing a comprehensive view of the field.

    I've been so impressed that I've already started sharing the book with a friend, who finds it equally enlightening. The clarity and depth of the content make it an invaluable resource for anyone interested in LLMs.

    I'm confident that this book will inspire countless innovations and breakthroughs in the field. Jay and Marteen have created a truly phenomenal work that's both educational and inspiring. Thank you for this exceptional contribution to the AI community!
    6 people found this helpful
  • 3.0 out of 5 starsVerified Purchase
    Very poor organization
    Reviewed in the United States on April 21, 2025
    Format: Paperback
    I'm still reading, so my opinion may change, but I'm not liking it so far. One of the things I hate in books is use of undefined terms. This book does it constantly. It's a structural decision - they give overviews, then eventually get around to...
    I'm still reading, so my opinion may change, but I'm not liking it so far.

    One of the things I hate in books is use of undefined terms. This book does it constantly. It's a structural decision - they give overviews, then eventually get around to explaining the pieces I the overview.

    But that's terrible, as the diagrams make no sense, until you understand the components. So you have to read the book twice to make any sense of it.

    I went looking for an example. Figure 3-6, p78. There are three things in the input path: tokenizer, transformer block, and LM head. Of the three, only the tokenizer has been explained. Transformer block are later explained on p87. LM head does not seem to be explained at all. Unless you think "simple neural network layer" is an explanation.

    Most books are much better about this, and make an effort to avoid doing what this book does constantly.

    From the other reviews, some people seem to like this format. I hate it.

    Not recommended.
    2 people found this helpful
  • 5.0 out of 5 starsVerified Purchase
    Hands-On Large Language Models
    Reviewed in the United States on March 8, 2025
    Format: Paperback
    This book sheds plenty of light into this abstract subject. By connecting the dots on the base rationale, better applications can be built. The graphics are amazing!
  • 4.0 out of 5 stars
    Over hyped
    Reviewed in the United States on November 27, 2024
    Format: Kindle
    Misses important subjects
    4 people found this helpful

Top reviews from other countries

  • Computational Scientist
    5.0 out of 5 starsVerified Purchase
    Great book that fills a much needed niche!
    Reviewed in the United Kingdom on April 14, 2025
    This is a great resource! The strength here is on sentence transformers, RAG, Agentic AI, and prompt engineering. This books covers those topics better than many others out there. Get this book and get started expanding your AI coding!
    This is a great resource! The strength here is on sentence transformers, RAG, Agentic AI, and prompt engineering. This books covers those topics better than many others out there. Get this book and get started expanding your AI coding!
  • José Alberto Santana
    5.0 out of 5 starsVerified Purchase
    Excellent textbook with stunning visuals
    Reviewed in Mexico on June 21, 2025
    I am blown away at how Jay Alammar and Maarten Grootendorst’s visuals blend in with the theoretical aspects of LLMs. As an 18 year old who is obsessed with the intricacies of LLMs and working with different environments like LangChain and the OpenAI API, this book felt like...
    I am blown away at how Jay Alammar and Maarten Grootendorst’s visuals blend in with the theoretical aspects of LLMs. As an 18 year old who is obsessed with the intricacies of LLMs and working with different environments like LangChain and the OpenAI API, this book felt like a playground. On another note, if you combine this with Chip Huyen’s AI Engineering textbook as well as the FastAPI framework and containerization using Docker, you’ll have the tools to deploy AI systems into production in the cloud.
    I am blown away at how Jay Alammar and Maarten Grootendorst’s visuals blend in with the theoretical aspects of LLMs. As an 18 year old who is obsessed with the intricacies of LLMs and working with different environments like LangChain and the OpenAI API, this book felt like a playground. On another note, if you combine this with Chip Huyen’s AI Engineering textbook as well as the FastAPI framework and containerization using Docker, you’ll have the tools to deploy AI systems into production in the cloud.
  • Hatim A. Aboalsamh
    4.0 out of 5 starsVerified Purchase
    Recommended
    Reviewed in Saudi Arabia on March 9, 2025
    nice book
    nice book
  • Jose Javier
    5.0 out of 5 starsVerified Purchase
    facil de entender y completo
    Reviewed in Spain on January 25, 2025
    completo y facil de entender, sobre el funcionamiento interno de los LLM, y las librerias de hugging face y langchain , heads (transfer knowledge), chat, RAG, prompt engineering, fine tunning etc. Un libro de referencia en este area
    completo y facil de entender, sobre el funcionamiento interno de los LLM, y las librerias de hugging face y langchain , heads (transfer knowledge), chat, RAG, prompt engineering, fine tunning etc. Un libro de referencia en este area
  • tb
    5.0 out of 5 starsVerified Purchase
    Good quality
    Reviewed in the United Kingdom on March 4, 2025
    Very detailed and very structured
    Very detailed and very structured

How customer reviews and ratings work

Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.Learn more how customers reviews work on Amazon

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.