Mastering Prompts: How to Get the Best Results from Generative AI
Rafael Luz
Azure Cloud Solution Architect - Data, AI & Machine Learning | Data Architect | Data Engineer | Data Scientist | Trusted Advisor | Leading Expert in Innovative AI Solutions
Generative AI can create anything from stories and images to code and poetry based on what you tell it. But to get the best results, you need to give it the right instructions — known as prompts.
Prompts help guide the AI’s response, shaping its tone, style, and quality. Well-written prompts lead to better, more creative results.
"Creating good prompts is the key to unlocking the full power of generative AI," says Jennifer Marsman, a principal engineer at Microsoft.
As generative AI becomes more popular, learning how to craft effective prompts can make a big difference. Here are some of Marsman’s top tips for writing better prompts.
Be Clear and Detailed
You had a perfect image in your mind, but when you asked Bing Image Creator to bring it to life, the result didn’t match your vision. What went wrong?
To get the best outcome, you need to be as detailed as possible when writing prompts, especially for images, says Marsman. For example, specify the style — is it a pencil sketch, oil painting, or cartoon? Think about the point of view and lighting, too. If it’s a baseball stadium, are you viewing it from the stands, the field, or from above like a bird?
In one example, Marsman used the phrase "high-quality digital art" in her prompt. Without that detail, the image wouldn’t have had the same level of precision, she explains.
Marsman was happy with the result, but she encourages not being afraid to tweak your prompt. Changing the word order can highlight different parts of the image. For instance, if she wanted mermaids to be the focus, she would have put "mermaids" at the beginning of the prompt.
Choose the Best Mode for Your Task
If you're after creative content like stories, poems, or jokes, go with the “more creative” mode in Bing Chat .
But if you need straightforward facts, the “more precise” mode is your best bet, says Marsman. This option will give you clear and accurate responses. The “balanced” mode is the default setting and works well for most situations, she adds.
Double-Check the Facts
Bing uses powerful AI and a vast search index to provide up-to-date, sourced, and conversational answers. However, generative AI can sometimes produce answers that sound right but are actually wrong. Here are some tips to ensure the information is accurate:
领英推荐
Customize Responses Based on Perspective
You can improve chatbot answers by specifying the way you'd like the information delivered. For example, if you want a simple explanation of quantum mechanics, you can ask Bing to “explain it to me like I’m in 8th grade.” On the other hand, if you're more familiar with the topic and want a detailed, technical explanation, you can ask it to respond like a college professor or technical expert. This lets you adjust Bing Chat’s tone and depth to match your knowledge level.
Start Fresh with the “New Topic” Button
If you’re asking follow-up questions on the same subject in Bing Chat, keep the conversation going. But when you’re ready to switch to a new topic, click the “New topic” button. This resets the model, ensuring it doesn’t mix up different conversations or blend unrelated information.
Control the Length of Your Responses
Do you prefer a brief answer or an in-depth explanation? You can specify the desired length—like asking for two sentences or two paragraphs—to guide the model's response. If the chatbot stops before you’re ready, simply prompt it to “go on” for more information.
Utilize Formatting for Clarity
AI-powered Bing can display information from various sources in different formats to enhance understanding. For instance, using tables and outlines helps present data in a clear structure. Similarly, diagrams and flowcharts can make complex information easier to visualize and interpret, improving overall comprehension.
Make the Most of Your Copilot for Writing Code
Keep in mind that the model is familiar with many programming languages, so simply asking it to complete a coding task may result in code written in any language. Be sure to specify which programming language you want to use. Also, include any relevant context, such as the libraries, APIs, or frameworks you're working with. You can even reference existing code, like mentioning that “the user’s input is stored in a variable called x.”
And always remember to run and test your code!
Keep Trying: Refine Your Prompts
Remember that getting the right responses from AI isn’t an exact science; iteration is essential, according to Marsman. The great thing about crafting prompts is that you can explore various approaches to find what works best for you. Feel free to experiment with different lengths, tones, and styles. If your first attempt doesn’t yield the desired results, tweak your prompt and try again. With practice, you'll become more skilled at directing the model toward the outcomes you want.
Related Links:
Learn more: Expl AI ning AI: The fundamentals and the frontiers