Nikita Modhavadiya Let's Talk
Nikita Modhavadiya
  • Home
  • Projects
  • Blog
  • Contact

What Happens When You Chat With AI?

What Happens When You Chat With AI?
What Happens When You Chat With AI?
  • nikita
    Written by

    nikita

  • Category

    Uncategorized

  • Date

    May 29, 2026

You type a sentence. An answer appears. In between, one of the most complicated things humans have built quietly does its job.

Aarav Patel grew up in Ahmedabad. Two years ago he moved to Bratislava for a software job. He has a week off, €800, and a stubborn craving for Indian food — so he opens ChatGPT and types one sentence.

AARAV’S PROMPT

“Plan a 7-day Europe trip starting from Bratislava with a budget of €800. Include Indian vegetarian food options.”

Half a second later a full seven-day plan is writing itself onto his screen. Nobody wrote that plan before he asked. It existed nowhere on the internet.

Here’s what happened in that half-second.

1. What Is an LLM?

The thing that answered him is an LLM — a Large Language Model. The name is the explanation:

  • Large — trained on a huge slice of the internet, books and conversations.
  • Language — reading and writing human language is its entire job.
  • Model — a giant pattern-learner.

The core idea

An LLM does not look up answers. It predicts them, one small piece at a time, from patterns it learned during training.

Think of your most well-read friend. They haven’t memorised every page — they absorbed how ideas connect. Say “a cheap week out of Bratislava should probably start with…” and they have an instinct for what comes next. That instinct, scaled up and turned into maths, is an LLM.

What it solves. 

For seventy years you had to speak the computer’s language — exact commands, exact formats. Now it speaks yours. And instead of handing you pages someone else already wrote, it writes something new for your exact situation: an itinerary, an email, an explanation, code.

Model Built by You use it as
GPT OpenAI ChatGPT
Claude Anthropic Claude
Gemini Google Gemini, and Google apps
Llama Meta Meta AI, open-source tools
Mistral Mistral AI Le Chat

Worth knowing

ChatGPT is not the model. GPT is the model; ChatGPT is the app around it. The app is the restaurant; the model is the chef.

Where you already use them. Gmail’s suggested replies, autocomplete, support chatbots, phone translation, meeting summaries, code assistants — and Aarav’s holiday.

2. What Happens When You Send a Message?

Typing a prompt. 

A prompt is just your input. Aarav’s works because it carries a duration (7 days), a start (Bratislava), a budget (€800) and a hard constraint (Indian vegetarian). Every one shapes the answer.

Processing your message. 

His sentence flies across the internet to a data centre. Before the model sees it, it’s quietly joined by hidden instructions from the app — “be helpful, be accurate, be safe.” That’s the system prompt. Aarav’s own sentence is the user prompt. Both go in together.

Generating a response.

The model doesn’t write the itinerary and then send it. It predicts one piece, adds it to what it has, predicts the next, and loops until done. Each piece is fired to his screen the instant it’s chosen — which is why the answer types itself. That’s streaming.

Why it isn’t copied from the internet. 

Google is a librarian: it hands you pages other people wrote. An LLM is a chef: it cooks something fresh. Aarav’s exact combination — Bratislava, €800, seven days, Indian vegetarian — may never have been written by anyone. It’s also why asking the same question twice gives two differently-worded answers. A copy would be identical.

3. Why Computers Don't Understand Human Language

The computer never actually saw the word “Bratislava.”

Text vs numbers. 

You read “Include Indian vegetarian food options” and get the meaning instantly. A computer sees symbols. Underneath, it only understands electricity being on or off — 1 and 0. That’s its whole alphabet.

Why everything becomes numbers. 

A neural network does exactly one thing: arithmetic — billions of operations per answer. You cannot multiply the word “vegetarian.” So the words must become numbers first. The world solved this long ago with Unicode: one table where every character gets a number.

Character Number From
A 65 English
€ 8364 Currency symbol
શ 2742 Gujarati
😀 128512 Emoji

Nothing is special to the machine — a Gujarati letter and an emoji are table entries, exactly like “A”. Each number is then stored as switches: 65 becomes 1000001. Once words are numbers, maths can run, and everything that looks like thinking is that maths.

So where do tokens come in?

Going letter by letter is wasteful. Using whole words is impossible — there are millions, plus names and typos the model has never seen. So models use a middle ground: chunks called tokens.

4. Tokenization

What tokens are. 

A token is the smallest chunk a model works with — a word, part of a word, a punctuation mark, a number. Splitting text into them is tokenization, and it’s always step one.

Why it’s needed. 

A vocabulary of ~100,000 reusable pieces can build any word, LEGO-style — including words the model has never seen, like a Gujarati surname or a typo. And chunks like “-ing” carry real meaning; single letters don’t.

Words vs tokens. 

They’re not the same thing. Common words are one token; rarer ones split:

Text Tokens Why
Plan 1 Common word
a 1 The space belongs to the token
-day 1 A common suffix chunk
Europe 1 Seen constantly in training
Bratislava 2 Rarer — splits into Bratisl + ava

Rule of thumb for English: 1 token ≈ ¾ of a word. A 100-word email is roughly 130 tokens. This matters because AI services charge per token — and memory is measured in tokens too.

The Gujarati twist.

English is token-efficient because models trained on mountains of it. Indian languages aren’t so lucky

Word Language Approx. tokens
vegetarian English ~2
शाकाहारी Hindi ~6
શાકાહારી Gujarati ~7

Same meaning, three times the tokens. Aarav’s prompt in Gujarati would cost more and fill the model’s memory faster — not because the model dislikes Gujarati, but because it saw less of it, so it has fewer ready-made pieces.

Try it yourself

Search for the OpenAI Tokenizer or Tiktokenizer, paste in any sentence — English, Gujarati, your own name — and watch it split into coloured tokens. Thirty seconds, and this whole idea clicks.

5. Transformers

What a Transformer is. 

In 2017 a paper titled “Attention Is All You Need” introduced it. It’s the architecture behind essentially every modern LLM — the T in ChatGPT. Its job: work out how all the tokens relate before predicting what comes next.

How it understands language.

Look at “Include Indian vegetarian food options.” To understand “food” you need “vegetarian.” To understand “vegetarian” you need “Indian.” Words only mean things in relation to each other.

Older models read strictly left to right and forgot the start of a long sentence by the end — like reading through a straw. The Transformer’s trick is self-attention: every token looks at every other token at once and decides which ones matter to it.

Picture friends planning the trip. Someone says “vegetarian” and heads turn towards whoever said “Indian” and “food.” Nobody looks at “options.” That’s attention. It’s also how a model knows that in “the suitcase didn’t fit in the car because it was too big,” the word “it” means the suitcase. Nothing in the letters tells you that — only the relationships do.

Why it changed AI. 

Two things. It reads in parallel instead of through a straw, so long requests stop falling apart and training can chew through vast amounts of text fast. And it scales absurdly well — making models bigger made them dramatically smarter, in ways nobody predicted. That’s how we went from autocomplete to holiday planning in a few years.

Why almost every LLM uses one. 

GPT, Claude, Gemini, Llama, Mistral — all Transformers. Different sizes, different training, one blueprint: understand the context, then predict the next token.

6. Two Dials Worth Knowing

The context window is how much the model can hold in mind at once, measured in tokens.

Think of it as the size of its desk. The system prompt, the question, and the answer being written all sit there together. Modern desks are huge — hundreds of thousands of tokens — but never infinite. Refine the trip for an hour and the earliest messages slide off the edge. That’s why AI sometimes “forgets” what you said earlier. (And Gujarati fills that desk faster.)

Temperature controls how boldly it picks. Predicting the next token gives the model a ranked list — after “Day 1: Explore Bratislava’s…” it weighs “Old” (very likely), “castle” (likely), “dragon” (basically never).

Low temperature takes the safe option: sensible, repeatable, slightly boring. High takes chances: creative, surprising, riskier with facts

One warning you shouldn’t skip

Because an LLM generates plausible text rather than verified text, it can confidently invent things. If the itinerary suggests “dinner at Maharaja Palace, near Vienna’s Opera House,” that restaurant may simply not exist — it just sounded like the kind of thing that belongs there. This is a hallucination.

Treat AI like a brilliant, fast, slightly over-confident intern. Great for drafts and ideas. But anything you’ll act on — a restaurant, a visa rule, a price — verify it first.

7. The Complete Picture

Aarav typed a prompt. It was joined by a hidden system prompt and sent to a data centre. It was shattered into tokens, which became numbers. A Transformer used attention to work out how every piece related to every other. Then it predicted the next token — and looped, hundreds of times, with temperature setting how adventurous each pick was and the context window bounding what it could see. Each token was streamed to his screen the moment it was chosen.

Leave A Comment Cancel reply

© Nikita Modhavadiya, All Rights Reserved

Back To Top