- Bytes and Brew
- Posts
- A Simple Trick to Keep ChatGPT Consistent
A Simple Trick to Keep ChatGPT Consistent
Plus a reformatted articles section, an interesting chess image, and more!
š Hey there!
Happy Monday!
This edition Iāve got something that may be a bit more applicable to developers, but it may spark some ideas for non-devsā¦
One quick note before we start: if you want to support me as an independent/solo creator, Iāve added a āBuy Me a Coffeeā link above (and here as well). Any support will help offset the cost of this newsletter.
Letās dive into this edition.
Affiliate links are used in this edition of Bytes and Brew. If you choose to purchase the product and/or service with one of these links, it will help support the newsletter with no additional cost to you.
New here? Grab a cup of coffee - weāre talking AI here. This newsletter talks about how you can use AI to create solutions to problems, so if this sounds like your kind of thing, hit that āsubscribeā button below!
Curated links to anything AI related
šŖ Tools
- Create and manage virtual events, sell tickets, and manage your event guests in one simple platform with RSVPify.
- Ad Copy Generator: Create high-converting ad copies like a professional.
- Visualize, analyze, and debug your code with Code to Flow.
š§āš» Coding
- TorNet - a Python Package to work with a benchmark dataset for tornado detection and prediction.
- Top 9 Programming Languages For Artificial Intelligence
š Readings
- Create the perfect ChatGPT prompt - The 3 components
- OpenAI releases āBuilding an early warning system for LLM-aided biological threat creationā
šŗļø Video Tutorials
- Beginners Guide to GPT4 API & ChatGPT 3.5 Turbo API Tutorial
- ChatGPT for Teachers | Beginner's Tutorial
Stay up-to-date with AI.
AI wonāt replace you, but a person using AI might. Thatās why 500,000+ professionals read The Rundownā the free newsletter that keeps you updated on the latest AI news, tools, and tutorials in 5 minutes a day.
Over this past weekend, I was toying around with OpenAIās API to parse through some long-form text that I was too lazy to read.
Since I was writing code, I wanted to make sure that the outputs were consistent between iterations.
I could use these outputs for something else, such as sending data to a database or to be displayed on a web page.
Ā» Speaking of, if youāre a community manager or of the sorts and want to build a webpage for your event, RSVPify is your go-to software! Design, create, and deploy a stunning web page with no code to attract your audience to your event in a matter of minutes. Manage your community, sell event tickets, and much more today!
Language models work extremely well when you tell it to format it a certain way. Take, for example, a prompt to ask how to peel a banana:
How to peel a banana
This is great, but if I were to try and parse this using code, it would be an absolute nightmare.
Plus, I canāt guarantee a consistent output from other language models:
How to peel a banana, according to GPT-4.
Good luck trying to parse this output to get it into a ācommon formatā thatās easy for a computer to work with - thatās a literal nightmare.
I want to introduce the JSON format.
For those who are not familiar with JSON, think of it as a āframeworkā. Itās very commonly used within web applications, where itās a consistent way of saving data.
JSON contains ākeysā (left side of the colon) and āvaluesā (right side of the colon). For example:
{
"key_1" : "value_1",
"key_2" : "value_2",
"key_3" : "value_3"
}
Ā» If you want more reading about the JSON format, check out FreeCodeCampās explanation in plain English.
Iāll take the above, input the information I want from it, and modify my prompt with a relevant example:
How to peel a banana, except with JSON.
And for GPT-4:
How to peel a banana according to GPT-4, except with JSON.
If you were to repeat this using Claude or LLaMa (or any other language model), youāll likely receive the data in the same manner.
Why not to prompt it to use a list?
You absolutely could! My OCD-self is not against lists at all. However, thereās a few caveats to using lists:
Thereās no predefined format. So, the language model that is different may produce an inconsistent format from what you want it to.
The language model may lack some additional contextual information. In fact, it may āforgetā some contextual information as it generates more information.
Itās also a matter of efficiency. Language models can understand structured data much better than unstructured/slightly structured data.
From a programming standpoint, itās something you canāt integrate easily into your application.
Made with DALL-E 3: A Lego Chessboard
Hereās a few different ways I can help you. If youāre looking toā¦
Book a 1-on-1 with me. Reserve a time on my calendar to ask me anything AI-related.
Start a newsletter, I am able to help you get going. Use my link and reach out to me to let me know youāve signed up!
Advertise in Bytes and Brew, I have availability next year. Please visit the advertising page to get in touch.
To get in touch about any of the above, click/tap the button below. This will open the default email interface on your device.
Did you enjoy this edition?Click/tap on your response. Any feedback is super helpful! |
āļø See you next edition š
The next edition will be delivered to your inbox on February 19!
Reply