A Simple Trick to Keep ChatGPT Consistent

Plus a reformatted articles section, an interesting chess image, and more!

Together with

 

 šŸ‘‹ 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

 

 

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.

 

 

Hereā€™s a few different ways I can help you. If youā€™re looking toā€¦

  1. Book a 1-on-1 with me. Reserve a time on my calendar to ask me anything AI-related.

  2. 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!

  3. 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!

Login or Subscribe to participate in polls.

 

ā˜•ļø See you next edition šŸ˜ƒ 

The next edition will be delivered to your inbox on February 19!

Reply

or to participate.