Prompt Engineering For Humans – ChatGPT
Have you ever interacted with ChatGPT or any other LLM (Large Language Model) and received an unexpected or inaccurate response? Well, you’re not alone. Complaints and concerns are abundant across the internet that LLMs can provide incorrect or even made-up information called “Hallucinations”.
The problem is that LLMs have become so complex, and the neural nets they derive their answers are so opaque that it’s challenging to get the best results from them. The way you phrase your prompt plays a crucial role in the type of response you receive.
Enter the “Prompt Engineer” – the AI industry’s newest specialist role starting at $250k/yr for sometimes only 90 days of experience. Yeah, it’s a thing. The prompt engineer’s primary responsibility is to extract the maximum value from AI models, like ChatGPT. Typically, recruited from people with a “hacker mindset,” the role involves constructing carefully phrased prompts that explain to the AI model precisely what they want and how they want it.
But what techniques can you use in Prompt Engineering? Contrary to what you might imagine, prompt engineering doesn’t involve spending all day shooting riddles at ChatGPT to see if it can solve them.
Prompt engineering is a dynamic process that involves guiding the model on a prompt-by-prompt basis. The processes are sometimes called “x-shot learning” where examples are provided in a prompt. Or you can create a fine-tuned model with specialized learning “prompt-completion pairs” uploaded from a file to train it on a specific task or domain.
ChatGPT works by analyzing large amounts of data, like text from the internet, books, and other sources, to learn about language patterns and human conversation. It doesn’t necessarily require specific prompts, but it does perform much better when you provide more context and specific examples. In fact, the more information you provide, the better ChatGPT can understand what you’re asking and provide an accurate response.
Here are some examples of different types of prompt engineering:
Using a few examples, ChatGPT can quickly learn to generate relevant responses. For example, if you want to train ChatGPT to answer HVAC-related questions, you can provide it with a few sample questions and answers. For instance, you could provide ChatGPT with a prompt such as “What is the best way to improve the efficiency of an HVAC system?” and a corresponding response such as “Regular maintenance and cleaning of the HVAC system components can help improve their efficiency.” With just a few examples like this, ChatGPT can start generating responses to similar HVAC-related questions.
Zero-Shot Chain of Thought (CoT) Prompting:
This technique allows ChatGPT to generate responses to questions or prompts it has never seen before by chaining together multiple prompts or pieces of information. For instance, if you want ChatGPT to answer the question “What is the ideal temperature to set a thermostat in a residential home?” using the CoT method, you could prompt it with a sequence of related facts, such as “Most people feel comfortable at a room temperature between 68 to 72 degrees Fahrenheit. The ideal temperature for sleeping is 60 to 67 degrees Fahrenheit. The temperature in the home should be adjusted based on the season and the number of occupants.” ChatGPT can then use this sequence of prompts to generate a relevant response.
The “genius in the room” mental model:
With this approach, ChatGPT can generate responses similar to how a human expert in the field would answer the question. For example, if you prompt ChatGPT with the question “What are the common causes of HVAC system breakdowns?” it could use its internal model of an HVAC expert to generate a response such as “HVAC system breakdowns can be caused by a number of factors, including dirty filters, faulty thermostats, and refrigerant leaks.”
This technique involves training ChatGPT on specific domains or topics to generate more accurate and relevant responses. For instance, if you want ChatGPT to provide HVAC maintenance advice for residential homes, you can fine-tune its training data by providing it with more HVAC-related data and prompts specific to residential homes. This will help ChatGPT generate more accurate and relevant responses to questions related to residential HVAC maintenance.
To wrap it up
Who am I to be writing a blog about prompt engineering for ChatGPT? Well, the answer is 1. No one really, and 2. I didn’t. I fed ChatGPT a blog I liked about prompt engineering, alongside a blog I wrote, and asked it to replicate my tone, using HVAC-related examples to make the concepts easier to understand. Based on the results, I’d say it speaks for itself… pun intended.
The moral of the story is, this is the new frontier and still very much the wild wild west. Those who not only survive but thrive will be the ones who embraced it and let go of the notion that innovating requires authority + experience. So if you haven’t yet, sign up @ chat.openai.com and start what I call “Take-A-Shot Learning” aka “Fuck Around + Find Out” prompt engineering.
After all, the future belongs to those who can see it.