Not All Drift Is a Mechanism: Tracing Prompt Adaptation in LLMs
Organizations: BRAIn Lab
Abstract
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.
Figures & tables
| Conditions | |
| GEPA–prompt | |
| GEPA–prefix |
| Target | Native | MSE | MSE+KL |
| GEPA | |||
| Prompt | |||
| Prefix |
| positions per row | Gini | Gini, comment tokens | busiest expert (%) | dead experts | ||
| Qwen3-30B-A3B | base | 153 | 0.635 | 0.757 | 5.2 | 7.8 |
| GEPA | 2154 | 0.729 | 0.759 | 8.2 | 7.6 | |
| prompt, 100 | 253 | 0.583 | 0.753 | 5.0 | 3.0 | |
| prompt, 200 | 353 | 0.610 | 0.747 | 6.1 | 4.5 | |
| prompt, 500 | 653 | 0.620 | 0.753 | 6.6 | 3.0 | |
| prefix, 100 | 153 | 0.640 | 0.760 | 5.8 | 8.4 |
| arm | answer only | with reasoning |
| prompt, 100 | 0.784 | 0.482 |
| prompt, 500 | 0.799 | 0.775 |
| prefix, 100 | 0.819 | 0.789 |
| prefix, 500 | 0.820 | 0.764 |
| unreadable (%) | super experts | |||||||
| original | kept | pruned | ||||||
| Qwen3-30B-A3B | base | 0.466 | 0.575 | 0.330 | 0.0 | 100.0 | all three | 0.328 |
| GEPA | 0.728 | 0.728 | 0.330 | 0.0 | 100.0 | all three | 0.328 | |
| prompt, 100 | 0.833 | 0.814 | 0.440 | 0.0 | 0.2 | L2 E92, L3 E82 | 0.409 | |
| prompt, 200 | 0.816 | 0.330 | 0.330 | 100.0 | 100.0 | all three | 0.328 | |
| prompt, 500 | 0.828 | 0.812 | 0.450 | 0.0 | 0.0 | all three | 0.328 | |
| Qwen3-30B-A3B | gpt-oss-20b | ||||
| L1 E68 | L2 E92 | L3 E82 | L6 E5 | L17 E5 | |
| base | 422 | 800 | 458 | 43 000 | 52 700 |
| GEPA | 422 | 800 | 458 | 43 000 | 52 700 |
| prompt, 100 | 11.1 | 250 | 572 | 43 000 | 50 700 |
| prompt, 200 | 470 | 764 | 472 | 43 000 | 51 500 |
| prompt, 500 | 1000 | 952 | 572 | 43 000 | 46 900 |
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
| discrete (GEPA) | prompt tuning | prefix tuning | ||||
| strict | set | strict | set | strict | set | |
| 0.6077 | 0.6604 | 0.7192 | 0.7336 | 0.7443 | 0.7445 | |
| 0.5888 | 0.6526 | 0.7662 | 0.7717 | 0.7951 | 0.7952 | |
| 0.6190 | 0.6598 | 0.8003 | 0.8017 | 0.8117 | 0.8118 | |
| branch | [95% CI] | norm-matched random |
| prefix tuning ( ) | ||
| discrete (GEPA) |
| condition | raw | centered |
| GEPA | 0.902 | 0.702 |
| prompt tuning ( ) | 0.830 | 0.473 |
| prefix tuning ( ) | 0.497 | 0.155 |
| 0.961 | 0.845 |
| Repredict | Fixed | ||||
| Target | Native | MSE | MSE+KL | MSE | MSE+KL |
| GEPA | |||||
| Prompt | |||||
| Prefix | |||||
| Regime | Target | full | ||||
| Repredict | GEPA | 0.634 | 0.640 | 0.645 | 0.660 | 0.683 |
| Prompt | 0.596 | 0.655 | 0.664 | 0.699 | 0.746 | |
| Prefix | 0.677 | 0.683 | 0.688 | 0.700 | 0.741 | |
| Fixed | GEPA | 0.635 | 0.635 | 0.636 | 0.640 | 0.641 |
| Prompt | 0.580 | 0.577 | 0.595 | 0.608 | 0.619 | |
| Prefix | 0.353 | 0.346 | 0.371 | 0.391 | 0.389 |
| Target | Native | Block-25 correction | Early exit |
| GEPA | |||
| Prompt | |||
| Prefix |
| Condition | Native (ms) | Early exit (ms) |
| Seed | – | |
| GEPA | ||
| Prompt | ||
| Prefix |
| Pair | MSE | MSE+KL |
| GEPA, prompt | 0.32 | 0.29 |
| GEPA, prefix | 0.27 | 0.24 |
| Prompt, prefix | 0.49 | 0.57 |
| GEPA seeds | 0.72 | 0.67 |
| Prompt seeds | 0.67 | 0.76 |
| Prefix seeds | 0.61 | 0.68 |
| Method | Predictor | Native | One-shot | Fixed | Repredict |
| GEPA | Linear | ||||
| MLP | |||||
| Prompt | Linear | ||||
| MLP | |||||
| Prefix | Linear | ||||
| MLP |
| model | arm | level (%) | mass (%) | exact | empty | unreadable | no end | looping | |
| Qwen | base | 0.0 | 0.466 | 0.211 | 26.5 | 0.0 | 0.0 | 0.0 | |
| base | 5.8 | 0.575 | 0.167 | 21.1 | 0.0 | 0.1 | 0.0 | ||
| base | 28.3 | 0.330 | 0.330 | 100.0 | 100.0 | 61.9 | 21.7 | ||
| GEPA | 2.0 | 0.728 | 0.583 | 24.1 | 0.0 | 0.0 | 0.0 | ||
| GEPA | 17.8 | 0.330 | 0.330 | 100.0 | 100.0 | 100.0 | 94.7 | ||
| prompt, 100 | 11.4 | 0.814 | 0.696 | 31.8 | 0.0 | 0.0 | 0.0 |
| Qwen3-30B-A3B | gpt-oss-20b | |||
| base | L1 E68, L2 E92 | all three | — | — |
| GEPA | L1 E68 | all three | — | — |
| prompt, 100 | L1 E68 | L1 E68, L3 E82 | — | L6 E5 |
| prompt, 200 | L1 E68, L2 E92 | L1 E68, L2 E92 | — | — |
| prompt, 500 | L1 E68 | L1 E68, L2 E92 | — | — |
| WikiText-2 perplexity | ||||||
| prefix | intact | values zeroed | keys masked | intact | values zeroed | keys masked |
| untrained | 48.0 | 7.22 | 6.87 | — | — | — |
| LR | 34.0 | 7.48 | 7.16 | 0.807 | 0.412 | 0.509 |
| LR | 275 | 8.95 | 8.63 | 0.807 | 0.759 | 0.766 |
| arm | frozen | retrained | difference ( ) | , retrained vs frozen |
| base | 0.461 | 0.800 | ( ) | 0.080 |
| GEPA | 0.730 | 0.803 | ( ) | 0.076 |
| prompt, 100 | 0.829 | 0.824 | ( ) | 0.030 |
| prompt, 200 | 0.813 | 0.820 | ( ) | 0.014 |
| prompt, 500 | 0.832 | 0.822 | ( ) | 0.011 |
| prefix, 100 | 0.830 | 0.832 | ( ) | 0.057 |
| gpt-oss-20b | Qwen3-30B-A3B | |||||
| GPUs | 2 | 4 | 8 | 2 | 4 | 8 |
| uniform load | 0.956 | 0.853 | 0.707 | 0.975 | 0.938 | 0.821 |
| GEPA | 1.010 | 1.040 | 1.109 | 1.008 | 1.046 | 1.062 |
| prompt, 100 | 1.020 | 1.038 | 1.071 | 1.004 | 1.000 | 0.979 |
| prompt, 200 | 1.038 | 1.039 | 1.096 | 1.014 | 1.014 | 0.993 |
| prompt, 500 | 1.042 | 1.061 | 1.135 | 1.019 | 1.026 | 1.007 |
| recipient donor | gap | support | coefficients | joint | matched random | shuffled |
| base prompt, 500 | ||||||
| prompt, 500 base | ||||||
| base prefix, 500 | ||||||