So recently Iโve been diving into AI, just like the rest of the world it seems. I decided I want to write about my journey and post some notes based off of things that I learn throughout this journey. So here it goes - Day 1.
I spent about 1 hour at 1.5x playback speed going through the course
The course iโm referring to is ChatGPT Prompt Engineering For Developers. Honestly, not sure why its called โChatGPT Prompt Engineeringโ as we actually just hit the OpenAI APIs, specifically gpt-turbo-3.5. Does that make it ChatGPT? I donโt think so? Anyways, here are some of my notes and learnings.
Notes
Use delimeters to indicate distinct parts of the prompt
```, โโโ, < >, <tag> </tag>, :
Delimeters protect against prompt injection
What is prompt injection?
If a user is allowed to add input into the prompt - can give conflicting instructions in the model.
The model understands that whatever is in the delimiter that needs to be โsummarizedโ or whatever the instruction is
Ask for structured output - โHTML, or JSONโ
Check whether conditions are satisfied, check assumptions required to do the task.
Give the model the ability to check if a condition is satisfied. Fore example, โif no steps provided, say โNo stepsโ. It's kind of like an โELSEโ statement
Few Shot prompting
Provide successful examples of what to perform.
LLMs are capable of zero-shot prompting but its better to give an example
Give the model time to think
provide it a chain of thinking or reasoning so that it doesnโt make up an answer. Such as โdo x first, then do yโ.
Models think kind of like humans and you have to be explicit otherwise itโll โskimโ and hallucinate
Prompts should really never work the first time. Iteration
Consensus
It was definitely a course targeted for beginners but gives you a good overview of the basics in my opinion. Was it worth the time? I think so! Especially at 1.5x. I learned best practices and the correct terminology when thinking about prompts. I feel like you could figure out everything that was taught just by going through different prompt libraries though and finding patterns, if thats your method of learning.
โ๏ธ Ismaen