Skip to main content

Understanding Large Language Models (LLMs)

Updated 8 min readMarkdown
Understanding Large Language Models (LLMs)

Artificial Intelligence has become part of our everyday lives. Whether you're asking ChatGPT to explain a concept, using an AI assistant to draft an email, or searching for code suggestions, you're interacting with a Large Language Model (LLM).

But have you ever wondered how these models actually work? What happens when you type a message? Why do they sound so human? And why do computers need to convert words into numbers?

This guide explains these concepts using simple, real-world examples that are easy to understand—even if you're completely new to AI.


What is an LLM?

LLM stands for Large Language Model.

Let's break that down:

  • Large – Trained on an enormous amount of text, including books, articles, websites, research papers, and publicly available content.

  • Language – Designed to understand and generate human language.

  • Model – A machine learning system that learns patterns from data to make predictions.

Think of an LLM as someone who has read millions of books—not memorizing every sentence, but learning how language works, how ideas connect, and how people communicate.

It doesn't "know" everything the way humans do. Instead, it predicts the most appropriate next words based on patterns it has learned.


What Problems Do LLMs Solve?

Language is everywhere. Emails, documents, conversations, customer support, coding, education, and research all involve understanding and generating text.

LLMs help automate these tasks.

They can:

  • Answer questions

  • Summarize long documents

  • Translate between languages

  • Generate code

  • Write emails

  • Create reports

  • Explain difficult concepts

  • Brainstorm ideas

  • Analyze documents

  • Power chatbots

Instead of searching through dozens of web pages, you can ask one question and receive a conversational answer.


Some well-known Large Language Models include:

  • ChatGPT by OpenAI

  • Gemini by Google

  • Claude by Anthropic

  • Llama by Meta

  • Mistral by Mistral AI

Each has different strengths, but they all rely on similar foundational technology.


LLMs in Everyday Life

Many people use LLMs without even realizing it.

Examples include:

  • Writing professional emails

  • Creating social media captions

  • Generating programming code

  • Summarizing meeting notes

  • Customer support chatbots

  • Personalized tutoring

  • Resume improvement

  • Travel planning

  • Document search

As AI becomes more integrated into software, LLMs are becoming the "brain" behind many applications.


What Happens When You Send a Message to ChatGPT?

Let's say you type:

"Plan a two-day trip to Goa under ₹15,000."

Although it feels like you're chatting with another person, a fascinating sequence of events happens behind the scenes.


Step 1: You Type a Prompt

Your question is called a prompt.

A prompt is simply the instruction you give to the AI.

Examples:

  • Explain recursion.

  • Write a birthday message.

  • Summarize this PDF.

  • Fix my Python code.

Everything begins with the prompt.


Step 2: The Message is Processed

The AI doesn't immediately understand your sentence.

Instead, it first breaks your text into smaller pieces called tokens.

It then converts those tokens into numbers that computers can process.


Step 3: The Model Thinks

The model looks at:

  • Your prompt

  • Previous messages in the conversation

  • Relationships between words

  • Patterns learned during training

It predicts what the best next word should be.

Then it predicts the next one.

And the next.

This happens incredibly fast—hundreds of times per second.


Step 4: You Receive the Response

The predicted tokens are converted back into words and displayed as a natural conversation.

That's the answer you read.


Why Isn't ChatGPT Copying from the Internet?

Many people assume ChatGPT searches Google every time you ask something.

It doesn't.

Instead of searching the web for every response, the model generates text based on patterns learned during training.

Imagine a musician.

They don't memorize every song they've ever heard.

Instead, they learn:

  • rhythm

  • melody

  • harmony

  • structure

When asked to compose a new song, they create something original using those learned patterns.

LLMs work similarly.

They generate responses rather than copying text word-for-word.


Why Computers Don't Understand Human Language

Humans naturally understand sentences.

For example:

"Please remind me to drink water every afternoon."

A computer doesn't understand the meaning behind these words.

It only understands numbers.

To a computer, everything is represented as numeric data.

That means text must first be converted into numbers before any processing can happen.


Why Everything Must Become Numbers

Imagine giving directions to someone who only understands GPS coordinates.

You can't simply say:

"Meet me near the coffee shop."

Instead, you'd have to provide exact latitude and longitude.

Similarly, computers need every word represented numerically.

Only then can mathematical operations begin.


What Are Tokens?

A token is a small piece of text.

Depending on the tokenizer, a token might be:

  • one word

  • part of a word

  • punctuation

  • a number

  • even a single character


Example

Sentence:

"Artificial Intelligence is amazing!"

Possible tokens:

Artificial
Intelligence
is
amazing
!

Another example:

unbelievable

might become

un
believ
able

Different models use different tokenization methods.


Why Tokenization is Necessary

Imagine organizing a huge warehouse.

Instead of treating an entire shipment as one giant object, workers separate it into individual boxes.

Each box gets a label.

That makes storage, tracking, and movement much easier.

Tokenization does the same thing for language.

Instead of processing an entire paragraph as one block, the AI processes manageable pieces.


Words vs Tokens

Many beginners think one word always equals one token.

That's not true.

Example:

Sentence:

"AI helps everyone."

Possible tokens:

AI
helps
everyone
.

Now consider:

"internationalization"

This single word may become multiple tokens because it's long and uncommon.

So:

  • One word can become multiple tokens.

  • One token can sometimes represent only part of a word.


What is a Transformer?

The Transformer is the architecture that made modern AI possible.

Before Transformers, language models struggled with long sentences because they processed text sequentially.

Transformers changed this completely.

They can examine all relevant parts of a sentence simultaneously and determine which words influence one another.

This dramatically improved language understanding and generation.


Example: Planning a Group Trip

Imagine six friends are planning a weekend getaway.

The conversation goes like this:

  • Alice suggests Goa.

  • Ben says the budget is ₹12,000.

  • Clara reminds everyone that one friend doesn't like beaches.

  • David proposes a hill station instead.

  • Emma says they only have two days.

  • Frank remembers that trains are sold out.

Before making a final decision, everyone considers the entire conversation—not just the most recent comment.

Similarly, a Transformer looks at the relationships across the whole context, allowing it to generate responses that are coherent and relevant.


Why Transformers Changed AI

Earlier models often forgot information from the beginning of long conversations.

Transformers introduced mechanisms that allow models to focus on the most relevant parts of the input regardless of their position.

This made AI:

  • More accurate

  • Better at reasoning over long text

  • Faster to train

  • More effective at understanding context

Today, nearly every leading LLM is based on the Transformer architecture.


Context Window: The AI's Working Memory

Every LLM has a context window, which is the amount of information it can consider at one time.

Think of it like a whiteboard.

As long as your notes fit on the whiteboard, you can reference them.

Once it's full, older notes need to be erased to make space.

Similarly, if a conversation exceeds the model's context window, earlier parts may no longer influence the response.


Temperature: Why AI Can Be Creative or Precise

Temperature controls how predictable or creative the AI's responses are.

Low Temperature (e.g., 0.2)

Prompt:

"Name a programming language."

Possible response:

Python

The answer is focused and consistent.


High Temperature (e.g., 1.2)

Same prompt:

"Name a programming language."

Possible response:

Python, Rust, Elixir—or if you're feeling adventurous, try building something in Zig!

The response becomes more varied and creative.

Low temperature is ideal for factual tasks, while higher temperatures are useful for brainstorming and creative writing.

Large Language Models may seem like magic, but they're built on a series of understandable concepts: tokenization, numerical representations, Transformer architectures, and next-token prediction. They don't think or reason like humans—instead, they generate responses by identifying patterns learned from vast amounts of text.

No comments yet. Be the first to comment.

More from this blog