Build for me
AIPublished September 4, 2024

AI Prompt Engineering: How to Instruct AI Models to Avoid AI Bias and Get The Results You Want

Techniques for prompting AI models that will help you produce accurate, effective output for any task

Cait Levin

Cait Levin

Education Lead

AI Prompt Engineering: How to Instruct AI Models to Avoid AI Bias and Get The Results You Want

Artificial intelligence is everywhere, but getting the exact results you want can still be tricky. You type in your prompt and hit enter, but the response isn’t quite what you expected. Frustrating, right? That’s where prompt engineering comes in handy. 

AI prompt engineering is the skill of talking to AI, so you actually get what you’re asking for.

We’ll cover how to tweak your prompts, add context, and keep refining and problem-solving until you get the perfect output. We’ll also dig into the trickier stuff, like correcting for AI bias using careful prompt engineering.

We’ll also look at real-life ways to apply AI prompt engineering to software using a no code platform—Glide. Combining AI and no code gives you the ability to build incredibly efficient tools for work. You’ll be able to apply this knowledge when building your software with the help of AI, using Glide’s native AI functions, and using integrations with platforms like OpenAI.

Whether you are learning how to use AI effectively at work, want to develop the skills to land AI prompt engineering jobs, or are already working as a no code developer and want to make your skills more powerful by adding AI capabilities to your software, this guide is here to help you level up your skills. 

What is AI Prompt Engineering?

AI prompt engineering is about learning how to give clear instructions to AI so it understands exactly what you want. The more context and detail you provide, the better the AI can deliver what you're looking for. 

Similar to other programming languages, engineering AI prompts is a way of learning how to communicate with computers so they understand your intent and can deliver the correct results. The advantage of AI is that you can communicate using natural language instead of having to learn a new language like Python or Java.

Think of AI like an intern. It might have access to a lot of skills or knowledge, but it lacks context, judgment, and experience, especially as they relate to your specific needs or ways of doing things. Like an intern, you need to provide it with lots of direction in order for it to complete tasks in the way you want it to.

For instance, if you’re delegating a task to a human assistant and just say, “Create a report,” you might get a very simple report with just two or three metrics, and they might not be the ones you wanted or formatted in the right way.

But if you say, “Create a report that summarizes last quarter’s sales data, focusing on the top-performing products and customer segments, and make it easy to read with bullet points and charts,” you’re much more likely to get a helpful result. That’s the essence of AI prompt engineering—being specific and clear so the AI knows exactly what you want.

AI systems are excellent at this. They can take complex, unstructured data and turn it into something useful. But don’t be fooled—it only does this if you guide it properly. Without clear instructions, it might spit out something inaccurate, unhelpful, or just plain nonsensical.

This process shares a lot of similarities with the early days of search engines. Back then, people figured out how to stuff their queries with keywords to get better results (a.k.a. keyword ease) in search engines, like Dogpile and Ask Jeeves (As of writing this article, this site apparently still exists. So, there’s that!). That’s a bit like what we’re doing now with AI prompts, where we’re optimizing what we ask to get the best possible answers. The more you refine your prompt, the better AI’s output.

For example, if you’re using Glide, you might use AI to analyze customer feedback, write a social media post, or even create a thumbnail image. The key is to be clear, specific, and ready to experiment with different prompts until you get the right result. 

Just like working with a new intern, it takes a bit of back-and-forth, but with the right guidance, AI can become a powerful tool for your business.

3 Types of AI Prompts 

When it comes to working with AI, how you phrase your prompt can make a big difference in the results you get. Here are three types of AI prompts you can use. 

Zero-Shot Prompts

Zero-shot prompts are designed to get a specific output on the first try without the need for any examples, fine-tuning, or training. They’re usually short, simple, and to the point. 

These are the types of prompts that most people start out with, and they only work well if you need a quick answer.  

For example, Summarize these meeting notes with a high-level paragraph and bullet points highlighting important points and action items. A zero-shot prompt might be: “Give me a list of ingredients and a recipe for making coconut macaroons.” The AI would then spit out this recipe in one shot. 

Chain of Thought Prompts

Chain of thought prompts guide the AI in thinking through a problem step by step. This is particularly useful for more complex tasks where logical reasoning is needed.

For example, if you run a growing e-commerce business that sells commercial LED lights. You’ve been manually managing orders, inventory, and customer service, but with increasing sales, it’s becoming harder to keep up. You're considering automating parts of your business to save time and reduce errors, but you're unsure where to start. This is where you might want to use chain of thought prompts to help you think through the problem. You might start with this prompt. 

"Step by step, think through the process of deciding how to automate and improve efficiency for my growing chain of stores. Consider the following:

What tasks (order processing, inventory management, customer support) are currently taking up the most time and are prone to errors?

Which of these tasks could be automated using existing tools like inventory management software, automated email responders, or chatbots for customer service?” Then, based on the initial output, you might follow up with more prompts asking the following:

  • What are the potential benefits of automation, such as time saved, error reduction, and improved customer satisfaction?

  • What are the initial costs and ongoing maintenance expenses of implementing these automation tools?

  • How will automating these tasks impact my day-to-day operations, and what adjustments will my team need to make?

  • How can I measure the success of automation (e.g., reduced order processing time, fewer customer complaints, increased sales)?

  • Should I start with a single area of automation and expand gradually, or implement multiple tools at once?

This prompt guides the AI in methodically analyzing the various aspects of automating portions of your position. As part of this, it can help you assess both the immediate and long-term impacts of adopting new technologies. 

System Prompts

System prompts set the overall behavior or tone of the AI throughout an entire interaction. This is particularly useful when you want consistency in style or personality across multiple interactions.

Sticking with the same e-commerce example, let’s say you want the AI to help you craft emails, product descriptions, and social media posts for your business. You want the AI to maintain a consistent tone that reflects your brand—professional yet friendly and approachable.

That’s where a system prompt like this can be helpful. 

Throughout this interaction, adopt a tone that is professional but friendly and approachable. The language should be clear, concise, and free of jargon, making it easy for my customers to understand. Whether crafting an email, product description, or social media post, the content should reflect a brand that is helpful, trustworthy, and always puts the customer first.

Please draft a social media post announcing our new line of eco-friendly home goods. The tone should be in line with the system prompt: professional yet friendly and approachable. Emphasize the quality and sustainability of the products, and make sure to include a clear call to action.

As you continue to interact with the AI, whether it’s writing product descriptions or responding to customer inquiries, the system prompt ensures that the AI consistently uses the same tone and style throughout, keeping your brand voice unified across all communications.

Each of these prompt types has its strengths, and understanding when to use each can help you get the most out of the AI, whether crafting a marketing campaign, solving a business problem, or analyzing customer sentiment. 

Tips for AI Prompt Engineering

AI prompt engineering is a skill you’ll improve over time. The more you experiment with prompts and observe how AI responds to different inputs, the more effective your AI prompting techniques will become. Here are some tips to help you refine your skills. 

Be specific 

The clearer and more detailed your AI prompts are, the better the AI will understand what you want and how to deliver it. Instead of leaving room for guesswork, provide explicit instructions to guide the AI toward the desired outcome. In addition to being specific in your instructions, it’s also important to direct the AI on how to structure the output. Whether you need bullet points, numbered lists, or paragraphs, telling the AI exactly how you want the information presented will save you time and ensure the final product is easy to read and aligned with your expectations.

For example, rather than simply asking for a business report, you could say:

“You are a sales manager of a refrigerator logistics company. I need a report that highlights sales trends, customer feedback, and product performance in bullet points.”

This level of detail ensures that the AI not only understands what you want but also how to format the response in a way that meets your needs.

Pro Tip: If you’ve got a specific style, format, or an example or two in mind, include it in your prompt. This can make a big difference in the quality of the output.

Lastly, for more complex tasks, consider breaking them down into simpler chain of thought prompts. This approach makes it easier for AI to follow along and deliver more accurate results. 

Use constraints 

Without boundaries, AI can produce results that are too broad, unfocused, or just plain unhelpful.

Going back to delegating a task to an intern, you wouldn’t tell them (hopefully!) to go create this sales deck for the upcoming demo with Company XYZ next week with zero context. Instead, you’d provide specific instructions and limitations to ensure the final deck meets your expectations. The same applies to AI.

Constraints help narrow AI’s focus. Without them, you could end up with outputs that are difficult to refine or too complex to be practical. 

Here are a few examples of how you can set effective constraints in your AI prompts:

  • Word Limit: Summarize this article in 150 words.

  • Tone: Write this customer service email reply in a friendly but professional tone.

  • Format: List the key points in bullet form, with each point starting on a new line.

  • Focus: Describe only the benefits of this product, avoiding any mention of its features.

  • Length: Generate a product description that is no more than three sentences long.

Context matters (a lot) 

AI can’t read your mind. It doesn’t know you, what you’re thinking, or what you want. So if you’re not clear, it’s likely to guess wrong. That’s why providing the right context in your prompts is crucial. 

For example, a natural language processing (NLP) model is a machine learning technology that is trained examples of real writing from people. It essentially imitates the patterns it’s seen before, but it can’t anticipate what type of writing you need from it. You might instruct the LLM to write an email letting Customer A know our project is complete, and you might get something that sounds very unprofessional. Unlike a person, it can’t intuit that you would write a business email. You need to clarify that the email should be professional or conversational or instruct the AI to write something short and succinct or long and detailed.

Adding more clarifying details to your prompt makes it more likely to get your desired outcome. However, it still might not get it perfect on the first try, but by refining your prompts and adding more context, you can guide AI to deliver exactly what you need. 

Here are some additional tips to keep in mind:

  • Add personas. Set the scene by telling it who it is in the context of the task. For example, “You’re a social media manager drafting a post for a new product launch.”

  • Specify the task. Be explicit about what you want AI to do. Instead of saying, “Write a summary,” you could say, “Summarize this article for an audience of small business owners.”

  • Include relevant details. The more details you provide, the better. If you’re asking for a product description, you might include details like the target market, key features, and any specific tone or style you want.

AI is powerful, but it’s not a mind reader. The more context you provide, the better it will perform and the more satisfied you’ll be with the results.

Use the temperature parameter 

When using some tools like OpenAI, the temperature parameter controls how predictable or creative the output will be. The temperature parameter essentially controls the randomness in the AI's output.

At lower temperatures, the AI is more conservative, sticking closely to the most likely and predictable responses. This is great when you need consistent, reliable results—like when drafting an email or summarizing straightforward information. For example, setting the temperature to 0.2 might produce a response that’s accurate, focused, and to the point. 

On the other hand, cranking up the temperature allows the AI to take more creative risks. Higher temperatures introduce more randomness, which can lead to innovative, unexpected, and sometimes even surprising outputs. This is perfect when you're brainstorming ideas or when you want the AI to think outside the box. For instance, setting the temperature to 0.8 could result in a more imaginative, varied response but with less predictability.

For example, let’s say you’re using a large language model (LLM) to generate ideas for blog post headlines. At a lower temperature setting of 0.2, it might give you a straightforward title like “Top 5 Tips for Small Business Marketing.” It’s predictable and useful but not particularly exciting. However, if you increase the temperature to 0.8, the same writing prompt might produce something more unexpected and creative, like “How to Turn Your Small Business into a Marketing Powerhouse with These Bold, Unexpected Strategies.” The latter is more engaging but also riskier in terms of relevance.

While OpenAI’s ChatGPT is currently the dominant tool that offers this feature, it's likely that many natural language models and other AI platforms will adopt similar parameters under different names. 

Embracing an iterative process

As you may have guessed by now, the best approach is to not overthink it when writing AI prompts. Crafting the perfect AI prompt isn’t a high-stakes activity, like performing brain surgery where someone could die if you make a mistake. You can (and should) try over again until you get it right. Instead, with AI you can test, iterate, evolve, and refine based on the results you get. The key to successful prompt engineering is experimenting, seeing what AI produces, and then adjusting from there. 

In addition, don’t be surprised if you ask AI the same question five different times and get five different answers—that’s part of its beauty. The variability in responses is intentional and offers you a range of possibilities to explore. By embracing this iterative approach, you can clarify your prompts, experiment with different phrasing, and gradually hone in on the exact output you need.

How AI prompt engineering can help avoid AI bias

AI models learn from human data, and since humans have biases, AI can sometimes reflect those biases in its outputs. This is especially important to consider when generating images, writing profiles, or making decisions based on data analysis. 

What’s most important to understand is AI is only as knowledable as the inputs it was trained on. It can’t make judgment calls or correct for its own assumptions like a person can. That’s why it’s so important to learn how to guide your AI model using prompting to get more accurate and equitable results, whatever your use case. 

But before you can learn how to correct for AI bias, you need to understand how it happens. 

The data used to train a model is what results in AI bias

The data used to train a model is what results in AI bias

Learn about AI models

What is AI bias? 

AI bias is the inaccurate or skewed results machine learning algorithms produce when they are trained on incomplete or prejudiced data. An example could be an image generation AI only reproducing photos that look like commercial models (since that’s all it has seen), or it can have more consequential impacts like rating white patients as a higher priority than Black patients at a hospital because it’s reflecting the historical bias of intake procedures.

Bias in AI occurs because the inputs and data used to train the AI algorithm often reflect human biases—reinforcing them in AI outputs as a result. Or they can simply be a result of training AI on incomplete data sets. 

For example, if a university trains a generative AI model on photos of their students, that AI model would reasonably assume all people looked roughly age 18-25 and produce only AI-generated images of young adults. A human would pick up on that inaccuracy and correct for it, but artifical intelligence only knows what it’s trained on.

This can have real-life consequences when AI is used for important tasks. It can perpetuate discrimination, and it can cause you to produce inaccurate or unhelpful results when you are trying to use AI for particular work.

A recent Amazon AI recruiting tool was scrapped after it was discovered that it was discriminating against female candidates for software development positions. The software was trained by looking at resumes submitted for these roles over the past ten years. However, since they had more male candidates (and more male hires) due to the existing gender divide in tech, the AI learned that a “good candidate” should be male and was outright rejecting any resumes from women.

This is why it’s so important to figure out how to prompt AI in ways that reduce or eliminate the biased datasets that might be reflected in the algorithm.

How to correct for AI bias using prompt engineering

You can reduce the impact of AI bias by compensating for it with careful prompt engineering. You introduce your human judgment into the results by being intentional, specific, and detailed about what you are instructing the AI to do.

For example, if you simply prompt the AI to create ten pictures of software engineers, it is likely to default to showing ten white men, because that’s what it has seen most often in its training data. If you instead say, create ten pictures of software engineers where five of the subjects are women, seven of them are not white, and two are over the age of fifty, you’ll get a much more diverse and inclusive range of images.

To write better prompts and help spot bias, consider these best practices:

  • Encourage AI to “think.” Ask the AI to consider different perspectives or summarize its reasoning before giving an answer. This can help create more balanced and thoughtful outputs.

  • Guide AI in breaking down its reasoning step by step. Guide AI in explaining its thought process step by step. This helps in generating more logical and unbiased results.

  • Ask it to cite its sources. While it might sound odd, most newer AI models can cite their sources and even link you to where they found the information. This way, you can check where the information is coming from and ensure it’s diverse and credible.

  • Be painfully specific. Like in the above example, sometimes you just have to spell it out explicitly. The AI can’t make the same assumptions or corrections as you can, so you may have to input what your idea of diversity or realistic results might look like and instruct the AI to produce exactly that. 

How to engineer AI prompts in Glide

When building your own no code software with Glide, you can extend the power of your apps by adding various forms of AI functionality. AI features can help your users save time and effort and build truly powerful workflows right into your apps. The same principles of prompt engineering apply whether you are using AI to create your apps in the builder, adding Glide AI native capabilities to your apps, or instructing an LLM like OpenAI through a native integration in Glide.

“Everybody's talking about AI, but I think one of the main limiting factors is you can prompt it and receive an output, but how do you actually integrate it into an app? What Glide has done, which nobody else has done yet, is how Glide AI is baked into the product and even into the tables. It is truly game-changing.” - Oscar Brooks, V88

Glide’s native AI features run using "instructions.” Instructions are prompts you use to guide how the AI responds. The instructions field is the perfect place to put your prompt engineering skills to work. While Glide has done some work for you to steer the AI to provide a relevant and helpful response, the more context and direction you can give in the instructions, the better.

Instructions in Glide are a way to seed AI with the personality or context you want it to adopt when generating responses. It is the “how” of the response. This is where you can provide specific directions to shape the output you receive from your automation. By default, Glide AI produces responses that are polite, generic, and concise. However, you can tweak the tone, format, and length and even request specific outputs like bullet points or comma-separated values by adjusting the instructions you give. This makes the AI interaction more intuitive and tailored to your business needs.

In addition to instructions, Glide also uses "inputs," which are the “what” of Glide AI. This refers to the data or text that the AI will consider when generating a response. 

Depending on the feature you’re using, inputs can take many forms—you can start from scratch with a new data table or combine your existing data with Glide AI's capabilities to enhance your outputs. It’s important to note that while the AI models in Glide are primarily built for English, they do have some capabilities in other languages, though accuracy may vary.

In general, it’s best to start with small-scale tests before applying AI to larger datasets or more complex tasks. This cautious approach helps you understand how Glide AI will behave with smaller amounts of data, reducing the risk of significant errors as you scale up. However, as you scale up, you can create more personalized, accurate, and effective automations for your business. 

Putting your AI prompts to work

Once you’ve learned how to effectively prompt your AI to get the results you need, the next trick is identifying where and how to best apply AI. Oscar Brooks of V88 Agency has found a niche, building AI-powered workflows into all of the apps he builds for clients, with the goal of helping them become more efficient with less work.

He finds that AI is best used in streamlining processes, saving time, improving accuracy, and analyzing data. His suggestion is to begin by asking clients; Which parts of your processes do you find frustrating? What doesn’t need to be done by a person? What tasks are largely manual and repetitive? Their answers will point you in the right direction.

“We use AI to take out some of the human elements and replace them with automated processes. You're giving people 10% or more of their time back and they're spending that time doing the things that they're good at. The impact can be massive.” - Oscar Brooks, V88

Whether you’re building AI tools for your own business or working as a Glide Expert and aiming to impress your clients, learning how to apply AI in the right places and prompt it effectively are important skills to develop.

Build an AI feature in minutes

Sign up
Cait Levin

Cait Levin

An educator for over 15 years, Cait leads all aspects of Glide’s educational experience for users, from Glide University to the Glide Docs and everywhere in between. She has worked with learners of all ages across disciplines and mediums. When not thinking about how to help folks use Glide, she reads and writes on her couch in Boston, often with a snack.

Share this article

Glide's mission is to put the power, beauty, and magic of software development into the hands of a billion new creators. Join Us