Vol. 23 · LLM Foundations

What a Prompt Is and Why a Question Becomes an Answer

The main paradox of LLM is this: if the model is just predicting the next token, why does it answer the question meaningfully, and not just continue our text? This volume analyzes the prompt as the model's actual input, chat mode as a special data format, instruction tuning as a shift in behavior towards the “assistant”, and the connection of prompt with the model weights.

Retrieval answer

The main paradox of LLM is this: if the model is just predicting the next token, why does it answer the question meaningfully, and not just continue our text? This volume analyzes the prompt as the model's actual input, chat mode as a special data format, instruction tuning as a shift in behavior towards the “assistant”, and the connection of.

01

The Great Paradox

4 cards
01ParadoxLLM really predicts the next token. But the next token counts after the whole context.1 visual

The most important thing is that the model doesn’t just look at your last sentence. It looks at the entire prefix that was provided as input. If the input already has a history of dialogue and a label that it is the assistant’s turn, then the “next token” should already be the assistant’s response token, rather than a continuation of the user’s question.

02ParadoxThe model does not answer the question. It continues the format in which questions are usually answered.1 source note

This is a subtle but important shift. The LLM does not think of “I have a question, I have to answer.” It sees a pattern where after a user message in the assistant slot, there is usually a response, explanation, clarification or refusal. The answer appears as a statistically plausible continuation of this format.

Source-complete notesUseful framing

Useful framing

  • The model continues the interaction format
  • The answer is continuation in the right mode.
  • The model understands the question as a person in an explicit form
03ParadoxOne meaningful answer is many small next-token steps in a row.1 source note

The answer is not born entirely. The model selects the first token, then this token is added to the input, then the second, third and so on are selected. Because of this, early tokens very strongly set the trajectory of the entire response.

Source-complete notesstep by step
step by steptext
prompt
Choose the first answer token
Append it to the input
Choose a second token
Append it to the input
Repeat to stop token/limit
04ParadoxTherefore, the “next token” and the “meaningful response” do not contradict each other.1 source note

A meaningful answer is simply a long chain of locally believable tokens within the desired mode. There's no contradiction. The fact that only one token is predicted at each step does not prevent the whole sequence from appearing as an explanation, dialogue, code, or step list.

Source-complete notesformula
formulatex
Reasonable answer = many times in a row
Which token is most appropriate now
in this conversational state?
02

What is Prompt by Essence?

5 cards
05PromptPrompt is not a “query idea” but a specific tokenized prefix1 visual

From an engineering point of view, prompt is everything that got into the model before the next token was generated. Not just your question, but the entire input: system instruction, dialogue history, retrieved context, tool results, separators, service tokens and sometimes hidden chat template. After tokenization, all this becomes a token ID sequence.

Visual model · Annotated exampleInspect the concrete example behind Prompt is not a “query idea” but a specific tokenized prefix, one layer at a time.
Complete view · 2 layers
06PromptPrompt is visible and invisible1 source note

The user sees only their own text, but the model almost always gets more. An SDK or server can automatically add system prompt, role markers, chat template, safety instructions, tool schema, and chunks of history. So “my prompt” and “real prompt” are often not the same thing.

Source-complete notesfrequently

frequently

  • system message
  • assistant prefix
  • tool schema
  • history trimming / formatting
07PromptFor the model, prompt is not “meaning points”, but a sequence of tokens.1 source note

People think of prompts as intentions and instructions. But the model at the input sees only tokens and their order. This is why wording, separators, role marking, JSON frames, and sample patterns influence behavior so much.

Source-complete notesinside
insidetext
"Be brief and get JSON back."
→ tokenizer
→ [tokens...]
→ embeddings
→ transformer
→ next-token distribution
08PromptPrompt is a temporal context, not a brain change model1 visual

When you write a good prompt, you are not rewriting the weights of the network. You temporarily set the context within which the model unfolds one trajectory of behavior rather than another. At the end of the request, this context disappears and the weights remain the same.

Visual model · Annotated exampleInspect the concrete example behind Prompt is a temporal context, not a brain change model, one layer at a time.
Complete view · 3 layers
09PromptA good prompt “chooses mode” rather than “adds intelligence”1 source note

If the weights already encode the right skills, a prompt helps activate them in the right form: briefly, in a table, as a tutor, as a reviewer, with quotes, or step by step. But if the knowledge or skill is not encoded in the weights at all, a prompt will not create it out of thin air.

Source-complete notesprompt is good.

prompt is good.

  • style
  • format
  • choose
  • Embedding a new area of knowledge in weight
03

Why the question turns into an answer

5 cards
10DialogPretraining already teaches the model a huge number of templates “question → answer”1 source note

At the pretraining stage, the model sees a sea of texts with FAQs, forums, references, textbooks, documentation, interviews and dialogues. Therefore, even before instruction tuning, she already knows that after many question constructs, there are often explanations, definitions, lists or solutions.

Source-complete notespattern
patterntext
Q: ... A: ...
Question: ... Answer: ...
User: ... Assistant: ...
Task: ... Solution:
Why ... ? Because...
11DialogInstruction tuning shifts the model from “continue text” to “help the user”1 visual

After pretraining, the model has many language patterns, but does not have to be a convenient assistant. Instruction tuning shows her special pairs like “user instruction → helpful assistant response.” In this way, she learns that in a certain format of dialogue, the continuation should not be an abstract text, but a useful response.

Visual model · ComparisonContrast the alternatives in Instruction tuning shifts the model from “continue text” to “help the user” under the same frame.
Complete view · 3 layers
12DialogRLHF/preference tuning reinforces “assistance” behavior1 source note

In the next stages, the model is further pushed toward answers that people rate as more helpful, safe, polite, and understandable. Therefore, in chat mode, she can not just respond, but prefers a response over a strange continuation or aggressive style.

Source-complete notesreinforcement

reinforcement

  • utility
  • politeness
  • formatting
  • Absolute truth is not guaranteed.
13DialogThe model is not “obliged” to continue the question with the question mark, because the assistant is in line.1 source note

This is the main answer to the initial confusion. In chat, the model doesn’t try to guess “what the end of your line will be.” Your line is over. Now you have to guess what usually comes after her in assistant-turn.

Source-complete notesliterally
literallytext
User Message Ended
slot assistant
The next token will start the assistant reply
So it's possible:
"Of course," "Therefore," "This," "Neuronet,"
Not a continuation of the user question.
14DialogIf the prompt format is knocked down, the model may begin to behave “not like a chat”1 source note

If you submit raw text without role markers, mix user and assistant into one thread, break a template or give a strange few-shot format, the model can go into another continuation mode: start copying the style of the case, finishing the document, repeating the question or continuing the list instead of answering.

Source-complete noteshence

hence

  • format
  • broken format = strange behavior
04

What is Dialog Mode Technically?

5 cards
15DialogChat mode almost always turns into a regular text sequence through a template.1 visual

Most chat models inside still get a linear sequence of tokens. Just before that, the list of messages is serialized by the chat template: role markers, separators, sometimes special start/end tokens, and often an explicit prefix for the assistant’s response are added.

Visual model · Annotated exampleInspect the concrete example behind Chat mode almost always turns into a regular text sequence through a template., one layer at a time.
Complete view · 4 layers
16DialogSystem, user, assistant are not magical entities, but part of a format.1 source note

These are roles for us. For the model, signals in the token sequence. They help to distinguish: where is the top-level instruction, where is the user's request, where is the assistant's past response, where is the tool's result. This dramatically streamlines the behavior of the network.

Source-complete notesrole-play
role-playsql
The system defines the policy/framework
user sets the task
The place where the model continues the answer
The external result, which then reads the model
17DialogAssistant prefix is one of the most important hidden pieces of prompt. and1 source note

In many chat templates, the last piece of prompt looks like an open assistant-turn. That's the signal: now continue on behalf of the assistant. Therefore, the model did not “guess to start answering”; it was literally shown that now it is necessary to fill this slot.

Source-complete notesThe latest prompt tokens are often similar to
The latest prompt tokens are often similar totext
...
<user> Why is the sky blue? </user >>
<assistant>

After that, the next token should be an assistant reply token.
18DialogA multi-way dialogue is just a longer and longer prompt.1 source note

Each new move does not create a new personality. It simply extends the current prompt: it now includes past answers, past errors, refinements, and tool outputs. That's why history is so powerful in behavior, and that's why it's sometimes cut or summarized.

Source-complete notesconsequences

consequences

  • history = part of the context
  • A dirty story pollutes the answer
  • Too long a story is expensive.
19DialogTool-calling is also a special dialogue format.1 visual

When a model invokes an instrument, it is not “agent magic.” This is again a special pattern in the sequence of messages: the assistant asks for a tool call, runtime executes it, puts the tool result in the story, and then the model continues with this new text.

Visual model · Process flowFollow the sequence behind Tool-calling is also a special dialogue format. and locate where work or state changes.
Complete view · 3 layers
05

How Prompt Is Linked to Libra

5 cards
20WeightsWeights are compressed statistics and skills. Prompt is the current task and the current data1 visual

Weights contain long-term patterns: language, style, code, facts, reasoning patterns, frequency, propensity for certain answers. Prompt contains a short-lived scene: what exactly needs to be done now, for whom, in what format and on what material. Weights without prompt-and do not know which mode to choose now. Prompt without weights can't do anything by itself.

Visual model · Annotated exampleInspect the concrete example behind Weights are compressed statistics and skills. Prompt is the current task and the current data, one layer at a time.
Complete view · 4 layers
21WeightsPrompt is not recorded in weight during normal inference1 source note

During normal communication, the model is not trained on your request in the classical sense. It just makes a forward pass on fixed weights. So after a query, it doesn’t become forever smarter or forever better at your topic.

Source-complete noteswhat is/what is not
what is/what is nottext
inference:
  weights fixed
  activations change
  context changes

training / fine-tuning:
  weights update
  The model's ability to change
22WeightsIt is better to think that prompt “swifts” the weights.1 source note

A useful intuition is this: weights set a huge field of possible continuations, and prompt brings the model to one area of this field. Therefore, the same network can look like a tutor, code assistant, summarizer or reviewer, although the weights are the same.

Source-complete notesmetaphor

metaphor

  • weights = landscape of possibilities
  • prompt = route through the landscape
23WeightsRAGs and prompt examples do not “teach the model” but temporarily supply it with facts and templates.1 visual

When you add retrieved passages or few-shot examples, you’re not recording those facts in weight. You just put them in the current prompt so that at that launch the model builds on them as part of the context. At the next launch without these pieces, the model may no longer have the same support.

Visual model · Annotated exampleInspect the concrete example behind RAGs and prompt examples do not “teach the model” but temporarily supply it with facts and templates., one layer at a time.
Complete view · 3 layers
24WeightsFine-tuning and prompt engineering solve different problems1 source note

Prompt engineering changes behavior on the fly for a specific challenge. Fine tuning changes the weights themselves and thus changes the model more steadily. Therefore, prompt is good for instructions and format, and fine tuning is needed when you want a systemic shift in behavior or a specialized skill.

Source-complete notestable
MethodWhat changes
Promptcurrent call context
Fine-tuningweight and long-term behavior
06

What Happens at Runtime

5 cards
25RuntimeDuring the answer, the model constantly recalculates the distribution by dictionary.1 source note

At each step, the network outputs logits throughout the dictionary. After softmax, the probability distribution is obtained, and then the system selects the following token: either the most likely or sampling strategy. After that, the token is added to the input, and the cycle repeats.

Source-complete notesruntime loop
runtime looptext
prompt
→ logits over vocab
→ probabilities
→ choose token
→ append token
→ repeat
26RuntimeTemperature and sampling do not affect knowledge, but the choice of possible continuations.1 source note

If the temperature is lower, the model often takes the most likely tokens and behaves more predictably. If above, it explores the tail of the distribution more. It doesn’t make it smarter or less intelligent directly, it only changes the style of choice.

Source-complete notesusually

usually

  • Low temperature is more stable
  • High temperature is more varied but noisier
27RuntimeThe first 5-20 answer tokens set the entire future mode1 source note

If the beginning of the answer went in the direction of “Briefly:”, “Of course!”, JSON format, list of points or refusal, then the model will continue inside this corridor. This is why prompt engineering has a particularly strong impact on the start of the response.

Source-complete notesexample
exampletext
first token "{"
The answer goes into the JSON trajectory.

first token "1."
The answer goes into the list trajectory

first token "Sorry"
The answer goes into a refusal trajectory.
28RuntimeSometimes the model does not answer immediately, but clarifies the question. It's just another possible follow-up.1 source note

If prompt and training signal that there is not enough data, the more plausible continuation may not be the answer, but the clarification: “Which framework do you mean?” or “Clarify the period.” It's not a separate magic. This is again the choice of the most appropriate next move assistant.

Source-complete noteswhat it looks like

what it looks like

  • answer continuation
  • clarification continuation
  • refusal continuation
29RuntimeThis is why prompt engineering works.1 source note

Prompt engineering does not change the “soul of the model,” but rather the local distribution of probabilities in the first and next steps of generation. Added role, format, example, constraints, context, and made some sequels more likely and others less likely.

Source-complete notesmechanics
mechanicstext
changed promptly
Changed internal activations
Changed the logits
Changed the probability of tokens
Changed the trajectory of the response
07

Myths, Boundaries and Final Framework

5 cards
30MythMyth: “If it’s a next-token prediction, then the model can’t do anything complicated.”1 source note

The complexity of behavior does not have to be a separate “thinking module.” It can arise from a very powerful model, which is able at every step to assess well which continuation in this context will be logical. Many local predictions in a row produce globally complex behaviors.

Source-complete notescorrectly

correctly

  • Complex behavior can be emergent
  • Next-token = keyboard autocomplete only
31BoundariesPrompt does not guarantee the truth. It only changes the probability of response forms.1 source note

You can fine-tune the format, style, and Useful framing of the answer, but that doesn’t mean the model will always be factually right. If knowledge is lacking or the context is ambiguous, it can still generate a very convincing but incorrect continuation.

Source-complete notesconsequence

consequence

  • prompting - fact checking
  • Facts often require RAG/retrieval/tools
32ConclusionThe most useful final formula1 visual

To avoid confusion, it is convenient to keep in mind this chain: weights store abilities and patterns, chat template designs the scene, prompt sets the current task and context, and generation by one token unfolds the most likely move of the assistant inside this scene.

Visual model · Formula mapConnect the quantities and operations that determine The most useful final formula.
33ConclusionExplain very briefly1 source note

Prompt is the entire current context fed to the model prior to generation. In chat mode, this context is already framed in a way that the assistant is now saying. Therefore, the next-token prediction naturally gives not a continuation of your question, but the beginning of the assistant’s answer.

Source-complete notesphrase
phrasesql
The model doesn't continue with your question.
And all the dialogue in the dot.
where the assistant's turn came
34ConclusionThe main engineering idea1 source note

If you want to run an LLM, think not “how to get her to understand me,” but “what token context I’m creating for her now and what continuation mode I’m making most likely.” It is a more accurate and more useful mental model for prompt engineering, RAG, agents and structured output.

Source-complete notesshort reminder

short reminder

  • format
  • history
  • Slot is important.
  • Weights and prompt must be distinguished

No dead end

Keep moving through the map.

Continue in sequence, switch to a related guide, or return to the seven-track learning map.

Discovery graph / next reads

Continue through New Runtime

Open the graph
  1. 01learning trackLlm FoundationsOpen the complete learning track.
  2. 02related materialFrom a Neuron to an LLMContinue with another guide in this learning track.
  3. 03related materialLLMs in Plain EnglishContinue with another guide in this learning track.
  4. 04related materialLLM Internals: From Token to Logit to AnswerContinue with another guide in this learning track.
  5. 05related materialLLM Internals: KV Cache & GenerationContinue with another guide in this learning track.

These links are also published in this page’s JSON twin and as typed edges in DiscoveryGraph v1.

Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate…

Open the JSON contract