https://youtu.be/zjkBMFhNj_g

LLMs are trained algorithms that receive text input and predict and generate humanlike text output.

image.png

Large

The term "large" refers to the enormous scale of these models, both in terms of the training data they're trained on and the number of parameters they contain. For example, some models are trained on terabytes of text data and can have billions or even trillions of parameters. These parameters are essentially the numbers that the model learns to adjust during its training to control the output of each neuron and the strength of the connections between them, ultimately allowing the model to make accurate predictions.

Language model

refers to a computer algorithm trained to receive written text (in English or other languages) and produce output also as written text (in the same language or a different one). These are neural networks, a type of ML model which resembles a stylized conception of the human brain, with the final output resulting from the combination of the individual outputs of many simple mathematical functions, called neurons, and their interconnections. If many of these neurons are organized in specific ways, with the right training process and the right training data, this produces a model that is capable of interpreting the meaning of individual words and sentences, which makes it possible to use them for generating plausible, readable, written text.

Let’s say we instruct an LLM to complete the following sentence:

The capital of INDIA is _______.

image.png

The LLM will take that input text and predict the correct output answer as New Delhi. This looks like magic, but it’s not. Under the hood, the LLM estimates the probability of a sequence of word(s) given a previous sequence of words.

How LLMs Understand Language?

LLMs don't read words the way we do. Instead, they break down text into smaller, numerical units called tokens. Think of tokens as the basic building blocks of language for an AI.

What are tokens?

A token can be a whole word, part of a word, a single character, or even a punctuation mark. The goal of a tokenizer the tool that converts text into tokens is to represent common words as a single token. This makes processing more efficient.

image.png

While we see "good morning chai peelo" as four words, an LLM sees a sequence of tokens. For example, a tokenizer might break it down like this:

Why tokens matter?

By using tokens, models can handle a massive vocabulary more efficiently. Common words get their own unique token, while less common or more complex words are broken down into smaller pieces. This allows the model to work with a manageable number of tokens rather than an overwhelming number of unique words. On average, a single token represents about four characters of text in English, or about three-quarters of a word.

The "Brain" Behind the Model: The Transformer