BLOG

5 Principles of Writing Prompts, with Examples That Work in ChatGPT, Claude, and Gemini

Artificial intelligence (AI) is taking the world by storm. The growth and progress of AI over the past decade have been remarkable. We have all tried various AI models, whether to gain insights, solve problems, get a second opinion, automate tasks, or simply out of fear of being left behind. There are many popular AI models, such as ChatGPT, Gemini, Copilot, Claude, DALL-E, Llama, and Sora, but what do they all have in common? They all need a prompt.

A prompt is the input given to an AI model, and the AI model generates its response based on it. A prompt can take the form of a set of instructions, a piece of text, or a simple question.

As a software engineer, I think of a prompt as something like a requirement for us. The clearer and more concise the requirements, the better the final product. In the same way, the clearer and more precise the prompt, the better the output the AI generates.
As you can tell from the title, this article walks through five basic principles of prompting that help produce better, more accurate output.

1. Give Direction

When you give a prompt to an AI model, it is important that the prompt be clear and concise if you want the output you actually expect. Say you ask someone for directions and they tell you, "Go straight and turn right." But as you move forward, there are several right turns, and you can't tell which one to take. If they had told you, "Go straight until you see a school, then take the first right after the school," you would be much more likely to reach your destination. In the same way, giving an AI model a clear and concise prompt gets you the output you want. Let's look at an example:
Basic prompt: Suggest a title for a blog.
Improved prompt: Suggest five catchy titles for a tech blog focused on the latest trends, practical solutions, and emerging technologies.
If you try the prompts above, you will see the difference in the output. The first prompt returns a vague response, while the second returns a clearer, more precise one.

2. Specify the Format

You can also specify the format of the output you expect in your prompt. This saves you from having to reprocess the output to get a response in the format you want. If you need the output in comma-separated form, it is more efficient to specify that in the first prompt than to prompt the AI model again to convert the output to comma-separated form. Let's demonstrate this with an example.
Without specifying the format:

Output of a prompt that does not specify the format

Specifying the format:

Output of a prompt that specifies the format

As you can see in the images above, the first prompt required reprocessing the output to get the result as a comma-separated list, while the second prompt needed no reprocessing because it had already specified the output format.

3. Provide Examples

Providing examples can have a major influence on an AI model's output. When you include examples in a prompt, the AI model tries to imitate the format of the examples provided, which makes the output more reliable. The more examples you provide, the more reliable the output becomes, but creativity drops significantly.

Without examples:

Output of a prompt without examples

With examples:

Output of a prompt with examples

As the images above show, the first prompt had no examples, so the AI model responded with creative names. In the second prompt, on the other hand, we provided examples, so the AI model created a pattern and output [name] following the pattern shown in the examples.
Note: if you provide too many examples in a prompt, the AI model comes to rely more heavily on the examples instead of establishing a pattern.

4. Evaluate Quality

Another basic principle of prompting is evaluating the quality of the output. AI models such as ChatGPT offer thumbs-up and thumbs-down options on each response. You can give feedback on the output ChatGPT generated by using thumbs up when the result meets your expectations and thumbs down when it does not. When you choose thumbs down, you can give the reason you did not like the response, which helps improve the AI model further. You can also regenerate the response if you need more options.

Giving feedback on a generated response

In the image above, we are giving "bad response" feedback on a response the AI model generated. This feedback helps improve the AI model in the future.

5. Divide the Work

Dividing the work generally means breaking a problem down into smaller parts so that it is easier to solve. With prompts, splitting a long, complex, or ambiguous prompt into a series of smaller prompts lets you put the output in order and make it more accurate and effective. Long, complex, or ambiguous prompts can cause "contextual hallucination" (a type of AI hallucination), in which the AI model misinterprets the context of the prompt and starts giving inaccurate or inappropriate responses.
Complex prompt: Plan an annual event for a technology company.
Improved prompts:
1. Suggest three themes for a technology company's annual event that focus mainly on team building, achievements, and next steps.
2. Create an agenda that includes the main activities and a timeline for each activity, so that the event does not become boring.
3. List the top five event venues within an hour of <location>, along with capacity, average rating, key features, and possible drawbacks.
4. Write an invitation email for attendees that briefly covers the theme, agenda, main activities, and venue, while balancing fun and professionalism.

If you try the prompts above, you can see how each response differs. You will notice that the second set of prompts gives a well-structured response tailored to your needs, while the first prompt gives a vaguer, more generic response.
I hope you learn these principles of prompting and put them into practice to get more accurate responses from AI models.


This article is a translation of a piece written by our engineer Manjish Pradhan in February 2025.
You can read the original English version here.
https://articles.wesionary.team/5-principles-of-prompting-86d941050a00


Careers

We are working on systematizing product co-creation. We are looking for product managers to lead product co-creation, and for sales members to bring our vision to the market!

https://wesionary.team/career/product-manager


For companies looking for a development partner

By making the most of the advantages of global development, we deliver both high cost-effectiveness and high quality. Our experienced, diverse team takes the time to understand your challenges correctly and delivers the right system and an excellent experience. Whether it is business system development, new business development, or challenges around operational efficiency and digital transformation (DX), please feel free to consult us.