How to write an effective prompt
Prompt is a textual instruction for a language model that guides its work, helping to get an accurate and relevant result. The success of interaction with the model directly depends on the quality of the prompt.
The main structure of the prompt
1. Briefness and clarity
- Formulate the task as clearly as possible.
- Avoid ambiguous phrases and their duplication
- Divide the prompt into sections of context by dividing them by headings (using Markdown markup)
2. Indication of the role of the model
- Determine who the model is in the context of the task. It sets the style and tone of her responses.
Example: You are the sales manager of TechnoGadget. Your job is to help clients find the right equipment.
3. Purpose of interaction
- Specify the ultimate goal, whether it is advice, assistance in choosing or completing the transaction.
Example: Your task is to help the client choose a smartphone, clarifying their budget and preferences. Offer three models with a brief description.
4. Context and details
- Provide information that will help the model complete the task.
Example: The client is looking for a laptop to work with graphics. Offer three models with a powerful processor and video card.
5. Style and tone of communication
- Determine how the model should respond: friendly, formal or businesslike.
Example: Communicate with customers friendlyly, avoid complex technical terminology and offer specific solutions.
Dependence of the prompt on the model
The efficiency of the model and processing costs directly depend on the length and structure of the prompt.
Why is it important?
- Cost of processing: The more symbols, the higher the costs.
- Optimize tasks: Prompt should correspond to the capabilities of the model.
Approaches for different models
- Full models (e.g. 4o, 4)
- Use the minimum length prompts.
- Focus only on the key tasks.
Example: You're the manager. Offer three popular smartphones at the request of the customer.
- Average models (e.g. 4o-mini)
- Add context and step-by-step instructions.
- Specify the format of the response.
Example: You're the manager. The client is looking for a laptop to work with graphics.
- Check the budget.
- Ask if the screen size is important.
- Offer three models with characteristics.
Markdown at Prompt
Markdown can be a useful tool for structuring and formatting prompts with chatbots. Its application improves readability, makes tasks more comprehensible to the model, and helps ensure that tasks are executed accurately. The writing structure in markdown can be found at link
Why use Markdown in prompts?
-
Clarity and structure Markdown allows you to create structured instructions that are easily perceived by the model and ensure accurate execution of tasks.
-
Identification of key information Markdown helps highlight important parts of text (bold, italic, headers) so that the model can focus on the main aspects of the task.
-
Simplification of complex tasks Markdown allows you to break down complex tasks into steps and subtasks, ensuring that instructions are executed accurately.
-
Formation of answers With Markdown, you can specify the desired response format (list, table, structured text).
-
Creating tables Markdown allows you to create tables to structure information and make it easier to understand.
Testing Prompt
To ensure high-quality configuration and optimal operation of the chatbot, it is necessary to conduct thorough testing of the prompt. This helps to identify flaws, improve the accuracy of responses and increase user satisfaction.
Testing objectives
-
Performance check:
- Make sure the bot understands the task and interprets the prompt correctly.
-
Optimization of results:
- Clarify language to improve responses.
-
Identification of errors:
- Identify moments where a bot may give inaccurate or irrelevant answers.
The main stages of testing
- Development of scenarios
- Prepare a list of scripts that cover all the main tasks of the chatbot.
- Make sure scripts include both standard and non-standard queries.
Example:
- The customer asks about available smartphone models.
- The user is interested in delivery conditions.
- The client makes an incorrect request (“show the laptop”).
- Conducting tests
- Check how the bot responds to requests from prepared scenarios.
- Use both standard queries and unexpected questions.
Tip: Test the prompt with multiple users to account for different query styles.
- Analysis of results
- Write down the bot’s responses and rate them according to the following criteria:
- Relevance: How well does the answer match the request?
- Clarity: Is the answer clear to the user?
- Plenty: Does the bot provide all the necessary information?
Example of analysis: Request: "Tell me about laptops for graphics." I recommend the ASUS Vivobook, MacBook Pro and Dell XPS. Evaluation: The answer is relevant, but there are not enough details about the characteristics.
- Improving the prompt Based on the analysis, make changes:
- Clarify the wording to avoid misunderstandings.
- Add context or instructions for complex tasks.
Example: It was, "Tell me about the laptops." It became, "Name three graphics laptops with short specs and price."
- Retesting After making changes, repeat the test to see if they are effective.
Before the next edit, save the bot. ChatRex will add a prompt to the story, where you can compare options and restore a suitable version. The procedure for working with history is described in the instruction "Basic settings and prompts".
Tips for successful testing
-
Test different versions of requests:
- Use simple, complex and incorrect queries to check the stability of the bot.
-
Attract testers:
- Give users the opportunity to test the bot to get feedback.
-
Document the results:
- Keep a test log indicating the request, response and proposed improvements.
Example of a testing journal
Careful testing helps create a bot that meets users’ expectations and performs its tasks effectively.