Using AI Effectively: Prompt Engineering

See also: Using Large Language Models (LLMs)

The big question in many businesses over the last few years has been overwhelmingly “How do I get the results that I want from artificial intelligence (AI)?”.

There is a general understanding that AI can improve both speed and efficiency—but somehow many businesses and individuals are simply not getting the results they expected or hoped to achieve. The answer lies in better prompt engineering.

Prompt engineering may sound very technical. However, it is actually simple: it means giving your chosen generative AI model the right information or question (the “prompt”) so that it gives you the information you need. This page explains more about how you can get better at prompt engineering.

Getting Started

Improving your prompt engineering means understanding a bit more about how AI works.

As a starting point, our page on Understanding Large Language Models may help.

The key is to appreciate that AI is both complex and simple. It has vast resources at its disposal, but it doesn’t know what you need unless you tell it. It cannot infer anything from your tone of voice, or the context. One suggestion is to think of it as a well-intentioned but very naïve intern.

Your prompt or question therefore needs to:

  • Tell the AI what you want to achieve, otherwise known as your goal;

  • Give it enough context that it can draw out the information that you want, and separate it from less useful information; and

  • Set out constraints, for example, telling it what you don’t want the answer to include, or what information should not be used as a source.

A Template for Prompt Development

Our guest page on How AI Can Help You to Think, Learn and Create contains a useful template for developing prompts for AI.

Universal prompt template for working with AI


Your prompt should cover five key areas:

  • Goal: What are you trying to achieve?

  • Application: How will the result be used (email, report, study notes, marketing copy, etc.)?

  • Inputs: What data/materials do you already have (notes, links, rough draft, product photo, etc.)? You can supply these if they are not confidential.

  • Constraints: Time, tone, length, format, must include / must avoid.

  • Quality Bar: What does “good” look like? How will you check it (accuracy, clarity, originality, rubric)?

This can be used in almost all circumstances when working with AI: for visual, text or other output, and for any model.

This template will help you to structure your thinking more clearly.



Refining Your Prompt

It should by now be clear that a good prompt is probably not a single line of text.

Developing a prompt is also not a five-minute job. It can often take refinement and iteration to get it right. You may need to test it out in practice, checking the results thoroughly each time to see what needs changing. It is only really worth it if it is going to save you a significant amount of time or effort.

Case study: Developing a Prompt for Content Publishing


A digital publisher recently integrated AI to format and set up their web pages for publication. To achieve this, they engineered a highly detailed prompt that is roughly the equivalent of one-and-a-half A4 pages of text. It took several months of testing and iterative refinement to develop the prompt into a version that produces the exact required formatting every time.

However, now that it is perfected, it saves the editorial team a significant amount of manual work per published page. Scaled across multiple articles a week, this single, well-crafted prompt saves a lot of time and resources overall.

Here are some useful tips that will help you to develop your prompts.

  • Define your position

    The key to using the template effectively is to understand and define your position (that is, who you are), what you want from the AI, and what standards the output has to meet.

    This means that you need to understand this—and you also need to communicate it to the AI model.

    Lack of clarity in your instructions will be reflected in lack of consistency or inaccuracy in the output.

  • Start drafting elsewhere

    Don’t start drafting your prompt when you open the AI model.

    Instead, start developing your prompt in a Word document or similar. Set out the headings from the template, and work each of them up in turn.

    Do the thinking yourself first, and then ask the AI for help—not the other way round.

  • Give the AI some room for manoeuvre

    You need to be careful to give the AI model enough scope for it to create something useful.

    If you constrain it too much, this will be impossible. It will only be able to reflect your words.

    Consider that you probably want options or ideas to choose from as part of your output. This means you can’t afford to draw the instructions too tightly: you need to find a balance between guardrails and usefulness.

  • Iterate and review

    You are unlikely to get your prompt right the first time.

    It is therefore worth trying things out and reviewing the results—then amending your prompt to fill the gaps or tighten the criteria.

    For example, you might start by asking for an image generator to make you a picture of clouds at sunset (the initial prompt for the picture in our page on Identifying and Using AI-Generated Images and Videos). To match the other image on that page, the prompt was then refined by adding more information about the colours required, and the information that the picture should include silhouettes of trees against the sunset.

    It could have been further refined by asking for UK-native trees to be shown, or for the clouds to be specific types (e.g. cumulus clouds), or for the blue to be less intense and closer to purple.

  • More context may help

    If you are not getting the output you want, try adding some more context.

    In the example above, the prompt could have been refined by showing the AI the original photo, and asking it to create something similar, but with a different background, or clouds. The context could have included the information that it was being used to compare AI-generated images with real photographs.

    WARNING! No sensitive information


    When you are providing context, make sure that you don’t give the AI any sensitive information. That means no personal information, or anything about any clients or customers: nothing, in fact, that is not already in the public domain.

    For example, the reason for not providing the photo in the example was to avoid it being copied later by the AI model.

  • Check the output

    The output is key to iterating and refining your results.

    Before you amend the prompt, consider which part of it resulted in which parts of the output.

    If you have asked for several options, you can use these to consider what the AI seems to have taken of what you said, and what is missing. You can then add more information to fill the gaps.

  • Keep a record

    It is worth keeping a record of the prompts that you have used in the past, and also a reminder of whether they gave useful results. This is another reason for drafting up a prompt in another document, rather than directly into the AI model.

    This is because language is key with an AI model.

    When you use the same language, you will (usually) get the same—or very similar—results. It is therefore worth remembering prompt phrases that give you results that you like or that are more useful.

    A record helps transparency, too


    Keeping records of prompts and their iteration is also helpful for transparency. It may be important that you—and others—can understand exactly what you did to generate a particular output.

  • Accept the limitations

    AI has some very distinct limitations. It basically just puts words or pixels together in the right order. It can’t give you new information, and the information that it provides may not be accurate.

    In other words, you may not be able to do exactly what you wanted—especially with free tools (most of which are still under development).

    Fundamentally, you may have to accept that sometimes there is nothing much you can do to refine the results any further.

There is more about the skills needed to develop good prompts in our guest post on Essential Skills for AI Prompt Engineers.

And Finally...

Before you start to develop any prompt, it is worth asking yourself whether you really need to use AI for this work.

Will it really save time and energy, or will the output cost more than it is worth, when you factor in the energy cost of using AI?

And is it actually safe and ethical to use AI for this work?

Take as your motto: Prompt well, but don’t prompt blindly.

TOP