Back to Basics

What Happens When You Send a Prompt? A Walkthrough

What Happens When You Send a Prompt? A Walkthrough
AI Tutorials Team 2 July 2026

Between pressing enter and the first word appearing on screen, a specific sequence of things happens. None of it is visible, and following it in order explains a surprising number of behaviours that otherwise look arbitrary.

What gets assembled before the model sees anything?

Your message is not sent on its own. The application builds a complete input, usually in this order: a system prompt written by the company, any custom instructions you set, relevant notes from memory, attached files, the full conversation so far, and finally your new message.

This assembly happens on every request. The model has no ongoing session, so the entire conversation is rebuilt and resent each time you press enter. What feels like an ongoing discussion is a series of independent requests, each one carrying the whole history with it.

What does the system prompt do?

It sets behaviour: what the assistant is called, what it should refuse, what format to prefer, which tools are available and how to use them. It is typically longer than most people expect, running to thousands of words in consumer products.

You are competing with it whenever you ask for something it discourages. This is why a request for a very short answer sometimes still produces headings and a summary, and why the same model behaves differently through an API where no such prompt exists.

How is the input converted for the model?

Into tokens, then into vectors. Each token becomes a list of numbers representing its meaning and position, and the whole sequence is processed together rather than one word at a time. This is the step where the total length is checked against the context limit, and where older messages are dropped if the input will not fit.

What happens during generation?

  1. The sequence passes through every layer of the model, producing a probability for each possible next token.
  2. One token is sampled from that distribution according to the temperature setting.
  3. It is appended to the sequence.
  4. The whole calculation runs again, now including the new token.
  5. This continues until a stop token is produced or a length limit is reached.

Answers appear word by word because each token is streamed as it is produced. The visible typing is not an animation; it is the actual pace of generation.

Where do tools fit into this?

If the model determines that a search, a calculation or a file lookup would help, it produces a structured request rather than an answer. The application pauses generation, runs the tool, inserts the result into the context, and restarts generation with that material now present.

A visible pause with a status message is usually this. It also means a tool result is simply more text in the input, which is why a model can still misread what a search returned.

What checks happen on the way out?

Most consumer products run classifiers over both the input and the output, separate from the model itself. These can block a request, halt a response part way through, or replace it with a refusal.

This explains the behaviour where an answer begins normally and then vanishes. The model produced text, a separate system judged it, and the two disagreed. It also explains why refusals sometimes feel disconnected from the conversation: the component that intervened was never part of it.

How long does the whole sequence take?

The assembly and tokenising are close to instant. The delay before the first word appears is the model processing the entire input, which grows with the length of the conversation. After that, tokens arrive at a steady rate set by the model size and the load on the provider, which is why a smaller model feels dramatically more responsive even when the finished answers are comparable.

What does the walkthrough explain in practice?

Why long conversations get slower, since the whole history is reprocessed every time. Why instructions from forty messages ago stop working, since they may no longer be in the input. Why a fresh conversation often fixes strange behaviour, since it removes everything accumulated. And why the same model feels different in different products, since the system prompt, the tools and the filters around it are entirely separate from the model itself.