Dan Stroot

Analyze Your Dreams using AI

Hero image for Analyze Your Dreams using AI
2 min read

The big news in 2022 has been the rise of “generative” AI models. Generative AI models generate things: text, code, images, and even music! Today we are going to check out a fun example of the technology that I created to showcase an example of how it could be used.

OpenAI's GPT-3 technology refers to set of models that can understand and generate natural language. In case you are wondering "GPT" stands for “Generative Pre-trained Transformer”. This technology powers the new ChatGPT service offered by OpenAI you may have heard about.

None of the current generative models would have been possible without the Internet. The internet created the technology where humanity could make publicly available millions (billions?) of documents, images, and software code examples. The GPT-3 models are leveraging billions of lines of text that was collected and used to train these general-purpose text generating models. In order to have this technology available in 2022 we also needed to develop sufficiently powerful GPU's, huge storage, and a machine learning framework to develop and train massive models.

The GPT-3 architecture is a standard transformer network (with a few engineering tweaks) with the unprecedented size of 2048-token-long context and 175 billion parameters (requiring 800 GB of storage). It "writes" by predicting tokens, which aproximate words. According to OpenAI this is how the training process works:

ChatGPT Process

What can a model like this do? It writes text that is indistinguishable from a human. Here is a quick video showing the power of the technology using ChatGPT. The prompt I provided is "Generate an upbeat mission statement for a life insurance company". ChatGPT created the following response:

Pretty amazing right?

Here are the latest GPT-3 models as of this writing:

LATEST MODELDESCRIPTIONMAX REQUESTTRAINING DATA
text-davinci-003Most capable GPT-3 model. Can do any task the other models can do, often with higher quality, longer output and better instruction-following. Also supports inserting completions within text.4,000 tokensUp to Jun 2021
text-curie-001Very capable, but faster and lower cost than Davinci.2,048 tokensUp to Oct 2019
text-babbage-001Capable of straightforward tasks, very fast, and lower cost.2,048 tokensUp to Oct 2019
text-ada-001Capable of very simple tasks, usually the fastest model in the GPT-3 series, and lowest cost.2,048 tokensUp to Oct 2019

Let's create a website that will analyze dreams using the most capable model (text-davinci-003) as our AI. Sound fun?

Here's how it works: I give "text-davinci-003" a prompt: "analyze my dream". The model is then given a dream (a text string) entered on a webpage using the OpenAI API. Once the model finishes processing and returns it's generated text I display its response. I used Next.js as the web framework and Vercel for web hosting. I registered the domain "dreamaweso.me" last week and this weekend I built out the site/service. You can try it at DreamAweso.me.

The most incredible aspect of this experiment is that GitHub Copilot helped me write the code, and ChatGPT wrote the disclaimer in the website footer. In other words I used generative AI technology to build a website that uses generative AI technology.

In addition, the testimonials are of course fake people - people generated by AI. The site This Person Does Not Exist uses a GAN (generative adversarial network) called "StyleGAN2" to generate realistic human faces. I used several faces, then I used a random name generator to give the faces realistic names. Finally I used ChatGPT to generate the testimonial text. So the testimonials are 100% computer generated.

Give it a try - it's fun, and I don't save or track anything. Anyone who has experimented with this technology comes away feeling like Aaron Levie, co-founder and CEO of the enterprise cloud company Box:

References

Sharing is Caring

Edit this page