Jensen’s Interceptor, Are Coders Redundant?

The NVIDIA CEO Jensen Huang has been on the media rounds over the last month, ramping up the share price and market cap of the company that he steers. Huang has even done an interview with Jim Kramer which, in some circles, may be the strongest signal to short the lot.

One comment that’s garnered a lot of attention is that Jensen has suggested that software engineering isn’t worth studying anymore as AI will do the code generation for us. The Linkedin AI experts, of which there seems a plentiful supply, all had their opinion.

So, is Generative AI the death of coding that NVIDIA’s CEO, Jensen Huang, suggests? [i]

Along with the discussion on CQF December 2023 podcast between Dan Turnbull and Paul Wilmott. The use of artificial intelligence and the creation of programming code in the context of quant finance. What will the impact on the human talent pool of software developers with the advent of this technology?

It’s a matter I’ve kept a close eye on since October 2022, as OpenAI released the GPT4 model to a rather stunned and surprised world, I started to get concerned about my own career of over thirty years in software.

Prompting With CoPilot and ChatGPT

Let’s look at two methods for code creation: OpenAI’s ChatGPT web interface, the second is using Github’s Co-Pilot within Microsoft’s Visual Studio Code (VSCode).

Both mechanisms require a prompt to be entered for the AI model make its prediction.  The key to good output is asking the right kind of questions, “the quality of the question determines the quality of the answer”[ii].

To illustrate, I’m going to take a well documented requirement and see what CoPilot gives as output. I’m going to use Python as my language of choice, a reason I will get on to later. It’s not a quant problem, but I do want to use an example that is well used to give you a clear and predictable example.

'''Create a function that outputs a haversine distance between two points on the earth given their latitude and longitude in decimal degrees.'''

The instruction is simple, create a function for a haversine equation. Once I’ve entered this into the code editor CoPilot is creating the output based on the code it’s been previously trained on. For something like Haversine, there are plenty of examples, therefore the output quality is predictably good.

The result is generated as I started typing in the ‘def’ keyword into the editor. CoPilot suggests the code I should use and all I need to do is agree to accept the prediction with the tab key. I’m impressed but at the same time a little concerned about my future.

Moving to ChatGPT and using the exact same prompt, the output is not what I was expecting.[iii]

Interestingly the model (GPT4 in this instance) didn’t generate any useful code, the reason for which is clear to me, I never asked it to produce anything in a particular language in my original prompt. Adding the desired language to the prompt, Python, GPT then gives me a more useful answer. Our jobs are safe!

It’s also worth pointing out that the code suggested by both generative methods are starkly different, this being down to the way the respective models have been trained. CoPilot is trained on code repositories from services such as GitHub whereas ChatGPT is trained on large text corpus’ some of which include programming language and code. If CoPilot can’t give a meaningful prediction it will rely on code that you have within the development environment.

While it’s helpful for these kinds of generative models to generate code for us, they leave out the more critical areas of software development. First, there are no unit tests, while the code outputs are generated, I still am unsure whether the code works reliably. There’s a high degree of confidence that the code will work, the question is whether output is correct?

This is easily tested with something like my haversine example, when it comes to quant finance the rigors of testing must hold up to closer scrutiny, repeated testing and review.

Our role as developers is to deliver the full solution, not just the code. The tests, the fresh set of eyes, our skill and tacit domain knowledge. Those pushing AI will suggest it’s all possible, that’s marketing, but I’ll take human intelligence and skill over AI in the real world.

Ethics and Vulnerabilities

How do I know I’m not breaking another company’s copyright? This is the part of generative AI that is up for some serious debate. Microsoft, GitHub’s now owner, was subject to a lawsuit in 2022[iv] for training CoPilot on licenced code. Where does that leave us as developers who are generating code? I’ve no idea while generating code of the provenance of the original training corpus. Does this leave me, or the company I’m working for, liable?

Some institutions will never let code or data leave the premises, this gives them the limited options to protect human skills or use trained in-house predictive models.

Emphasis much be placed on software security within the finance industry. Generative AI coding has come under attack from bad actors who are adding incorrect or fictitious package names in code output.[v]  These “hallucinations” can cause untold damage to a business if trojan code is released. The vigilance from developers, testers and QA must be increased to reduce the likelihood of this happening.

It is also vital to review each of the providers terms and conditions to see how code the organisation is creating is protected from being reintroduced to these models for further training and fine tuning. Samsung were caught out by some very simple copy and pasting of information into ChatGPT.[vi]  Samsung eventually banned ChatGPT from being used.

So, What About My Job?

While 2023 was the year of GPT and CoPilot, the mild cooling of 2024 is underway as businesses try to figure out if the effort is worth the payoff. Eyes are also on the number of legal challenges some organisations are making against the model owners. I know a number of companies who are resistant, for now.

The two primary languages that generative AI is trained are Java and Python. For those using things like Matlab, R or C++ then while AI will generate code there’s a lot of reviewing and general checking that needs to happen. For example, I have seen Go code generated where variable names are different during the output of the generated code. The general logic is there though the code will never work.

On AI panels in the past I’ve predicted we’ll see two types of developer: a junior role where the task is to take a specification and, using prompts, generate the basic code for the application. It will then be passed to a senior developer to review, test and decide whether that code will go on to QA for release.

I believe, as software developers, we are in a good place where our careers are concerned. Our skills and domain knowledge outshines the model’s output, especially in the lesser used languages and specialist algorithms are used. We do, however, need to keep a very close eye on the next few years to see how the landscape develops. The media may play up our demise though I think it’s a long way off.

References

[i] https://www.techradar.com/pro/nvidia-ceo-predicts-the-death-of-coding-jensen-huang-says-ai-will-do-the-work-so-kids-dont-need-to-learn

[ii] https://www.dgmlive.com/in-depth/guitar-craft-aphorisms

[iii] https://chat.openai.com/share/f9eba4e5-5d9c-441b-8244-65d4949d9c63

[iv] https://www.theverge.com/2022/11/8/23446821/microsoft-openai-github-copilot-class-action-lawsuit-ai-copyright-violation-training-data

[v] https://vulcan.io/blog/ai-hallucinations-package-risk/

[vi] https://www.forbes.com/sites/siladityaray/2023/05/02/samsung-bans-chatgpt-and-other-chatbots-for-employees-after-sensitive-code-leak/?sh=7f6244ec6078

Bio

Jason Bell is a software developer of over thirty five years. He is also the author of Machine Learning: Hands on for Developers and Technical Professionals – published by Wiley in 2014 and a second edition in 2022.