No history yet

Introduction to AI Models

Models That Understand Language

At its core, an Artificial Intelligence (AI) model is a program trained to recognize patterns in data. It learns from vast numbers of examples to make predictions or decisions. For instance, a model could learn to identify cats in photos by analyzing thousands of pictures labeled "cat."

Large Language Models (LLMs) are a specific type of AI model, one that focuses on understanding and generating human language. They are the engines behind chatbots and other AI tools that can write emails, summarize articles, and even create code. These models learn the patterns, grammar, structure, and nuances of language by processing enormous amounts of text from the internet, books, and other sources.

Lesson image

Think of it like this: AI is the entire field of creating intelligent machines. Machine Learning is a subfield of AI that uses data to help systems learn without being explicitly programmed. Deep Learning is a type of machine learning that uses complex structures called neural networks. And Generative AI, including LLMs, is a category of deep learning models that can create new content.

The Transformer Architecture

Most of today's powerful LLMs are built on an architecture called the Transformer, introduced in 2017. Before the Transformer, models processed text sequentially, word by word. This made it difficult to keep track of relationships between words that were far apart in a sentence.

The Transformer's breakthrough was a mechanism called self-attention. It allows the model to weigh the importance of different words in the input text simultaneously. When processing a sentence, it can "pay attention" to all the words at once and figure out how they relate to each other, no matter how far apart they are.

For example, in the sentence, "The robot picked up the ball because it was light," the self-attention mechanism helps the model understand that "it" refers to the "ball," not the "robot."

Lesson image

This ability to understand context is what makes Transformers so powerful. They can grasp subtle meanings, grammatical structures, and the intricate connections within language, leading to much more coherent and relevant text generation.

Tokens and Context Windows

AI models don't read text as a string of words. Instead, they break it down into smaller pieces called tokens.

token

noun

A piece of text that an AI model processes. A token can be a whole word, a part of a word, a punctuation mark, or even a space.

The model processes these tokens to predict the next most likely token. The number of tokens a model can consider at one time is determined by its context window. This is like the model's short-term memory.

Everything you provide in a prompt—instructions, examples, and questions—plus the model's own responses, must fit within this window. If a conversation gets too long, the earliest parts will be forgotten as new tokens are added. Understanding this limitation is key to guiding the model effectively, as only the information within the context window can influence its next response.

Now that you understand the basic building blocks of LLMs, let's test your knowledge.

Quiz Questions 1/5

Which statement best describes the relationship between Artificial Intelligence (AI) and Large Language Models (LLMs)?

Quiz Questions 2/5

The Transformer architecture's key innovation, which allows it to weigh the importance of all words in a sentence simultaneously, is called __________.