Skip to main content
To KTH's start page

Use generative AI efficiently

How you formulate prompts is critical to how useful the results are that you get from a generative AI tool. Here you will find concrete tips on how to write effective instructions – so-called prompts – by, for example, including details and purpose. You will also find more tips, for example on how to work critically with the results from the tool.

Guidelines

​In addition to using generative AI effectively, it is also important to use it legally and ethically. How to do this is covered in the generative AI guidelines on the page Considerations for using generative AI .

What is prompting and how does it work? 

To use a generative AI, you need to give it instructions in some way, usually in the form of questions or statements. These instructions are called prompts. For chatbots like ChatGPT, you type prompts into a text box and get the response in a chat. There are a huge number of generative AI tools available online that can generate all kinds of material, such as text, images, code, audio, video, and music. Despite the wide variety, prompts are similarly accepted and handled by most generative AI tools. 

The response to your prompt is created based on the statistical model and training data used to build the generative AI tool. In simple terms, the response is generated word-for-word based on the most common wording in the model's training data. More advanced models include more steps and controls to improve the response, but fundamentally, responses are probability-based.  

The importance of human review  

A human should check and edit material created by generative AI before publication, both for quality purposes and to meet certain legal requirements. For example, human involvement is required to comply with copyright and the AI act. It also allows you to argue that the prompt and the response from the AI are drafts and therefore do not have to be saved according to the principle of public access to official documents. 

Effective and useful prompting 

Using a generative AI tool effectively is partly to write a good prompt and partly to deliberately address the tool's strengths and weaknesses.  

Write detailed prompts 

Details are an important part in getting useful output from generative AI tools. Without details, you risk getting an answer that is the statistical average, that is, a generic and mediocre answer. Keep the following in mind: 

  • Be specific. 
  • Include the goal, your purpose of the prompt.  
  • Combat bias. 
  • Set restrictions, such as guidelines to follow or expected layout. 

Hint! A good method to get started is to first write down all the relevant details you can think of without worrying about the formatting. Once you have all the details, rewrite the prompt so it's specific and to the point. 

Ask a text tool to enhance your prompt 

Text-based generative AI tools can help you write better prompts if you ask them for help. For example, write "clarify this prompt" or "rewrite this prompt so it's more efficient". You can also ask what details you need in your prompt to achieve a better result. 

Critically review generated material 

All generative AI tools "hallucinate" to varying degrees, that is, they make up false facts. This is something that's practically impossible to get away from, which means you'll need to critically review all generated material. Check the facts often, especially in areas where you are not an expert. 

Generative AI tools generate what's common, not always what's true or most relevant. Therefore, remember to check if any facts or sources have been ignored or downplayed by the tool, for example by searching a search engine for counterarguments. 

Iterate through interactive dialogue 

Once you've received a response to your first prompt, you can pretend that you're talking to a person and ask them, for example, to explain something in more detail or in other words. You can also ask them to correct something that they have done wrong or didn't turn out the way you intended. This way, you don't have to write a "perfect" question, you can simply chat and guide the AI to the result you want. 

Note, however, that this way of working is energy-consuming and has a diminishing effect with each iteration. After a few iterations, it may be worth making the changes yourself rather than asking the tool to make them.

Further reading 

Here you will find more detailed guides and tips for writing prompts: