
When you ask ChatGPT a question, it may seem like it's thinking like a human. In reality, it uses a powerful AI model trained to understand patterns in language and predict the most likely next token (a word or part of a word). To understand how this works, let's first look at three important terms: ChatGPT, GPT, and LLM.
What is ChatGPT?
ChatGPT is the chat application you are using. It uses a GPT model underneath and adds conversation features.
What is GPT?
GPT (Generative Pre-trained Transformer) is a Transformer-based Large Language Model (LLM) that generates text by predicting the next token based on the previous context.
Let's break down:
Generative - It generates new content such as text, code, or summaries.
Pre-trained - It is first trained on a massive collection of text before being used for specific tasks.
Transformer - It uses the Transformer neural network architecture, which helps it understand relationships between words and context efficiently.
What is LLM?
An LLM (Large Language Model) is a very large AI model trained on huge amounts of data that understands and generates human language by predicting the next token based on the context.
What does LLM stand for?
LLM (Large Language Model
Large - Trained on massive dataset.
Language - Designed to understand and generate human language.
Model - A trained neural network that has learned patterns from data.
What problems LLMs solve?
It automate or assist with tasks that involve language and reasoning, such as:
- Answering questions
- Writing emails, reports, and articles
There are some Popular LLM's we use in our daily life examples include GPT, Llama, Gemini, Claude, and DeepSeek. LLMs are widely used in chatbots, writing assistants, coding tools, education, customer support, and search assistants.
What Happens When You Send a Message to ChatGPT?

1. Typing a prompt - You type a question or request in the chatGPT UI and hit enter.
2. Processing your message - Your message is sent to the server processed by the GPT model. It analyzes the text, understand the context, and prepare to generate a response.
3. Generating a response - The model predicts the next token based on the context. This happens one token at a time until a complete response is formed.
4. Response Delivered - The final response is sent back to chatGPT and displayed in the UI.
ChatGPT does not copy and paste answer from the internet(by default). It generates response based on patterns learned training on enormous amount of text data (no live internet browsing)
Why Computers Don't Understand Human Language
Computers don't understand human language because they only process mathematical probabilities and binary code, not actual meaning. While humans use shared context, emotion, and life experience to easily grasp nuance, machines rely on statistical pattern matching to predict which words should come next.
Computers translate human-readable text and numbers into binary (strings of 0s and 1s) so electrical circuits can process them. Because computer hardware only understands "on" (1) and "off" (0), all data is stored as combinations of these digits
What is token?
A token is the basic unit of text that an LLM processes. Before generating a response, the model breaks your input into tokens, converts those tokens into numerical representations.
Before a sentence can be understood by the model, it must first be broken into smaller pieces called tokens.
So, for LLM we uses tokens. tokens are actually numbers as LLM can not understand the text.
What is Tokenization?
Tokenization is nothing but conversation of Natural language(human language) to numbers or token.

Why tokenization is needed?
Machine learning models (like LLMs, text classifiers, and translators) cannot directly process raw letters or words. Tokenization bridges this gap through two main functions:
1. Structuring - it divides a continuous stream of text into manageable pieces.
2. Numerical Mapping - It translates those pieces into a vocabulary of numerical IDs, allowing models to process language using linear algebra and probability.
Type of Tokenization
1. Word Tokenization - Splits text by word boundaries (e.g., "Machine learning is fun" becomes ["Machine", "learning", "is", "fun"]).
2. Sub-Word Tokenization - Breaks down complex words into smaller, frequently occurring units (e.g., "unhappiness" into ["un", "happi", "ness"]).
3. Character Tokenization - Splits text into individual letters/symbols. It is useful for heavily misspelled data or character-level language modeling.

What is Transformers
Transformers: The Technology Behind Modern LLMs
By now, we've seen how your text is broken into tokens and converted into numbers that a computer can process. But a new question arises:
How does the model understand the relationship between these tokens and generate meaningful responses?
A Transformer is a deep learning architecture introduced by researchers at Google in 2017 in the paper "Attention Is All You Need."
It understands the relationships between tokens using a mechanism called self-attention, allowing it to process language efficiently and generate context-aware responses.
How Does a Transformer Understand Language?
The secret behind the Transformer is a mechanism called Self-Attention.
Self-attention allows every token to determine which other tokens are important for understanding the current context.
Consider the sentence:
"The animal didn't cross the street because it was tired."
When processing the word "it", the Transformer learns that "it" refers to "the animal", not "the street."
Why Almost Every Modern LLM Uses Transformers?
Today's leading language models all rely on the Transformer architecture because it offers several major advantages over older approaches.
one of them is:
Better Context Understanding
Transformers can learn relationships between words that are far apart in a sentence.
For example:
"The book that I bought last week was surprisingly interesting."
Even though "book" and "interesting" are separated by several words, the Transformer can still understand their relationship.
Conclusion
Understanding how ChatGPT works doesn't require a deep background in Artificial Intelligence. At a high level, the process is surprisingly systematic. When you send a prompt, your text is broken into tokens, converted into numerical representations, processed by a Transformer-based Large Language Model (LLM), and used to predict the next token repeatedly until a complete response is generated.
Throughout this article, we explored the building blocks behind this process—from understanding what LLMs are and the problems they solve, to why computers need text converted into numbers, how tokenization works, and why the Transformer architecture became the foundation of modern AI systems.
While we've covered the high-level workflow, there's still much more happening behind the scenes. Concepts like embeddings, self-attention, positional encoding, and next-token prediction are what enable these models to understand context and generate remarkably human-like responses.
I hope this article gave you a solid foundation for understanding how ChatGPT works. The next time you ask ChatGPT a question, you'll know that behind every answer is a fascinating pipeline of tokens, mathematical computations, and Transformer layers working together to generate a response—one token at a time.
0
1
0