GPT Forth

I have recently been working with Forth-like languages and come to realize that GPT tokens closely resemble Forth words that can be executed immediately as they appear. This eliminates the need to wait until an entire response is finished, which can take up to a minute to draw the first element on the screen.

GPT3.5 is familiar with quite a few Forth dialects, with ANS Forth serving as a good starting point--I didn't have to train it from scratch. I have taught GPT to understand new words for creating vector images in predefined colors, such as 'line', 'circle', 'rectangle', and a few others.

While the final results may not necessarily be groundbreaking, but it does offer a few benefits. It is more enjoyable to see drawings appear on the screen step by step, and on average, Forth drawings twice as compact as SVGs, which makes them a more viable option when working with GPT4.

A cat drawn with GPT Forth

GPT Forth Instructions:

\ Set canvas size
500 500 canvas

\ Draw head (circle)
250 250 100 circle

\ Draw left ear (circle)
175 200 25 circle

\ Draw right ear (circle)
325 200 25 circle

\ Draw left eye (ellipse)
225 225 15 10 ellipse

\ Draw right eye (ellipse)
275 225 15 10 ellipse

\ Draw nose (triangle)
245 270 10 10 rectangle

\ Draw mouth line
250 285 250 295 line

\ Draw left whiskers
235 280 210 270 line
235 285 210 285 line
235 290 210 300 line

\ Draw right whiskers
265 280 290 270 line
265 285 290 285 line
265 290 290 300 line