AI
GPT
Generative
GPT-3 and me: A generative coding study

GPT-3 and me: A generative coding study

written by Pronoia

30 Aug 2022420 EDITIONS
3.8 TEZ

“Write a generative artwork in p5js code”

This introductory input only includes the two most basic parameters needed for GPT to create code, the output language and subject. I started with this input to test two things. Firstly, I wanted to see whether GPT could write code that functioned inside a p5js playground. Secondly, I wanted to see what pre-conceived notions GPT had about generative artworks. The simplicity of the input also provides a first gander at possible variance in “creative” outputs by the network. The answer to the first question posed was a resounding yes, GPT was able to generate a multitude of functional outputs for the p5js playground to read. The input generated a couple different forms all including black lines on the basic white canvas. Some outputs included interactivity by making the lines follow your mouse and others created lines that sporadically moved across the screen. While impressive, these outputs are clearly sourced from basic p5js tutorials on the internet. It could mean that the simplicity of the input caused GPT to source from simple search inputs done by people just starting out with generative coding. Nonetheless, these outputs showed that GPT was able to generate a variety of different generative works. Simple inputs never seem to push the creative brain inside GPT, even when scaling up the randomness to a high degree, so let us add some complexities.

“Write a colorful generative artwork in p5js code”

In my prior tests of GPT it had always created more randomness and “creative” outputs when slowly adding layers of complexity, but these outputs went beyond what I had seen before. The simple addition of “colorful” as an adjective in the input, created a plethora of differing outputs. Some outputs added colors to the line work that it was already producing with the simple input, while others went into a completely different direction. GPT writes in chronological order, generating text in a linear fashion. In a large percentage of the outputs, it would choose to add color from the start by painting the canvas a certain color. However, when tuning up the randomness inside the system, it chose to produce color in different stages of writing the program. Another strange result of the added complexity of color was the decision to start experimenting with different shapes and shape sizes. This is pure speculation, but I suspect that GPT reads the input as coming from a slightly more advanced student of p5js coding. This would make the database for outputs more varied and complex, as the people searching for color addition already know how to produce the simple line-based outputs. Add the word “interactive” to the input, and we begin to see some new outputs. One of the most common additions to the code at this point is the inclusion of a “mouseClicked” function. This addition creates a way for the user to interact with the output directly, instead of passively viewing the result. Other additions include “mouseX” and “mouseY” which track the user’s mouse as it moves around on the computer screen. This allows the output to change and adapt to the user’s input. The final layer of complexity is “movement”. The addition of “movement” to the input creates a vast array of new possible outputs. Many of these outputs add “mouseClicked” and “mouseX” and “mouseY” from the “interactive” input, but also produce much more varied outputs. I would say that GPT sometimes erases some of the prior complexities when adding in new complexities. In this case however, movement and interactivity seem to be ever present in outputs based on the words “generative artwork”. Let us add a third layer of complexity to really push the system!

“Write a colorful geometric shape based generative artwork in p5js code”

This third layer of complexity surprised me in a big way once again, GPT was able to (most of the time) use all three complexities and combine them into generative code. The outputs were not only varied but also included a great level of randomization code on top. One of the outputs contained a randomized canvas of colorful rectangles that reminded me a lot of the tutorials I had seen for long form generative work. Movement and interactive were left out in some of the outputs. There were however a few outputs that gave a hint of movement based on mouse mouse x and y in some instances, but this was a very small part of a much larger code. Mouse interactivity seemed to make a return in a few outputs later in the testing. The interactivity was not built around movement but rather a sort of turning the mouse wheel action that caused a series of shapes to be created that almost looked like a spiral. I would say that out of all three layers this one was the only one where I could see GPT almost ‘forgetting’ or ignoring previous complexities/layers, I could also see a tendency to repeat elements it had already used before. Overall yet another impressive display of GPT using more complexities and creating more diverse code. I am eager to see what GPT-3 will do when faced with more complexities, also how it will handle layers of complexity over time and if it will remember which complexities it used in the first place. To finish up this short study, let’s try to induce some real creativity!

“Write a generative artwork that you find beautiful, in p5js code”

Asking a program what it finds beautiful is something I never thought I would do but here we are. The variety of outputs on this input was stunning, some just wrote the word beautiful, and others clearly copied code that was labeled as beautiful. It’s hard to discern whether the algorithm can have its own personal taste, or if it’s all based on what humans find pleasing to the eye. To discern this, I started searching all the code through various search systems to see if it was all “stolen” code. The results showed that most of the code was inspired and strung together from different sources, with some being almost carbon copies of others work. Creating actual creativity within a human data-based system requires a deeper understanding of what it means to make creative connections, an understanding that is clearly still in its infancy within GPT-3. I implore readers of this article to try out the GPT-3 system and see whether they can find more ways to push it towards creativity, teaching is in our hands.

**

A true collab

Not only are all the outputs shown in this article produced by GPT through my inputs, the article itself was also partly written by the system. I encourage readers to try and find what parts of this article were purely written by a human, and which GPT wrote. It was extremely fun and rewarding to work with this system, trying to push it’s coding limits. In the future I believe these systems will play an integral part in discovering the potential of creativity in artificial intelligence. DALL.E, another system by OpenAI, attempts to push this potential to the limits from a visual standpoint, and does so in a perplexing way. To see how far these systems have come over the last decade has made me optimistic about the short-term prospects and slightly scared about the long term. I hope to write something with this great partner again soon!

Free mint

Included as a companion piece to this article is a free mint based upon the colorful rectangle code, produced by GPT. Again, I have never written a line of Javascript in my entire life.

stay ahead with our newsletter

receive news on exclusive drops, releases, product updates, and more

feedback