Think back to your school days. You come into class only to discover a timed writing assignment on the agenda. You have to respond to the provided prompt, quickly and accurately and will be graded against criteria like grammar, vocabulary, factual accuracy, and more.
Well, that’s what natural language processing (NLP) software like ChatGPT does daily. Except, when a computer steps into the classroom, it can’t raise its hand to ask questions.
That’s why it’s so important to provide AI with a prompt that’s clear and thorough enough to produce the best possible response.
What is ai prompt engineering?
A prompt can be a question, a phrase, or several paragraphs. The more specific the prompt is, the better the response.
Writing the perfect prompt — prompt engineering — is critical to ensure the NLP response is not only factually correct but crafted exactly as you intended to best deliver information to a specific target audience.
You can’t use low-quality ingredients in the kitchen to produce gourmet cuisine — and you can’t expect AI to, either.
Let’s revisit your old classroom again: did you ever have a teacher provide a prompt where you just weren’t really sure what the question was asking? So, you guessed a response based on the information provided, only to receive a low score.
In the post-exam review, the teacher explained what she was actually looking for and how the question was graded. You sat there thinking, “If I’d only had that information when I was given the prompt!”
Well, AI feels your pain.
The responses that NLP software provides are only as good as the input data. Learning how to communicate with AI to get it to generate desired responses is a science, and you can learn what works best through trial and error to continuously optimize your prompts.
Prompts that fail to deliver, and why.
What’s the root of the issue of prompt engineering gone wrong? It all comes down to incomplete, inconsistent, or incorrect data.
Even the most advanced AI using neural networks and deep learning techniques still needs to be fed the right information in the right way. When there is too little context provided, not enough examples, conflicting information from different sources, or major typos in the prompt, the AI can generate responses that are undesirable or just plain wrong.
How to craft the perfect prompt.
Here are some important factors to take into consideration for successful prompt engineering.
Clear instructions
Provide specific instructions and multiple examples to illustrate precisely what you want the AI to do. Words like “something,” “things,” “kind of,” and “it” (especially when there are multiple subjects within one sentence) can be indicators that your prompt is too vague.
Try to use descriptive nouns that refer to the subject of your sentence and avoid ambiguity.
- Example (ambiguity): “She put the book on the desk; it was blue.”
- What does “it” refer to in this sentence? Is the book blue, or is the desk blue?
Simple language
Use plain language, but avoid shorthand and slang. When in doubt, err on the side of overcommunicating and you can use trial and error to determine what shorthand approaches work for future, similar prompts. Avoid internal company or industry-specific jargon when possible, and be sure to clearly define any terms you may want to integrate.
Quality data
Give examples. Providing a single source of truth — for example, an article you want the AI to respond to questions about — will have a higher probability of returning factually correct responses based on the provided article.
On that note, teach the API how you want it to return responses when it doesn’t know the answer, such as “I don’t know,” “not enough information,” or simply “?”.
Otherwise, the AI may get creative and try to come up with an answer that sounds good but has no basis in reality.
Persona
Develop a persona for your responses. Should the response sound as though it’s being delivered by a subject matter expert or would it be better (legally or otherwise) if the response was written by someone who was only referring to subject matter experts (SMEs)?
- Example (direct from SMEs): “Our team of specialists…”
- Example (referring to SMEs): “Based on recent research by experts in the field…”
Voice, style, and tone
Decide how you want to represent your brand’s voice, which will largely be determined by your target audience. Would your customer be more likely to trust information that sounds like it was provided by an academic, or would a colloquial voice be more relatable?
Do you want a matter-of-fact, encyclopedia-type response, a friendly or supportive empathetic approach, or is your brand’s style more quick-witted and edgy?
With the right prompt, AI can capture all that and more.
Quiq takes prompt engineering out of the equation.
Prompt engineering is no easy task. There are many nuances to language that can trick even the most advanced NLP software.
Not only are incorrect AI responses a pain to identify and troubleshoot, but they can also hurt your business’s reputation if they aren’t caught before your content goes public.
On the other hand, manual tasks that could be automated with NLP waste time and money that could be allocated to higher-priority initiatives.
Quiq uses large language models (LLMs) to continuously optimize AI responses to your company’s unique data. With Quiq’s world-class Conversational AI platform, you can reduce the burden on your support team, lower costs, and boost customer satisfaction.
Contact Quiq today to see how our innovative LLM-built features improve business outcomes.