Indy's Weblog
2020 Jul 29

How an AI like GPT-3 would change Software Development

How many languages do you know C3PO?

The recent explosion of auto generated code using GPT-3 made many developers uneasy, including the legendary John Carmack(1). Is this a warranted anxiety? In this post, I try to gather some thoughts on how coding will change due to an advanced AI.

Twitter was abuzz with many coders showing off awesome things they created with GPT-3 as the backend(2). They seem magical, because of the way it was presented:

just tell the computer what you want in natural language, and it just makes it.

Sounds almost like the Replicator from StarTrek universe.

All this surely added up to the fear factor: is coding going to be obsolete? Will the developers be replaced by an AI. Let’s take a look closely.

Programming is the language we communicate with a machine. We tell the computer what to do, with code. When we look back at how computers were programmed in the beginning, at first it was connecting wires together, and then came the punch cards, then the keyboard. Programming languages started as machine code, and then assembly, and then was abstracted by higher order programming languages, libraries, and frameworks, etc.. This gradual improvement enabled us to build ever more sophisticated systems. The reason for the popularisation of programming languages like Python ( which is almost like psuedo code) was because of the better user experience in telling the machine what we want done. Now with GPT-3 and future improvements to it, that language is most probably going to be a lot closer to a structured natural language in the mid-far future.

Interestingly, GPT-3 gives the illusion that the machine knows and understands the problem, and it also knows how to solve it. But this isn't the case. What a language model like GPT-3 had done is to learn associations from natural language, to a massive amount of code samples available online. Solving anything more than a simple Todo app (of which there are many examples(3a) written using web frameworks) or a button list is yet to be seen, and would require considerable logical reasoning.

However, GPT-3 had displayed some amount of reasoning(3b), when the responses were cherry picked. But its level of reasoning is nowhere close to a what is required for software engineering problem solving. Logical reasoning (4)is a frontier that Deep learning is yet conquer, even though this is a research interest of a few.(5a,5b)

Zooming back out, the most difficult thing about programming is specifying a problem fully and accurately, so that it can be implemented. Posing the problem correctly is the hardest part which needs considerable effort before code can be written. When we solve a complicated real world problem, this require addressing many layers of concerns from various stake holders, and many lines of communications to clarify what is actually required. These clarifications need wide understanding of a domain or domains. Most times, this require many rounds of "design, build, evaluate" process. Needing multiple experts from various disciplines to create a software product tells the scale of common sense, reasoning, and understanding required. Even though GPT-3 can generate code, it doesn't understand what the code does, at least currently. Nor does it know if the code is correct. This goes back to its deficiency in logical reasoning. This level of reasoning is the goal of an Artificial General Intelligence. So my guess is that until we have an AGI, this sort of software engineering will predominantly be human driven.

The natural lanuage is vauge, and full of assumptions and abstractions. Some patterns can be captured by a pattern recogniser like GPT-3 would come in handy to build better tools. A low hanging fruit would be to improve Software Development IDEs, so that some inefficiencies of the process of software development can be optimised. This has the potential to simplify tedious programming tasks, and free the developers to focus on more interesting things. After all who wants to create the same layout or the similar functioning app for the millionth time. These are better automated. But, having to repeatedly clarify what you require is a tedius user experience and would fall out of fashion quickly.

For this reason, some level of structure and disambiguation would be required in this new programming language. A long term memory and attention of the conversation would also be needed to keep the coherence of the code generation intact. This is currently a limiting constraint with O(n2) complexity in Transformers like GPT-3.(6a, 6b) Therefore in the near term, my guess is, code generation would be limited to short snippets.

Writing code should be easy. That's why we build ever more sophisticated tools and frameworks, and re-use them to solve a wide variety of problems. In short programming will change, but that is always the case. New things to learn everyday. This will just be another step on the long march to improve and simplify.


[1] "The recent, almost accidental, discovery that GPT-3 can sort of write code does generate a slight shiver"
John Carmack

[2] Currated list of GPT-3 based applications
Aditya Joshi @1adityajoshi

[3a] Same Todo application implemented using MV* concepts in most of the popular JavaScript MV* frameworks of today.

[3b] To what extent is GPT-3 capable of reasoning
Alex Turner, Oregon State University PhD student

[4] Logic and Artificial Intelligence, The Stanford Encyclopedia of Philosophy (Summer 2020 Edition)
Thomason, Richmond, Edward N. Zalta (ed.)

[5a] Bridging Machine Learning and Logical Reasoning by Abductive Learning
Wang-Zhou Dai, Nanjing University, Nanjing 210023, China

[5b] A Neural Network With Logical Reasoning Based on Auxiliary Inputs
Fang Wan (Ningquan Technology Co. Ltd., Shenzhen, China),
Chaoyang Song (Southern University of Science and Technology, Shenzhen, China)

[6a] A Survey of Long-Term Context in Transformers
Madison May

[6b] Breaking the Quadratic Attention Bottleneck in Transformers like GPT-3?

Attibution: Photo by Jens Johnsson on Unsplash