Lets talk Prompts in Chat GPT4
In the world of AI, a 'prompt' is like a question or command you give to an AI model, similar to how you might ask a question or give a command to a person. This is true for AI models like ChatGPT from OpenAI, which can understand and respond in everyday language, or even computer programming languages.
The success of your interaction with the AI mostly depends on how well you phrase your prompts. Good prompts can guide the AI to give you useful and accurate information. On the other hand, unclear prompts can lead to the AI giving information that's not useful, or even incorrect.
Carefully constructed prompts pave the way for productive conversations addressing desired subjects; conversely, ill-defined prompts not only obstruct the dialogue from being beneficial for the user but could also generate potentially deceptive content. ChatGPT is not without flaws, including a knowledge base cut-off in 2021, and the tendency to 'hallucinate', a common pitfall among generative AI systems.
Basic V Defined Prompts
Let's start at the beginning. You are finding the technical jargon from books difficult to comprehend and you want to understand a technical concept like Convolutional Neural Networks. If you don't know anything about it, you'll want to start with a simple introduction. From there, you can gradually explore more complex aspects of the topic based on the AI's responses. The strategy is to delve deeper into pertinent elements, commencing from the first output.
As you see from above images. The right is your basic prompt. There will be many times you may need to start with the basic question to drill it down to get what you are really searching for. I can write a better more defined prompt to receive a quality response aimed at my needs. As you see by above right image, the change in my request has given an answer that suits the user (me) in a more precise way.
We can do better. This is the genius of ChatGPT. Practise, capture what works, learn from what doesn't and keep leveraging The Ai's learning capabilities.
Zero, One and Few Shot Learning
"Zero-shot learning" is like asking a student to answer a question on a test about a topic they haven't studied specifically, but they have studied other related things. For instance, if the student has learned about addition and subtraction, and then they're asked a question about multiplication (which they haven't learned yet), they might guess that it's about combining numbers because of their prior knowledge.
An example for our AI student, could be asking it to create a story about space travel. It hasn't been directly taught how to write space stories, but it has read many different types of stories and knows about space from other texts.
"One-shot learning" is more like a pop quiz. The student gets one example or lesson about a new topic and then they're asked to use that knowledge to answer questions or solve problems. It's as if a teacher briefly explains a new math concept and immediately asks the student to solve a new type of problem using that concept.
For our AI, an example might be showing it a conversation where someone asks for a pizza delivery and the AI helps place the order. After seeing this example, the AI would then try to help place orders when asked similar things in the future.
In both cases, the AI is trying to make smart guesses or decisions based on what it's learned before.
"Few-shot learning" on the other hand, tries to construct a predictive model using a small number of examples. It is like giving an artist a handful of pictures (usually around 3 to 5) to learn a new painting style. The artist looks at these few pictures and then tries to paint something new in the same style. They're using what they learned from these few pictures and their prior painting experience to create a new piece of art. Continuing our example, we can guide our AI artist by showing it more examples. We can even give it a clear idea of what we want the final artwork to look like, like a template or a sketch.
Let's imagine that you're asking the AI to write in a style reminiscent of early 1800's English literature, say, similar to Jane Austen's writing style. You might give it a few examples to learn from (hence "few-shot learning"). As you see in above image I have condensed it all into one paragraph prompt.
I then sent a prompt to ask chat if it answered correctly and as you can see in above right image there is a sensible and logical disclaimer. Chat is not foolproof, it is not perfect. Use it as a tool to assist you.
Feel free to use below prompts to explore and practise few shot learning.
- Prompt: "Compose a short story set in a futuristic city." Ideal completion: "In the gleaming metropolis of tomorrow, where towering skyscrapers kissed the clouds, a lone detective pursued the enigma of a missing memory chip that held the key to unravelling a web of corporate intrigue."
- Prompt: "Write a dialogue between two characters, one desperately trying to hide a secret." Ideal completion: Character 1: "I implore you, promise me you won't reveal my secret. It could destroy everything." Character 2: "But the truth has a way of surfacing, no matter how deeply buried. Perhaps it's time to face the consequences and find a way forward."
- Prompt: "Here are three books that match your criteria: 'Book A' features a compelling mystery with a brilliant female detective at its core, 'Book B' presents an intricate web of secrets unravelled by a strong-willed protagonist, and 'Book C' explores a thrilling mystery through the eyes of a courageous female investigator. Based on these examples, can you recommend another book that aligns with your preferences?"
Few-shot learning opens up a world of possibilities that are not only more useful than traditional methods but also require a bit of experimentation and patience to discover the most effective prompt designs.
It's important to differentiate few-shot learning from supervised learning and fine-tuning. In few-shot learning, the objective is to train the model using a limited number of examples and enable it to generalize to new tasks based on that limited exposure.
Now that we understand how ChatGPT can learn from examples, in my upcoming blog posts, let's delve into the art of crafting precise prompts to maximize the model's accuracy. We'll explore how to structure prompts that resonate, regardless of technical expertise.