5 expert tips for creating the perfect AI prompt.
Recently, Google's prompt creation expert, Lee Boonstra, published a 68-page in-depth report on prompt creation techniques, with numerous tips and strategies for creating perfect prompts for LLMs. While this report is compiled for future prompt creation professionals, some of the tips are applicable to everyday AI interactions. This article lists five prompt creation tips that will help you get better responses from your AI chatbot.
1. Keep the prompt simple and get straight to the point.
Although it's often advertised that you can speak with LLMs in natural or everyday language, that's primarily to make the product appealing to the average user. For better results, you should keep the prompt concise and easy to understand, focusing on action verbs. Every superfluous word or complex phrase you add has the potential to lead to misunderstanding.
Instead of telling your problem to the AI as a story, focus directly on the answer you need. Here are some examples to help you understand better:
Prompt is not good :
Tôi sẽ đi du lịch Tokyo vào tháng tới trong 5 ngày. Tôi rất muốn tham quan các ngôi chùa cổ, và cũng yêu thích các phòng trưng bày nghệ thuật hiện đại. Tôi sẽ ở gần ga Shinjuku và muốn tìm những nơi không quá đông đúc vì tôi dễ bị choáng ngợp. Good prompt :
Hãy đóng vai trò là hướng dẫn viên du lịch Tokyo. Đề xuất 5 ngôi chùa cổ và 3 phòng trưng bày nghệ thuật hiện đại gần Shinjuku, tránh những nơi đông người.
2. Assign roles to AI first.
For specialized requests, it's best to ask the AI to act as an expert in a specific field, such as 'act as a tour guide' or 'you are a kindergarten teacher'. Because large language models (LLMs) learn from vast textual repositories, this will force them to stick to a particular occupation or personality. The model will use the tone and vocabulary characteristic of the role, limiting itself to the scope of that role, which will prevent it from straying off-topic.
Here are some examples of requirements:
Prompt is not good:
Tạo một kế hoạch bài học về quang hợp. Good prompt:
Bạn là một giáo viên mẫu giáo. Hãy thiết kế một kế hoạch bài học 30 phút về quá trình quang hợp với một câu chuyện hấp dẫn, một hoạt động thực hành và ba câu hỏi ôn tập đơn giản.
3. Provide examples.
Whenever possible, try to provide multiple examples of how you want the output to look. This will ensure the model delivers exactly what you want without deviating from the goal. These concepts are known as one-shot prompts and few-shot prompts. It's best to provide at least 3 to 5 examples if possible.
Of course, examples aren't necessary for most prompts, but whenever you need to follow a specific structure, they significantly improve results. For example, if you're giving it ratings to understand emotions, you can provide exactly how it needs to categorize those ratings, such as negative, neutral, or positive.
4. Try the Step-Back Prompting method.
Step-Back Prompting means dividing a prompt into two steps by asking a principle-level question first, then providing a reverse answer to obtain a detailed response. Essentially, the first question activates the model's background knowledge on the topic, helping the model to provide a better answer when you ask the actual question using the details from the first question.
This approach is better than directly asking for the answer, as it 'encourages LLMs to think critically and apply their knowledge in new and creative ways' .
To help you understand better, the article provides an example illustrating this approach:
First prompt :
Các nguyên tắc cốt lõi của một mô tả sản phẩm hiệu quả là gì?
After receiving the answer, use the second prompt (the step-by-step hint).
Second prompt :
Sử dụng các nguyên tắc này, hãy viết mô tả sản phẩm cho một chiếc đồng hồ thông minh mới với các thông số kỹ thuật sau (cung cấp thông số kỹ thuật).
5. Focus on guidance rather than restrictions.
LLMs work better when you instruct them to 'do something' rather than tell them 'don't do something'. Instead of telling the model what it should avoid, it's better to specify exactly what to include. If you add restrictions to the question, the model might start guessing what's allowed and may restrict itself more than necessary. Using direct instructions leads to more creative answers.
Although the paper states that using constraints when necessary is acceptable, it's better to use positive guidelines. Here's an example of this concept:
Prompt is not good:
Mô tả chai sinh học mới của chúng tôi. Không sử dụng các từ ngữ so sánh nhất và không nói về giá cả của nó. Good prompt:
Viết một mô tả sản phẩm gồm 2 câu cho chai sinh học của chúng tôi, nêu bật khả năng giữ nhiệt 48 giờ và cấu tạo bằng thép tái chế 100%. Sử dụng ngôn ngữ rõ ràng, tập trung vào lợi ích mà không đề cập đến giá cả.
These are some helpful tips for everyday use. However, there are many other ways to create better AI responses besides just creating better prompts, such as personalizing the AI.