Skip to Main Content

AI and Generative AI

Prompt engineering

A prompt is a specific instruction or question given to an AI tool to guide it in generating a relevant and accurate response.   

Crafting clear and specific prompts is crucial for guiding AI to produce tailored, high-quality outputs. This activity is often called prompt engineering. 

Different strategies work better depending on the type of AI you are using and the type of query that you have. Some AIs will ask you for more information if your prompt lacks detail but understanding what works best from the start can save you time. 

Here are some key strategies that can improve your prompt engineering: 

  • Use instructional prompts, being clear and specific. Direct the AI to perform a specific task, such as, "Summarise the key points of this article on climate change." If you want specific information, be clear: e.g. “what does the article say about the main causes of climate change and their impacts on global weather patterns?" 
  • Try role-based prompting. Assign a specific role to the AI to make the output more relevant. For example, saying “You are a UK primary school teacher creating a quiz for your Year 4 students” will lead to a more structured, educational response, aimed at the specified student, than a generic request for quiz questions. 
  • Give examples. This is known as few-shot prompting and involves providing an AI with a few examples to guide its responses; for instance, providing the AI with a few sentences in a specific writing style, such as a formal letter, to help it generate a new letter in the same style. 
  • Tell it the output format you want: Make it clear whether you want the output to be presented as an article, script, bullet point list, table, guide, etc. You can also specify the word count limit to fine-tune the response. 
  • Specify the audience. Explain who the content is for so that the AI response is relevant and engaging for that particular group.  For example, explaining a scientific concept to high school students versus professionals would result in different language and detail levels. 
  • Establish the tone. Setting the style upfront refines the AI's output. Providing examples or reference links can enhance accuracy. For example, when prompting for blog post content, you might ask for it in an informal tone, whereas for sales output you might want a persuasive tone. 
  • Natural language is best. Although structured prompts are essential, over-complicating them can be counterproductive. AI models are built to understand natural language, so keeping prompts clear, direct, and conversational yields the best results. 
  • Ask the AI to demonstrate its reasoning. If you need clarity on steps taken, ask the AI to demonstrate its thought process. This method, called chain-of-thought prompting, is helpful for tasks such as explaining problem-solving steps or outlining an argument.  You can also ask it to provide its source material. 
  • Use follow-up prompts. Even with well-crafted prompts, the initial output might not be perfect. Refine by adjusting tone, detail, or word choice. Small tweaks can make a big difference. After the initial response, ask follow-up questions like, "Can you give a real-world example?" Be prepared to have a ‘conversation’ with the AI. 
  • Try open-ended questions.  For a more detailed response, instead of asking, "Is renewable energy important?" ask, "Why is renewable energy important for sustainable development?" 
  • Break down complex queries. By simplifying the query, you help the AI focus on specific aspects, reducing the risk of confusion and improving the overall quality of the output.  For example, instead of asking, "Explain quantum computing," break it down into smaller parts like, "What is quantum computing? How does it differ from classical computing?" 
  • Check with the AI for advice.  You can always ask the AI to suggest a good prompt…. 

Examples of good prompts verses bad prompts 

Prompt libraries

Some institutions have created prompt libraries to help their users. We don’t have one of these at Cranfield, but you may find it useful to look at the following to help develop your prompting:  

Customising your AI

If you’re using an AI which allows customisation you will get better results by sharing some information about yourself and your expectations.