Hands-On Large Language Models versus Prompt Engineering for Generative AI.

Both show up on every "best" list. They're not competitors. They're a sequence. Here's which one to read first, and when.

Reviewed by Ashish Sheth · Updated May 2026
Option A
Hands-On Large Language Models
Hands-On Large Language Models
Jay Alammar, Maarten Grootendorst · 2024
READ FULL REVIEW →
Option B
Prompt Engineering for Generative AI
Prompt Engineering for Generative AI
James Phoenix, Mike Taylor · 2024
READ FULL REVIEW →
Author
Jay Alammar, Maarten Grootendorst
James Phoenix, Mike Taylor
Pages
425
422
Published
2024
2024
Publisher
O'Reilly Media
O'Reilly Media
Level
beginner to intermediate
beginner to intermediate
Amazon Rating
4.5/5 (392)
4.5/5 (132)
Goodreads Rating
4.29/5 (254)
3.64/5 (144)
Hands-On Large Language Models
Strengths
+ 275+ custom diagrams make abstract concepts visual and intuitive
+ Accessible to beginners without prior PyTorch/TensorFlow knowledge
+ Practical code examples covering real use cases like semantic search and RAG
+ Well-structured progression from foundations to advanced techniques
Caveats
− Limited depth on transformer internals despite the author's blog reputation
− Image generation sections lack clarity
− May be too introductory for experienced ML practitioners
Prompt Engineering for Generative AI
Strengths
+ Covers both text and image generation in one book
+ Good entry point for developers completely new to prompt engineering
+ The five principles framework provides a structured starting point
+ Practical and project-oriented approach
Caveats
− Heavy reliance on specific tools (LangChain, etc.) that date quickly
− Reads more like assembled blog posts than a cohesive narrative
− Tutorial-style code that ages fast as APIs change
− Breadth over depth on most topics
The verdict
Hands-On Large Language Models is the stronger pick overall, but Prompt Engineering for Generative AI may suit you better if you're a developers new to generative AI.
Hands-On Large Language Models
Check Price on Amazon →
Prompt Engineering for Generative AI
Check Price on Amazon →
Frequently asked
Which is better, Hands-On Large Language Models or Prompt Engineering for Generative AI?
Hands-On Large Language Models is the stronger pick overall, but Prompt Engineering for Generative AI may suit you better if you're a developers new to generative AI.
Is Hands-On Large Language Models good for beginners?
Yes, it's one of the most beginner-friendly LLM books available. No PyTorch or TensorFlow experience needed. The 275+ diagrams carry a lot of the explanation load.
Does this cover image generation too?
Yes. About a third of the book covers image generation with Midjourney and Stable Diffusion. Most other prompt engineering books focus only on text.