Chapter 4: Prompt engineering and problem formulation
This introduction positions prompt engineering and problem formulation as complementary skills for productive AI interactions and previews their application in the next chapter.
After this chapter you will be able to
- Prompt engineering purpose. Explain prompt engineering as choosing the words and approach that communicate a task effectively to an AI system, with the amount of guidance varying by task complexity.
- Problem formulation priority. Describe problem formulation as clearly defining the desired outcome before writing prompts, analogous to establishing business requirements and specifications before coding an enterprise system.
- Conversational prompt style. Distinguish keyword-focused search-engine queries from natural-language prompts for modern AI systems. Describe effective prompts as instructions or requests you might give a knowledgeable colleague rather than rigid keyword strings.
- Progressive learning questions. Explain how prompt engineering can help a person explore an unfamiliar topic by asking questions that build on one another. State that effective AI use depends not only on how a question is phrased, but also on identifying what to ask for.
- Prompting strategy spectrum. Describe the four broad prompting categories—zero-shot, single-shot, few-shot, and many-shot—and explain that they differ in the examples supplied to guide the AI.
- Zero-shot prompting definition. Explain zero-shot prompting as giving an AI a task without prior examples or context, so it relies on its inherent knowledge and training to respond.
- Zero-shot task fit. Describe that zero-shot prompting works well for straightforward factual questions and basic requests, but its output reflects general training rather than a user's particular objectives.
- Single-shot prompting definition. Explain single-shot prompting as giving an AI model one example that guides its response, including the desired pattern, style, technique, mood, or other characteristics.
- Visual single-shot guidance. Describe how a multimodal AI can use one example image to analyze or reproduce matching visual characteristics in a new image, such as an icon series or a new subject in the same artistic style.
- Few-shot prompting concept. Explain few-shot prompting as giving an AI a small number of examples so it can grasp the nuances of a task. Distinguish it from single-shot prompting by stating that few-shot prompting supplies multiple examples rather than one.
- Patterns and variations guidance. Describe how varied but related few-shot examples establish both the consistent pattern and the acceptable variations in an AI response. Explain that this temporary learning can help the AI handle subtle differences, complex judgment, or styles absent from its original training data.
- Many-shot prompting definition. Explain many-shot prompting as providing an AI model with numerous examples so it can craft responses for complex and nuanced tasks. Distinguish it from few-shot prompting by noting that many-shot prompting can use dozens of examples rather than only a few.
- Example organization strategy. Describe how to organize many-shot examples strategically so they build on one another and reveal clear patterns. State that a large collection of random or poorly organized examples can overwhelm or confuse the AI.
- Many-shot task selection. Describe the kinds of work for which many-shot prompting is especially valuable: complex patterns, multiple edge cases, context-dependent tone or style, and strict formats or standards. Explain that it can make output more specific and work-ready, such as for service-desk resolution suggestions or escalation identification, but is not needed for every question.
- Model capability and prompt complexity. Explain how increasing AI reasoning capability changes the amount of instruction a prompt needs for basic tasks. Describe why zero-shot and single-shot prompts can produce relevant results with less explicit guidance as models improve.
- Examples for customization. Describe why few-shot and many-shot prompting remain valuable even as models need less help performing basic tasks. Explain that examples increasingly communicate a user's preferred output, requirements, and style rather than teach the model the task fundamentals.
- Problem formulation focus. Explain the predicted shift in prompt engineering toward problem formulation: defining the desired outcome and how results should be presented, then refining outputs to match requirements rather than explaining fundamentals.
- Four prompt construction principles. Explain the four principles of effective prompting—clarity, conciseness, relevance, and specificity—and how they work together to produce useful AI responses.
- Prompt clarity. Explain why a prompt must state its request directly and precisely, using a logical flow, correct grammar, and enough information for the AI to understand it. Describe why a new chat starts without memory of earlier interactions and why vague references such as “that new AI feature” lead to unfocused answers.
- Goal-relevant prompt context. Explain that prompt content, role context, and audience should directly support the intended goal. Describe how irrelevant details or an unsuitable “Act as” role can misdirect the AI, and how naming an audience sets an appropriate level of depth and terminology.
- Response-targeting specificity. Describe how specificity turns a broad question into a focused request by defining clear response parameters. State that useful parameters can include a timeframe, context, technical domain, and particular use case, which reduce ambiguity and prevent surface-level or off-target answers.
- Specific IT prompt construction. Describe how the examples transform broad IT questions into prompts that name a particular task, technology or platform, and requested kind of response.
- Role-based interactive prompts. Describe how assigning the AI a specific role and defining the interaction creates a focused prompt, using examples such as an ESL teacher, job interviewer, Linux terminal, or JavaScript console.
- Prompt specificity and objectives. Explain why a good prompt states the concrete objective, the information the user will provide, and the output or behavior expected from the AI, rather than making a broad request.
- Prompt experimentation and adaptation. Describe how to use ready-made prompts as starting points: try them, modify their wording or structure, observe the changed results, and adapt them to a particular IT role or task.
- Purpose of advanced techniques. Explain that advanced prompting techniques are used to refine and direct AI responses with greater precision than foundational prompt crafting.
- Recursive prompting. Explain that recursive prompts use a previous AI response as the basis for a follow-up prompt, building a deeper or more nuanced conversation.
- Prompt chaining approach. Describe prompt chaining as asking a series of related questions in one prompt to obtain a comprehensive response, such as requesting blockchain principles, its financial use case, and its data-security impact together.
- Response templating. Explain how templating directs an AI to organize its response in a predefined format for a report, summary, or analysis.
- Simple iterative prompting mindset. Explain why prompt engineering should be approached through practice and experimentation, using a simple prompt that is close enough to accomplish the task rather than trying to make it perfect.
- Iterative prompt experimentation. Explain why hands-on trial and error is the primary way to improve prompting. Describe how experimentation reveals what works, what does not, and the strengths and limitations of different AI models so prompts can be tailored accordingly.
- Prompt detail balance. Distinguish over-specification from under-specification and describe the middle ground of supplying essential details without either constraining the AI with irrelevant detail or leaving its task vague.
- Capability alignment. Explain why a prompt must align with the AI model's capabilities and available information, including why asking for unpublished proprietary internal details cannot yield a meaningful answer.
- Explicit context provision. Describe why a prompt must provide context that the AI has not received in the current interaction, especially when a new chat or stateless API call has no record of an earlier discussion.
- Meta-prompt purpose. Explain what a meta-prompt is and how it changes an AI response. State that it is a special instruction embedded with a prompt that guides the model toward a particular kind of response or presentation.
- Audience-tailored responses. Describe how applying different meta-prompts to the same question can produce responses suited to different audiences. Use the planet examples to explain that prompts such as "For Kids," "For college students," and "For astrophysicists" change the depth, vocabulary, and detail of the answer.
- Problem formulation definition. Explain problem formulation as the process of clearly defining and structuring a problem so that AI can help produce an effective solution. Describe the shift from asking AI for an answer as a student would to directing how it should solve the problem as a teacher would.
- Structured AI guidance. Describe how problem formulation breaks a problem into components, identifies their interconnections, and maps a path before execution. Explain why the user should define requirements and boundaries and guide AI throughout creation rather than ask for a final product immediately.
- Problem formulation integration. Explain how integrating problem formulation into a prompt adds the broader objective, context, and requirements needed to guide AI toward a targeted response.
- Context-rich sorting prompt. Distinguish the basic Python sorting prompt from the revised prompt by describing the revised prompt's data-analysis purpose, scalable performance needs, algorithm guidance, and documentation requirements.
- Writing refinement prompt examples. Describe how the listed prompts ask an AI to improve chapter writing through changes such as rewriting an introduction in a specified style, removing clichés and idioms, simplifying unclear prose, presenting information in a table, replacing bracketed words, generating iterations, and completing a sentence.
What it builds on
- Prompts (chapter 3) · The basic meaning of a prompt.
- Context retention and coherence (chapter 3) · The idea that chatbots retain context and coherence during a conversation.
- Text-to-image AI models (chapter 2) · The availability and use of text-to-image AI models.
- OpenAI DALL-E and 4o (chapter 2) · Image-generation capabilities available through OpenAI tools.
- Google Gemini Imagen and Meta Imagine (chapter 2) · Image-generation capabilities associated with Gemini and other tools.
- Summary comparison of AI assistants (chapter 2) · The existence of multiple AI assistants with differing capabilities.
- Statefulness (chapter 3) · The idea of statefulness, including the limits of conversational memory.
- Token limits and AI interactions (chapter 3) · How token limits affect AI interactions.
Section by section
Introduction
This introduction positions prompt engineering and problem formulation as complementary skills for productive AI interactions and previews their application in the next chapter.
- Prompt engineering purpose: Explain prompt engineering as choosing the words and approach that communicate a task effectively to an AI system, with the amount of guidance varying by task complexity.
Why it matters: Matching the prompt to the task helps you get more useful AI responses. - Problem formulation priority: Describe problem formulation as clearly defining the desired outcome before writing prompts, analogous to establishing business requirements and specifications before coding an enterprise system.
Why it matters: A clear definition of the goal prevents problems caused by asking AI to solve an ill-defined task. - Chapter learning path: Trace the chapter's planned progression from prompt-engineering basics and prompting strategies to problem formulation, experimentation with prompts, and a real-world synthesis in chapter 5.
Why it matters: Knowing the learning path helps you connect the individual techniques to their later practical use.
Key terms: prompt engineering, prompts, problem formulation, business requirements, specifications, zero-shot prompting, single-shot prompting, few-shot prompting, many-shot prompting
4.1 Prompt engineering
This section contrasts search-style queries with conversational AI prompting and explains how skilled, progressive questions help users learn unfamiliar topics.
- Conversational prompt style: Distinguish keyword-focused search-engine queries from natural-language prompts for modern AI systems. Describe effective prompts as instructions or requests you might give a knowledgeable colleague rather than rigid keyword strings.
Why it matters: Using a conversational style helps you take advantage of an AI system's ability to interpret context and nuanced requests. - Progressive learning questions: Explain how prompt engineering can help a person explore an unfamiliar topic by asking questions that build on one another. State that effective AI use depends not only on how a question is phrased, but also on identifying what to ask for.
Why it matters: This lets IT professionals use AI as a guide when they need to learn or investigate areas outside their existing expertise. - Prompt engineering's growing role: Describe the evidence in the section that prompt engineering has become a visible professional skill, including prompt-engineer roles and communities that share prompting techniques.
Why it matters: It places prompt engineering in context as an emerging, actively shared skill rather than a private trick for using chatbots.
Key terms: prompt engineering, keywords, rigid syntax, natural conversation, context, questions that build on each other, comprehensive knowledge, prompt engineers, social media communities, prompting techniques
4.2 The spectrum of AI prompting
This section introduces four prompting categories distinguished by how many examples you provide to guide an AI response.
- Prompting strategy spectrum: Describe the four broad prompting categories—zero-shot, single-shot, few-shot, and many-shot—and explain that they differ in the examples supplied to guide the AI.
Why it matters: Choosing an appropriate amount of example guidance helps you communicate with an AI more effectively. - Situational prompt selection: Explain why no prompting category is inherently best: different scenarios call for different ways of structuring AI interactions and different amounts of example guidance.
Why it matters: The useful strategy is the one that fits the situation, not automatically the one with the most examples.
Key terms: zero-shot prompting, single-shot prompting, few-shot prompting, many-shot prompting, examples, prompting strategies, scenarios
4.2.1 Zero-shot prompting
This section defines zero-shot prompting as asking an AI to perform a task with no examples or context, explaining when its general-purpose results are useful and when prompts need refinement.
- Zero-shot prompting definition: Explain zero-shot prompting as giving an AI a task without prior examples or context, so it relies on its inherent knowledge and training to respond.
Why it matters: This is the simplest prompting approach and establishes the baseline for comparing more guided methods. - Zero-shot task fit: Describe that zero-shot prompting works well for straightforward factual questions and basic requests, but its output reflects general training rather than a user's particular objectives.
Why it matters: Knowing its limits helps you recognize when a general answer needs a more refined prompt.
Key terms: zero-shot prompting, examples, context, inherent knowledge, training, straightforward tasks, factual questions, basic requests, general training, particular objectives
4.2.2 Single-shot prompting
This section explains how a single example can guide an AI model to produce a response with matching patterns, style, or characteristics, especially through multimodal image prompting.
- Single-shot prompting definition: Explain single-shot prompting as giving an AI model one example that guides its response, including the desired pattern, style, technique, mood, or other characteristics.
Why it matters: One well-chosen example can communicate an intended result more clearly than a broad request alone. - Visual single-shot guidance: Describe how a multimodal AI can use one example image to analyze or reproduce matching visual characteristics in a new image, such as an icon series or a new subject in the same artistic style.
Why it matters: Showing an image lets you communicate visual qualities that may be difficult to describe accurately in words.
Key terms: single-shot prompting, single-shot learning, example, vision capabilities, multimodal, visual single-shot approach, artistic style, design principles
4.2.3 Few-shot prompting
This section explains how few-shot prompting uses several examples to teach an AI the patterns, variations, and boundaries of a desired task or style.
- Few-shot prompting concept: Explain few-shot prompting as giving an AI a small number of examples so it can grasp the nuances of a task. Distinguish it from single-shot prompting by stating that few-shot prompting supplies multiple examples rather than one.
Why it matters: Several examples can communicate a task more clearly when one example cannot capture its important variations. - Patterns and variations guidance: Describe how varied but related few-shot examples establish both the consistent pattern and the acceptable variations in an AI response. Explain that this temporary learning can help the AI handle subtle differences, complex judgment, or styles absent from its original training data.
Why it matters: The examples let you communicate not just a format, but how the response should adapt across situations while staying consistent. - Situational example design: Apply few-shot prompting by describing a set of related examples that preserve a consistent tone and structure while covering different situations. For example, explain how customer-service responses for a shipping delay, refund request, and product inquiry can teach adaptation while retaining professionalism and empathy.
Why it matters: Well-chosen examples help an AI respond appropriately to new situations rather than merely copy one fixed response.
Key terms: few-shot prompting, single-shot prompting, examples, temporary training, patterns, variations, boundaries, consistent tone and structure, customer service emails, consistent quality
4.2.4 Many-shot prompting
This section explains how many-shot prompting uses numerous organized examples to guide AI through complex, nuanced, and format-sensitive tasks.
- Many-shot prompting definition: Explain many-shot prompting as providing an AI model with numerous examples so it can craft responses for complex and nuanced tasks. Distinguish it from few-shot prompting by noting that many-shot prompting can use dozens of examples rather than only a few.
Why it matters: Knowing the distinction helps you choose a richer example set when a simple request or a few examples will not reliably guide the output. - Example organization strategy: Describe how to organize many-shot examples strategically so they build on one another and reveal clear patterns. State that a large collection of random or poorly organized examples can overwhelm or confuse the AI.
Why it matters: The value of many-shot prompting comes from clear, cumulative examples rather than from adding examples indiscriminately. - Many-shot task selection: Describe the kinds of work for which many-shot prompting is especially valuable: complex patterns, multiple edge cases, context-dependent tone or style, and strict formats or standards. Explain that it can make output more specific and work-ready, such as for service-desk resolution suggestions or escalation identification, but is not needed for every question.
Why it matters: Choosing many-shot prompting only when its added guidance is useful avoids unnecessary prompt complexity while improving usable results on demanding tasks.
Key terms: many-shot prompting, few-shot prompting, examples, careful organization, strategically chosen examples, clear patterns, edge cases, complex patterns, tone, style
4.2.5 The future of prompt engineering
This section explains how improving AI capabilities will reduce the instruction needed for basic tasks while making examples and problem formulation more important for customization.
- Model capability and prompt complexity: Explain how increasing AI reasoning capability changes the amount of instruction a prompt needs for basic tasks. Describe why zero-shot and single-shot prompts can produce relevant results with less explicit guidance as models improve.
Why it matters: Knowing when a capable model can infer routine steps helps you avoid unnecessarily detailed prompts. - Examples for customization: Describe why few-shot and many-shot prompting remain valuable even as models need less help performing basic tasks. Explain that examples increasingly communicate a user's preferred output, requirements, and style rather than teach the model the task fundamentals.
Why it matters: Examples let you shape an AI's results around your particular requirements instead of accepting a merely adequate generic answer. - Problem formulation focus: Explain the predicted shift in prompt engineering toward problem formulation: defining the desired outcome and how results should be presented, then refining outputs to match requirements rather than explaining fundamentals.
Why it matters: Clear problem formulation helps you direct AI effort toward the outcome and presentation you actually need.
Key terms: zero-shot prompting, single-shot prompting, reasoning capabilities, few-shot prompting, many-shot prompting, customization, preferences, requirements, prompt engineering, problem formulation
4.3 The mechanics of a good prompt
This section introduces clarity, conciseness, relevance, and specificity as the enduring principles for writing effective AI prompts despite differences among models and platforms.
- Four prompt construction principles: Explain the four principles of effective prompting—clarity, conciseness, relevance, and specificity—and how they work together to produce useful AI responses.
Why it matters: These principles help you turn a vague request into guidance the AI can act on usefully. - Task-focused database prompt: Distinguish the broad database question from the transactional-workload example by explaining how the latter states a purpose, use case, and requirements that narrow the possible answers.
Why it matters: Adding relevant constraints helps the AI select pertinent information instead of giving a broad overview. - Platform-specific prompt behavior: Describe why a prompt is not a one-size-fits-all solution: different AI models, including specialized text models and image generators, can respond differently to the same wording.
Why it matters: You may need to adapt or test a prompt when changing models or moving between text and image tasks. - AI-assisted prompt expansion: Explain how AI can refine a general user request into detailed instructions, using DALL-E 3's GPT-based prompt expansion and GPT-4o's integrated text-and-image capabilities as examples, while recognizing that this does not replace prompt-engineering principles.
Why it matters: AI-assisted expansion can help bridge the gap between a user's general idea and the detail a system needs for better output.
Key terms: clarity, conciseness, relevance, specificity, prompt engineering, transactional workloads, enterprise support, high performance, language models, text classification
4.3.1 Key principles in prompt construction
This section explains how clarity, conciseness, relevance, and specificity make prompts more effective and useful.
- Prompt clarity: Explain why a prompt must state its request directly and precisely, using a logical flow, correct grammar, and enough information for the AI to understand it. Describe why a new chat starts without memory of earlier interactions and why vague references such as “that new AI feature” lead to unfocused answers.
Why it matters: Clear prompts give the AI the context it needs to return accurate, useful help rather than guessing what you mean. - Efficient prompt conciseness: Describe conciseness as including every instruction needed for the task while removing redundant or confusing wording. Distinguish concise prompting from simply making every prompt short, since complex work can require long prompts.
Why it matters: Efficient wording reduces mental processing while preserving the instructions the AI needs to respond well. - Goal-relevant prompt context: Explain that prompt content, role context, and audience should directly support the intended goal. Describe how irrelevant details or an unsuitable “Act as” role can misdirect the AI, and how naming an audience sets an appropriate level of depth and terminology.
Why it matters: Relevant context keeps the response focused on the task and tailored to the people who will use it. - Response-targeting specificity: Describe how specificity turns a broad question into a focused request by defining clear response parameters. State that useful parameters can include a timeframe, context, technical domain, and particular use case, which reduce ambiguity and prevent surface-level or off-target answers.
Why it matters: Specific boundaries guide the AI toward the exact information you need instead of a broad overview.
Key terms: clarity, logical flow, new chat, memory, conciseness, efficient, redundant language, relevance, intended goal, Act as prompt
4.4 Introductory prompts for IT roles
This section demonstrates how to turn vague IT requests into clear, specific, role-relevant prompts through examples across common IT tasks.
- Specific IT prompt construction: Describe how the examples transform broad IT questions into prompts that name a particular task, technology or platform, and requested kind of response.
Why it matters: Specific prompts narrow the possible response and make AI guidance more useful for real IT work. - Role-based prompt examples: Explain how the section's good prompts apply the same focused-prompt approach to database querying, network troubleshooting, software development, cybersecurity analysis, and web development.
Why it matters: The same prompt-writing approach can be adapted to the practical tasks of different IT roles. - Interactive prompting transition: State that more complex goals may require multiple prompts and interactive prompting rather than a single prompt, as introduced in the transition to the Awesome Prompts Lab.
Why it matters: Recognizing when one prompt is insufficient prepares you to develop a task through an AI conversation.
Key terms: bad prompt, good prompt, specific, clear, relevant, SQL Server, SELECT query, home Wi-Fi network, Python script, file backups
4.4.1 Awesome Prompts Lab
This lab uses role-based prompt examples to show how specific instructions, expected inputs and outputs, and experimentation make AI interactions more useful and interactive.
- Role-based interactive prompts: Describe how assigning the AI a specific role and defining the interaction creates a focused prompt, using examples such as an ESL teacher, job interviewer, Linux terminal, or JavaScript console.
Why it matters: Clear roles and interaction rules help the AI respond in the mode you actually need rather than giving a generic answer. - Prompt specificity and objectives: Explain why a good prompt states the concrete objective, the information the user will provide, and the output or behavior expected from the AI, rather than making a broad request.
Why it matters: Specific instructions reduce generic responses and make the result fit the task you are trying to accomplish. - Prompt experimentation and adaptation: Describe how to use ready-made prompts as starting points: try them, modify their wording or structure, observe the changed results, and adapt them to a particular IT role or task.
Why it matters: Experimenting with proven prompt patterns saves time while helping you discover instructions that produce richer and more useful responses. - Language choice for prompting: State that users can prompt AI in their native language, while English may give more precise results for technical or specialized topics because it is typically the AI's primary training language.
Why it matters: Choosing an appropriate prompt language can balance accessibility for the user with precision for specialized work.
Key terms: role-play scenario, ESL teacher, Systems Administrator interviewer, Linux terminal, JavaScript console, objective, specific task, input, output, motivational coach
4.5 Advanced techniques
This section introduces advanced prompting techniques as practice-based methods for refining and directing AI responses more precisely.
- Purpose of advanced techniques: Explain that advanced prompting techniques are used to refine and direct AI responses with greater precision than foundational prompt crafting.
Why it matters: Knowing the purpose of these techniques helps you choose them when a basic prompt does not produce a sufficiently focused response. - Practice-based technique mastery: Describe that advanced prompting techniques may require practice to master and will be demonstrated through prompt examples throughout the book.
Why it matters: You can treat early difficulty as part of learning and use later examples to see how the techniques work in context.
Key terms: advanced techniques, foundational prompt crafting, AI responses, prompt examples
4.5.1 Recursive prompts
This section introduces recursive prompts as prompts that use a prior response to extend a conversation with deeper or more nuanced follow-up analysis.
- Recursive prompting: Explain that recursive prompts use a previous AI response as the basis for a follow-up prompt, building a deeper or more nuanced conversation.
Why it matters: Using an earlier response as input helps you progressively explore a topic rather than treating every prompt as isolated. - Follow-up trend analysis: Describe how the example takes a prior summary of renewable-energy trends and asks for potential challenges and opportunities over the next five years.
Why it matters: This example shows how a focused follow-up can transform a general summary into forward-looking analysis.
Key terms: recursive prompts, previous responses, previous summary, potential challenges, opportunities, next 5 years
4.5.2 Context injection
4.5.3 Explicit constraints
4.5.4 Prompt chaining
This section introduces prompt chaining as asking related questions together, while noting that large-context tasks may work better one request at a time.
- Prompt chaining approach: Describe prompt chaining as asking a series of related questions in one prompt to obtain a comprehensive response, such as requesting blockchain principles, its financial use case, and its data-security impact together.
Why it matters: Prompt chaining can combine connected aspects of a topic into a single, comprehensive AI response. - Large-context request strategy: Explain the section's caution that when a task involves large amounts of information or context, asking for one thing at a time can yield better results than combining requests.
Why it matters: Choosing a narrower request for a large-context task can improve the quality of the AI's results.
Key terms: prompt chaining, comprehensive response, context, large amounts of information
4.5.5 Sentiment directives
4.5.6 Templating
This section shows how templates specify a predefined response structure so AI can produce organized outputs such as reports, summaries, and analyses.
- Response templating: Explain how templating directs an AI to organize its response in a predefined format for a report, summary, or analysis.
Why it matters: A template makes AI output easier to read and use by requiring the structure you need. - Structured analysis format: Describe the example template for text analysis: Introduction, Main Arguments, Methodology, Conclusion, and Recommendations.
Why it matters: Naming the desired sections precisely helps the model deliver an analysis in the form you can immediately use. - Complex instruction adherence: Explain that advanced prompting techniques, including templates, can improve AI-generated response quality by leveraging modern models' ability to understand and follow more complex instructions.
Why it matters: Knowing why structured instructions help lets you deliberately request output that better fits your task.
Key terms: Templates, predefined format, Introduction, Main Arguments, Methodology, Conclusion, Recommendations, advanced techniques, AI-generated responses, complex instructions
4.6 Best practices and common mistakes
This section introduces a practical mindset for prompt engineering: practice, experiment, and keep prompts simple rather than pursuing perfection.
- Simple iterative prompting mindset: Explain why prompt engineering should be approached through practice and experimentation, using a simple prompt that is close enough to accomplish the task rather than trying to make it perfect.
Why it matters: This mindset helps you get useful AI results without wasting effort overthinking every prompt. - AI instruction-following expectations: Describe the section's expectation that an AI model will do its best to follow the instructions in a prompt, so the user need not worry excessively about exact prompt wording.
Why it matters: Reasonable expectations about instruction following support a confident, low-friction prompting workflow.
Key terms: prompt engineering, practice, experimentation, best practices, common mistakes, AI model, instructions, prompt
4.6.1 Learning from success
This section recommends learning effective prompting by studying successful community examples and refining prompts through hands-on experimentation with different AI models.
- Successful prompt templates: Describe how community-contributed successful prompts, such as those in the Awesome ChatGPT Prompts repository, can serve as templates for your own prompts. Explain that you should examine their structure, language, and context to identify elements that make them effective.
Why it matters: Studying proven examples gives you useful starting points rather than requiring every prompt to be designed from scratch. - Iterative prompt experimentation: Explain why hands-on trial and error is the primary way to improve prompting. Describe how experimentation reveals what works, what does not, and the strengths and limitations of different AI models so prompts can be tailored accordingly.
Why it matters: Prompting skill develops through testing and adjustment, especially because models do not all respond in the same way.
Key terms: Awesome ChatGPT Prompts, templates, structure, language, context, hands-on experience, trial and error, strengths and limitations, AI models, tailor your prompts
4.6.2 Pitfalls to avoid
This section identifies common prompt-design mistakes and shows how to avoid unclear, unworkable, or context-confused AI requests.
- Prompt detail balance: Distinguish over-specification from under-specification and describe the middle ground of supplying essential details without either constraining the AI with irrelevant detail or leaving its task vague.
Why it matters: Balanced detail guides the AI toward useful output while preserving room for an appropriate response. - Capability alignment: Explain why a prompt must align with the AI model's capabilities and available information, including why asking for unpublished proprietary internal details cannot yield a meaningful answer.
Why it matters: A request the model cannot support wastes effort and sets expectations that the AI cannot meet. - Explicit context provision: Describe why a prompt must provide context that the AI has not received in the current interaction, especially when a new chat or stateless API call has no record of an earlier discussion.
Why it matters: Supplying needed context prevents the AI from being asked to continue a conversation or process it cannot see. - Conversation context coherence: Explain that, in an ongoing interaction, a prompt should account for the context established by earlier exchanges so the AI can interpret whether a new request continues the topic or intentionally changes it.
Why it matters: Maintaining or clearly changing context helps the chatbot produce coherent responses instead of inferring the wrong connection.
Key terms: over-specification, under-specification, misalignment, AI capabilities, proprietary algorithm, training data, assuming AI understanding, contextual knowledge, current chat session, stateless
4.6.3 Meta-prompts
This section introduces meta-prompts as embedded instructions that steer how an AI presents an answer, especially for different audiences and styles.
- Meta-prompt purpose: Explain what a meta-prompt is and how it changes an AI response. State that it is a special instruction embedded with a prompt that guides the model toward a particular kind of response or presentation.
Why it matters: Meta-prompts let you customize an answer's form without changing the underlying question. - Audience-tailored responses: Describe how applying different meta-prompts to the same question can produce responses suited to different audiences. Use the planet examples to explain that prompts such as "For Kids," "For college students," and "For astrophysicists" change the depth, vocabulary, and detail of the answer.
Why it matters: The same information can be made useful to different readers by explicitly directing the model's presentation. - Meta-prompt experimentation: State that meta-prompts are flexible instructions whose possibilities are limited by the user's imagination, and describe testing them by applying multiple new meta-prompts to one prompt and comparing the results. Note that the section tested them successfully with ChatGPT, Claude, Copilot, and Gemini.
Why it matters: Experimenting with alternative instructions reveals how small prompt changes can substantially alter AI output.
Key terms: meta-prompts, prompt, language model, For Kids, For college students, For astrophysicists, ChatGPT, Claude, Copilot, Gemini
4.7 Problem formulation
This section explains problem formulation as defining, structuring, and guiding an AI task with domain expertise rather than merely asking AI for a finished answer.
- Problem formulation definition: Explain problem formulation as the process of clearly defining and structuring a problem so that AI can help produce an effective solution. Describe the shift from asking AI for an answer as a student would to directing how it should solve the problem as a teacher would.
Why it matters: Formulating the problem well sets the direction for the AI response before any wording of a prompt can help. - Structured AI guidance: Describe how problem formulation breaks a problem into components, identifies their interconnections, and maps a path before execution. Explain why the user should define requirements and boundaries and guide AI throughout creation rather than ask for a final product immediately.
Why it matters: Detailed structure and continuing guidance produce more professional output than a one-step request for a finished product. - Expertise and prompting combination: Justify why domain knowledge combined with prompt-engineering skill produces the most valuable AI results. State that subject matter expertise enables a person to define the right problem and ask the right questions, while prompting skill helps communicate that direction effectively.
Why it matters: AI is more effective when an expert uses their knowledge to supply the direction, details, and structure the model needs.
Key terms: problem formulation, prompt engineering, components, interconnections, requirements, boundaries, final product, subject matter expert, domain knowledge, technical prompting skill
4.8 Incorporating problem formulation
This section shows how incorporating problem formulation turns a basic prompt into a context-rich request that produces more targeted AI output.
- Problem formulation integration: Explain how integrating problem formulation into a prompt adds the broader objective, context, and requirements needed to guide AI toward a targeted response.
Why it matters: A well-formulated problem helps AI act as a useful workflow partner rather than merely return a generic answer. - Context-rich sorting prompt: Distinguish the basic Python sorting prompt from the revised prompt by describing the revised prompt's data-analysis purpose, scalable performance needs, algorithm guidance, and documentation requirements.
Why it matters: Being able to state solution-focused requirements lets an IT professional obtain output suited to an actual work need instead of generic sample code. - Desired-solution expertise: Describe why an IT professional's understanding of the desired solution enables effective problem formulation and more efficient, precise AI responses.
Why it matters: Your domain experience helps you provide the details that make AI output fit the work you actually need done.
Key terms: problem formulation, context, specific requirements, targeted AI responses, Python, ascending order, QuickSort, MergeSort, scalable, computational complexity
4.9 Prompts used in this chapter
This section lists example prompts used to revise writing, refine wording, and verify technical language while developing the chapter.
- Writing refinement prompt examples: Describe how the listed prompts ask an AI to improve chapter writing through changes such as rewriting an introduction in a specified style, removing clichés and idioms, simplifying unclear prose, presenting information in a table, replacing bracketed words, generating iterations, and completing a sentence.
Why it matters: These examples show how specific revision requests can turn vague feedback into usable AI prompts. - Terminology and claim validation prompts: Explain that some prompts use AI to evaluate wording and factual claims, including asking whether a technical phrase such as "data analytics engine" exists and asking the AI to search the web to check whether statements are true.
Why it matters: AI can help assess terminology and claims when the prompt clearly identifies what needs checking.
Key terms: style, clichés, idioms, table, iterations, data analytics engine, Search the web
4.10 Summary
This summary consolidates how prompt engineering and problem formulation produce more useful, precise AI responses for practical IT work.
Where this is used later
- Prompt engineering in action (chapter 5) · Applies prompt-engineering techniques in a real-world example.
- Problem formulation in action (chapter 5) · Demonstrates problem formulation in action.
- Basic prompting (chapter 5) · Basic prompting applies the shift from terse search queries to usable AI requests.
- Practicing for real-time scenarios (chapter 8) · The spectrum of AI prompting, including the prompting approaches used to direct chatbot behavior.
- Developing an effective process (chapter 12) · Few-shot prompting through examples that demonstrate the intended output.
- Template creation (chapter 5) · Template creation applies customization of outputs in a practical prompt workflow.
- (chapter intro) (chapter 5) · Principles for constructing a good prompt.
- Troubleshooting problems (chapter 8) · Troubleshooting prompts benefit from specifying the concrete environment and problem.
Concepts explained in this chapter
- prompt engineeringPrompt engineering is the deliberate design and refinement of instructions supplied to an AI system to improve the quality or relevance of its responses.
- problem definitionProblem formulation is the process of defining and structuring a problem precisely so that it can be analyzed and solved effectively.
- many-shot promptingMulti-shot prompting is a prompting strategy that uses multiple sequential interactions or examples to guide an AI model toward a result.
- promptA prompt is an instruction or input supplied to an AI system to elicit a specified response or output.
- conciseness criterionConciseness is the quality of communicating necessary information with minimal redundant or unnecessary wording.
- relevanceRelevance is the quality of directly relating information or requirements to the task or use case being addressed.
- few-shot learningFew-shot prompting is a technique that supplies an AI model with a small number of examples in the prompt to guide its behavior on a task.
- one-shot promptingSingle-shot prompting is a prompting technique that provides an AI model with one task-specific example before requesting an output.
- meta-promptA meta-prompt is an instruction embedded in or attached to a prompt that directs an AI model toward a desired response format, style, audience, or behavior.
- AI writing tutorAn AI writing tutor is an instructional interaction pattern in which an AI system provides feedback and guidance to improve a learner's written composition.
- role-playing scenarioA role-play scenario is an interaction pattern in which a system is instructed to adopt a specified role and respond according to that role.
- zero-shot promptingZero-shot prompting is the technique of asking an AI model to perform a task without providing prior examples or task-specific context.
- domain knowledgeDomain knowledge is specialized information and understanding about a particular subject area, profession, or operational context.
- recursive promptA recursive prompt is a prompting technique that incorporates an AI system's previous response into a subsequent prompt to develop a deeper or more nuanced interaction.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
