AI that expands its features by writing its own source code

When I finished reading David Shapiro’s “Natural Language Cognitive Architecture”, I got very excited with GPT3 because I finally grasped how powerful a LLM (large language AI model) can be. David’s contributions to the OpenAI community and his youtube videos have helped fuel my interest and desire to experiment with things for myself as well.

After many months of playing with the OpenAI playground, I decided it was time to start building something more serious. I identified 3 goals that would be worth exploring and developing:

  1. an AI agent with proper memory, layers of detail, summarization, etc
  2. the capability of fetching new and updated knowledge from the outside world (using the internet)
  3. give AI the possibility of expanding its features by writing its own source code

I decided to go with number 3 because it sounded to me the most challenging, interesting, and perhaps less explored option.

After about two weeks of trial and error, I managed to get the first working version of my self-expanding AI. It was very limited and error-prone but, it was working as I intended it to. I thought it was pretty cool, so I recorded a short demo video and shared it in a few places to see what people would say about it.

The responses I got in return, no matter if it was on Youtube, Discord, or Reddit, were quite interesting and caught me by surprise. We could split those into two groups: the ones that went “wow, that’s nice” and the others than went “fake. prove it”.

It was surprising to me to experience the disbelief of others because I didn’t really think that what I was showing was that amazing or impossible to achieve.

Not because of those disbelievers, but I decided to record a second video where I did a guided tour of the inner working of my demo, show some code, and even some live interactions with code generation happening in real-time.

Funny enough, the responses I got for this one were far fewer and less interesting. I guess that when you take the mystery and wonder out, and explain how simple it actually is, interest is lost, even though the same features and achievements are still there.

A lesson in human psychology, I guess 🙂

Since then, two and a half months have passed and unfortunately, I have not been finding time to continue developing this idea further. I have a couple of ideas on how this could be improved and expanded, mainly by using Reflection APIs to have the AI analyze its own (pre-existing) code and, potentially, change it as well.

One important aspect that is still missing is error handling and testing. When new code is generated (or edited) the AI should first make sure that it works as intended and that it doesn’t break anything that is already working. Only then the new code should be inserted into the program.

I’d also like to explore more the interaction between the AI and the system where it runs, giving it partial access to some system operations and exploring the possibilities there.

Leave a Reply