The most interesting mode of AI: ChatGPT with Code Interpreter*

data scientist working on his laptop

The most powerful AI on the planet has just leveled up. With the ability to solve problems and analyze data, it’s poised to disrupt the field of data science and change the way we do business.

Let me start with something that happened this March that you might have missed, but it’s very important. A new kind of AI was born, one that can do more than just answer questions or generate text and images. It’s called #AutoGPT, and it’s an “AI agent” that can achieve goals that you give it in natural language. How does it do that? By breaking the goal into sub-tasks and using other AI agents in an automatic loop. In other words, we move with AI from prompts to goals! AutoGPT technology is still in its infancy, but it shows the way of where things are going with AI. It’s a glimpse of the future, where AI can perform autonomous tasks and learn from its own experiences.

ChatGPT with the Code Interpreter plugin, which recently became publicly available, is a first small implementation of a mass AutoGPT.

you and me? It means that #ChatGPT can do more than just chat with us. It can also write and run code within the chat interface, thanks to

chatgpt logo

the #CodeInterpreter plugin. (we talked about the importance of the plugins, in our previous article). This plugin allows ChatGPT to translate your problem into code and execute it to solve it 😲. This is not only useful for learning new programming languages, debugging code, testing algorithms, and more, but also a sign of something bigger. It shows that ChatGPT can use its natural language understanding and generation abilities to manipulate the world and perform autonomous tasks.

Before we start with some examples of how it works, let me tell you the steps to use Code Interpreter:

  • You need to be a ChatGPT Plus subscriber, which costs $20/month.
  • Activate Code Interpreter in beta features from your ChatGPT account settings.
  • Select Code Interpreter as a plugin in your chat window:

     Code Interpreter as a plugin

Now let’s see some examples.

Example 1: ChatGPT is a powerful language model, but it has one major weakness: it’s not good at math. This is because math requires a different kind of reasoning than language. Math is about logic and problem-solving, while language is about communication and understanding.

However, with the help of the Code Interpreter plugin, ChatGPT can address its “by design” weakness and write Python code to solve mathematical problems.

visualization of the Mandelbrot
I asked ChatGPT to do something impressive with maths and used Code Interpreter to visualize a fractal, a Mandelbrot set.

Example 2: ChatGPT can now graph public data without any input from you. This means that you can ask it to graph data from public sources, and it will do all the work for you. ChatGPT will fetch the data, load it into its software, and format the chart. This is a major improvement over the previous process, which required you to find the data, load it into excel, and then format the chart.

graph of countries with the biggest population
I asked ChatGPT to prepare a graph of countries with the biggest population

Example 3: Video editing is actually maths, so Code Interpreter can create videos or animated gifs from prompts:

This image is a panoramic shot. Help me turn it into an animated GIF with aspect ratio 3:2, with the image filling the entire video (so the sides are cut off). The video should be centered in the middle of the image. Then, pan the video smoothly (with no sudden jumps) as follows:

Start: Center –> Right –> Center –> Left –> Center: End

Use the imageio library to help you. Save the frames directly to a video file instead of into a list. Use a frame step of 8 pixels. If necessary, crop the edges of the image so that the size of the image is divisible by the frame step.

instructions for Code Interpreter plugin

While this is the animated GIF that it created from a static panoramic picture:

gif created with AI: ChatGPT with Code Interpreter
While this is the animated GIF that it created from a static panoramic picture:

Example 4 (and the most important one): The democratization of data analysis. Code Interpreter is a powerful data science tool that operates at an advanced level. We at Pobuca are impressed by its ability to automate complex quantitative analyses and perform sophisticated data-driven tasks! (by the way, Zemark is one of the first customer engagement agents to use this amazing technology)

Let’s see step by step how it works:

  • First, we upload to ChatGPT with Code Interpreter a sample sales dataset (you can find it here) with 500,000 sales lines that looks like this:

code Interpreter a sample sales dataset

I will upload you a file with 500,000 lines of sales data and I want you to conduct whatever visualizations and descriptive analyses you think will help understand the data.

While this is the respond I got initially:

  • This is the prompt that I started:
instructions for Code Interpreter plugin
  • Then it moves to the visualizations of data

visualization of data

visualization of data

comparison of sales channels

In the end it summarizes the insights!insights summary for chatgpt Code Interpreter

  • Finally, I went deeper and asked Code Interpreter to find patterns in the data and then to see how outliers affected the results and it went extremely well (just a sample picture of a bigger analysis):
Code Interpreter finds patterns in the data

Will Code Interpreter be a disruption?

I believe yes. Code Interpreter is a game-changer. It can revolutionize data science and any other business that needs to analyze information. But Code Interpreter is more than just a handy tool. It is a vision of the future where AI enhances our knowledge and skills, not substitutes them. This means that we can finally work more efficiently and creatively. We can concentrate on the things that we excel at, and let AI handle the rest!

* There’s a clear sign that #Microsoft and #OpenAI are in a close partnership 🙂. Just look at how they name their products! Microsoft is notorious for its bland and boring names, and now OpenAI seems to follow suit. They have the most amazing Generative AI engine in the world, and the best they can come up with is “ChatGPT with GPT-4 or GPT-3.5” and a plugin called Code Interpreter?!?!?! Seriously? 😒