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.

References

[1] "The recent, almost accidental, discovery that GPT-3 can sort of write code does generate a slight shiver"
John Carmack
https://twitter.com/ID_AA_Carmack/status/1284901555917987847?s=20

[2] Currated list of GPT-3 based applications
Aditya Joshi @1adityajoshi
https://gpt3examples.com/

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

[3b] To what extent is GPT-3 capable of reasoning
Alex Turner, Oregon State University PhD student
https://www.alignmentforum.org/posts/L5JSMZQvkBAx9MD5A/to-what-extent-is-gpt-3-capable-of-reasoning

[4] Logic and Artificial Intelligence, The Stanford Encyclopedia of Philosophy (Summer 2020 Edition)
Thomason, Richmond, Edward N. Zalta (ed.)
https://plato.stanford.edu/entries/logic-ai/

[5a] Bridging Machine Learning and Logical Reasoning by Abductive Learning
Wang-Zhou Dai, Nanjing University, Nanjing 210023, China
https://papers.nips.cc/paper/8548-bridging-machine-learning-and-logical-reasoning-by-abductive-learning.pdf

[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)
https://www.frontiersin.org/articles/10.3389/frobt.2018.00086/full

[6a] A Survey of Long-Term Context in Transformers
Madison May
https://www.pragmatic.ml/a-survey-of-methods-for-incorporating-long-term-context/

[6b] Breaking the Quadratic Attention Bottleneck in Transformers like GPT-3?
Gwern
https://www.reddit.com/r/gwern/comments/hxvyhz/d_breaking_the_quadratic_attention_bottleneck_in/

Attibution: Photo by Jens Johnsson on Unsplash