liveBook · Manning

Prompt engineering

As explained in Grokking AI Applications

Prompt engineering is the systematic design and refinement of prompts to influence a generative model's outputs.

Prompt engineering is the creative, structured design and refinement of prompts to guide large language model responses. Clear, relevant context helps align an answer with the task; prompts that are too vague or overloaded can invite tangents or misinterpretation. section 3.0 section 3.1

Figure 3.4 Role, Task, Features, and Examples—elementary, my dear Watson

The diagram names four parts of a prompt template: role, task, features, and examples. section 3.1

Refine prompts with techniques such as:

  • Repeat critical instructions, or specify a fallback such as “not found” when the answer is unavailable. section 3.2
  • Break complex requests into smaller steps, ask for step-by-step reasoning, or request self-validation. section 3.2
  • Use enough relevant context to guide the response, while avoiding unnecessary detail; prompt improvements can reduce but do not eliminate hallucinations. section 3.1

How Grokking AI Applications covers it

How deep it goes
Explains prompt clarity, length trade-offs, and refinement techniques without descending into model internals.
Examples
Uses a business-plan request, a “not found” fallback, repeated instructions, and self-validation prompts.
What you can do after
Apply it by balancing context and concision, decomposing tasks, adding fallbacks, and requesting self-validation.
How it connects
Ties prompt design to large language models, hallucinations, and context windows.

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 Grokking AI Applications. The section links point to the parts of the book it draws on.