Ampelofilosofies

homeaboutrss
The mind is like a parachute. If it doesn't open, you're meat.

Adventures in the land of AI

01 Nov 2024

The advent of AI marks a fundamental change to the discipline of software engineering. It is one of those changes that rearranges the way people work and think about that work. So, in the interest of self-preservation I have been spending time with various AI models.

There are two avenues that I am interested in pursuing this, how it affects my coding and how it affects a team.

Delegating coding tasks

Everyone is enthusiastic about how much of a productivity boost tools like GitHub CoPilot bring and all the introductory articles and demos are wild about how easy it is to get to a running application in “seconds”.

Yes…and definitely no. I’ve been conducting a couple of experiments with simple tasks that crop up daily.

My goto question was “how do I ensure the an Azure Pipeline, when triggered, executes only if there is no run of the same pipeline currently active”.

All systems will hallucinate Azure Pipelines YAML syntax that is very believable. Believing them will cost you a couple of hours and some frustration. None of the clarifying prompts used subsequently could convince the system to not hallucinate.

As context: this is a trick question. There is no easy, out-of-the-box supported way to do this in Azure Pipelines.

In one particularly egregious example, ChatGPT kept re-writing the same line of code using all the ways the language had to do string interpolation, without actually changing the answer.

That question was on how to perform WebDAV deletes in Ruby. The code provided used Faraday, but was using custom HTTP requests, which the library does not support.

ChatGPT responded with the same piece of code after every correction prompt, only rewriting one line:

# First answer
response = client.run_request(:propfind, server_url, nil, { 'Depth' => '1' })
## Second answer
response = client.connection.run_request(:propfind, server_url, nil, { 'Depth' => '1' })
## Third answer
response = client.send(:run_request, :propfind, server_url, nil, { 'Depth' => '1' })

I find the above example hilarious. Reminds me of when I catch my son lying, point it out and then watch how he digs himself deeper trying to deny it.

The general observations are:

  • AIs are currently seemingly incapable of saying “I don’t know” or “that is not possible”. This is very important and it is a big flaw when used in a professional context, specifically while programming.
  • Prompting is an art and it is the art of properly identifying requirements and being able to phrase them clearly and unambiguously. We are going to have some hilarious misunderstandings.
  • Niche knowledge is far from the AIs reach at the moment. It is an easy way to get them to hallucinate.

I find the first point very dangerous. It makes every answer a suspect that requires cross-examination and verification. Either that or gain a false sense of confidence about how easily some things are achievable.