Andrej Karpathy is a legendary AI researcher who helped start OpenAI.
He recently gave a talk on how to craft great GPT prompts that almost everyone missed.
I watched the 40 min talk - here's @karpathy's top 5 tips to make AI work better for you:
1/ Let's start by comparing humans to LLMs.
To arrive at the output "California's population is 53x that of Alaska", a human would:
1. Look up the populations on Wikipedia
2. Use a calculator to divide the numbers
3. Do a sanity check and craft a sentence
2/ A LLM, in comparison, thinks only about producing the next token or word.
They don't:
- Have an inner monologue
- Do any sanity checks
They do:
- Have a vast knowledge base
- Have a great working memory
Now that you know this, here are some ways to improve AI's outputs:
3/ Help the LLM succeed
An LLM has no notion of success. You have to make it want to succeed with prompts like:
• "You're an expert in X"
• "Think through this step by step"
• "Make sure you have the right answer"
Here's how the above helps with accuracy:
4/ Be specific and give examples
Imagine that you had to get someone to complete a task well with a single email.
You would:
- Give them context
- Make the goal clear
- Share examples of success
LLMs are the same - you need to give detailed, specific prompts with examples:
5/ Load relevant context into its memory
Providing detailed prompts is tedious.
So save your detailed prompts and load it into the LLM's memory each time you want it to perform a particular task.
6/ Continuing my previous example:
I have a ready made list of tweets that I load into ChatGPT's memory when I want it to help me improve my writing hooks.
7/ Encourage it to ask for more info
Even if you write a detailed prompt, it's hard to guess what the LLM needs.
So include this in your prompt:
"Ask me questions if you need more info."
This will get the LLM to ask you to share relevant context to improve its output.
8/ Use LLMs with other tools
LLMs have flaws. They may:
- Be biased
- Hallucinate false info
- Have knowledge cutoffs
Try different tools like:
- Bing for browsing
- Code interpreter for data
My thread on the latter made it into Andrej's deck:
9/ Here's @karpathy's full talk where he also discusses the state of GPT overall:
Sign up for my newsletter, I'll be sharing the top AI prompts that I return to after 100s of hours with ChatGPT and other LLMs:
creatoreconomy.so
10/ To recap:
1. Help the LLM succeed (e.g., "you're an expert", "step by step")
2. Be specific and give examples
3. Load relevant context into its memory
4. Encourage it to ask for more info
5. Use LLMs with other tools
Follow me @petergyang and RT below if you enjoyed this:
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.