Blog Logo

9 April 2024

Language Models are Parrots

A beginner's guide to prompt engineering for AI language models.


First, we must learn how to communicate with AI.

ChatGPT is was trained to be very conversational and intelligent. It very much so is intelligent. But, at it’s core, it’s doing something very simple. It’s attempting to predicting the word in the statement you provide.

If you give ChatGPT “Sally sold” it will reply with “seashells by the seashore”. It works like a super intelligent autocomplete for language. That’s why they call them Language Models. These models are typically trained on the text on the internet and that’s what’s it’s using to decide what the next word is.

[image] Language Models are really intelligent parrots.

However, the models today can write stories or answer complex questions that seem way beyond autocomplete. If we turn “Sally sold” into “Where was Sally?” we get a very different type of question. Early versions of the models might have replied with something like: “Where was Sally? … What did Sally wear?“. However, if you ask as models today, you’ll get the correct answer. The leap from autocomplete to complex Q&A is what made these models so impressive. And now we have a room full of pretty advanced models.

[image] Advanced models

However, understanding prompt engineering techniques require you to understand this “autocomplete” behavior fundamental into how the AI communicates.

A prompt is how you ask the AI questions or get it to do work for you. “Work” here is pretty important. Because for us humans, that could mean moving faster at work or creating a machine to make money for you.

How do you use this to help you write prompts?

Provide Examples to Your Prompt

When you provide examples in your prompt, you’re effectively guiding the model on the type of response you’re looking for. This is particularly useful for tasks that have multiple correct answers or formats. By giving examples, you’re narrowing down the context and giving the model a template to follow, which can significantly improve the relevance and quality of the response.

Good Prompt Example: “Can you give me a list of three healthy breakfast options? For instance, oatmeal with fruits, Greek yogurt with honey and nuts, and a smoothie with spinach, banana, and almond milk.”

Bad Prompt Example: “Tell me some healthy breakfasts.” Without examples, this prompt is too vague and could result in a broad range of answers, not all of which may align with the user’s definition of “healthy” or their dietary preferences.

First Person is Better Than Third Person

Using the first person in prompts can create a more direct and engaging interaction. It personalizes the request, making it clearer who the subject of the prompt is and what their needs or questions are. This clarity can lead to responses that are more tailored to the user’s perspective or situation.

Good Prompt Example: “I am working on a digital marketing campaign for an eco-friendly product and need ideas for social media posts. Can you suggest five creative themes or messages that emphasize sustainability?”

Bad Prompt Example: “What are some ideas for marketing eco-friendly products?” This prompt lacks the personalization and specific context that might lead to more generic and less targeted responses.

Breaking Your Big Questions into Chunks

Complex questions or tasks can be overwhelming for both the user and the AI. By breaking down a large request into smaller, more manageable pieces, you can guide the model through your thought process, step by step. This approach not only makes it easier for the model to generate accurate and coherent responses but also helps in managing expectations for each part of the response.

Bad Prompt Example: “Plan a road trip through France for me.” This prompt is too broad and doesn’t provide a clear starting point or specific interests to tailor the trip around, which can result in a generic or unfocused response.

Good Prompt Example: “I’m planning a road trip through France. First, can you suggest the best time of year for such a trip? Next, what are the top five must-visit places in France for nature lovers? Finally, could you provide a simple itinerary that includes these places?”

The tips may vary depending on the model you use and how it’s trained, which we will cover in the next tip. By incorporating these ideas, you can significantly enhance the quality and relevance of the responses you receive from language models.


Headshot of Taron Foxworth

Hi, I'm Fox. I'm a software engineer and educator based in Tulsa, Oklahoma. You can follow me on Twitter, or read more about me on my website.