The anatomy of a prompt

The anatomy of a prompt

These days, whenever a conversation gets going, one topic almost always comes up: artificial intelligence. With the rapid spread of AI, more and more people are trying to "make these systems talk". Many marvel at the clever answers a chatbot or text generator can produce, but few stop to think: behind every spectacular result stands a well- (or poorly-) worded request, an instruction — a prompt. The prompt is nothing other than the text input with which the user instructs the AI. It is rather like a magic spell in a fantasy story: if we choose our words carefully, the machine reacts in line with our intention, whereas imprecise wording easily leads to misunderstanding. "Conversing" with AI is therefore not a mere list of commands but almost the learning of a new language, where words really do have power.

Why do we need to learn this new language? Over the past years I have myself worked countless times with neural networks and large language models (LLMs). In my work I entrust to artificial intelligence problems that are difficult for a human to solve — linguistic analyses, the interpretation of visual information, drawing inferences from complex datasets, reviewing vast amounts of data. In my experience, the system's behaviour is determined above all by the form of the input. This article sets out to present, in an understandable yet scientifically grounded way, the anatomy of prompts — how artificial intelligence thinks about our words, and how we can use them deliberately so that the machine not only gives an answer but truly understands us.

What is a prompt?

A prompt is simply the message or question with which we instruct the AI to do something. It can be a single sentence, a command, or even a longer description containing the task description and the necessary background information. For example, a prompt might read: "Give me five tips for a healthier life" — a simple request. But it can be more complex: "Imagine you are an expert dietitian. Write a short article with 5 tips for a healthier life, with concrete examples and in a friendly tone." As we can see, the task is similar in both cases, but the second prompt defines much more precisely what we want.
Although the idea of prompting is fundamentally simple, it has an interesting historical background. As early as around 2019, researchers recognised that most language tasks — translation, reading comprehension, question answering — can be described in a question–answer format. This realisation led to being able to solve various problems in a unified way, with the help of questions, using the models. Modern prompt engineering as a deliberate methodology began to spread from 2021, when it became obvious that an appropriately worded input has an enormous effect on the AI's answers. We speak of an "engineering mindset" because designing prompts really is like fine-tuning our question: we polish the wording until the answer we get is as good as possible.

The parts of a prompt

A good prompt can be built from several elements, all of which contribute to what and how the model answers. The figure below illustrates the main components of a prompt.
The anatomical parts of a prompt. The figure shows the most important elements: the Directive, the Examples, the Role, the Output formatting and the Additional info. Together these elements determine the success of the prompt, and it is not always necessary to use all of them — but it is worth knowing them.

The anatomical parts of a prompt

  • Directive: This is the instruction or question itself, the heart of the prompt. In brief, we tell the AI what to do or what to answer. For example: "List five good books for children!" or "Translate from English to Hungarian: 'Good morning'." Here we give the action (listing, translating) with precise verbs — this helps the model understand the intention. It is important to know that the directive can also be given in a hidden form: if, for example, we write "Good morning: Jó reggelt; How are you: ...", the model works out on its own that it should continue the translation, even though we did not explicitly ask a question.
  • Examples: By giving examples in the prompt, we can show the AI what kind of solution we expect. If, for instance, we want the system to recognise positive or negative opinions, we can give one positive and one negative sample opinion and their evaluation. The model is able to "learn" from the input examples while answering — this is called in-context learning, when the machine picks up a pattern in the background from the examples it receives, without needing to be reprogrammed. A few well-chosen examples can drastically improve the accuracy of the answer. (An interesting point: research shows that generally the more examples we give, the better the result, but beyond a certain point — roughly above a dozen examples — the degree of further improvement decreases. Moreover, the order in which we give the examples is not irrelevant either: arranged differently, we may even get a significantly different answer to the same question!)
  • Role: It often matters what personality or point of view the AI answers with. By specifying a role we can ask the system to answer as though it were a certain professional or character. For example, we can indicate: "Act as if you were an experienced customer-service agent, ..." or "Imagine you are a history teacher, and explain ...". This sets the tone and the style. The role helps the answer to be consistent and fitting to the topic — in the role of a doctor, for instance, the model will use more technical expressions, whereas as a stand-up comedian it will respond in a more humorous tone.
  • Output formatting: It is important to specify not only what we want, but also in what form we ask for the answer. In the prompt we can indicate if we expect a list, or a tabular form, or perhaps a specific style. For example: "Please write the answer in 3 points." Or: "Give the answer in JSON format." These instructions help the model to provide the information in a structured, clear way. If we do not do this, the form of the answer may be haphazard — but if we do, we can save time by not having to rearrange the result afterwards.
  • Additional info: It often happens that, to answer the question, the AI also needs some background information. For example, if we ask it to write a letter, it does not hurt to state who the recipient is and what the context is; or for a professional question we can summarise the basic situation in a few sentences. Extra data built into the prompt helps the model answer more accurately and more relevantly. Importantly, it is worth providing the additional info before the actual request, so that the model first processes the background material and then turns to the task. As a rule of thumb, the background can go at the start of the prompt, then the examples, and finally the concrete instruction — this way it is most likely that the model will not mix our examples into its own answer.

Of course, we do not need to use all the above elements for every task. Sometimes a single well-posed question (directive) is enough, while elsewhere a more complex prompt is assembled from several parts. The key is to compose our request deliberately, because this way we are much more likely to get a useful answer.

Example: developing a prompt step by step

In theory this all sounds good, but let us look at a practical example. Suppose there is a restaurant, and the task is to analyse guest feedback with the help of AI. The goal: for each individual guest review, the system should determine whether it is positive or negative in tone, and briefly justify the decision as well. How is it worth wording this request? Let us see, step by step:

  1. First attempt — a simple instruction: Let us start with a minimal prompt, for example: "Determine whether the following text has a positive or negative sentiment: 'The pizza was tasty, but the service was slow'." Here the request is clear: for a given sentence we have to decide whether it is positive or negative. The model's answer, however, may surprise us. It may write: "Mixed sentiment." This is understandable in a way — after all, there is both good in it (tasty pizza) and bad (slow service) — but it does not meet our task, which expected two categories (positive/negative) as the result.
  2. Adding examples — creating context: On the second try, let us provide examples to show the model what we expect. For example: "Example – 'I love this place, the service is perfect': positive. Example – 'I hate the slow service, I'll never come here again': negative. Task: Determine the sentiment of the review: 'The pizza was tasty, but the service was slow'." With this we gave two samples: the first a clearly positive rating, the second negative. Now the model understands the context better, and is expected to answer: "Negative, because the slow service is a heavier complaint." That is, the system recognised that although the pizza was tasty (a positive element), overall the review is negative in tone because of the complaint.
  3. Giving a role and style — a professional tone: We can increase accuracy further by giving the model a role and defining the style. Let us say: "You are a customer-service manager who analyses guest reviews professionally." In addition we can ask: "Write one sentence explaining the decision." Together, the prompt looks like this: "Examples… (as above). Role: As a customer-service manager, determine the sentiment and justify it in one sentence." As a result the answer might be, for example: "This review is rather negative, because although the taste of the pizza earns praise, the slow service spoils the overall experience." Here one can already sense the professional tone and the coherent justification.
  4. Adding a train of thought — step-by-step analysis: Although the task is simple, we can try out the chain-of-thought technique: we ask the model to "think it through step by step". For example: "Analyse the positive and negative statements in the text, then state which way the evaluation finally tips." As a result the system first lists what speaks for the positive and negative sides (e.g. "Positive: the pizza is tasty. Negative: the service is slow."), and then at the end summarises the decision. This method makes the reasoning process transparent, which can be particularly useful for more complex tasks, because we can better understand how the AI reached its answer.
  5. Combining several prompts and self-criticism — increasing reliability: Finally, if we want a truly accurate result, we can use an ensemble method: we can run several different prompt variations and then compare the answers. For example, out of three differently posed questions, two judge the review "negative" and one "positive" — then on a majority basis we can take it as negative. In addition, we can ask the model one final question: "Are you sure? If not, correct your answer." With this we encourage self-checking. If it was uncertain, it will refine its explanation, or indicate that it is not entirely sure of the evaluation.

Step-by-step development of a prompt

We can see that with this process the originally simple instruction became an increasingly refined, reliable prompt. With each addition we brought the system closer to analysing like a human expert. The result is a more accurate answer accompanied by justification — which is exactly what we were aiming for.


How can we accidentally influence the AI?

It is important to know that not only do we teach the AI with prompts, but the wording of our questions certainly affects the style and content of the answer. We often influence the model without noticing it. For example, if we begin a question like this: "It's true, isn't it, that...?", then we are already suggesting the answer. With a tag like "isn't it", even in everyday language, we expect the other party to agree with us — and the AI may react similarly. In such cases it tends to nod along with our assumption, even if it is not entirely correct. To give a simple example: if we ask, "Cats live longer than dogs, don't they?", it may well be that the chatbot opens with a "Yes" and tries to support the statement — even though in reality the truth is not so clear-cut. The model fundamentally strives to answer politely and cooperatively in most cases, following our question. It will not necessarily automatically correct an error hidden in our question, especially if it is not obvious to it, or if the prompt suggests that we expect agreement.

How the wording of a question influences the AI

A similar phenomenon can be observed when we ask a question containing false information. If the model does not have reliable background knowledge on the topic, it may simply take the false statement in the question over into its answer. In a Hungarian test, for instance, ten misleading statements were put to various chatbots, and there was indeed a model that repeated the false information in its answer almost without change. This too shows that AI is not "all-knowing" — it uses the information we give it. If the starting point in the prompt is faulty or one-sided, the answer can be distorted as well.

How can we avoid these traps? First of all, let us be conscious when posing questions: let us try to word the prompt neutrally and factually if we expect an objective answer. For example, instead of "It's true, isn't it, that...?", let us rather ask: "What do you think about the fact that...?" or "Is it true that...?" — this gives room for a more nuanced answer. Secondly, we can encourage the model to evaluate its own answer: we can ask "How sure are you about this?" or "Are there counterarguments too?". With this we encourage it not merely to answer in agreement, but to review its own statements. And finally, it is always worth treating the information given by the AI with reservation, especially when we are making a critically important decision — in such cases we should verify the facts from other sources too.

Summary

Prompting — that is, communicating with the AI — plays a key role in what result we get from the machine. We have seen that a carefully constructed request almost teaches the model what we are curious about, while a sloppy instruction can result in an inaccurate or superficial answer. We can draw ideas from the principles above: let us word things clearly, give context and examples, and where necessary assign a role and a requested format, and let us not be afraid to iterate — to try several times — for the sake of a better answer.

It is also important to highlight that creating prompts is a kind of creative process. There are no rules set in stone, but rather guidelines and a great deal of experimentation. If there is an opportunity, it is worth playing with the wording: let us try several approaches and observe how the system responds. This is how we can develop the "language" in which we and the machine understand each other best.

And finally, let us remember that the AI reflects the quality of our questions back like a mirror — the more carefully we word the "magic spell", the more precisely the desired result comes true. A prompt is therefore not a mere technical detail but the soul of effective AI use: with its help, AI can not only give an answer but truly become a useful partner in problem-solving.

Back to the Knowledge base

Have a question on this topic? Write to us.

We are happy to answer your professional questions — we respond to every enquiry.

Write to us