Prompting for LLM’s
I’m nowhere near an expert at prompt engineering or LLM’s. But, I’ve spent the past few months learning and understanding how LLM’s like ChatGPT can increase your efficiency. And just like Google searches, unlocking ChatGPT’s full potential is a skill in of itself.
How ChatGPT Works: The Basics
Before diving into how to prompt ChatGPT, it’s important to have a basic understanding of how it works.
When you provide a prompt (a question or instruction), ChatGPT processes the information and predicts what comes next in the conversation based on patterns it learned during training. It doesn’t have real-world understanding, nor does it have access to real-time data, so it relies on the context and patterns in the input to generate a response.
The key to getting useful responses is in how you craft your prompts. A clear and well-structured prompt helps guide ChatGPT toward more accurate and relevant answers.
TLDR: The 5 General Frameworks to Unlock the Full Potential of ChatGPT
R-T-F (Role, Task, Format): Your are an expert Chef (Role). Design a delicious healthy dinner that includes steak and vegetables. (Task). Start by creating 3 options that I can choose from, then give me a grocery list sorted by department and step-by-step instructions. (Format).
T-A-G (Task, Action, Goal): You’re tasked with evaluating the performance of my son’s report card (Task). Act as my son’s teacher and assess the strengths and weaknesses based on the feedback (Action). Goal is to improve his grades and suggest any areas where he could use extra help in (Goal)
B-A-B (Before, After, Bridge): My son cannot recognize sign language (Before), We want him to be able to understand and communicate with sign language in the next 6 months (After), Develop a detailed plan for teaching my son sign language, include the top 30 signs we should teach him and techniques to make teaching easier (Bridge).
C-A-R-E (Context, Action, Result, Example): My child is entering Kindergarten (Context) Can you help us create a plan to make the transition easier (Action)? Our desired outcome is to transition him from pre-school to Kindergarten seamlessly (Result). A good example of this method is the framework that is explained in the book “The Gardener and the Carpenter" By Alison Gopnik (Example).
R-I-S-E (Role, Input, Steps, Expectation): Imagine that you are a storyteller (Role). I’ve gathered a list of topics that my son is interested in (Input). Provide an outline for a story about the given topic, images that could go with it, then write a first draft of the story (Steps). I expect to publish this book for my son before his birthday in 2 months (Expectation).
————————————————————————————————————————————————
If you’re curious about more detailed information, read on!
The beauty of ChatGPT lies in its flexibility. Whether you need a simple answer, a detailed explanation, or a creative idea, the prompts you give it can shape the responses you get. Here’s how to get started with effective prompting.
1. Be Clear and Specific
The more specific and clear you are in your prompt, the more accurate and useful the response will be. For example, if you're asking for a summary, try being specific about the length or key points you want emphasized.
Vague Prompt: “Explain climate change.”
Better Prompt: “Can you explain climate change in a few sentences, focusing on the role of human activity in global warming?”
Being specific about what you're looking for helps guide the model toward the type of answer you want, whether that’s a high-level overview or a more in-depth response.
2. Use Contextual Information
ChatGPT works best when it has some context. If you’re asking for an answer or advice, include background information that helps the model understand your situation.
Without Context: “How can I improve my health?”
With Context: “I’m a 35-year-old man who works at a desk job, and I’m looking to improve my overall health by incorporating exercise into my daily routine. What steps should I take?”
By providing context, ChatGPT can generate a more tailored response that suits your specific needs.
3. Ask Follow-Up Questions
You’re not limited to a single prompt. Feel free to ask follow-up questions to narrow down your search or dive deeper into a topic. If you get an answer that’s too broad or not what you were expecting, you can refine your prompt to ask for more detail or clarification.
First Prompt: “What is machine learning?”
Follow-Up Prompt: “Can you explain the differences between supervised and unsupervised learning in machine learning?”
This back-and-forth approach will help you extract more relevant and precise information.
4. Experiment with Different Instructions
Sometimes, the wording of a prompt can dramatically change the response you get. Don’t be afraid to experiment with different phrasing. For example, if you want a step-by-step guide or a list of resources, specify that in your prompt.
General Prompt: “Tell me about time management.”
More Effective Prompt: “Can you give me a step-by-step guide for improving time management for someone with a busy work schedule?”
In this case, the latter prompt directs ChatGPT to provide a more structured response that meets your needs.
5. Use ChatGPT’s Ability to Roleplay or Adopt Specific Tones
Another cool feature of ChatGPT is its ability to adopt specific personas, tones, or perspectives. You can tell it to respond in the form of a teacher, a coach, a friend, or even a fictional character. This is helpful if you want ChatGPT to deliver information in a particular style.
Roleplay Prompt: “Can you explain quantum physics as if you were a high school teacher?”
Tone Prompt: “Please explain the benefits of meditation in a casual, conversational tone as if you were explaining it to a friend.”
Using these instructions helps personalize the experience, making the responses more engaging and tailored to your preferred style.
6. Leverage ChatGPT’s Creativity
ChatGPT can also help you brainstorm ideas, create stories, or generate content. When using it for creative purposes, don't hesitate to ask for a variety of options or ideas. It can generate lists, write poems, or help develop concepts.
Creative Prompt: “Can you give me five unique podcast ideas for a new fatherhood-themed show?”
Creative Prompt for Writing: “Write a short story about a father and son on a camping trip, focusing on their evolving relationship.”
The more direction you provide in terms of tone, theme, or desired outcome, the more aligned the creative result will be with what you're envisioning.
Common Mistakes to Avoid
As you practice crafting prompts, keep an eye out for these common pitfalls:
Being too vague: A vague prompt often leads to an equally vague response. The more specific you are, the better the result.
Asking overly complex questions: If a question is too complicated, ChatGPT may struggle to provide an accurate answer. Break down complex questions into simpler, smaller prompts.
Ignoring follow-up prompts: If you're not getting the answers you need, refine your prompts or ask follow-up questions. This will help you dig deeper into the topic.
Overloading the prompt: Too much information in one prompt can confuse ChatGPT. Instead, focus on one main idea per prompt.
Conclusion
Mastering the art of prompting on ChatGPT is a skill that takes practice but pays off in big ways. Whether you're asking for a quick answer, a detailed explanation, or creative inspiration, knowing how to craft effective prompts helps you get the most out of this powerful tool. By being clear, specific, and providing context, you can unlock a world of possibilities with ChatGPT, making it a valuable assistant in many aspects of your personal and professional life.
Start experimenting with different prompts today, and see how easy it is to make ChatGPT work for you!