What is Prompting & Why You Need To Learn It
Prompting is the process of giving instructions or input to a generative AI model to get a specific output. A prompt is simply the command that directs the AI to perform a task, which can range from a simple question to a complex instruction.
For example, a prompt can be:
- Text, such as “Write a marketing email for a new running shoe”.
- Code, such as a partial function that the AI is instructed to complete.
- Images, which can be provided to an AI that can segment or edit them based on a text prompt.
Why is prompting important?
The quality of an AI’s output is highly dependent on the quality of the prompt. Vague instructions lead to generic or unhelpful responses, while specific, well-crafted prompts yield more accurate, relevant, and useful results.
The importance of good prompting has led to the development of prompt engineering, which is the practice of designing and refining prompts to produce the best possible output from an AI model. This process involves a blend of creativity, clear communication, and an understanding of how AI works.
How to write an effective AI prompt
The best prompts contain a clear goal, with a well-defined structure and helpful context. This can include several key parts:
- Directive: The main instruction or question, such as “Write a summary” or “Explain the concept of…”
- Role: Asking the AI to assume a persona, like “Act as a personal trainer” or “You are an expert copywriter”.
- Context: Providing background information. For example, rather than just “Find a good restaurant in Cambridge,” specify “in Cambridge, Massachusetts, within walking distance of Harvard Yard”.
- Constraints and format: Giving instructions on length, style, or specific requirements, such as “in 100 words or less” or “format the response as a bulleted list”.
- Examples: Providing a few examples of desired inp
Fundamental tips for better prompting
- Be specific and provide context. The AI needs details and background information to give a precise response.
- Vague: “Tell me about the history of AI”.
- Specific: “Explain the history of AI in five key technological breakthroughs, and keep the language accessible for a college student”.
- Assign a role to the AI. Ask the AI to act as an expert to get a more tailored and insightful response.
- Vague: “Write a social media post about marketing tips.”
- Role-based: “Act as a seasoned digital marketing consultant. Write a LinkedIn post offering three advanced SEO tips for mid-sized tech companies”.
- Specify the output format. Direct the AI on how to structure its response. Use bullet points, a table, a specific word count, or code.
- Example: “Summarize the article [insert article] in five bullet points”.
- Use constraints. Tell the AI what to “do” and “don’t” to limit the scope of the output and prevent unwanted elements.
- Example: “Write a product description for a new coffee maker. Do focus on its ease of use and modern design. Don’t mention the price”.
- Provide examples (Few-shot prompting). Give the AI one or more examples to help it learn the desired tone, style, or structure, which is especially useful for complex tasks.
- Example: “Here are two examples of employee feedback. Write a third one in the same professional but supportive tone. [Insert examples]”.
- Don’t accept the first answer. AI often gives a good, but not great, first draft. Refine your prompts by building on previous responses in the conversation.
- Example: “Refine the email you just wrote. Make the tone more urgent and add a specific call to action for a free trial”.
- Iterate and experiment. Prompting is an iterative process. Try rephrasing your prompt, adding or removing details, and observing how the AI responds.
Advanced prompting techniques
- Chain-of-thought (CoT) prompting. Instruct the AI to “think step-by-step” to break down complex reasoning. This leads to more accurate answers for logic-based tasks.
- Example: “A store has 10 apples. They sell 3, then receive 5 more. How many apples do they have? First, show your reasoning step-by-step”.
- Self-ask prompting. Tell the AI to ask you clarifying questions before generating the output. This helps the AI gather all the necessary context for complex topics.
- Example: “To help me write a blog post about AI, ask me a series of follow-up questions to understand my goals and desired focus”.
- Retrieval-augmented generation (RAG). Provide the AI with specific documents or real-time data to ground its answers in factual information. This is useful for summarizing articles, analyzing private documents, or getting up-to-date information.
- Example: “Using the articles provided in this chat, summarize the main points about the recent market fluctuations”.
- Multi-perspective prompting. Ask the AI to simulate different viewpoints or roles to get a more balanced and comprehensive analysis of a topic.
- Example: “Provide an analysis of the new urban development plan. First, present the perspective of a city planner. Then, present the perspective of a local business owner”.
- Self-critical prompting. Ask the AI to critique its own response. This technique forces the model to identify potential weaknesses or missing details, which helps refine the output.
- Example: “Draft a marketing campaign plan for a new product, then list three potential weaknesses in your plan and how you would address them”



Post Comment