Skip to main content

Command Palette

Search for a command to run...

HOW CHATGPT UNDERSTANDS YOUR QUESTIONS ?

Updated
4 min readView as Markdown
HOW CHATGPT UNDERSTANDS YOUR QUESTIONS ?

Have you ever wondered what actually happens after you type a question into ChatGPT?

It feels almost magical. You ask a question in plain English, and within seconds you receive a detailed, human-like response.But here's the interesting part:

ChatGPT doesn't actually understand language the way humans do.

It doesn't read like humans do, it doest not talk in natural language like English, Hindi, etc in fact it converts user text into Numbers and processing those numbers using an advanced neural network called Transformer. It predicts what to come next and then convert those numbers back to Text.

Let's explore this journey step by step.


What is LLM ?

LLM stands for Large Language Models.

Think of LLM as a giant prediction machine, Instead of memorising answers , it learns relations between words sentences, facts, and even programming language.

What Problems Do LLMs Solve?

LLMs can

  1. answer questions

  2. write articles

  3. translate language

  4. write code

  5. summarise documents

  6. give brainstorm ideas

and many more interesting things...

some popular LLMs are :

  1. ChatGPT

  2. Gemini

  3. Claude

  4. Llama

  5. DeepSeek


2. What Happens When You Send a Message to ChatGPT?

When we type a text which is called a "Prompt" into ChatGPT it basically converts our prompt into smaller pieces called tokens . After tokenisation those tokens becomes numbers and then Ai began its processing.

After this the transformer comes in action it basically examines your prompt , previous conversations, context and many other criteria based on this it predicts the next token based on everything it has learned .

This prediction becomes repeatedly . one token become one sentence , one sentence to one paragraph and then to whole response.

Why Isn't ChatGPT Copying From the Internet?

During training this models learned statistical patterns from massive datasets, so when a user asking a question to this LLMs they don't directly copy paste from internet instead they uses their own data on which they are being trained on and then predict the next tokens .


3. Why Computers Don't Understand Human Language

Human can talk in natural languages like English, Hindi, Gujarati , etc unlike Humans ,computer can only understand Numbers.

Text vs Numbers

When we write "Hello" as a human we can understand this in English language but Computer translate this Text into Number like [15690] and then process it based on data on which it trained.

Why Everything Must Become Numbers

Once everything becomes numbers, neural networks can perform mathematical operations on them. Neural networks are giant functions which perform mathematical operations .

Those mathematical operations can be operated on numbers only so LLM must have to translate a text into numbers.


4. Tokenization

Tokenisation is the process into which the Llm models first break down a text into small pieces which is called tokens. A token is a small word or a piece of word or maybe a letter , a number, a symbol, an emoji or a small space in words.

Why Tokenization is needed ?

without tokenization it would be impossible for AI to learn everything at once it consumes a lot of effort and time, instead of that LLM breaks those words into small pieces and then create tokens and when next time when user ask something , this LLM can modify their output based on previous tokens .

Those token can combine to create millions of different sentences. Tokenization makes language manageable.


5. Transformers

In 2017 researchers introduce revolutionary architecture called Transformer.

What Is a Transformer?

A transformer is a neural network architecture specially designed for understanding relationships between tokens .

instead of reading words one by one , transformer examine many tokens simultaneously and predicts the next tokens

Why Did Transformers Change AI?

Earlier models struggled with long sentence, they often forgot information that occurred much earlier in text. Transformer solved this problem using mechanism called Attention. Attention lets the model decide which earlier words matter most for understanding the current word.

How Does a Transformer Understand Language?

Through Attention mechanism they understand relations between all tokens in the sentence to determine the most likely meaning.

Why Almost Every Modern LLM Uses Transformers

Transfomer provide many advantages like:

  • Understand long text better

  • scale efficiently to billion parameters

  • train faster using parallel computation

  • generalize across many different tasks.