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