Test-time adaptation enables large language models (LLMs) to modify their behavior at inference without updating model parameters. A common approach is many-shot prompting, where large numbers of in-context learning (ICL) examples are injected as an input-space test-time update. Although performance can improve as more demonstrations are added, the reliability and limits of this update mechanism remain poorly understood, particularly for open-source models. We present an empirical study of many-shot prompting across tasks and model backbones, analyzing how performance varies with update magnitude, example ordering, and selection policy. We further study Dynamic and Reinforced ICL as alternative test-time update strategies that control which information is injected and how it constrains model behavior. We find that many-shot prompting is effective for structured tasks where demonstrations provide high information gain, but is highly sensitive to selection strategy and often shows limited benefits for open-ended generation tasks. Overall, we characterize the practical limits of prompt-based test-time adaptation and outline when input-space updates are beneficial versus harmful.
Figures & tables
Figure 1: A unified view of prompt-based test-time adaptation. Update design determines whether added context provides signal or noise.
Figure 2: Scaling behavior of prompt-based test-time updates. (a) Many-shot accuracy vs. update magnitude (b) Dynamic ICL update policies (c) Model capacity effects (d) Reinforced ICL scaling
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
n per-class shots
N Total demonstrations
1
77
2
154
3
231
4
308
5
385
50
3850
Appendix
Table 1: Comparison of per-class shots with total demonstrations in input prompt for Banking 77
Figure 3: Dynamic ICL Selection Strategies on Banking 77
Per-class shots n
LLaMA-3.1-8B
LLaMA-3.1-8B-Instruct
50
33.9
80.8
70
35.9
82.3
Appendix
Table 2: Many-shot prompting for Llama-3.1-8B on Banking 77 (accuracy in %). Prompts contain N total demonstrations, constructed using n shots per class ( N=n×C , C=77 ).
Generator Prompt
Generator agent for creating step-by-step reasoning. Rules:
– Use at most 10 steps.
– No explanations.
– No restating the question.
– End immediately after the answer.
– Do not reference the order of the answers in the question (e.g., option a, b, c).
Appendix
Table 3: Prompt template used for the Generator agent during data generation for Reinforced ICL.
Verifier Prompt
Verified agent for step by step reasoning.
For the text within the <a> tags, make sure it matches exactly to the correct answer, word for word.
Appendix
Table 4: Prompt template used for the Verifier agent during data generation for Reinforced ICL.
Task
Baseline
4-Shot
16-Shot
32-Shot
Domain-Specific / Information-Heavy Tasks
DROP
10.8
13.1
14.2
15.8
FDA
39.65
86.8
89.4
89.7
SWDE
74.17
92.9
95.1
96.4
Structured Reasoning Tasks (Constrained Output)
ARC-Challenge
38.82
93.72
93.48
93.45
Appendix
Table 5: Task-dependent performance of many-shot test-time updates (LLaMA-3.3-70B-Instruct)
Figure 4: Context length scaling with update magnitude
Large language models (LLMs) are typically deployed with fixed parameters, and their performance is often improved by allocating more computation at inference time. While such test-time scaling can be effective, it cannot correct model misconceptions or adapt the model to the specific structure of an individual query. Test-time optimization addresses this limitation by enabling parameter updates during inference, but existing approaches either rely on external data or optimize generic self-supervised objectives that lack query-specific alignment. In this work, we propose Query-Conditioned Test-Time Self-Training (QueST), a framework that adapts model parameters during inference using supervision derived directly from the input query. Our key insight is that the input query itself encodes latent signals sufficient for constructing structurally related problem--solution pairs. Based on this, QueST generates such query-conditioned pairs and uses them as supervision for parameter-efficient fine-tuning at test time. The adapted model is then used to produce the final answer, enabling query-specific adaptation without any external data. Across seven mathematical reasoning benchmarks and the GPQA-Diamond scientific reasoning benchmark, QueST consistently outperforms strong test-time optimization baselines. These results demonstrate that query-conditioned self-training is an effective and practical paradigm for test-time adaptation in LLMs. Code is available at https://chssong.github.io/Query-Conditioned-TTST/.
Chaehee Song, Minseok Seo, Yeeun Seong +2
School of Electrical Engineering, KAIST · 2Graduate School of Green Growth and Sustainability, KAIST
Test-time training (TTT) lets a model store information in its weights during inference. When the model learns from its own output, however, each update also changes the model that generates the next training example. Across 128K-token streams, retaining generated-text updates worsens prediction on independent human-written text with three TTT-E2E model configurations (labeled 125M, 760M, and 3B). The same failure occurs when Adam updates Qwen3-4B's existing weights. The same update mechanisms can improve on real text, so writing itself is not the failure. Three matched comparisons trace the causal pathway. Fixed Generation removes over 98% of the damage at 125M and 760M by using a frozen model to generate training chunks. Recorded Replay separates the loss caused by reading degraded text from the additional loss stored by updating on it. A paired one-update comparison then shows the local conflict: an update predicts its source better but new real text worse. This cost grows after Closed Loop adaptation, with a few trajectories accounting for most large failures. Finally, Settlement evaluates the candidate state on independent real text before commitment. It leaves mean endpoint gaps of 0.07 and -0.02 nats at 125M and 760M while retaining real-text adaptation. These results motivate checking prediction on independent evidence before retaining an update.
Cheng Luo, Bing Li, Bernard Ghanem
King Abdullah University of Science and Technology (KAUST)
Prompt-based adaptation offers several ways to specialize a frozen language model, ranging from natural-language prompt optimization to learned continuous prompts. These methods are usually compared through downstream performance, although similar outputs need not arise from similar internal computations. We study how discrete prompt optimization, prompt tuning, and prefix tuning alter the processing of dense and mixture-of-experts language models. Our analysis shows that the location of the adaptation predicts how task information is carried to the output: optimized text primarily changes response construction, input-level prompts write their influence into content representations, and layer-wise prefixes maintain direct control through attention. In MoE models, these differences further induce distinct expert-routing patterns. At the same time, common representation-level measurements respond strongly to generic context changes and do not reliably distinguish useful adaptations from matched placebos. We argue that understanding prompt adaptation requires separating representation drift from the part of that drift that is aligned with, and causally used by, the model's task computation. This perspective provides practical guidance for selecting, evaluating, and interpreting prompt adaptation methods.
Mikhail Aleksandrov, Nail Bashirov, Maksim Ivanov +6