liveBook · Manning

Prompt engineering

As explained in Building Specialized AI Systems

Prompt engineering is the deliberate design of instructions and input context to guide a model’s behavior without changing its parameters.

Prompt engineering is the deliberate crafting of instructions and input context to steer a general-purpose language model’s behavior without updating its parameters. It can make a model more useful for specialized tasks by specifying context, desired conduct, and output expectations. section 1.2.1 section 1.5.1

Common prompt-design techniques include:

  • Set detailed context so the model receives task-relevant framing. section 1.2.1
  • Provide few-shot examples to demonstrate the intended response pattern or style. section 1.2.1
  • Use chain-of-thought prompts or role-playing scenarios to steer outputs toward more accurate and useful results. section 1.2.1

Specialized-looking outputs

A carefully constructed prompt may elicit legal contract analysis, financial assessment, or medical documentation that appears domain-aware. Such results do not create underlying expertise: a model lacking specialized training may mimic terminology or recall general information, then fail on edge cases or novel situations. section 1.2.1

Prompting has a knowledge ceiling: instructions and examples cannot supply the deep, interconnected understanding absent from the model’s original training. This makes it a potentially fragile production choice for highly specialized, mission-critical work demanding precision, consistency, and reliable handling of unusual cases. section 1.0 section 1.2.1

Figure 1.2 Prompt engineering. The process is iterative: you try different configurations, test them in QA environment, deploy to production, gather outcome, evaluate the results, and improve the prompt with each iteration.

Treat prompt engineering as an iterative delivery practice: try configurations, test in QA, deploy, gather outcomes, evaluate results, and revise the prompt. section 1.2.1

Choose prompt engineering when high accuracy is not critical and a lightweight solution is preferable. It avoids parameter updates and complex infrastructure, but higher-performing alternatives such as RAG plus fine-tuning or standalone fine-tuning may justify their added data, compute, and operational cost when requirements are stricter. section 1.5.1 section 1.2

How Building Specialized AI Systems covers it

How deep it goes
Explains instruction, context, few-shot, chain-of-thought, and role-playing strategies, then details the knowledge ceiling and iterative evaluation workflow.
Examples
Uses legal contract analysis, financial assessment, medical documentation, and an algebra-to-calculus analogy to illustrate prompting limits.
What it assumes
Introduces prompting through practical instruction-design strategies without assuming advanced mathematical or deep-learning knowledge.
What you can do after
Evaluate/understand when careful prompts suffice and when accuracy, knowledge gaps, or production demands call for more specialized approaches.
How it connects
Connects prompt engineering with RAG, few-shot learning, fine-tuning, RLHF, LoRA, and QLoRA as specialization approaches.

Also explained in

Compare how 51 books explain prompt engineering →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Specialized AI Systems. The section links point to the parts of the book it draws on.