How large language models like Grok work

Grok does not look up answers in a database. It writes them piece by piece from patterns it learned. Once that clicks, its strengths, its slips and the best way to prompt it all make sense.

6 min readUpdated

Grok is a large language model, or LLM: a program trained on an enormous amount of text to continue text in a useful way. You do not need any maths to understand the main ideas, and knowing them pays off quickly. They explain why Grok is brilliant at rewriting a paragraph, why it sometimes states a wrong date with total confidence, why it does not know last week's news in our chat and why a clearer prompt gets a better answer.

The one big idea: predicting what comes next

At its core, an LLM does one thing. Given some text, it estimates which small piece of text is likely to come next, adds it, and repeats. Your question, the earlier messages and the instructions the site gives the model are all part of that starting text. The answer you read is built from thousands of these small predictions, one after another, each one based on everything written so far.

That sounds too simple to produce a useful explanation of tax rules or a working function. The reason it works is scale. To predict text well across billions of examples, a model has to absorb a great deal about grammar, facts, reasoning patterns, styles and the way people explain things. Prediction is the task; a broad, fuzzy model of language and the world is the side effect.

There is a little deliberate randomness in each choice, which is why the same question can give a differently worded answer each time you regenerate.

Tokens: the pieces the model works with

Models do not read letters or whole words. They read tokens: chunks that are often a whole short word, part of a longer word, a space with a word, or a punctuation mark. Common English words are usually one token; rare words and many non-Latin scripts break into several.

Tokens matter to you in two ways. Limits on how much a model can read and write are measured in tokens, not words. And because the model sees chunks rather than letters, tasks such as counting the letters in a word or reversing a string can trip it up, even though it handles much harder language tasks with ease.

The Grok models in our chat also accept images. A picture is converted into a form the model can process alongside your text, which is how it can read a chart or describe a photo. It still answers in text.

Training: from raw text to a helpful assistant

Building a model like Grok happens in stages. The details of any company's process are mostly not public, but the general shape is well known.

  1. Pre-training. The model learns to predict text across a very large collection of books, websites, code and other material. This is where its general knowledge and language skill come from.
  2. Fine-tuning. It is then trained on examples of good conversations: questions paired with helpful, well-formatted answers. This turns a text predictor into an assistant that follows instructions.
  3. Feedback. People and automated checks rate answers, and the model is adjusted to prefer the kinds of answers that score well, such as accurate, clear and safe ones.

The result is a large file of numbers, called weights, that encode what the model learned. The model does not keep a copy of its training texts to look things up in. It keeps patterns, which is why it can explain an idea in new words but may misremember a specific detail.

Knowledge cut-off and no internet

Training stops at some point, and everything after that is unknown to the model. That point is the knowledge cut-off. Some versions of Grok can search the web: the official Grok on grok.com and X has live search. Our chat does not, so Grok here answers only from its training and from what you put in the conversation.

In practice: for news, prices, sports results, timetables, new laws and the latest software versions, use a current source. If you paste an up-to-date article into the chat, Grok can work with it, because then the information is part of the conversation.

Context window: the model's working memory

A model's context window is the amount of text it can consider in one go, counting your messages, its replies and any instructions. xAI's Grok models have very large windows; OpenRouter lists 2 million tokens for Grok 4.20, 1 million for Grok 4.3 and 500,000 for Grok 4.7. Our chat sends a much smaller slice to keep answers fast and free, trimming the oldest messages of a long conversation.

Two things follow. Within a conversation, Grok "remembers" only what is still in the window. And between conversations it remembers nothing at all: a new chat starts empty, even though your old chats are saved in your browser for you to reopen. If a long chat starts losing track, ask for a recap and start fresh with it.

Reasoning: models that think before answering

Some models are trained to write out a stretch of working before the final answer: listing conditions, trying an approach, checking it. This is called reasoning, and it helps most with maths, logic, planning and debugging. In our chat, Grok 4.3 Thinking and Grok 4.7 reason before answering, while Grok 4.20 runs with reasoning switched off for speed. Our guide to reasoning models explains when the wait is worth it.

Why models make things up

Because the model always produces a plausible continuation, it does not naturally stop when it reaches the edge of its knowledge. Asked for a source it never saw, it can produce a convincing title. Asked about a small town, it may blend details from similar towns. This is usually called hallucination, and it is a side effect of the same mechanism that makes the model fluent. Training reduces it, and instructions such as "say if you are not sure" help, but no current model is free of it. Our guide on checking AI answers shows where to look.

What this means for your prompts

Every idea above leads to a practical habit. The model predicts from what it sees, so give it the material. It has a cut-off, so paste current facts yourself. It may guess, so invite it to flag doubt.

Weak:
What are the rules for my visa?

Strong:
Below is the text from the official page about my visa type, copied
today. Explain in plain words what I must do before my visa expires
and list any deadlines it mentions. Use only this text, and tell me
if anything is unclear.
---
[pasted text]

The weak prompt asks Grok to recall rules that may have changed. The strong one hands it the current source and asks it to do what LLMs do best: read, explain and organise. Try the summarizer for this kind of task, or ask Grok to explain itself in plain words.

Think of it as a well-read improviser. Grok has read widely and improvises fluently, but it improvises. Give it notes to work from and it stays on script; leave gaps and it will fill them, not always correctly.

FAQ

Does Grok understand what it says?

That is a debated question. What is clear is that it can explain, summarise and reason in ways that are often useful, and that it can also be wrong without noticing. Judge it by checking its output, not by how sure it sounds.

Is Grok learning from my chats right now?

The model does not change while you talk to it; its weights are fixed after training. Within a chat it uses your messages as context, and a new chat starts without them.

Why do different AI models give different answers?

They were trained on different data, in different ways, with different goals. Our comparisons of Grok with other models, and what is Grok, cover how the Grok family fits in.

Who makes Grok?

Grok is made by xAI, which SpaceX acquired in February 2026. Our site is independent and uses Grok models through a cloud API; we are not affiliated with xAI, SpaceX or X. The Grok history page has the timeline.

Ready to ask Grok something?

No account, no download, no card. Open the chat, type your question and read Grok's answer as it appears.

Open Chat