Skip to main content

πŸ—£ I can talk to AI?

In 2022, consumers got to see the true power of AI for the first time. ChatGPT gave users an interface to have conversations with AI.

Everyone is familiar with chat interfaces. They're the software we use to speak with bots. They convincingly simulate the way a human would behave in conversation.

To get the most out of this type of interaction, we need to understand how to speak to an AI system. To start with AI, the best place to start is to understand the idea of prompts, then start working through basic Chat GPT commands, then build from there.

What are Prompts?​

Prompts are the input data we give a model to make predictions. They can come in different formats; like text, image, audio, or video. They're used as a way to provide the model with information or examples it can learn from.

tip

Prompts are how you speak with AI.

Is there a way to make this easier?​

Prompt engineering is theΒ artΒ of communicating with the model, effectively. AI is still a nascent technology, so we need to be very clear and use specific strategies to get consistent answers. Here, you'll learn the basic strategies to get better answers.

tip

Prompt Engineering is about getting the best result for our prompt. The examples that follow are best used with Chat GPT or GPT-3.

Giving Instructions​

The simplest prompting method is just to give instructions. These can be really simple, like What is 1000*1000? Make sure your answer has the correct number of 0s: (AI can struggle with math, so we tell it to add the right number of zeros).

We can get more fancy, with prompts like this

Read the following sales email. Remove any personally identifiable information (PII),
and replace it with the appropriate placeholder. For example, replace the name "John Doe"
with "[NAME]".

Hi Wile E. Coyote,

I'm writing to you because I noticed you recently purchased some ACME dynamite. I'm an account representative with ACME, and I wanted to let you know that we are building a new module we would love to test with you. We've even tested it with Road Runners, which I know fits what you're doing. If you're interested, please let me know.

Thanks,

Road Runner
Phone: 310-828-6098
Email: road.runner@acme.com

When we use Chat GPT, we get this as a response. As you can see, the result is good not great. AI isn't a catch all solution, rather a bridge to get started.

Hi [NAME],

I'm writing to you because I noticed you recently purchased some [PRODUCT NAME]. I'm an account representative with [COMPANY], and I wanted to let you know that we are building a new module we would love to test with you. We've even tested it with [PLACEHOLDER], which I know fits what you're doing. If you're interested, please let me know.

Thanks,

[PLACEHOLDER]
Phone: [PLACEHOLDER]
Email: [PLACEHOLDER]

Role Prompting​

Another technique is to tell the AI to play a specific role. You could start the prompt with "You are a doctor" or "You are a lawyer" and then ask the AI to answer some medical or legal question (Make sure not to rely on AI for medical or legal advice... please).

Input: You are a copywiriting expert. Give me 5 headlines for ACME dynamite. it should emphasize its ability to deal with road runners

Output:
1. "Blast away Road Runners with ACME Dynamite"
2. "Stop Road Runner troubles with ACME Dynamite"
3. "Eliminate Road Runner nuisances with ACME Dynamite"
4. "Get rid of Road Runners for good with ACME Dynamite"
5. "Say goodbye to Road Runner issues with ACME Dynamite"

Standard Prompts​

In the world of Prompt Engineering, prompts with only a question are called "standad" prompts. They can also be asked in Q&A format

What is the capital city of France?

OR in Q&A

Q: What is the biggest city in South Africa?
A:

Few Shot Learning​

Sometimes, when we generate text we have the issue that we need a specific format or type of answer. This is when Few Shot Learning comes into play.

Few shot learning is when we provide a few small examples for the AI to recognize a pattern. We generally consider this to be between 2 and 5 examples within the prompt. The model learns how to solve the given problem.

For Few Shot Learning, you must have prior knowledge about the correct answer you want. As you'll notice in the following examples, we give 2 correct question and answer examples. Then we ask one more question, and it gives us a correct answer.

What is the capital of Spain?
Madrid
What is the capital of Italy?
Rome
What is the capital of Slovenia?

While this example is quite basic, it shows how these prompts work. Below is another example that is a bit more in depth.

tip

Giving the model more context, will improve results