A story about AI · 01
How Large Language Models Learned to Talk
From a question Alan Turing asked in 1950 to the model on your own computer. A story about words, numbers and making room for ideas.
Published by AI Model Green Zone
Continue reading →Underlined terms open the glossary. Hover or use keyboard focus for a quick explanation.
There is something slightly unsettling about the first good conversation with a machine.
You type a question. The answer arrives almost immediately. It has paragraphs. It remembers what you said three messages ago. It can explain a tax rule, rewrite a love letter, find the bug in a Python program, and, if you ask nicely, invent a bedtime story about a depressed dragon who works in accounting.
The natural reaction is to imagine that somewhere inside the computer there must be a small electronic scholar who has read the Internet and is now rummaging through its memory for the answer.
There isn’t.
What is actually happening is both less magical and, in some ways, much stranger.
A modern Large Language Model, usually shortened to LLM, is an enormous mathematical system trained to recognize patterns in language and predict what is likely to come next. It does this one small piece of text at a time. And from that seemingly modest talent—predicting the next piece—emerges an astonishing collection of abilities: writing, translating, coding, summarizing, answering questions, analyzing documents, and carrying on conversations that can feel remarkably human.
To understand why these machines work, and why they sometimes fail in such spectacularly confident ways, it helps to begin long before ChatGPT, GPUs, or even the modern computer industry.
Before the chatbot, there was a question
In 1950, the British mathematician Alan Turing published a paper with the wonderfully direct title Computing Machinery and Intelligence.
The paper began with a question:
Can machines think?
Turing immediately recognized the problem with that question. Nobody could agree on a precise definition of thinking, and philosophers had been arguing about it for centuries without requiring a power supply.
So Turing proposed something more practical.
Imagine communicating through text with two unseen participants. One is human. The other is a machine. If the machine can converse well enough that you cannot reliably tell which is which, perhaps arguing about whether it truly “thinks” is less useful than observing what it can actually do.
This idea became known as the Turing Test.
Turing did not invent the Large Language Model. He did something more important: he helped move the conversation from What is intelligence? toward What behavior would convince us that intelligence is present?
For decades, the answer remained mostly theoretical.
Computers were very good at arithmetic. Conversation was another matter.
Teaching computers language, one rule at a time
Early language programs were often built by giving the computer rules.
If you see this word, do that. If a sentence has this structure, classify it this way. If the user says something about his mother, perhaps ask how he feels about his mother.
This could produce clever demonstrations, but the approach had a basic problem: human language refuses to behave itself.
We use sarcasm. We omit words. We invent new expressions. We change meaning depending on context. “That’s sick” can describe a medical emergency or an excellent guitar solo.
Writing enough rules to capture ordinary language turned out to be rather like trying to write an instruction manual for having a personality.
By the 1980s and 1990s, researchers increasingly turned toward statistics.
Instead of telling the computer exactly how language works, they could show it enormous quantities of language and let mathematics discover regularities.
One important family of systems was called the n-gram language model.
An n-gram model looks at short sequences of words and asks, in effect:
Given the words I have just seen, what word usually comes next?
If you encountered the phrase:
peanut butter and...
you would probably expect jelly more often than helicopter.
The machine could learn the same thing by counting examples.
This was primitive compared with modern AI, but something profound had changed. The computer was no longer being told every language rule. It was beginning to learn patterns from data.
Words become numbers
Computers do not actually understand the word cat as the furry creature currently sitting on your keyboard and preventing you from working.
Computers understand numbers.
So researchers needed a way to turn language into mathematics without losing all of its meaning.
One important development was the word embedding.
A word embedding represents a word as a long list of numbers—a point in a mathematical space with hundreds or even thousands of dimensions.
That sounds abstract, but the intuition is simple.
Words that appear in similar circumstances tend to acquire similar numerical representations.
“King” and “queen” end up related. So do “Paris” and “France,” “Tokyo” and “Japan,” or “dog” and “puppy.”
The model does not have a little dictionary entry saying puppy = young dog. It learns relationships because these words repeatedly appear in related linguistic neighborhoods.
For the first time, machines had something resembling a mathematical map of meaning.
But another problem remained.
Language is not merely a bag of related words. Order and context matter.
Consider:
The bank approved my mortgage.
and:
We sat on the bank of the river.
Same word. Entirely different world.
To understand language well, a model needs to pay attention not merely to individual words, but to how different pieces of a sentence relate to one another.
That brings us to the breakthrough that changed modern AI.
The Transformer arrives
In 2017, eight researchers published a paper titled “Attention Is All You Need.”
The title was slightly cheeky. The consequences were enormous.
The paper introduced an architecture called the Transformer.
The key idea was a mechanism called attention.
Attention allows a model to look across a sequence and decide which pieces of information are especially relevant to one another.
Take a sentence such as:
Maria put the glass on the table because it was wet.
What was wet?
The glass? The table?
A useful language system must examine the surrounding words and relationships to decide.
Attention provides a mathematical mechanism for doing that.
Instead of processing language only as a rigid chain—word one, then word two, then word three—a Transformer can examine many relationships within the text and assign different importance to them.
This made training much more efficient on modern parallel hardware and allowed researchers to build much larger models.
And once models became larger, something surprising happened.
They became useful for tasks that nobody had explicitly programmed into them.
So what exactly is “large”?
When people say that a model is 8B, 14B, or 70B, the B means billion.
An 8B model contains roughly eight billion parameters.
A parameter is one of the adjustable numerical values inside a neural network.
The easiest analogy is to imagine a gigantic mixing board with billions of tiny knobs.
At the beginning of training, those knobs are poorly adjusted. The model makes bad predictions.
Training presents examples, measures the model’s errors, and adjusts the knobs slightly.
This happens again and again—an almost unimaginable number of times.
Eventually, the arrangement of those billions of numerical settings captures an enormous collection of patterns.
Those stored parameter values are usually called the model’s weights.
So when you download a model file that occupies five, ten, twenty, or fifty gigabytes, a large part of what you are downloading is essentially an enormous collection of learned numbers.
The model’s knowledge is not stored as a tidy encyclopedia with chapters marked “Napoleon,” “Python programming,” and “How to make lasagna.”
It is distributed throughout those weights.
That is one reason language models can be brilliant one moment and bizarre the next.
They are not traditional databases.
They are pattern machines.
The smallest unit of conversation is not a word
Suppose you type:
I absolutely love this computer.
The model does not necessarily see six words.
Before the text reaches the neural network, another piece of software called a tokenizer chops it into units called tokens.
A token might be a whole word.
It might be part of a word.
It might be punctuation.
It might be part of a number.
The word “computer” might be one token for one model and several tokens for another.
This matters enormously because modern AI systems measure their working space in tokens, not pages or words.
A context limit of 32,000 tokens does not mean 32,000 words.
It means approximately 32,000 pieces according to that model’s tokenizer.
Different languages can also consume different numbers of tokens for the same idea. English, Russian, Spanish, Chinese, source code, and mathematical notation may all be split differently.
This is one reason token counts can feel mysterious when you first begin working with local models.
The model is reading the same sentence you are reading—but mathematically, it may be seeing a very different collection of pieces.
The invisible punctuation of AI conversations
There is another class of tokens you usually never see.
They are called special tokens.
Imagine a theatrical script without labels telling you who is speaking. You would quickly become confused.
AI conversations have the same problem.
The model needs invisible markers that can mean things such as:
The system instructions begin here.
This is the user speaking.
Now the assistant should answer.
This message is finished.
One important example is the End-of-Sequence token, commonly abbreviated EOS.
Think of it as a special form of punctuation understood by the model rather than the reader.
Different model families use different special tokens, and applications usually insert them automatically.
You may never see them.
But they still occupy space.
Which brings us to one of the most misunderstood parts of running AI locally.
A model has a desk, and the desk is not infinite
Every language model has a context window.
The context window is the amount of information the model can actively work with at one time.
Imagine hiring a brilliant researcher who has an enormous library but only one desk.
The books in the library represent the knowledge learned during training.
The desk represents the context window.
Whatever you want the researcher to consider right now must fit on that desk.
Your question takes space.
The conversation history takes space.
A document takes space.
Programming code takes space.
Instructions take space.
Tools take space.
The answer itself needs space.
A model advertised as supporting 32,000 tokens therefore does not give you 32,000 tokens for your document.
You may already have used several thousand before the document arrives.
This distinction becomes especially important with AI agents, where the model may receive system instructions, descriptions of tools, loaded skills, search results, files, previous actions, and conversation history before it even begins the task you actually care about.
The theoretical context window and the usable working context are not the same thing.
That difference is one of the reasons we built Green Zone.
The model also needs a notebook
There is another memory consumer with a wonderfully cryptic name:
Key-Value Cache (KV cache).
The name sounds like something hidden inside a database server. The idea is much simpler.
Imagine having a long conversation with someone.
Each time you say a new sentence, that person does not start the conversation again from the beginning and mentally recompute every previous sentence.
They retain working information about what has already happened.
A Transformer does something analogous.
As it processes tokens, it calculates internal information called keys and values. Rather than recalculating all of that information for every new token, the system stores it temporarily in the Key-Value Cache, or KV cache.
You can think of model weights as the model’s long-term learned knowledge and KV cache as its temporary notebook for the conversation happening right now.
The longer the conversation becomes, the larger that notebook becomes.
And the notebook occupies memory.
This creates an important practical problem.
A model can technically fit into your GPU and still be almost useless for the work you want to do.
Suppose your graphics card has 32 gigabytes of Video Random Access Memory (VRAM).
VRAM is the high-speed memory used by the Graphics Processing Unit (GPU).
If your model weights occupy 27 gigabytes, you may look at the numbers and celebrate.
Twenty-seven is less than thirty-two.
Success!
Not necessarily.
You have only about five gigabytes left for the KV cache, runtime buffers, temporary working memory, and everything else required during inference.
It is rather like buying a sofa that technically fits inside your living room but leaves no space to open the door.
The sofa fits.
The room no longer works.
Quantization: teaching large numbers to travel light
This is where quantization enters the story.
Model weights are numbers. Normally, computers can store those numbers with various levels of numerical precision.
Higher precision stores more information about each number but requires more memory.
Quantization stores those numbers using fewer bits.
Imagine recording every measurement in a laboratory.
You could write:
3.14159265358979
or you could write:
3.14
The second version requires less space. It also throws away some precision.
Quantization applies a much more sophisticated version of that idea to neural-network weights.
You will frequently encounter names such as Q8, Q6, Q5, and Q4.
The Q means quantized.
The number gives a rough indication of the number of bits used to represent the weights.
Q8 uses approximately eight-bit representations.
Q4 uses approximately four-bit representations.
Q4 therefore usually requires considerably less memory than Q8.
That does not mean an 8-billion-parameter Q4 model suddenly becomes a 4-billion-parameter model.
It still has roughly eight billion parameters.
You have simply packed the numerical representation of those parameters more tightly.
There is a trade-off.
Lower precision saves memory, but some information is lost.
Fortunately, modern quantization methods can preserve model quality surprisingly well. A well-made Q4 or Q5 version of a model can often be extremely useful while occupying dramatically less memory than a sixteen-bit version.
You may also encounter FP16, meaning 16-bit floating point, and BF16, meaning Brain Floating Point 16.
These are higher-precision formats commonly used in modern AI.
The practical question is not:
Which format has the most precision?
The useful question is:
Which format gives me enough model quality while leaving enough memory for the work I actually want to perform?
That is a much better question.
Why an “Instruct” model has manners
Model names contain clues.
Consider:
Qwen 8B Instruct
“Qwen” tells you the model family.
“8B” tells you it contains roughly eight billion parameters.
“Instruct” means something else entirely.
After a model completes its enormous initial training process, it may understand language reasonably well but still be awkward to interact with.
You ask:
Explain gravity to a twelve-year-old.
A raw pretrained model is not necessarily trained specifically to behave as a helpful assistant.
So developers perform additional training using examples of instructions and desirable responses.
This is called instruction fine-tuning.
The model sees examples resembling:
User: Summarize this paragraph.
followed by a useful summary.
Or:
User: Write a Python function that sorts this data.
followed by appropriate code.
After enough examples, the model becomes much better at understanding the conversational pattern:
A person asks me to do something; I should try to do it.
Thus the word Instruct.
It is less a measure of intelligence than a description of upbringing.
The base model went to school.
The Instruct model also went through etiquette training.
Fine-tuning: sending the model back to school
More generally, fine-tuning means taking an already trained model and continuing its training for a more specialized purpose.
Imagine someone with a broad university education who later attends medical school.
The person does not forget how to read or do arithmetic.
They acquire specialized training.
A general model can similarly be fine-tuned for programming, medicine, finance, customer service, legal writing, or particular styles of interaction.
Traditional full fine-tuning can be expensive because it modifies a very large number of model weights.
A lighter technique called Low-Rank Adaptation (LoRA) modifies the model more efficiently by training relatively small additional components.
You can think of LoRA less like rewriting an encyclopedia and more like attaching a carefully prepared set of annotations.
The underlying book remains mostly unchanged.
Three Transformer families
Not every Transformer is built for the same job.
One broad category is the encoder.
An encoder reads information and produces a numerical representation of it.
Google’s BERT is a famous example.
Encoders are useful for tasks such as identifying what a text is about, finding similar documents, extracting names, or classifying sentiment.
Then there are decoder models.
Decoder models generate new tokens.
Most of the conversational systems people run locally today—Llama, Qwen, Mistral, Gemma and similar models—belong largely to this family.
They are good at answering, writing, coding, and continuing sequences.
Finally, there are encoder-decoder systems, also called sequence-to-sequence models.
One part reads the input. Another generates the output.
Models such as T5 and BART are examples.
They became especially useful for tasks such as translation and summarization.
You do not need to memorize these categories to use local AI.
But they explain why two models both labeled “Transformer” can behave very differently.
A pickup truck and a Formula One car both have engines.
You would not choose between them by counting cylinders alone.
The strange power of predicting the next token
Here is perhaps the strangest fact about Large Language Models.
At their core, many generative models are trained to do something that sounds almost embarrassingly simple:
predict what comes next.
You write:
The capital of France is...
The model assigns probabilities to possible next tokens.
“Paris” receives a very high probability.
“Banana” receives, one hopes, a very low one.
The model selects a token.
Then it repeats the process.
Again.
And again.
Thousands of times.
From this repeated act of prediction emerge paragraphs, programs, explanations, translations, poems, arguments, jokes, and sometimes complete nonsense delivered with the confidence of a man explaining directions in a city he has never visited.
That last part matters.
An LLM is not a truth machine.
It is a prediction machine.
Its objective is to produce a plausible continuation—not to swear under oath that every sentence is correct.
That is why models can hallucinate: produce information that sounds convincing but is false.
The word is imperfect, but the phenomenon is real.
The model is not necessarily “lying.”
It is generating a continuation that fits learned patterns even when the underlying fact is wrong.
From chatbot to agent
A language model by itself can only generate information.
An AI agent adds tools.
Imagine again our researcher sitting at a desk.
Without tools, the researcher can answer only from memory and whatever documents you place in front of them.
Now give the researcher:
a calculator,
a search engine,
access to files,
a database,
a Python interpreter,
and permission to perform certain actions.
The researcher becomes dramatically more useful.
An AI agent works similarly.
The LLM provides the language understanding and decision-making component.
Ordinary software performs the actions.
When the model needs a number from a database, it can request the database tool.
When it needs to inspect a file, it can request a file-reading tool.
When it needs arithmetic, it can call a calculator instead of trying to be one.
This distinction is important because people often describe an AI agent as though the model itself magically acquired new powers.
It did not.
It received tools.
A carpenter with a drill is still the same carpenter.
The drill simply changes what the carpenter can accomplish.
Running AI locally changes the questions
When you use a cloud AI service, someone else owns the hardware.
You send the request.
A distant data center worries about GPUs, memory, cooling systems, power supplies, and the horrifying electricity bill.
Running a model locally changes the relationship.
Now the hardware is yours.
Suddenly questions that once belonged to data-center engineers appear on your desk.
How much VRAM do I have?
How large are the model weights?
Which quantization should I choose?
How large a context can I afford?
How much memory will the KV cache consume?
Can I load this model and still have enough room to do something useful with it?
These questions can initially feel like alphabet soup.
GPU. VRAM. KV. Q4. Q8. FP16.
But beneath all of those acronyms lies one very ordinary problem:
You have a limited amount of space. What should you put in it?
That is the problem Green Zone is designed to make visible.
The difference between fitting and working
Imagine two people buying luggage for a trip.
The first traveler fills the suitcase completely with clothing.
He triumphantly manages to close the zipper.
Success?
Then he remembers he still needs shoes, medication, a toothbrush, and the passport he has somehow packed at the bottom.
The second traveler deliberately leaves some room.
Technically, the first suitcase contains more clothing.
Practically, the second suitcase is better prepared for the trip.
Local AI has the same problem.
You can load the largest possible model into VRAM and congratulate yourself because it fits.
But if almost no memory remains for context and working state, you may have built an impressive system that cannot comfortably perform the task you bought it for.
That is why model selection is not simply a contest to find the largest number followed by the letter B.
The useful configuration is a balance.
Model capability.
Quantization.
Context.
KV cache.
Tools.
Files.
Conversation history.
Response space.
And the physical memory available on your GPU.
The best configuration is not necessarily the largest model your hardware can technically load.
It is the configuration that leaves enough room for the model to work.
And once you understand that distinction, the intimidating forest of numbers on model-download pages begins to look considerably less mysterious.
You are no longer asking:
Can I squeeze this model onto my graphics card?
You are asking the question that actually matters:
If I put this model on my graphics card, how much room will still be left for it to think, remember the conversation, use my files, and finish the job?
That is where local AI stops being a collection of mysterious specifications and starts becoming an engineering problem ordinary people can reason about.
Sources & further reading
Sharing & republication
Published by AI Model Green Zone.
You may republish this article only in full and without changes, with credit to AI Model Green Zone and a clearly visible, active link to the original article on our website.
Translations, abridged versions and adaptations require separate permission.
These terms do not restrict uses permitted by law.
The public article link will be available once the website’s public address is configured.