Prompt Engineering is Programming

Prompt Engineering is Programming

Prompt engineering is a fairly new word. Before December of 2022 barely anyone knew what it meant. Today most people clearly understands what prompt engineering implies - But is it a new thing? Let's follow that thought down the rabbit hole a bit.

When I started programming at the age of 8 back in 1982 it was the largest kick I had experienced in my life. Here I had this "thing" (the computer) that I could provide instructions to, and if my instructions were clear, it would actually do what I told it to do.

40 years later and I'm arguably back where I started

Prompt Engineering defined

Prompt Engineering is the art of making a large language model return the correct output given some input. You start out with input, you apply some "function", resulting in output. If the output is what you expected, you have created a correct "function". In programming we supply our functions using complex programming languages such as Python, C# and Java. With prompt engineering we supply our "functions" as humanly readable text. Really, that's the only difference.

Fundamentally there exist two distinct different personality types; Technical minds and social minds. Some few of us are able to move into both of these spheres. However, it requires a technical mind to do prompt engineering, the same way it requires a technical mind to create computer programs.

To excel at prompt engineering you need a technical mind

When we create a ChatGPT chatbot what we're really doing is arguably prompt engineering. A lot of this prompt engineering is automated by for instance scraping your website for training data, or by integrating with your Shopify account. However, we consume OpenAI's APIs with system messages and context data. The context data and system messages provides instructions to ChatGPT informing it how to use our data. Our data again is the question asked by users to our chatbots.

If our prompt engineering is good and high quality, ChatGPT will return the correct output. The training data your chatbot is created from, and its system messages, becomes "the function" we apply to transform input to output. Hence, our training data and our system messages becomes the equivalent for ChatGPT as a Python program is to your local computer.

Lessons for the future

We as software developers messed up programming at some point. We "forgot" what computer programming was all about, and we started creating new axioms and idioms making our own jobs much more complex. Examples are OOP, design patterns, and SOLID programming. OOP of course is nothing but the software equivalent of a mass psychosis. Instead of focusing on "the verb" it moves all focus to "the subject". Regardless of what process you've got, there are no "subjects" in it. A process is by the very definition of the term "a verb".

This created mountains of garbage code. I would know, I'm typically the guy they send out to salvage this garbage once its complexity has reached a threshold beyond the point where the average human mind can comprehend it. 41 years of experience as a programmer tends to result in such things.

I probably shouldn't complain too much. After all, it's what makes me "useful", allowing me to live a fairly decent life, with more money than large portions of the world's population, enjoying respect for my skills, being able to ask for more salary than most. I also still enjoy my work, which is weird considering there are literally close to zero human beings alive today with more programming experience than me, since most programmers tends to move into other roles after some 5 to 15 years of coding.

However, there are lessons to be learned here. The primary lesson is keep shit simple! Where we went wrong, was by believing in our own rubbish, being that software development was difficult and complex, and therefor needed abstractions such as OOP, Design Patterns, and SOLID architectural principles to simplify it.

Such ideas were of course nothing but a software development mass psychosis

KISS

KISS, and I don't mean the band here, is an acronym that means "Keep It Stupid Simple". It basically implies making sure you use the simplest possible solution for your problem at hand. At AINIRO we've spent mountains of cognitive energy to ensure our stuff is as simple as possible. Paradoxically, the simpler it becomes, the more cognitive energy have usually been applied at the problem to ensure its simplicity.

Simplicity is HARD

Which probably explains why so many programmers tends to give up the craft after some 5 to 15 years. They simply become tired of trying to simplify other people's garbage complexity after a decade, realizing their jobs are basically no different than the guy washing the toilets in the same office building.

Gene Simmons from KISS

Conclusions ...?

According to science you need to apply 10,000 hours of programming before you're a genius. I'm not sure if I'm a genius, but I've got roughly 97,000 hours of programming behind me. Maybe if you look very hard, you'll find 5 to 10 people alive today on the planet with more hours of coding. I guess I feel responsible for future generations you might argue, so I feel obligated to come up with some sort of conclusion here ...

... and I guess the conclusion is please keep stuff simple. Avoid OOP at any cost, don't believe in Micro Services, it's anyways a cult. NoSQL is "the new rubbish and software development's equivalent of 'get rich fast BitCoin schemes'", and message brokers are "organized madness"!

Please, let's keep "smart" out of prompt engineering, and keep stuff simple!

Even though prompt engineering is programming, don't believe you can learn anything from programmers. Programmers messed up the world to the point where 20,000 software developers at Facebook couldn't even make their app's "Submit" button work on a Thursday ... 🤪

I would know, my phone's Facebook app haven't worked for a month! 😂

And I'm tired of cleaning up other people's mess, so I simply stopped using Facebook from my phone. If you want a single sentence conclusion about how to approach prompt engineering, let me sum it up for you in one sentence.

Once in doubt, ask the programmer what to do - Then do the exact opposite!! 😂

Have a Custom AI Solution

At AINIRO we specialise in delivering custom AI solutions and AI chatbots. If you want to talk to us about how we can help you implement your next custom AI solution, you can reach out to us below.

Thomas Hansen

Thomas Hansen I am the CEO and Founder of AINIRO.IO, Ltd. I am a software developer with more than 25 years of experience. I write about Machine Learning, AI, and how to help organizations adopt said technologies. You can follow me on LinkedIn if you want to read more of what I write.

Published 30. Aug 2023

Integrating ChatGPT with Shopify

During the weekend we successfully integrated our ChatGPT chatbot with Shopify, ingesting products and stock into our chatbot.

Read More

5 Unique Selling Points with our ChatGPT Chatbot

In this article I explain the 5 most important USPs our ChatGPT chatbot have, which are crucial features for any successful AI project.

Read More

The Cost of not Embracing AI

In this article we've created an example use case of two different companies. One company using AI for support and marketing, the other not using AI.

Read More