Skip to content

My Two Cents on AI

Posted on:May 14, 2023 at 05:46 PM

Disclaimer:- The opinions expressed in this article are solely my own and represent a personal perspective worth just two cents, not even a dollar. 😉 - While AI has assisted me 🤝  in the writing process, the thoughts and ideas conveyed in this article are entirely my own 🖕🏻.

Table of contents

Open Table of contents

The Impact of AI on Jobs

Do you fear that your job will be taken over by AI? Most probably not, but the uncertainty can be unsettling.

Let’s delve into the subject…

Throughout the history of humankind, there have been numerous groundbreaking innovations such as fire, the wheel, and electricity. Interestingly, Geoffrey Hinton, widely recognized as the godfather of AI, has placed AGI (Artificial General Intelligence) on that very list. (You can watch his interview here)

And this certainly sounds frightening…

Exploring the Capabilities of OPENAI’s API

Let’s explore what OPENAI’s API, specifically the chatGPT, is capable of.

For this task, we will be using the completion API from OPENAI’s API. Here’s the basic setup (reference: link):

Extracting Sentiment and Anger from Text Reviews

Problem: On our e-commerce website, we have multiple text reviews for different products, and we want to extract the customers’ sentiment (‘positive’ or ‘negative’) and determine if there is any expression of anger (‘true’ or ‘false’) towards the product and brand.

// main.ts
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  organization: process.env.ORG_ID,
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);

async function getCompletion(prompt, model = "gpt-3.5-turbo") {
  const messages = [{ role: "user", content: prompt }];

  const response = await openai.createChatCompletion({
    model: model,
    prompt: messages,
  });

  const completion = response.data.choices[0].message;
  return completion;
}

const lampReview = `
  Needed a nice lamp for my bedroom, and this one had \
  additional storage and not too high of a price point. \
  Got it fast. The string to our lamp broke during the \
  transit and the company happily sent over a new one. \
  Came within a few days as well. It was easy to put \
  together. I had a missing part, so I contacted their \
  support and they very quickly got me the missing piece! \
  Lumina seems to me to be a great company that cares \
  about their customers and products!!
`;

const prompt = `
  Identify the following items from the review text: 
    - Sentiment (positive or negative)
    - Is the reviewer expressing anger? (true or false)
    - Item purchased by reviewer
    - Company that made the item

  The review is delimited with triple backticks. \
  Format your response as a JSON object with \
  "Sentiment", "Anger", "Item", and "Brand" as the keys.
  If the information isn't present, use "unknown" \
  as the value.
  Make your response as short as possible.
  Format the Anger value as a boolean.

  Review text: '''${lampReview}'''
`;

(async () => {
  try {
    const response = await getCompletion(prompt);
    console.log(response);
  } catch (error) {
    console.error("Error:", error);
  }
})();
// Output
{
    "Sentiment": "positive",
    "Anger": false,
    "Item": "lamp with additional storage",
    "Brand": "Lumina"
}

This is truly magical, isn’t it? Typically, companies allocate a team of 7-8 engineers, set a budget, and spend 2-4 weeks on such tasks.

Here, we have achieved the same task in just 15-30 minutes. Given a full day or two, we could even add a polished product with UI/UX, making it easily understandable for business personnel as well.

I must admit, I’m truly amazed by the capabilities of this technology. Not only can we extract data from review texts, but we can also leverage the power of OPEN AI models to create finished products.

Reflecting on Self and the Future of Work

Now, this is something truly remarkable, isn’t it? It raises questions about the future and whether your role might become obsolete. Take a moment to reflect:

Who are you?

What have you been working on?

Has your work been making a significant impact?

Let’s set aside our comfortable lives and temporary complacency for just two minutes.

It’s important to approach this with humility, leaving our egos behind. No one knows everything, despite what our ego might tell us.

We’ll wait…

Yes, we’ll wait patiently because we’re not in a rush. But now you need to decide whether your job involves this type of work, the work that AI could potentially do better than you, or if it involves something more significant.

Embracing AI: New Opportunities for Programmers

In my opinion, the demand for frontend engineers will significantly rise as we witness a growing number of AI applications being developed. Some may argue that there will be job cuts (N - M) due to AI, but it’s important to note that there will also be new job opportunities (N + P) arising from the advancements in AI. However, it is worth considering that the overall impact remains unaffected, much like adding or removing drops of water from the sea or making changes to an infinite system.

Additionally, I believe backend development will also see an increase. Inputting information into AI, storing data from AI, and performing actions based on that data will be crucial.

Just as companies expect you to know Git, Docker, Kubernetes, Cloud and other tools, they will soon expect you to understand how to interact with AI APIs. Developing your own AI models may not be feasible for everyone due to the significant resources required in terms of time and money.

So go grab a seat and learn little bit of AI, at least learn to interact with this LLM (Large language mode) with API, learn the what can you build with with LLM, learn to find your answer and save your time and do something significant with it.

And guess what? It’s not as difficult as it may seem. We have adapted to new technologies countless times before:

Think about how effortlessly your child, parents, and grandparents use smartphones nowadays. It’s astonishing to witness the ease with which they adapt to new technologies.

So, instead of fighting against AI, let’s embrace it and adopt its potential. Let’s evolve alongside these technological advancements and explore the incredible opportunities they offer.

AI’s Role in Code Generation and Application Building

On a personal note, I don’t believe AI will be capable of writing 100,000 to 1,000,000 lines of code for an entire product. Why? Because even though many applications may share the same tech stack and architectural patterns, they are unique in their own way. Twitter is for tweeting, Instagram is for sharing images and videos. While the underlying technologies may have similarities, they are tailored to specific purposes, adding uniqueness and differentiation.

I haven’t witnessed AI coding massive applications of 100,000 lines yet. We don’t know if OpenAI, Google’s BARD, or any other LLM possesses the capability to build complete applications. Perhaps there are concerns among AI experts, including the godfather of AI himself, about this aspect.

With OpenAI, you might be able to create a new Twitter-like platform within a few days and with minimal resources, freeing yourself from the madness of Elon Musk. However, these products also require ongoing support and continuous refinement to truly captivate users.

If an AI builds a 100,000-line product, how will developers understand it in a matter of days and make necessary tweaks?

Developer can’t.

When developers switch companies, there is typically a onboarding period to comprehend the product’s development. Gradually, they start by fixing small bugs, and within 3-4 months, they contribute to significant features.

You might argue that AI is smarter and that we can use AI to create a product that teaches itself to developers. They might understand it in 15 days instead of 3 months. But they still need to work on features demanded by users. AI can help reduce development time, but it is still necessary.

The developer still needs to develop a product that will help him understand the inner workings of the main product.

Do you see my point? Perhaps not, as we can sometimes be oblivious and act like monkeys (more about monkeys latter.)

Some may question why create a product that teaches developers about the product and then code on the application. Why not let AI fix the product itself? Hmm… Now, that’s a scary thought. A self-learning, self-healing application. This is precisely why the godfather of AI is concerned—things could go haywire.

And experts don’t dismiss the possibility. We cannot leave this unresolved.

Wait, this sounds a lot like failed ambitions: Creating a machine that generates its own perpetual energy and sustains itself indefinitely (Perpetual motion machine).

Here’s another example: Many companies offer drag-and-drop website builders that work quite well. However, the majority of people still prefer the ground-up approach because it allows for more customization and flexibility to suit their individual preferences.

You can see from the above examples that we, as humans, embrace technological advancements, which is why we have surpassed other animals. Of course, we have our failures like Chernobyl and engage in wars at times. While we may have evolved from monkeys, we are not monkeys anymore. Each individual has their own tastes, desires, and uniqueness, which is both challenging and fascinating. You can’t put every human in the same basket.

The Future Landscape: AI-Driven and Human-Driven Applications

So, in the future, we can expect to see applications that are entirely built using AI, as well as applications that are built with the assistance of AI. Furthermore, there will continue to be applications that are created by humans from the ground up.

The development landscape will be diverse, with a blend of AI-driven and human-driven approaches to building applications.

Adapting to Change: The Key to Programming Success

So, it’s important to embrace the fact that as a programmer, you were considered good because you knew how to use Google to find answers and solutions.

Now, you also need to become proficient as a prompt engineer, utilizing AI APIs to enhance your programming capabilities. While the tools and technologies may change, the core qualities of adaptability and continuous learning remain unchanged.

In a sense, ‘Nothing has changed, and nothing will…’

Change you are looking at is the change we have been anticipating, change is currently unfolding, and change remains an eternal constant.

Previously, Robotics automation was a threat to blue-collar workers, and now AI is a threat to so-called white-collar workers.

Set your course and sail on, the destination will reveal itself in time.

Discuss on