No. 430 of 500 No. 53 in Generative AI & LLMs

Prompt Engineering for LLMs

The Art and Science of Building Large Language Model-Based Applications

By John Berryman and Albert Ziegler

Print length
280 pages
Publisher
O'Reilly Media
Reading level
Intermediate
ISBN-13
978-1098156152
Published
December 31, 2024
Written for
Software engineers and product builders designing applications on top of large language models.

Synopsis

John Berryman and Albert Ziegler treat prompt engineering as a software discipline rather than a bag of phrasing tricks. Their starting point is how large language models work: a model continues a document one token at a time, so an application succeeds when it turns a user's request into a document whose most likely continuation is the answer the user needs. From that premise the authors explain tokens, sampling, temperature and log probabilities, and why chat-tuned models behave differently from base models trained only to complete text.

The core of the book follows the loop every LLM application runs: gather context, rank and trim it to fit the model's window, assemble it into a prompt, and convert the completion back into something useful. Drawing on their work on GitHub Copilot, the authors show how to choose and order snippets, when few-shot examples help or mislead, how chain-of-thought prompting and retrieval-augmented generation fit the loop, and how to build multistep workflows and tool-using agents. Closing material covers evaluation, both offline test suites and online signals from real users. Readers come away with a mental model they can apply across model vendors, though specific API details reflect late 2024.

Scorecard

Editorial score

How it scored

Editorial score: 68.6 / 1005 weighted criteria

  • Influence30%

    18.0/30
  • Authority25%

    18.8/25
  • Practical value20%

    15.0/20
  • Currency15%

    9.8/15
  • Readability10%

    7.0/10
  • Editorial score

    68.6/100

How the rank was computed

Rank No. 430 of 500 comes from a composite of 49.1: observable signals 18.2 of 55 points plus editorial review 30.9 of 45 points.

All 11 inputs
InputPoints
Observable signals18.2/55
Reach (Amazon ratings volume)6.7/16.5
Consensus across best-of lists5.5/13.8
Awards and bestseller evidence0.0/8.3
Reader rating, sample-adjusted3.6/8.3
Amazon sales rank0.7/5.5
Recency1.7/2.8
Editorial review30.9/45
Author authority8.4/11.3
Influence8.1/13.5
Practical value6.8/9.0
Readability3.2/4.5
Currency4.4/6.8

Each criterion is scored from 1 to 10 and weighted, and the points add up to the editorial score. The rank combines observable signals (55 percent) with this score (45 percent). Read the methodology.

Verdict

A thoughtful engineering guide to building LLM applications from two GitHub Copilot veterans, stronger on durable principles than on current tooling.

Strengths

  • Grounded in real GitHub Copilot engineering experience
  • Explains model behavior before prescribing techniques
  • Treats evaluation as a core discipline

Keep in mind

Readers wanting copy-ready code or vendor-specific recipes may find it conceptual, and techniques built on log probabilities need API features some vendors do not expose.

Key takeaways

  1. An LLM is a document completer, so effective prompts frame the task as a familiar document whose natural continuation is the desired answer.
  2. Context must be gathered, scored and trimmed to fit the window, with the most valuable snippets prioritized and positioned deliberately.
  3. Prompts that resemble patterns common in training data, such as code files or transcripts, tend to produce more reliable completions.
  4. LLM applications need both offline evaluation suites and online measures of real user behavior, such as how often suggestions are accepted.

Notable facts

  • Berryman and Ziegler co-wrote "A developer's guide to prompt engineering and LLMs" on the GitHub Blog in July 2023, describing how Copilot gathers, ranks and assembles context into prompts. Source (opens in a new tab)

About the author

John Berryman and Albert Ziegler

John Berryman began in aerospace engineering, moved into search and recommendation, co-wrote Relevant Search (Manning), and at GitHub rebuilt code search infrastructure before providing technical leadership on prompt crafting for Copilot; he now runs the consultancy Arcturus Labs. Co-author Albert Ziegler was among the GitHub Next researchers who created GitHub Copilot and is now head of AI at the security company XBOW.

Questions

Is Prompt Engineering for LLMs worth reading in 2026?
Yes, if you build software on language models. Its central framework, treating the model as a document completer and the application as a loop of gathering, ranking and assembling context, applies to current models and agents. Some details, such as heavy use of log probabilities, matter less with today's chat and reasoning models, so pair it with up-to-date vendor documentation.
Who should read Prompt Engineering for LLMs?
Software engineers, machine learning engineers and technical product managers who design LLM-powered features will benefit most. The book assumes programming familiarity but explains model internals from the ground up. Casual users looking for tips on writing better chatbot requests will find it more technical than they need, since it addresses application design rather than individual conversations.
What is Prompt Engineering for LLMs about?
Written by two engineers from the GitHub Copilot effort, the book explains how large language models generate text and how to design applications around that behavior. It covers context retrieval and ranking, prompt assembly, few-shot examples, chain-of-thought prompting, retrieval-augmented generation, tool use, multistep workflows and evaluation, using lessons drawn from building a widely used AI coding assistant.

Sources

As an Amazon Associate, Best AI Books earns from qualifying purchases. Best AI Books is sponsored by Iternal.ai, whose founder and CEO, John Byron Hanby IV, wrote The AI Strategy Blueprint, our #1 ranked book. How we rank books.