Have you ever tried to describe a picture to your preschooler and have them draw the picture in real time? Did the end result look like what you envisioned?
I’m guessing it did not. Why?
Well, a preschooler only has so much experience in the world to understand core assumptions. Things like spatial dimension, color palettes, relative sizing etc.
You probably used descriptions or prompts to convey the picture which were ambiguous or just unknown to a preschooler.
Prompt Engineering is likely to emerge as a new skillset for professionals in a world of A.I. Think of it like learning the finesse of explaining things to a small child.
Whether it’s a child, or A.I. , without proper prompting, a person may think they’re being clear and precise to convey the directives but the results may turn out useless or worse — destructive.
To help avoid these errors and headaches, learning the best practices of interacting with A.I. will be imperative over the coming years to utilize the tools best.
Tips for Interacting with A.I. systems.
OpenAI has a best practices website giving examples of how to effectively interact with its A.I. model . (PROMPT ENGINEERING). To avoid “tantrums” and “hallucinations” or to just get the results you are looking for they suggest things like:
1. Using the latest model
This should seem obvious. Just like with children, as they get older and experience more things, the more likely their skills and outcomes will be up to standards and expectations.
2. Know when to try zero-shot prompts, few-shot prompts or if fine-tuning is required
Zero-shot prompting would be giving the model a single vague and open ended request then getting an answer back as a final solution.
Examples would be like the above’s preschooler drawing example. No re-dos and not a lot of detail in the request. Just the system taking its best shot at an answer.
Few-shot prompting would be giving the model a task but providing a few examples of the task along with the prompt to help frame the requirements and show success. Iterations are likely as well. Here we might upload pictures of families in front of houses in the pose you want, or of a family made up of the intended group. (Mom/Dad/Baby or Mom/Dad/5 teenagers or Mom/Mom/adopted child etc. etc.)
Finally, fine-tuning is the work of customizing models prior to prompting in order to perform much higher complexity tasks. It’s in fine-tuning open source foundational models that create all the niche specific start up companies we’re now seeing with Narrow AI models for use on specific jobs.
3. Reduce “fluffy” and imprecise descriptions
Using salesmanship hyperbole, idioms, or other literary abstractions to describe your request is just not a strong method of success when interacting with A.I. systems.
A Prompt such as:
“Write me the best vacation blog post you’ve ever heard. Something that will knock my socks off with wit, heart and humor”
may sound like great brainstorming or a cheat code to popularity but the results will likely turn out sounding fake, sappy or sleazy.
4. Be specific, descriptive and as detailed as possible about the desired context, outcome, length, format, style, etc.
Vague Adjectives and ambiguous measurements like “big” ,”small”, “1 Page long”, and others are open to interpretation so being precise in the prompt will reduce the need for revisions and do-overs.
5. Put instructions at the beginning of the prompt and use delimiters like ### or """ to separate the instruction from context & examples
Syntax is important. Like using proper SQL syntax in a database query— learning delimiter techniques and formatting of the prompt into steps (order of instruction, limits on output, requirements vs optional components) makes for debugging easier and enhances the chance an acceptable response.
6. Use “leading words” to nudge the model toward a particular pattern
With Profiles and saved preferences from vendors like OpenAI, the model can learn and personalize its answers to you. Slang, technical jargon and improper phrasings may all be necessary for the intended output but without the model understanding this about the user, they will correct you and create an inferior reply.
We all see this now when SMS Text messages spellcheck makes you look “ducking stupid” at times.
Be positive and results oriented in iterations
Provide positive or negative feedback for the model while iterating through answers. Second and tertiary prompts will often be required to get to a final solution. Instead of just saying what not to do, say what to do instead and say which parts you approved or rejected in the previous iteration.
The last item is simple: Practice.
Playing with the models and taking time to learn the tricks is ultimately the only way forward for success. Find a project, login to a model and start using your new virtual assistant towards the goal!
Interested in being on the Trader Dads Podcast in 2024? Shoot me an email! I’d love to have subscribers on to sit for a discussion
TRADERDADS MAILBAG
Thoughts? Questions? Comments?
Reach out! Maybe I’ll do a full post on the topic or as a Q&A
traderdads@substack.com