![The only frame of reference for every use](https://technicalterrence.com/wp-content/uploads/2024/08/The-only-frame-of-reference-for-every-use.jpg)
Image of ai=excluded&format=search&last_filter=page&last_value=2&page=2&query=scaffolding&selection=1&type=photo#uuid=f8637cdd-5cbb-4e8a-a9bb-381719fa20d1″>freestockcenter on Freepik
With the emergence of large language models, cue engineering has become an essential skill. Simply put, cue engineering refers to the way humans interact with machines. Cue engineering suggests an effective way to communicate the requirement so that machine responses are contextual, relevant, and accurate.
The framework
The prompt engineering framework shared in this article significantly improves your interactions with ai systems. Let’s learn how to create effective prompts by following the six-step framework, including persona, context, and task, and show us how the outcome and tone are expected.
Image by the author
1. Person
Think of a persona as the go-to person or an expert in the area that you would turn to for solving a particular task. The persona is similar, only the expert is now the model you are interacting with. Assigning the persona to the model is equivalent to giving it a role or identity that helps establish the appropriate level of expertise and perspective for the task at hand.
Example: “As an expert in sentiment analysis through customer service conversations…”
The model that is trained on a huge corpus of data is now instructed to leverage the knowledge and insight of a data scientist performing sentiment analysis.
2. Context
Context provides the background information and scope of the task that the model must understand. This understanding of the situation might include facts, filters, or constraints that define the environment in which the model must respond.
Example: “…analyze call logs to understand customer pain points and sentiments based on call details between a customer and an agent”
This context highlights the specific case of call center data analysis. Providing context amounts to an optimization problem: providing too much context can obscure the real goal, while providing too little limits the model’s ability to respond appropriately.
3. Task
The task is the specific action that the model must perform. This is the overall goal of the instruction that the model must achieve. I call it 2C: Clear and Concise, which implies that the model must be able to understand the expectation.
Example: “…analyze the data and learn how to gauge the sentiment of any future conversation.”
4. Show me how
Please note that there is no free lunch. Large language models have been shown to hallucinate, meaning they tend to produce misleading or incorrect results. ai-hallucinations” target=”_blank” rel=”noopener”>Google Cloud He explains: “These errors can be caused by a variety of factors, including insufficient training data, incorrect assumptions made by the model, or biases in the data used to train the model.”
One way to limit this behavior is to ask the model to explain how it arrived at the answer, rather than simply sharing the final answer.
Example: “Provide a brief explanation highlighting the words and reasoning behind the calculated sentiment.”
5. Expected results
In general, we need the output to be in a specific format that is structured in a clear and easy-to-follow manner. Depending on how the user consumes the information, the output could be organized as a list, table, or paragraph.
Example: “Share the answer for the delivery call summary in a 2-point format that includes the customer sentiment and keywords that reflect the sentiment category…”
6. Tone
While specifying tone is often considered optional, doing so helps tailor the language to the intended audience. There are several tones that the model can modify their response to, such as casual, direct, cheerful, etc.
Example: “Use a professional but approachable tone, avoiding overly technical jargon whenever possible.”
Putting it all together
Great, we've covered all six elements of the prompt framework. Now, let's combine them into a single prompt:
“As an expert in sentiment analysis through customer service conversations, analyze call logs to understand customer pain points and sentiments from the call details between a customer and an agent. Analyze the data and learn to calculate sentiment from any future conversation. Provide a brief explanation highlighting the words and reasoning behind the calculated sentiment. Share the answer for the call summary in a 2-point format that includes the customer sentiment and keywords that reflect the sentiment category. Use a professional yet approachable tone, avoiding overly technical jargon whenever possible.”
Benefits of effective incitement
Not only does this framework set the stage for a clear question, but it also adds the necessary context and personality description to tailor the response to the specific situation. Asking the model to show how they arrive at their results adds more depth.
Mastering the art of prompting is an ongoing process that comes with practice. Practicing and honing prompting skills allows us to extract more value from interactions with ai.
It is similar to designing experiments while building machine learning models. I hope this framework gives you a solid structure, but don’t feel limited by it. Use it as a foundation to experiment further and keep tweaking it to your specific needs.
Vidhi Chugh is an ai strategist and digital transformation leader working at the intersection of product, science, and engineering to build scalable machine learning systems. She is an award-winning innovation leader, author, and international speaker. Her mission is to democratize machine learning and break the jargon so everyone can be a part of this transformation.