Generative AI Foundations

This is my guide on generative AI foundations.

This is my favorite Python book on Amazon, if you are interested in learning Python I highly recommend it

Whether we like it or not, artificial intelligence pervades every aspect of our life, and that makes it very important for us to understand what exactly is artificial intelligence and machine learning. As a technologist or anyone working in any kind of industry, even if you are not directly coding up any of these algorithms or deploying any of these models, it is important that you understand what exactly these terms are and how they can be harnessed for the benefit, for your organization, and for your career. This learning path is for anyone who has a general curiosity about AI and ML, but absolutely no background in any of these technologies.

 

What is Artificial Intelligence

I will start from the basics and walk you through a high level, intuitive understanding of how these algorithms and models work. The objective is by the time you are done you should be able to have meaningful conversations with the data scientists and technologists in your company that are actually working with AI and ML, and it can also be the start of your learning journey towards developing these AIML models in a hands-on manner.

 

Let us start with the very basics, and I will first define the term artificial intelligence. Now the fact of the matter is this is easier said than done because this term has been around since at least the 1950s, and it has applied to such a broad array of algorithmic techniques and models that it is hard to pin down. A layman's definition would be artificial intelligence is an activity devoted to making machines intelligent, and intelligence is that quality that enables an entity to function appropriately and with foresight within its environment.

 

The idea is that you give these machines the capability to behave and make decisions in a way that is appropriate  for the context in which they operate. Now, it is very easy to say artificial intelligence involves mimicking human intelligence, but this would not be entirely right. So, it is hard to define AI perfectly, and this definition of AI has varied over time. But one thing should be clear in your head is that artificial intelligence is its own kind of intelligence, and it is not actually like human intelligence. Now, you might say something like, oh, AI models can see or perceive objects like human beings. Well, they can perceive objects, but it may not be exactly how we perceive objects. We may try to get them to perceive objects like us, but they are their own kind of intelligence. And to complicate this further, over the last 50 or 70 years, the term AI has come to apply to so many different algorithms and techniques.

 

Historically, the term artificial intelligence has often been conflated with machine learning, where machine learning refers to algorithms that learn from data. Now, we will dive into machine learning in a little more detail in just  a bit, but you should know that artificial intelligence is more all-encompassing. Traditionally, AI used to refer to machine learning fields as well as non-machine learning fields such as game theory. Another important detail to keep in mind about artificial intelligence is that it refers to a system as a whole.

 

AI is often powered by a model that enables this intelligence, but AI can be thought of as a term that encompasses the complete system that includes this model. For example, let us say you are interacting with a chatbot such as ChatGPT. The entire system is an example of artificial intelligence, but there is a language model that actually powers the conversation behind the scenes. AI is the system and not just that model.

 

Now I understand that was a long and detailed introduction to artificial intelligence, but it is a nuanced term, and I wanted to ensure that I got across its subtleties. But the term AI in regular everyday use is not as loaded. It serves as a catchall term for applications that perform human-like tasks without any human intervention. And this is a perfectly reasonable way to talk about artificial intelligence in general conversation.

 

Now, people working in AI in a big tech company might refer to artificial intelligence as something very, very specific. Their definition of  AI is likely to be the use of deep learning models that perform tasks that extract meaningful representations from data and use that for prediction. Data scientists, engineers, product managers, project managers, people at big tech companies who are closely involved with working on artificial intelligence, may have a very specific meaning when they say AI.

 

Engineers and data scientists developing these systems may only refer to the model as artificial intelligence and not the system as a whole. In the real world, you are likely to be conversing with people from different fields and different walks of life, when you talk about AI, and it is important that you keep these different perspectives in mind, so you know what AI means in that particular context.

 

Machine Learning

With that discussion of AI under our belt,  let us move on to discussing artificial intelligence and machine learning. Now, these two terms are often used interchangeably, but they actually mean very different things. At this point, you have a good big picture understanding of what AI is all about. It is an umbrella term for computer software that mimics human cognition to perform complex, almost human-like tasks. Anytime you see a machine doing something that is almost human-like, maybe its walking, maybe it is detecting obstacles, maybe it is conversing with you. If it does something that seems almost human-like, you refer to that as artificial intelligence. Artificial intelligence is a very broad term, and artificial intelligence encompasses the field of machine learning. Machine learning is a part or a subfield of artificial intelligence that uses algorithms trained on data to produce models that can perform predictive reasoning.

 

So, machine learning is all about algorithms that can learn from data. You feed in a whole corpus of data to a machine learning algorithm, and once the algorithm has trained on that data, you refer to that as a model. This machine learning model during the training process, has learned generalized patterns that exist in the data, and it can use those patterns for predictions. This is a good intuitive way to distinguish between AI and ML, but I should tell you that out there in the world, there is no standard approach for separating artificial intelligence and machine learning, which is why these two terms are often used together and often used interchangeably.

 

Deep Learning

Now another term you are likely to have encountered in the context of artificial intelligence and machine learning is deep learning. Deep learning is a subset of machine learning. Just like machine learning is a subfield of artificial intelligence, deep learning is one very specific kind of machine learning that uses advanced models built using neural networks to perform some of the most complex tasks in the world of machine learning. Do not be thrown off by the term neural networks. Neural networks refer to one particular architecture of a machine learning model, which uses active learning units called neurons, arranged in layers to actually learn from data. We will be discussing neural networks in more detail later on.

 

The most advanced models today, the ones that surprise you and seem almost magical, are all built using deep learning models, which are a subcategory of machine learning models in general.

 

Now, I had mentioned earlier that the term AI is usually used to refer to the system as a whole, and not just the machine learning model powering the system. So here are some examples of AI that we see here in the real world today. A self-driving car that can navigate traffic and routes on its own. It brings together machine learning models and a bunch of other technologies to make this happen. Another example of AI that is relevant today, is a conversational chatbot that can answer questions and respond to queries. Also, voice assistants such as Alexa or Siri that can respond to voice queries.

 

AI systems bring together a number of different technologies, but at the heart of an artificial intelligence system is machine learning. Machine learning can be thought of as powering artificial intelligence. For example, self-driving cars use computer vision algorithms to recognize stop signs, signals, and other obstacles that come in the way, and then it takes action accordingly. A conversational chatbot has to understand natural language. It has to recognize patterns in your prompts and your queries, and then understand what they mean, and then produce responses. And if you think about voice assistants, they use speech-to-text models to interact with users, in addition, they need to have an understanding of what is said so that they can respond appropriately. This involves natural language processing as well.