"Prompt Engineering: Understanding Prompts is Key to Getting the Best Results from AI"

Artificial intelligence (AI) systems have become an integral part of our lives, assisting in tasks ranging from creative writing to technical problem-solving. At the heart of effectively using these systems lies the concept of AI prompting. Prompts are instructions given to AI to guide it in generating specific outputs.
While humans interpret language with nuance and contextual awareness, AI systems take prompts more literally.
This guide aims to help you bridge the gap between human and AI interpretation, ensuring your prompts yield accurate and meaningful results.
Key Principles of Prompt Writing
Be Clear and Specific: Humans often rely on implicit context, but AI requires explicit and precise instructions. Avoid ambiguity by clearly stating what you need.
Example:
Human thought: "I want information about climate change."
Effective prompt: "Provide a summary of the main causes and effects of climate change, including recent scientific findings."
Provide Context: Context frames the scope and purpose of the task, guiding the AI towards more relevant responses.
Example:
Human thought: "I need to write a business email."
Effective prompt: "Draft a professional email to a potential client introducing our new software product. The client is a medium-sized marketing firm."
Use Examples: Including examples can clarify your expectations and steer the AI towards the desired output.
Example:
Human thought: "I want a catchy slogan."
Effective prompt: "Create a catchy slogan for a new eco-friendly water bottle. For reference, here's an example of a good slogan: 'Refresh yourself, refresh the planet.'"
Employ Emotional Context: Adding emotional dimensions can help elicit thoughtful and nuanced AI responses.
Example:"As a passionate environmentalist concerned about climate change, explain the most effective ways individuals can reduce their carbon footprint."
Generate Multiple Examples: Creating a variety of examples can help refine subsequent prompts and improve outcomes.
Example:"Generate ten examples of eco-friendly daily habits. Then, use these examples to create a comprehensive guide for sustainable living."
Advanced Prompting Techniques
Role-Based Prompts
Assigning a role helps tailor the AI’s responses to specific needs.
Example:
Human thought: "I want expert advice on gardening."
Effective prompt: "As an experienced horticulturist, provide advice on how to care for orchids in a home environment. Include watering, light requirements, and common issues."
Step-by-Step Instructions
Breaking down tasks into logical steps is particularly useful for complex or analytical tasks.
Example:
Human thought: "I need to solve this maths problem."
Effective prompt: "Solve this algebra problem step by step: 2x + 5 = 13. Show your work for each step, including isolating the variable and performing arithmetic operations."
Emotion-Based Prompting
This technique involves incorporating emotional stakes to potentially improve AI performance.
Example:"You are an AI assistant under significant pressure to provide accurate information. Your response could save lives. Explain the symptoms of a heart attack and when to seek immediate medical attention."
Creative Problem-Solving Prompts
Encourage the AI to generate innovative solutions or imaginative content.
Example:"Imagine you're a city planner in the year 2100. Design a sustainable transportation system that addresses overpopulation and environmental concerns while maximising efficiency."
Prompt Structures for Different Tasks

Information Retrieval Prompts
These prompts treat AI systems as knowledge repositories, guiding them to provide specific details.
Example:"Provide a comprehensive overview of the latest advancements in quantum computing, focusing on developments made in the last six months."
Generative Prompts
These prompts encourage the AI to create original content.
Example:
"Write a short story about a time traveller who accidentally changes a major historical event. Include elements of suspense and irony."
Analytical Prompts
These prompts ask the AI to interpret or analyse information.
Example:"Analyse the potential economic impacts of implementing a four-day work week in the United Kingdom. Consider both positive and negative effects on productivity, employee well-being, and overall economic growth."
Comparative Prompts
These prompts ask the AI to compare and contrast different concepts or ideas.
Example:"Compare and contrast the leadership styles of Steve Jobs and Elon Musk. Consider their approaches to innovation, company culture, and public perception."
How AI Interprets Prompts

Understanding how AI processes prompts can help you write more effective instructions:
Tokenisation
AI breaks down prompts into smaller units called tokens, which can be words or parts of words.
The phrase "I love artificial intelligence" might be tokenised as: ["I", "love", "artificial", "intelligence"].
A more complex word like "tokenisation" could be broken down as: ["token", "isation"].
Numbers and punctuation are often separate tokens: "2023!" might become ["2023", "!"].
How to Write Prompts Considering Tokenisation?
Be Concise: Use clear, direct language. Avoid unnecessary words or repetition.
Example: Instead of "Please write a story about a dog that is very friendly", use "Write a story about a friendly dog".
Use Compound Words: Some compound words are single tokens, while their separated forms are multiple tokens.
Example: "Tokenisation" might be one token, while "token ization" would be two.
Abbreviations and Acronyms: These are often single tokens and can save space.
Example: Use "AI" instead of "Artificial Intelligence" when appropriate.
Numbers and Symbols: Be aware that numbers and symbols are often separate tokens. Use them judiciously.
Example: Writing out "twenty twenty-three" instead of "2023" might use more tokens but could be clearer in certain contexts.
Capitalisation: Some models treat capitalized and lowercase words as different tokens. Be consistent in your capitalisation.
Punctuation: Use punctuation purposefully. Each punctuation mark is often a separate token.
Technical Terms: For specialised topics, using precise technical terms can often convey more information in fewer tokens.
Leverage Common Phrases: Common phrases or idioms might be tokenised as single units, making them efficient choices.
Context Setting: Provide context efficiently. Instead of long explanations, use role prompts or brief scenario setups.
Example: "As a marine biologist, explain..." instead of "Imagine you have studied marine biology for many years and have extensive knowledge about ocean life. Now, explain..."
Iterative Refinement: If you're using a system where you can see token counts, experiment with different phrasings to find the most token-efficient way to express your prompt.
Contextual Understanding
AI uses its training data to understand the context and meaning of your prompt.
Example: "The bank is closed," the AI understands "bank" as a financial institution based on context.
"I'm feeling blue today," the AI recognises "blue" as an emotional state rather than a colour.
"Can you give me a hand?" the AI interprets this as a request for help, not a literal hand.
How to Write Prompts Considering Contextual Understanding?
Provide Clear Context: Set the stage for your prompt by offering relevant background information. This helps the AI interpret ambiguous terms or phrases correctly.
Example:
"In a financial advisory setting, explain the concept of a 'bank run' and its potential consequences."
Use Domain-Specific Language: Employ terminology specific to the field you're discussing. This guides the AI towards the correct context.
Example:
"As a psychologist, describe cognitive behavioral therapy techniques for managing depression."Leverage Figurative Language Carefully
When using idioms or metaphors, ensure the context is clear to avoid literal interpretations.
Example:
"Explain the emotional impact of 'feeling blue' in the context of mood disorders."
Specify Multiple Contexts: For terms with various meanings, explicitly state the desired context.
Example:
"Compare the term 'interest' in financial, legal, and psychological contexts."
Use Role-Playing Prompts: Assign a specific role to the AI to frame its understanding and response.
Example:
"As a marine biologist, describe the various 'banks' found in ocean ecosystems."
Provide Contextual Cues: Include words or phrases that hint at the intended meaning of potentially ambiguous terms.
Example:
"In the realm of social media marketing, explain how to 'go viral' with content."
Pattern Recognition: The AI identifies patterns and relationships between words and concepts.
In text analysis, AI can recognise patterns in sentence structure to identify the subject, verb, and object.
For stock market prediction, AI identifies patterns in historical data to forecast future trends.
In image recognition, AI identifies patterns in pixel arrangements to detect objects like faces or landmarks.
Generation
Based on the prompt and its training, the AI generates a response.
For a creative writing prompt like "Write a short story about a time traveller," the AI generates an original narrative based on its training data.
In code generation, given a prompt like "Write a Python function to calculate factorial," the AI produces the corresponding code.
For a customer service chatbot, when asked "What's your return policy?" the AI generates a response based on its training on company policies.
Historical Analysis
Prompt: "Analyse the causes and consequences of the French Revolution."
Generation: The AI would produce a structured analysis drawing from its historical knowledge, potentially covering factors like social inequality, financial crisis, and Enlightenment ideas, as well as outcomes such as the rise of Napoleon and changes in European politics.
Scientific Explanation
Prompt: "Explain the process of photosynthesis in layman's terms."
Generation: The AI would create a simplified explanation of photosynthesis, likely using analogies and everyday language to describe how plants convert sunlight, water, and carbon dioxide into energy and oxygen.
Recipe Creation
Prompt: "Create a recipe for a vegan chocolate cake."
Generation: The AI would generate a list of vegan ingredients and step-by-step instructions for baking a chocolate cake without animal products, based on its knowledge of baking techniques and vegan substitutes.
Legal Advice Simulation
Prompt: "As a legal AI assistant, explain the concept of intellectual property rights."
Generation: The AI would produce an overview of intellectual property rights, potentially covering patents, copyrights, and trademarks, and explaining their importance in protecting creative and innovative work.
Language Translation
Prompt: "Translate the phrase 'The early bird catches the worm' into French, Spanish, and German."
Generation: The AI would provide translations of the idiom in the requested languages, possibly including:
French: "L'avenir appartient à ceux qui se lèvent tôt."
Spanish: "A quien madruga, Dios le ayuda."
German: "Der frühe Vogel fängt den Wurm."
Mathematical Problem Solving
Prompt: "Solve the quadratic equation 2x^2 + 5x - 3 = 0"
Generation: The AI would likely show the steps to solve the equation using the quadratic formula, arriving at the solutions x ≈ -2.85 or x ≈ 0.35.
Marketing Strategy
Prompt: "Develop a social media marketing strategy for a new line of eco-friendly cleaning products."
Generation: The AI might create a multi-point strategy including target audience identification, content ideas emphasising environmental benefits, suggested platforms (e.g., Instagram, Facebook), and potential influencer partnerships.
Movie Plot Summary
Prompt: "Summarise the plot of the movie 'Inception' in three sentences."
Generation: The AI would condense the complex plot into a brief summary, likely touching on the concept of dream infiltration, the mission to plant an idea, and the blurring of reality and dreams.
Fitness Routine
Prompt: "Create a 30-minute HIIT workout routine for beginners."
Generation: The AI would likely produce a structured workout plan with warm-up, main exercises (e.g., jumping jacks, push-ups, squats), rest periods, and cool-down, tailored for those new to high-intensity interval training.
Tech Troubleshooting
Prompt: "Provide steps to troubleshoot a laptop that won't turn on."
Generation: The AI would generate a list of troubleshooting steps, potentially including checking the power source, battery, and charger, as well as more advanced steps like checking internal components if the basic steps don't work.
Common Pitfalls and How to Avoid Them
Ambiguity: Humans often use ambiguous language, but this can confuse AI. Be precise in your wording.
Example:
Ambiguous: "Tell me about the best car."
Improved: "Describe the top-rated electric car in terms of range and safety features for 2024."
Overloading: Avoid cramming too many requests into a single prompt. Break complex tasks into smaller, manageable prompts.
Example:
Overloaded: "Write a 1000-word essay on climate change, its economic impact, and potential solutions, including a detailed analysis of renewable energy sources and their implementation challenges."
Improved: "Outline the main points for a 1000-word essay on climate change, focusing on its causes, effects, and potential solutions." Follow-up prompt: "Based on the outline, expand on the economic impact of climate change and analyse the potential of renewable energy sources as a solution."
Lack of Specificity:Vague prompts often lead to generic responses. Specify the depth, tone, or style you're looking for.
Example:
Vague: "Write about dogs."
Specific: "Write a 300-word article about the health benefits of owning a dog, targeting an audience of senior citizens. Include scientific studies to support your points."

Crafting effective AI prompts is a skill that bridges human thinking with AI interpretation. By being clear, specific, and contextual in your prompts, you can guide AI systems to produce more accurate and useful outputs. Advanced techniques such as role-based and step-by-step prompting further refine your results. Understanding how AI interprets prompts allows you to design inputs that maximise its potential, whether for creative, analytical, or practical applications. With practice and refinement, you will master the art of communicating with AI, transforming it into a powerful tool for a wide range of endeavours.