Frontier model behaviour and interpretability
In-context learning and temporary adaptation
A prompt does not rewrite a model; it creates a transient task coordinate system in activation state, within which retrieval, task inference or implicit optimisation can produce the answer.
TLDR
- In-context learning changes behaviour while model parameters remain fixed.
- The prompt first establishes a temporary task frame, then a solver acts inside it.
- Retrieval, task inference and implicit optimisation predict different failures.
- Reset, label-remapping, decoy and order interventions expose those differences.
- Prompts should be governed as temporary programs, not treated as casual instructions.
At 08:40, a warehouse invents a sorting language that has never existed before.
For the next shift, damaged packages must be marked miv, temperature-sensitive packages taro, and everything that needs manual inspection kesh. A language model receives six examples. “Cracked bottle, liquid visible” maps to miv. “Insulin cooler, seal intact” maps to taro. “Address partly erased” maps to kesh. The next item reads: “Glass jar, corner crushed, no leak.” The model returns miv.
Nothing in its pretraining could have contained this exact codebook. No gradient was computed. No parameter was updated. Yet its behaviour changed in a way that looks like learning. Close the session, remove the six examples, and ask again. The skill disappears. Restore the examples, and it returns.
What, exactly, existed during those few seconds?
The easy answer is that the model “learned the task in the prompt”. That description is operationally useful and mechanistically vague. It hides three different possibilities. The model may have copied the label attached to the most similar example. It may have inferred a latent sorting rule and then applied it. Or it may have built a temporary predictor from the examples, much as a small learning algorithm would fit a function.
These possibilities can agree on the answer and disagree everywhere that matters. They respond differently to a misleading neighbour, a label swap, a change of basis, a reordered prompt, or a reset. That is why the central question is not whether in-context learning is “real learning”. The useful question is: which state changed, which relation was extracted, and which intervention would make the competing mechanisms diverge?
The answer that vanishes at reset
The phrase in-context learning names a behavioural pattern before it names a mechanism. A model receives examples or instructions in its input, then performs differently on a new query without changing its trained parameters. GPT-3 made this pattern widely visible, and controlled studies later showed that transformers trained on synthetic function families can construct useful predictors from prompt examples.[1, 3]
The definition is intentionally modest. It tells us when adaptation occurs, not how. The common hidden assumption is that all learning must be stored in weights. If the weights do not move, the model must merely be retrieving something it already knew. That conclusion treats parameters as the only state a computation can possess.
A transformer also has per-request computational state. Every token changes later activations. Attention keys and values derived from earlier tokens remain available during the forward pass. The residual stream carries transformed information from layer to layer. Depending on the serving architecture, a key-value cache may persist across generated tokens. None of this is a parameter update, but it is still a causal change inside the configured system.
Call the trained parameters θ, the demonstrations D, and the new query x*. In-context prediction can be written without claiming any particular internal algorithm:
θ stays fixed. The causal question is how changing D changes the internal computation and therefore ŷ.
This simple notation removes one confusion. A fixed function can still produce different behaviour when its input contains a dataset. A spreadsheet formula does not change when its cells change. A database engine does not retrain when a query changes. Likewise, a transformer can use the prompt as data, instruction, index, temporary codebook, or all four.
The more useful factorisation is experimental rather than ontological:
C constructs a transient task frame zD. S executes a solver inside that frame. The decomposition need not be unique to be useful for interventions.
The frame-solver distinction is the paper’s central proposal. Frame construction answers: What is the task, which features matter, what do the labels mean, and what output form is permitted? Solver execution answers: Given that temporary specification, how should this query be handled?
Research on compact function representations gives this proposal some empirical footing. Causal interventions have identified task-related activation directions in particular language models, and layer-wise masking experiments have found points where some models no longer need direct access to the original examples to continue performing the recognised task.[9, 11] These results do not prove a universal task vector. They do show that “the prompt is still visible” and “the task has been compressed into a usable internal state” are separable hypotheses.
The apprentice who forgets at the doorway
Imagine an apprentice who can infer a new filing rule from five cards. While the cards remain on the desk, every new file is sorted correctly. The moment the apprentice walks through a doorway, the rule disappears, yet all lifelong skills remain. Bring back the cards and performance returns.
Change only one causal property: whether the temporary state crosses the doorway. If behaviour survives, the rule was stored in a persistent substrate. If it vanishes, the adaptation depended on bounded working state. A language-model context reset performs the same intervention. It does not prove where the state lived, but it shows that the observed skill was not consolidated into the model parameters.
This matters because “learning” usually bundles several operations: extracting regularity, changing an internal state, retaining that change, and transferring it later. In-context learning clearly performs the first two. It may perform the third only within a request, and the fourth only when the relevant state is deliberately carried forward. Temporary adaptation is learning with a deliberately narrow retention boundary.
Established: model behaviour can change from in-context examples without parameter updates. Supported in bounded settings: trained transformers can encode task information in activations and approximate familiar estimators. Still contested: whether one mechanism, such as gradient descent, explains in-context learning in pretrained language models generally.
flowchart TD A["The answer that vanishes at reset"] --> B["Three solvers inside one<br/>temporary frame"] B --> C["Interventions that separate<br/>the stories"] C --> D["Build the prompt as a<br/>controlled state"] D -. "re-test" .-> A classDef first fill:#0a1424,stroke:#D95545,stroke-width:2px,color:#e6f3ff classDef step fill:#0a1424,stroke:#3f7da0,stroke-width:1px,color:#e6f3ff class A first class B,C,D step
Three solvers inside one temporary frame
Suppose the model gives the correct warehouse code. The output alone cannot tell us which computation produced it. We need rival generators that agree on ordinary cases and separate under intervention.
The three most useful rivals are retrieval, task inference, and implicit optimisation. They are not exhaustive, and a real transformer may blend them. Their value is that each makes a different causal commitment.
Retrieval: the answer is near an example
Retrieval is the smallest plausible mechanism. Find the demonstration whose input most resembles the query, then reuse its output or continue its local pattern. Attention makes this computationally natural. Induction heads, studied in small transformers, can detect a repeated pattern and copy the token that followed an earlier occurrence.[15] Higher-order variants can estimate next-token distributions from contextual fragments.
A minimal retrieval rule is:
sim measures similarity in some representation. The rule assumes that local resemblance is a reliable guide to the output.
Retrieval explains why example selection often matters. A semantically close demonstration can provide the right vocabulary, format and local transformation. It also explains a particular failure: one highly similar but wrongly labelled example can dominate several globally consistent examples.
When copying is enough
The prompt contains “red square → nali”, “blue circle → voro”, and “red triangle → nali”. The query is “red hexagon”. A nearest-neighbour system may match “red triangle” and return nali. A task-inference system may infer that colour alone determines the label. Both succeed.
Now change the query to “blue triangle”. Retrieval may choose either the same shape or the same colour, depending on its representation. Task inference predicts voro if it has identified the colour rule. The disagreement is not philosophical. It is produced by a single counterexample chosen to separate the candidate mechanisms.
Task inference: the examples identify a latent rule
Task inference treats the prompt as evidence about which rule generated the demonstrations. If the model has learned a distribution over possible tasks, it can update its belief when examples arrive. Xie and colleagues showed how in-context learning can emerge as implicit Bayesian inference in a stylised setting where documents have latent concepts and long-range coherence.[2] Later work explored how closely transformers track Bayesian predictors across multiple function families and where they depart.[14]
Suppose the candidate rules are h1: y=x+1, h2: y=2x+1, and h3: y=5-x. The demonstrations change the posterior probability of each rule:
h is a candidate task. The equation is valid only when the task family, likelihood and prior are meaningful descriptions of the data-generating process.
Task inference is not synonymous with conscious hypothesis testing. It is a functional description of a computation. It predicts robustness to a single local decoy when the remaining evidence strongly supports one global rule. It also predicts systematic failure when the true rule lies outside the learned task family.
Training distribution matters because it determines which task families become easy to recognise. Controlled studies found that bursty sequences, many rare classes and changing item meanings can promote in-context learning, while task diversity can produce a transition from a narrow pretraining prior towards behaviour resembling a more general regression algorithm.[4, 8] These are findings about studied distributions, not a universal recipe for language models.
Implicit optimisation: the prompt supplies a tiny training set
The third route constructs a predictor from the examples. In a linear task, the model might behave as though it estimated a slope and intercept. More generally, it might implement one or more update steps on an internal model encoded in activations.
For squared-error regression, a familiar estimator is:
β is the temporary predictor, and λ controls regularisation. This equation describes a candidate algorithm, not a claim that a transformer literally stores a conventional parameter vector.
Transformers can be constructed or trained to emulate gradient descent, ridge regression and related estimators on stylised tasks. Akyürek and colleagues found that trained in-context learners could match several standard linear predictors and encode related quantities in late-layer activations. Von Oswald and colleagues gave a weight construction linking linear self-attention to a gradient step and observed closely matching behaviour in controlled regression models.[6, 7]
Capability to implement an optimiser is not evidence that every pretrained language model uses that optimiser. The construction establishes possibility under specified assumptions. Mechanism claims require interventions on the actual model, task and training regime.
Three points and one dangerous neighbour
Consider the demonstrations (1,3), (2,5), and (3,7), followed by the query x*=4. The global rule is y=2x+1, so the correct answer is 9.
Nearest-neighbour retrieval returns 7. Task inference over the three candidate rules identifies y=2x+1 and returns 9. Least-squares fitting also returns 9.
Now add one demonstration: (3.9,0). Only one causal property changes, the presence of a highly similar contradiction. Retrieval jumps to 0. A robust task-family selector can still choose y=2x+1. Ordinary least squares is pulled to approximately 2.74. The base case hid the mechanism. The decoy makes it visible.
Gradient-like behaviour on linear regression is a valuable mechanistic clue, not a licence to rename all in-context learning “gradient descent”. A direct comparison on pretrained language models found different sensitivity to demonstration order and different changes to output distributions, leaving broad equivalence an open hypothesis.[13]
The three routes can also cooperate. Retrieval can supply a relevant local example. Task inference can identify the output convention. An optimiser-like computation can estimate the remaining relation. The frame-solver distinction accommodates such mixtures because it asks two questions in sequence: what temporary problem representation was constructed, and what computations used it?
Interventions that separate the stories
A mechanism claim becomes useful when it tells us which single change should alter behaviour. The following experiments preserve most of the prompt while changing one causal property at a time.
Keep the categories, replace the names
A classifier already associates “positive” with praise and “negative” with complaint. Replace those labels with miv and taro. Then reverse the mapping in a second prompt. The underlying sentiment distinction stays fixed; only the output coordinate changes.
What should happen? A system dominated by semantic priors may continue emitting familiar labels or follow the natural meaning despite the demonstrated mapping. A frame-sensitive system should bind the temporary symbols to the categories. A retrieval system may succeed only when the query resembles a demonstration closely enough.
Scale and number of demonstrations matter. Experiments with flipped and semantically unrelated labels found that larger models were better able to override semantic priors and follow the demonstrated mapping. Many-shot prompting further improved the ability to overcome some pretraining biases.[10, 12] The important point is not that more examples always win. It is that the label mapping is a manipulable part of the temporary frame.
Label experiments also reveal why the phrase “learn from examples” can mislead. In a set of classification and multiple-choice tasks, Min and colleagues found that randomly replacing demonstration labels often barely reduced performance. The examples still communicated the input distribution, label space and sequence format.[5] This does not show that mappings never matter. It shows that a prompt can help by constructing the frame even when it provides weak evidence for the exact decision rule.
Preserve the function, rotate the features
A two-dimensional regression task uses height and width. Rotate every input by the same angle and rotate the hidden weight vector with it, so every target value remains unchanged. The examples look unfamiliar in the original coordinates, but the relation among examples is preserved.
A solver that has memorised “height usually matters more than width” should fail. A nearest-neighbour solver may degrade if its similarity geometry was tied to the old features. A coordinate-aware estimator can recover because the transformed demonstrations still determine the relation. Formally, if x′=Rx and w′=Rw for an orthogonal rotation R, then wᵀx = w′ᵀx′. The numerical function is preserved while the representation changes.
This experiment asks whether apparent adaptation tracks a learned algorithm, a learned task family, or a preferred representation. It is especially useful in synthetic models where every transformation is controlled.
The rotation test also sets a boundary on the coordinate metaphor. A prompt may establish a usable frame without making the solver invariant to arbitrary transformations. Frame construction and solver quality are separate. A clear task representation can still feed a brittle procedure.
One prompt can carry four different kinds of evidence
A demonstration is not a single teaching signal. It can identify the task boundary, bind arbitrary labels, reveal a statistical relation, and specify the required output form. Those functions can be separated.
Remove the labels but keep the input examples and formatting. If performance remains above the instruction-only baseline, the prompt may be helping the model recognise the domain or expected response shape. Keep the labels but replace each input with unrelated text. If performance collapses, label exposure alone was insufficient. Preserve the input-output pairs but alter punctuation and order. A large change implicates the interface through which the frame was constructed, not necessarily the abstract task.
This decomposition clarifies an apparent disagreement in the literature. Some experiments found that corrupted demonstration labels barely hurt several classification tasks, suggesting that label space, input distribution and format supplied much of the benefit. Other experiments found that sufficiently large models can learn deliberately flipped or semantically unrelated mappings, especially with more examples.[5, 10, 12] Both can be true. A familiar task may need only recognition and output calibration, while an arbitrary codebook demands binding of a new relation.
Do not ask whether demonstrations matter in general. Ask which informational role each demonstration is serving in this task. The answer determines the correct control. A format control tests interface calibration. A label permutation tests binding. A held-out function tests relation estimation. Context masking after a candidate recognition point tests whether task information has been compressed into a transient state.
Layer-local studies offer one possible route. If early layers require direct access to examples but later layers continue after the examples are masked, the model may have moved from reading the prompt to executing a represented task. That interpretation is strongest when the transition reproduces across paraphrases and when causal restoration recovers performance. It weakens if the effect disappears under a small template change or can be explained by residual token leakage.
Make the closest example wrong
Start with eight demonstrations that obey one clean rule. Add a ninth example that is almost identical to the query but carries the wrong answer. Nothing else changes.
If the output flips, local retrieval has strong causal influence. If the model resists, it may be integrating the global pattern, rejecting an outlier, or following an instruction that outranks the example. Repeat the test while varying only the decoy’s distance. The resulting response curve is more informative than a single accuracy score.
The rival explanation is attention dilution: perhaps the extra token merely perturbs processing rather than serving as a retrieved neighbour. A matched control should therefore add an equally long but irrelevant example. The mechanism claim strengthens only when similarity, not token count alone, predicts the effect.
Two temporary selves of the same model
Fork one base context into two branches. In branch A, miv means damaged. In branch B, miv means cold-chain. Each branch answers consistently. Now concatenate the branches before a shared query.
A recency strategy follows the later branch. A majority strategy counts demonstrations. A hierarchy-sensitive strategy follows the explicit instruction that declares which codebook is authoritative. A compressed task-vector account predicts interference when incompatible task states occupy overlapping representational directions.
The experiment moves the boundary of state without changing model weights. It asks whether temporary adaptation behaves like a simple bag of examples, a sequential state update, or a structured contract with precedence. For deployed systems, that difference determines whether conversation history can safely be merged.
Together, these experiments create an identification strategy. No single result proves a mechanism. A pattern across interventions can eliminate weak explanations and identify the next internal measurement.
| Intervention | Retrieval-dominant signature | Task-inference signature | Implicit-optimisation signature | Main confound to control |
|---|---|---|---|---|
| Nearest wrong decoy | Sharp local flip | Resists if global rule remains clear | Moves according to loss and robustness | Extra-token or recency effect |
| Arbitrary label remap | Works near seen exemplars | Consistent global remapping | Fits mapping when examples identify it | Semantic priors and output-token frequency |
| Order reversal | May change nearest or recent exemplar | Stable for exchangeable evidence | Stable for batch fit, unstable for sequential updates | Position encoding and prompt truncation |
| Feature rotation | Depends on similarity representation | Stable if task family is equivariant | Stable if estimator uses preserved relations | Tokenizer or representation shift |
| Out-of-family task | Can still interpolate locally | Falls back to nearest known hypothesis | May generalise if solver class is broad enough | Hidden overlap with pretraining tasks |
| Context reset | Retrieved relation disappears | Posterior or task state disappears | Temporary predictor disappears | Server-side persistence outside visible prompt |
A temporary support taxonomy
A service team changes its issue taxonomy for a one-week migration. The application retrieves twelve approved examples, adds a short definition of each temporary category, asks the model to propose a code, and keeps the ticketing system authoritative.
The first design treats examples as decoration. It selects the most recent tickets, mixes old and new labels, and accepts the model’s code without a readback. The second design treats the prompt as a temporary program. It versions the codebook, retrieves balanced boundary cases, declares precedence, requires the model to return a typed proposal with cited examples, and abstains when two codes remain plausible.
Both use the same model. The second is safer because it governs frame construction. It does not assume the model has internalised the taxonomy merely because several sample tickets were correct. A prompt-controlled system should make the temporary task state inspectable through its inputs, outputs and receipts.
The prompt that learned position, not policy
Suppose every demonstration lists the correct label second, after a rationale. The model performs perfectly. Reverse the label and rationale fields, and accuracy collapses. The apparent task learning was partly a formatting shortcut.
This is not a rare nuisance. In-context performance is sensitive to which demonstrations are selected and how they are ordered; retrieval strategies that look good for one model can transfer poorly to another.[16] The relevant lesson is causal: a prompt defines more variables than its author intends. Position, punctuation, label frequency and recency can become features of the temporary frame.
We can now state a practical prediction. Retrieval should dominate when the query has a close, reliable analogue and the task is familiar. Task inference should dominate when several examples jointly identify one known latent rule. Implicit optimisation becomes more plausible when performance improves smoothly with additional diverse examples, generalises across representation changes, and reacts to noise like an estimator.
Many-shot results strengthen the case for treating context as more than a handful of hints. Across a range of studied tasks, hundreds or thousands of demonstrations produced gains, helped override some pretraining biases, and sometimes approached supervised fine-tuning performance.[12] Yet more context also creates more opportunities for conflict, retrieval failure and spurious regularity. Capacity to absorb examples is not the same as reliability of the inferred frame.
stateDiagram-v2 [*] --> Claim state "The apprentice who forgets at<br/>the doorway" as Claim state "Retrieval, the answer is near<br/>an example" as Test state "When copying is enough" as Revision Claim --> Test: expose mechanism Test --> Decision: evidence survives Test --> Revision: rival survives Revision --> Claim: narrow or rebuild Decision --> [*]
Build the prompt as a controlled state
The mechanism question changes engineering practice. A prompt is more than prose placed before a query. It is a temporary program whose examples, labels, ordering and state boundary determine the computation available to the model.
The smallest useful discipline is to version four objects separately:
- The task contract: the intended relation, output schema, precedence rules and abstention condition.
- The demonstration set: why each example was selected, which boundary it covers, and which known confound it controls.
- The state boundary: what persists across turns, what resets, and whether external retrieval or application state contributes.
- The intervention suite: label remaps, order changes, decoys, counterexamples and out-of-family inputs used before release.
Without this separation, a successful prompt is hard to reproduce. A model update may alter semantic priors. A retriever update may change which examples appear. A longer conversation may introduce a conflicting codebook. The output can move even though the visible instruction is unchanged.
An executable mechanism audit
The laboratory below makes the rival generators explicit. It uses synthetic scalar functions so every assumption is visible. Choose a hidden rule, the number of demonstrations and a query. Then add a near-query decoy, reverse the order, or remove all demonstrations.
The three transparent solvers are intentionally simple. Retrieval copies the nearest output. Task-family inference selects the candidate rule with the lowest median error, making it resistant to one outlier. Ridge optimisation fits a regularised linear predictor. Their disagreement is the lesson.
Temporary Adaptation Mechanism Audit
Run a synthetic prompt through three candidate solvers. The lab does not simulate a transformer. It exposes the behavioural signatures that a black-box model can later be tested against.
Nearest retrieval
Task-family inference
Ridge optimisation
How to use the result
A positive result is not “one bar is shortest”. It is a reproducible intervention signature. Suppose a black-box model remains stable under order reversal, follows an arbitrary label remap, and resists one close decoy, yet improves with diverse examples. That pattern makes pure retrieval less plausible and justifies tests for task representations or estimator-like computation.
A negative result means the three candidate solvers fail to account for the pattern. That is useful. Add a rival, such as sequential recency weighting, instruction hierarchy, majority vote, kernel regression, or a mixture-of-experts account. The audit is designed to expand rather than force every model into one category.
The laboratory cannot establish an internal transformer mechanism. Behavioural resemblance is underdetermined. To move from a solver-level hypothesis to a mechanism claim, intervene on activations, attention paths or layer access, then show that disruption and restoration track the behavioural signature. Function-vector and task-recognition studies provide examples of this stronger causal direction, though their findings remain model and task specific.[9, 11]
function nearestPrediction(points, queryX) {
if (!points.length) return 0;
return points.reduce((best, point) =>
Math.abs(point.x - queryX) < Math.abs(best.x - queryX)
? point : best
).y;
}
function inferTaskFamily(points, queryX, rules) {
if (!points.length) return 0;
const scored = rules.map(rule => {
const errors = points
.map(p => Math.abs(p.y - rule.fn(p.x)))
.sort((a, b) => a - b);
return { rule, score: errors[Math.floor(errors.length / 2)] };
});
scored.sort((a, b) => a.score - b.score);
return scored[0].rule.fn(queryX);
}
function ridgePrediction(points, queryX, lambda = 0.2) {
if (!points.length) return 0;
const n = points.length;
const sx = points.reduce((s, p) => s + p.x, 0);
const sy = points.reduce((s, p) => s + p.y, 0);
const sxx = points.reduce((s, p) => s + p.x * p.x, 0);
const sxy = points.reduce((s, p) => s + p.x * p.y, 0);
const det = (sxx + lambda) * (n + lambda) - sx * sx;
if (Math.abs(det) < 1e-9) return sy / n;
const slope = ((n + lambda) * sxy - sx * sy) / det;
const intercept = ((sxx + lambda) * sy - sx * sxy) / det;
return slope * queryX + intercept;
}
To test an actual model, generate prompts from the same synthetic tasks and record its predictions under every intervention. Do not tune the prompt after seeing each result. Pre-register the expected signature, include matched controls for token count and formatting, and repeat across random seeds and model versions.
Optional depth: minimal protocol for a black-box language model
- Create at least 100 synthetic tasks with held-out functions and arbitrary labels.
- For each task, generate a base prompt and matched variants: reversed order, label permutation, near decoy, irrelevant extra example, context reset and representation transform.
- Use deterministic decoding where available, then repeat with sampled decoding to estimate output variability.
- Fit candidate signature models to the intervention effects, rather than only to base-task accuracy.
- Reserve a separate task family to test whether the inferred mechanism predicts out-of-family behaviour.
- Version the model, tokenizer, prompt template, example set, decoding settings and serving state.
From prompt craft to temporary-state engineering
Prompt engineering often optimises one output. Temporary-state engineering asks whether the system has formed the intended task at all. That shift produces concrete controls.
Choose demonstrations for coverage, contrast and boundary value, not only semantic similarity. A nearest example helps retrieval, but a pair of minimally different examples can identify which feature should govern the decision. Include at least one case that defeats the easiest shortcut. Keep labels balanced unless imbalance is part of the intended rule. Randomise order during evaluation even if production order is fixed.
Separate example retrieval from authority. Retrieved demonstrations are evidence about how to interpret the task, not permission to act. The model should produce a typed proposal. An authoritative application validates the schema, checks permissions, applies deterministic rules where possible, and records the examples and task-contract version that shaped the proposal.
Make resets deliberate. A conversation boundary, cache eviction, tool call or summarisation step can delete or distort the task frame. Conversely, carrying context forward can import obsolete instructions. The state manifest should state which temporary facts survive, for how long, and under whose authority.
Finally, require abstention when the frame is underdetermined. If two codebooks fit the demonstrations equally well, more fluent generation is not a solution. The correct system behaviour is to expose the conflict and request an authoritative distinction.
Task-frame bottleneck hypothesis: for some in-context tasks, a compact intermediate state captures most task-relevant information before the final prediction layers. The hypothesis strengthens if the state can be extracted, transferred to a new query context, causally disrupted, and restored. It weakens if performance always requires direct access to individual demonstrations or if extracted states fail across harmless reformulations. A rival explanation is distributed token-level retrieval that only appears compressed under coarse probes.
A release gate for temporary adaptation
A consequential in-context workflow should pass a small release gate before its prompt is treated as a stable capability. Begin with a base-performance check, but do not stop there. Measure the same task under at least three harmless variations, such as paraphrased instructions, order permutations and equivalent output formatting. Large variance means the frame is not yet stable.
Next run a mechanism break test. Add the nearest wrong decoy, invert arbitrary labels, or move to a relation-preserving feature transformation. The chosen test should target the mechanism being claimed. If the system is sold internally as learning a rule, a result consistent only with nearest-example copying is a failed gate even when ordinary accuracy remains high.
Then test scope recognition. Include queries that sit just outside the demonstrated task family. The model should abstain or expose uncertainty rather than smoothly extend a temporary rule into an unsupported region. This is especially important when examples are retrieved automatically, because retrieval can make every query look deceptively familiar.
Finally, verify state and recovery. Reset the conversation, change the model version, remove one demonstration, and replay the same request. Record which changes alter the proposal. A system that cannot explain its dependency on temporary evidence cannot reliably resume after interruption or reproduce a past decision.
The release gate does not demand one universal threshold. It demands a declared claim and a test that could lower confidence in that claim. Passing permits bounded use under the tested task contract. Failing means the prompt remains an exploratory configuration, not a dependable learned capability.
Do not use the frame-solver language to imply that a model has formed a human-like concept, intention or understanding. It is a causal decomposition of task performance. It is also unnecessary for simple prompts where the model merely follows a stable instruction and no adaptation claim is being made. The audit earns its cost when behaviour is consequential, surprising, or being used as evidence about model capability.
sequenceDiagram participant Q as Question participant M as Mechanism participant E as Evidence participant D as Decision Q->>M: The answer that vanishes at reset M->>E: The apprentice who forgets at the doorway E-->>M: compare rival explanations E->>D: Govern prompts as temporary programs D-->>Q: revise scope or act
Govern prompts as temporary programs
When a model succeeds after seeing examples, stop saying only that it “learned in context”. That phrase compresses the evidence before the important decision has been made.
Ask which state carried the adaptation. Ask what the demonstrations established: a label basis, a task family, a local precedent, a fitted relation, or merely a format. Then choose an intervention that makes the leading explanations disagree.
The practical decision is to promote prompts from informal text to governed temporary programs. Version the task contract and demonstration set. Declare the reset boundary. Test label swaps, order, decoys and out-of-family cases. Keep actions outside the model’s authority. Require receipts that show which temporary evidence shaped the proposal.
This discipline changes both research and deployment. Researchers gain experiments that distinguish retrieval from task inference and optimiser-like computation. Engineers gain a way to predict when a prompt will fail after a model, retriever or conversation state changes. Reviewers gain a stronger question than “did accuracy improve?” They can ask whether the claimed mechanism survived its break test.
In-context learning is remarkable because a fixed model can become temporarily specific. Its power comes from that specificity. So does its fragility. Do not trust the answer until you know what temporary world the prompt caused the model to inhabit.
Glossary
- In-context learning
- A change in task performance caused by examples or instructions supplied at inference time, without updating trained model parameters.
- Temporary adaptation
- Task-relevant change stored within bounded request state, such as activations or context-derived cache, rather than consolidated into persistent weights.
- Task frame
- The transient representation that makes a task’s labels, relevant relations, scope and output convention usable for the current request.
- Retrieval
- A solver route that uses similarity to find and reuse a relevant demonstration or contextual fragment.
- Task inference
- A solver route that treats demonstrations as evidence about which latent rule or task generated them.
- Implicit optimisation
- A solver route that behaves as though it constructs or updates a temporary predictor from prompt examples.
- Intervention signature
- The pattern of behavioural changes caused by controlled prompt modifications designed to separate rival mechanisms.
References
- Brown, T. B. et al. (2020). Language Models are Few-Shot Learners. NeurIPS 33.
- Xie, S. M., Raghunathan, A., Liang, P. and Ma, T. (2022). An Explanation of In-context Learning as Implicit Bayesian Inference. ICLR.
- Garg, S., Tsipras, D., Liang, P. and Valiant, G. (2022). What Can Transformers Learn In-Context? A Case Study of Simple Function Classes. NeurIPS 35.
- Chan, S. et al. (2022). Data Distributional Properties Drive Emergent In-Context Learning in Transformers. NeurIPS 35.
- Min, S. et al. (2022). Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? EMNLP.
- Akyürek, E., Schuurmans, D., Andreas, J., Ma, T. and Zhou, D. (2023). What Learning Algorithm Is In-Context Learning? Investigations with Linear Models. ICLR.
- Von Oswald, J. et al. (2023). Transformers Learn In-Context by Gradient Descent. ICML, PMLR 202.
- Raventós, A., Paul, M., Chen, F. and Ganguli, S. (2023). Pretraining Task Diversity and the Emergence of Non-Bayesian In-Context Learning for Regression. NeurIPS 36.
- Todd, E. et al. (2024). Function Vectors in Large Language Models. ICLR.
- Wei, J. et al. (2023). Larger Language Models Do In-Context Learning Differently.
- Sia, S., Mueller, D. and Duh, K. (2024). Where Does In-context Learning Happen in Large Language Models? NeurIPS 37.
- Agarwal, R. et al. (2024). Many-Shot In-Context Learning. NeurIPS 37.
- Shen, L., Mishra, A. and Khashabi, D. (2024). Position: Do Pretrained Transformers Learn In-Context by Gradient Descent? ICML, PMLR 235.
- Panwar, M., Ahuja, K. and Goyal, N. (2024). In-Context Learning through the Bayesian Prism. ICLR.
- Olsson, C. et al. (2022). In-context Learning and Induction Heads. Transformer Circuits Thread. Non-peer-reviewed mechanistic study.
- Peng, K. et al. (2024). Revisiting Demonstration Selection Strategies in In-Context Learning. ACL.