Generative AI: The Dr Jekyll and Mr Hyde of Software Development

I have been using generative AI for code creation for two years now, more heavily in recent months. I have found it incredible to the point that I am doing programming at a level I would have never thought possible.

I wrote my first program as an undergraduate in 1969 using Fortran. I had just returned to Auburn University after 30 months in France as a missionary for The Church of Jesus Christ of Latter-day Saints. I had already had the introductory course in Aerospace Engineering where programming was taught, so my advisor told me I should take a course in the Chemical Engineering Department. Given that I knew very little of the subject matter from which the programming assignments, it was tough to say the least. I managed to squeak out an A, but not without many hours working on projects.

Fast forward to today: I am currently developing software as a service missionary for the Church. My task is to facilitate the translation of documents from English to 14 other languages. The work requires the processing of Word and PowerPoint documents to submit those to machine translation (Microsoft Translator) in the preparation of multicolumn documents using Word: English appears in one column and the target language in the other.

Translators are then able to review the machine translation without needing either computer-assisted translation (CAT) software or worrying about formatting. CAT tools are very powerful, but require more training and expertise than is available for our volunteer translators.

The bottom line is that I have been able to create some fairly sophisticated software in Visual Basic (VB.net). This language is closer to other programming languages I have used in the past. In addition, it provides much more complete access to the underlying content of Word and PowerPoint documents using the OpenXML library. This library provides very complete access to the the Office Open XML thatis used in Word in PowerPoint.

This combination of tools (Visual Basic, the OpenXML library. and AI tools such as OpenAI’s ChatGPT (the first system I used) and Claude from Anthropic (the system I have found even more useful than ChatGPT for several reasons) happens to be very powerful. Even so, there are problems, many of which I have to chalk up to my not using the tools in the best way possible. They can “hallucinate,” provide incorrect code, and even remove functionality that I had in my code before seeking to add other capabilities or simply improve the code (refactoring).

As I have worked for the past couple of days to return some capability to the software, inadvertenly omitted by one of the systems I use, I came up with what seems to be a great metaphor for describing generative AI (ChatGPT, Claude, etc.) for coding. It occurred to me this morning that it would be great fun to have AI assesss the quality of the metaphor.

To do this, I decided to use a research system LMSYS.org, which “originated from a multi-university collaboration involving UC Berkeley, Stanford, UCSD, CMU, and MBZUAI in 2023.”). The system provides free access to many AI systems, with the only requirement to be to provide feedback on the quality of the results received.

Here is how this exploration of the metaphor came out! (Note: Model A is from Google. I am not sure where Model B “raspberry” is from.)

My query posted on the LMSYS Chatbot Arena: Tell me how Generative AI for coding can be compared to Dr Jekyll and Mr Hyde.

Tell me how Generative AI for coding can be compared to Dr Jekyll and Mr Hyde.

Model A: raspberry

The comparison of Generative AI for coding to Dr. Jekyll and Mr. Hyde from Robert Louis Stevenson’s novella is a compelling analogy that highlights the dual nature of this technology—its potential for great benefit as well as its inherent risks.

The Dr. Jekyll Aspect: Benefits of Generative AI in Coding

Enhanced Productivity:

  • Automation of Repetitive Tasks: Generative AI can automate mundane and repetitive coding tasks, allowing developers to focus on more complex and creative aspects of software development.
  • Speeding Up Development: By generating boilerplate code, suggesting improvements, and even writing entire functions, Generative AI can significantly reduce the time required to develop software.

Improved Code Quality:

  • Error Reduction: AI can help identify and correct coding errors, leading to more robust and reliable software.
  • Best Practices: Generative AI can enforce coding standards and best practices, resulting in cleaner, more maintainable code.

Learning and Education:

  • Assisting Novices: Beginners can learn from the code generated by AI, understanding patterns and best practices.
  • Continuing Education: Experienced developers can stay updated with the latest coding trends and technologies by leveraging AI-generated examples.

Innovation:

  • Inspiration: Generative AI can provide novel solutions and ideas that human developers might not consider, fostering innovation.

Conclusion

Generative AI for coding, much like Dr. Jekyll and Mr. Hyde, presents a dual-edged sword. When used responsibly, it can greatly enhance productivity, improve code quality, and foster innovation. However, it also poses significant risks that must be carefully managed to prevent negative outcomes.

Model B: gemini-1.5-flash-002

The analogy of Generative AI for coding being like Dr. Jekyll and Mr. Hyde is a compelling one, highlighting the dual nature of this technology. Both the fictional character and the AI reflect a powerful duality: immense potential for good juxtaposed with significant risks and unforeseen consequences.

Dr. Jekyll (the good): Benefits of Generative AI

  • Increased Productivity: Just as Jekyll aimed for self-improvement and a better understanding of the human condition, Generative AI aims to improve developer productivity. It can automate repetitive tasks, generate boilerplate code, suggest improvements, and even help debug, freeing up developers to focus on more complex and creative aspects.
  • Accessibility and Democratization: Jekyll’s transformation was, in a way, a quest for knowledge and understanding. Similarly, Generative AI can democratize access to coding. Individuals without extensive programming experience might use it to build basic applications or automate tasks.
  • Innovation and Exploration: Jekyll’s experiments, though ultimately disastrous, were driven by a desire for knowledge. Generative AI can similarly foster innovation. It can help explore new coding paradigms and generate novel solutions to problems.

Mr. Hyde (the bad): Potential Dangers

  • Security Vulnerabilities: Hyde’s violent nature mirrors the potential for Generative AI to produce insecure code. If the AI is trained on flawed or malicious data, it can generate code containing vulnerabilities or security risks.
  • Lack of Transparency: Hyde’s unpredictable actions reflect the “black box” nature of some Generative AI models. It can be difficult to understand why the AI generated a particular piece of code.
  • Bias and Ethical Concerns: Hyde’s inherent wickedness stems from a lack of moral compass. Similarly, Generative AI can perpetuate and amplify biases present in the training data.
  • Job Displacement: Hyde’s destructive actions can be likened to the fear of job displacement among programmers. While AI can augment human capabilities, there’s concern about potential job losses.
  • Over-reliance and Skill Degradation: Over-reliance on Generative AI might lead to a decline in core programming skills if developers become too dependent on it.

In conclusion, Generative AI for coding embodies a powerful duality. The key is to control the “Hyde” within the “Jekyll” – to use the technology responsibly and thoughtfully, ensuring its transformative potential benefits humanity as a whole.

Posted in Generative AI, Large Language Models, Publications | Tagged , , , | Leave a comment

Using xAI’s Grok to Create a Music Player on a Web Page: Chapter 1

I have been experimenting of late with the idea of putting a music player on the Web server I have on our home network. This would give me the ability to easily share a song with a friend or family member, among other functionality. The Web server runs on a Raspberry Pi single board computer configured with Apache and replaces the server I maintained for some years on BlueHost:

Bluehost is a well-established web hosting provider that has been operating since 2003 and is known for its wide range of hosting services, including shared hosting, VPS, dedicated hosting, and specialized WordPress hosting. (via Grok)

Indeed, this new little the server provides this WordPress site on which I am posting this piece right now!

I already have two versions running, Player 1 and Player 2. The first generation player is about as basic of an application one can imagine. It consists of coding in HTML (HyperText Markup Language) and JavaScript, implemented with the help of one of the well-known generative AI systems, i.e. ChatGPT from OpenAI, Claude from Anthropic, or Gemini from Google. I found the second player on GitHub, and it is clearly the product of a lot of work by the developer, Laurens R. Krol, who included his information in the readme.txt for the software. To give credit where credit is due: (Here is Laurens personal Web site, and he is research director at “Zander Labs and scientific coordinator of Project NAFAS.”)

The bottom line is that each of these first two players suffers from a couple of limitations. The first version has no graphic design whatsoever, but hey, that was my first effort where I created something myself with these tools! 😊 Previously, I had “my guys” doing this sort of stuff in the lab at BYU. Now that I am retired, I no longer have any “guys” to do this sort of stuff. Not only that, but those “guys” would of course not have been doing this sort of personal project anyway! Because I have gotten back to programming in the past couple of years, I am excited about doing projects myself. After all I first started programming many years ago, beginning in January 1969 with Fortran.

Anway, back to the discussion of music players. The second player version is definitely an improvement. It has a nice graphical feel to it, but it also has the same serious limitation of the first. In each of those two cases I have to reference each song as an entry on a line of code in the program. This becomes a bit of a problem: there are 3,029 songs presently in my music collection!

Of course, I can access my music collection easily on my phone anywhere. Here at home, I can also use Amazon’s Alexa and the software system My Media for Alexa . When I say “Alexa, ask my media to play songs by the Beatles!” the system will very dutifully comply by connecting to the music player on a Raspberry Pi 3, one of the older single board computers running here. When is ask Alexa to play a French song, it’s a different story. Alexa’s lack of understanding is only sometimes resolved when I pronounce the title with the worst French accent imaginable!

Although my next project does not address that problem, I want to create a new version that mimics Winamp, an early media player for Windows on a PC. Here is how xAI’s Grok describes Winamp:

Winamp was not one of the very first media players on Windows, but it was among the earliest to gain widespread popularity. Before Winamp, there were players like Windows Media Player (which came bundled with Windows), but Winamp’s release in 1997 marked a significant shift due to its focus on MP3 playback at a time when this format was becoming mainstream due to the rise of file sharing.

To make that happen, I have started a discussion on xAI’s Grok. Because this is the first time that I am using that particular generative AI platform for anything substantive, I did not know how to return to previous chats. On the other platforms that I have used most extensively I can easily access previous queries. Not knowing that for Grok, I did know that could easily share a link. Thus, I am creating this post, to include this link, to document that query! 😊

P.S.

I just learned that to access previous chats, I only have to click on the “Chat history” icon that that appears at the upper right-hand corner to the left of the “New Chat” icon:

Posted in Generative AI, Large Language Models | Tagged , , , | Leave a comment

The Hoaxes Continue

Many people are upset that Presient Trump has pardoned the people who have been in jail as a result of the awful demonstrations gone awry on 6 January 2021. Their reasoning is that he supposedly instigated, even encouraged, their actions. Used for justification for this view is this quote that was endlessly repeatedly by the media, “And we fight. We fight like hell. And if you don’t fight like hell, you’re not going to have a country anymore.” It should be clear to the average reader that he said this in the context of political discourse in which “fighting” is used by basically all politicians, everywhere.

With that he also said, “I know that everyone here will soon be marching over to the Capitol building to peacefully and patriotically make your voices heard.” That part was purposely omitted by Trump’s opponents. His entire speech is available here.

The same people who want us to beleve he called for violence on that occasion also want us to believe that Trump referred to neo-nazis and white nationalists as “fine people.” President Joe Biden even cited that supposed statement as his main reason for deciding to run for the Presidency. As the world turns, however, that hoax was even debunked by Snopes.com, a site that is not known for taking up conversative causes.

So, if Trump did not call for violence on January 6, and he did not call neo-nazis “fine people,” what other lies have perhaps been fed to the American people? One Web site, “The American Debunk” has done an excellent job explaining how many hoaxes such as these have been foisted on the world. The site explains how removing context and selective editing make hoaxes such as these possible.

In fact, the site has already documented the latest hoax, which was started just yesterday, the day of the inauguration. Supposedly, Elon Musk gave a nazi salute at the parade at the Capital One Arena, but as the “The American Debunk” points out, Musk touched his heart and gestured to the crowd saying right afterwards, “My heart goes out to you” It would be well worth it to anyone who cares what is going on to take the two minutes to watch the site’s explanation of the framing of this latest hoax:

While on YouTube, it would be well worth another 3 minutes to watch the debunk of the Fine People Hoax. Here is the link to that one:

Posted in Current Events | Leave a comment

WordPress: From the Cloud to Raspberry Pi

I didn’t call it a blog, but I started my first Web site on a NeXT Cube on Thanksgiving Day, 1995. The computer was on loan from the US Air Force Academy, and when a new BYU colleague told me about this important development underway called the World Wide Web (Many thanks, Jesse!), I decided I needed to get involved.

First Web Server

It turned out that the particular computer I happened to have available was the same type of unit used to invent the World Wide Web.

Tim Berners-Lee had used a NeXT Cube for his work at the Center for Nuclear Research (CERN) in Switzerland. For this first Web site I downloaded the necessary software from the CERN FTP site and configured the Unix-based software. Voilà! I was online with my first Web presence! Almost 20 years later I created my first blog using WordPress, pretty much the gold standard for this type of functionality.

Update added in November, 2024:

That WordPress site ran on a “server in the cloud” with Bluehost for 11 years, and here we are in 2024! I recently completed the porting not only of the WordPress blog created on the Bluehost server, but also the content that resided on that NeXT computer all those years ago.

For current system, I am using a Raspberry Pi with 8GB of RAM with a terabyte hard drive, running on my home network with a URL assigned with a free registration with Cloudflare. 

I asked ChatGPT to compare the NexXT with a Raspberry Pi 4:

Raspberry Pi 4 Image and DescriptionThe Raspberry Pi 4 and NeXT Cube illustrate decades of progress. The Pi 4, with up to 8GB RAM, a quad-core 1.5 GHz ARM CPU, and a price under $100, is approximately 50-100 times more powerful than the 1988 NeXT Cube, which had 8MB RAM, a 25 MHz CPU, and cost $6,500—equivalent to about $16,000 today. The Pi’s immense power and affordability sharply contrast with the Cube’s premium cost and limited performance by today’s standards.

Of course, the NeXT had a monitor and a 256 MB magneto-optical drive, a pioneering storage technology for its time, as well as a 40-320 MB hard drive. But still, the comparison after about three decades is mind-boggling.

Posted in Geeky Stuff, Personal | Leave a comment