liveBook · Manning

Prompt engineering

As explained in Machines that Think

Prompt design is the deliberate construction of prompts to influence a language model's responses or performance.

Prompt engineering is the deliberate design and refinement of prompts to influence a language model’s responses. Wording, tone, structure and context provide signals that affect which learned patterns become salient during generation. As a result, prompts that ask for the same task can produce different outputs. section 6.3.2 section 6.3.3

Even details that appear irrelevant to the task can matter. Studies have found changes in predictions or accuracy after variations in punctuation, spacing, capitalization, label formatting, separators and example order. These effects differ across model–task combinations; newer models may be more robust, and rigid scoring can exaggerate apparent sensitivity. section 6.3.2 section 6.3.3

Refining a prompt by trial and error is not necessarily a reliable route to better performance. Without correct answers or another objective reference point, a user may mistake a convincing response for an improvement. In a classification experiment, participants sometimes believed their revisions helped even as accuracy declined. A formulation that performs poorly for one model may also behave differently with another. section 6.3.3

Context can also shift the balance between a model’s competing objectives. For example, framing a request as a fictional cybersecurity training scenario introduces defensive cues that may increase compliance where a direct request would be refused. A jailbreak deliberately manipulates such cues to seek outputs normally restricted by safety guidelines; it does not necessarily disable a rule or safeguard. section 6.3.4

Prompt changes should therefore be judged against reliable feedback where possible, not just the apparent quality of a response. Sensitivity is real, but its magnitude depends on the model, the task and how performance is measured. section 6.3.3 section 6.3.2

How Machines that Think covers it

How deep it goes
Explains prompt sensitivity and refinement through empirical findings and statistical cues, without providing a prompt-design procedure.
Examples
Uses formatting variations, classification-prompt revisions and a cybersecurity training scenario to illustrate changes in model behavior.
What you can do after
Evaluate prompt changes with attention to objective feedback, model differences and scoring limitations.
How it connects
Connects prompt engineering to language-model evaluation, classification, alignment and jailbreaks.

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 Machines that Think. The section links point to the parts of the book it draws on.