Whether writing texts, programming or searching for ideas - generative AI can provide support in many areas today. The quality of the answers depends largely on the formulation of the input. If you know the basic principles of prompting, you can work with language models in a more targeted way. The following article explains key terms, presents helpful strategies and provides practical tips for use in everyday life and in a professional context.
Generative Artificial Intelligence (GenAI) introduced the word prompt into our language, it describes the interaction with language-based GenAI. A lot of research is being carried out in the field of prompt engineering, and it is almost impossible to keep track of every development. Which model is suitable for which task? What is zero- and few-shot prompting? Is my shared information secure or not?
The aim of this article is to categorise some terms and present general procedures, both for everyday tasks and for use cases in a professional context.
How do I get started?
In order to achieve good results, there are a few points that should be considered for each task:
1. Which task is to be undertaken?
2. What role should the chosen language model play?
3. What should the output look like?
These points can be seen as a basis from which the prompt can be refined. As with almost all written texts, several rounds of adjustments are made until the optimum is found. Point 1 can be seen as the starting point: What is the task at hand?
Example: Write an article on the topic of prompting.
For point 2, it makes sense to provide some details or context, i.e. information about the discipline in which the topic is being dealt with. What tone should the article have?
Example: You are a scientist in the field of generative AI who can present findings from prompt engineering in a generally understandable way.
Finally, it is important to formulate how you envisage the output in order to avoid long answers that are repetitive or not specific enough. For longer tasks, it can be useful to divide them into individual sections.
Example: Write a short introduction to the topic of prompting.
Now you can add further context to the prompt; the more information you provide, the closer you get to the desired result. This is almost enough for an introduction, but not yet enough for an entire article.
Do I have to be nice to generative AI?
The rumour that generative AI provides better answers if the prompt is polite is persistent, but there is no scientific evidence for this. It has been shown for individual models that differently polite prompts deliver the same results in summaries and comparable results in translations into different languages. In some cases, the answers became shorter when the prompts became less polite – but this is not a quality feature per se (Yin et al. 2024). Important: Newer models in particular appear to be less influenced by politeness; in addition, the most impolite prompt in the study was accompanied by insults.
As long as insults are avoided, there is no need to use politeness norms from human communication.
What is zero-, one- and few-shot prompting?
Once the minimum basic framework for a prompt has been established, the question arises as to how to achieve better results. The terms zero, one or few-shot prompting describe how many examples are sent to the language model with the prompt. The prompt created above falls into the zero-shot category, as no example is included. For more complex tasks in particular, it may be worth adding one or more examples to the prompt. If the aim is to write an article on the topic of prompting, you could, for example, insert an introduction from another article (one-shot) or several examples (few-shot). This is conceivable for any task. For example, if a data set is to be analysed with Excel, R or Python, you can give precise examples of what is expected with a certain input.
Example: Create a new table/data frame with the participants who had particularly good or bad grades. You are an expert in data science and write Python code. Write a function that filters the data correctly. Here is an example: Input is a dictionary studentGrades = {‘name’: [Sophia, Marc, Ira, Anton], ‘grade’: [2,3,1,6]}, output is the filtered dictionary studentGrades = {‘name’: [Sophia, Ira, Anton], ‘grade’: [2,1,6]}.
What tasks can LLMs be used for?
Language models promise to support all kinds of tasks. Depending on the task and field of application, this works differently well. As a general rule, GenAI makes mistakes and the user is responsible for checking the output for correctness. In addition, certain tasks, e.g. creating texts, are solved better than others, e.g. logical reasoning. This is due to the nature of the AI, which outputs the most likely combination of words as an answer without having an understanding of the content. Some models are better suited to certain tasks, for example OpenAI, Mistral or DeepSeek have special models that are specialised in generating program code through further training. So if you want to solve a specific task that goes beyond text generation, it is worth comparing several models. If you use ChatGPT, DeepSeek and the like online, you should be aware that data is processed outside the EU and may also be used to train new models. API accesses, programming interfaces that are not used via a user interface and enable the automated integration of GenAI, can be an exception. OpenAI promises, for example, that data that reaches the servers via API will not be saved or used for training purposes.
Can the models be run locally?
Models such as Llama and DeepSeek are freely available and can theoretically be run locally. This means that you download the models to your own computer and run them there without sending data to a server. Even if you often read that no expensive hardware is required, this does not mean that every model can run on every computer. A powerful graphics card is particularly important here: the more parameters a model has, the higher the computing capacity required. Smaller models are available, e.g. from Llama (Meta); these also run on an average computer, but are not as effective as models with more parameters. If you want to try it out, you can use Ollama, for example, to test the model of your choice locally.
What is Chain of Thought Prompting?
When it comes to solving more complex tasks in which logical conclusions or dependencies play a role, Chain of Thought (CoT) Prompting can be used. In terms of content, this method is based on the human way of thinking. Large problems are broken down into individual steps that are easier to solve. Initially, only the prompt “Think step by step” was added to the prompts; now the steps themselves are sometimes created in the prompt.
Example: Create a three-course meal for 15 people and a shopping list. You are a hobby chef and like to invite friends round to cook for them. You pay attention to seasonal ingredients, in this case it’s spring in Germany.
1. Look for a vegetarian starter.
2. Choose a main course that can be served with both meat and vegetarian options.
3. Choose a vegetarian dessert, e.g. it must not contain gelatine.
4. Now plan the quantities for 15 people, ten eat meat and five are vegetarian.
5. Go through each chosen dish and write the ingredients on a shopping list.
Proceed step by step.
Give me the menu and the shopping list.
Why CoT prompting achieves better results than simply writing down the question is not clearly explained or comprehensible. Even if you can ask models for a reason and often receive a plausible answer, it must be taken into account that the models have no understanding of the content and cannot explain themselves. The developers can also explain the technical and mathematical principles, but not individual decisions, which is why they are also referred to as black box models. The more parameters a model has, the more confusing the network becomes. Llama 3.3, for example, has 70 trillion parameters that could be involved in an output.
Link tips
Where can I find out more about prompt engineering?
Where can I find out more about the technical background?
Where can I try out LLMS?
Sources
Ziqi Yin et al (2024). Should We Respect LLMs? A Cross-Lingual Study on the Influence of Prompt Politeness on LLM Performance. In: Proceedings of the Second Workshop on Social Influence in Conversations (SICon 2024), 9-35.
The blog posts published by the bidt reflect the views of the authors; they do not reflect the position of the institute as a whole.