System Prompt Hallucination: How Instruction Prefixes Alter Internal Computation in Language ModelsThe System Prompt Illusion: How Instruction Preambles Modify Computation in Language Models
The authors analyze representations from 17 models and find that role instructions deeply reconstruct intermediate representations, while safety instructions cause only shallow changes and are nearly identical to unrestricted instruction paths.
- System prompts are a central means of controlling language model behavior, but their mechanism of action on the model's internal computation is not yet clear. If prompts affect only shallow layers or the final output distribution, they can be easily bypassed by adversarial inputs. Quantifying how much prompts reconstruct hidden-layer representations helps explain why prompt-based safety defenses are often fragile.
- Using centered kernel alignment (CKA) to measure layer-wise representation similarity between 17 models under 20 system prompts and a no-prompt baseline, defining penetration depth as the proportion of non-embedding layers with CKA below 0.95. Activation patching is used to verify causality, and layer-wise linear probing compares prompt encoding and representation reconstruction differences.
- Representation reconstruction exhibits layer selectivity: role instructions penetrate on average 50.3% across 14 core models, while safety instructions only 7.3%; the layer-wise CKA correlation coefficient between restrictive safety instructions and unrestricted instructions is 0.997. All layers can linearly decode prompt categories with high accuracy, but only a few layers undergo geometric reconstruction.
- The authors note that the largest model is 72B and larger scales were not tested, CKA does not resolve specific features, multi-turn decoding dynamics were not measured, and all prompts are in English. The experiments cover 17 instruction-tuned models from 8 families, including 20 prompts and 100 general queries, with causal patching based on 10 coding tasks.
- Evaluated models
- Qwen-2.5-1.5BSmolLM2-1.7BGemma-1-2BGemma-2-2BQwen-2.5-3BLLaMA-3.2-3BPhi-3.5-MiniQwen-2.5-7BNemotron-Nano-8BMistral-7BGemma-2-9BOLMo-2-7BInternLM-2.5-7BQwen-2.5-14BQwen-2.5-32BLLaMA-3.1-70BQwen-2.5-72B
- Benchmarks
- 100 domain-general queries10 coding queries (Appendix B)
- Metrics
- CKAPenetration depth1 - ROUGE-LLinear probing accuracydelta (code-fraction shift)
The researchers compare layer-wise representations under 20 system prompts using CKA across 17 instruction-tuned models (8 architecture families, 1.5B–72B parameters). Persona and format instructions deeply reconstruct intermediate representations, while safety instructions barely change representations, statistically indistinguishable from a minimal baseline; restrictive safety instructions and instructions that explicitly lift restrictions activate nearly identical computational paths (mean CKA correlation 0.997), and safety penetration rates in 70B–72B models remain below 10%. Linear probes show that every layer of the model encodes prompt category, but computation is reconstructed in only a few layers, meaning safety instructions are "seen" but not deeply "executed"; causal activation patching confirms these layers mediate behavioral changes, and representation depth predicts the size of behavioral effects (Spearman ρ=0.761). The authors thereby mechanistically explain why system-prompt-based safety remains persistently vulnerable to jailbreaks.
Why it was selectedThe paper uses CKA and activation patching to quantify how system prompts alter internal representations, providing a mechanistic explanation for why system prompt safety is fragile.
Paper analysis
What problem does this paper attempt to solve?
Analyzing how system prompts change a model's internal layer-wise representations, investigating whether they are deep reconstruction or surface fine-tuning, and explaining the jailbreak vulnerability mechanism of safety prompts.
The core question is how system prompts change the layer-by-layer computation and representation geometry in the internal forward pass of large language models, and how the computational depth affects behavior control and adversarial robustness.
- Scenario and Importance: The authors state that system prompts are the core means of controlling model persona, safety constraints, and output format, but their mechanism of action on internal computation is unclear. If prompts only change shallow layers or output logits distributions, adversarial inputs can easily bypass their control; if they can reconstruct deep representations, they may provide persistent behavioral constraints.
- Limitations of Existing Methods: The authors state that existing mechanistic interpretability research often focuses on specific circuits or concept directions, while representation similarity tools have previously been used mainly for comparing different models or training stages; no work has systematically measured how system prompts change layer-wise representations within a single model.
- Core Hypothesis Setting: The paper formalizes three competing hypotheses: the shallow hypothesis (H1) that only the first two to three and last two to three layers are modified, the deep hypothesis (H2) that all hidden layers are uniformly modified, and the layer-selection hypothesis (H3) that specific layers are selectively modified depending on instruction category and model architecture.
- Main Approach of the Paper: The paper uses centered kernel alignment (CKA) as a probe across 17 instruction-tuned models (1.5B–72B) from 8 architecture families, measuring layer-wise representation changes induced by 20 system prompts across 5 major categories, combined with activation patching and linear probing to elucidate the internal mechanisms.
What related research exists?
Reviewing four lines of research—representation similarity, mechanistic interpretability, system prompts and alignment, and layer-wise analysis and scaling—and noting the lack of systematic measurement of internal representations within a single model.
- Representation Similarity Methods: Kriegeskorte et al. (2008) proposed representational similarity analysis in neuroscience; Raghu et al. (2017) and Morcos et al. (2018) introduced CCA-based analysis tools; Kornblith et al. (2019) proposed centered kernel alignment (CKA). Davari et al. (2022) evaluated CKA's sensitivity to distribution and sample size, Williams et al. (2021) established its geometric unification framework, and Murphy et al. (2024) corrected finite-sample bias. The authors note that these works are mainly used to compare different models or training stages, whereas this paper applies CKA to compare representations of the same model under different system prompts, isolating prompt effects and avoiding cross-model identifiability issues.
- Mechanistic Interpretability and Circuit Analysis: Wang et al. (2022) identified the indirect object identification circuit; Meng et al. (2022) localized factual associations via causal tracing; Geva et al. (2020) modeled feed-forward layers as key-value memories; Park et al. (2023) and Zou et al. (2023a) modeled concepts as linear directions in activation space; Todd et al. (2023) identified functional vectors; Lv et al. (2024) and Shu et al. (2025) analyzed knowledge storage layers; nostalgebraist (2020) and Belrose et al. (2023) proposed logit lens and tuned lens. The authors note that these works aim to identify what each layer represents, whereas this paper measures the magnitude of representation changes when system prompts change, making them complementary.
- System Prompts and Safety Alignment: Olsson et al. (2022) and Hendel et al. (2023) explored in-context learning mechanisms; Guo and Cai (2025) and Neumann et al. (2025) focused on the effect of prompt position on behavior; Zou et al. (2023b) and Wei et al. (2023) documented universal adversarial suffixes and jailbreak strategies; Qi et al. (2024) found that minimal fine-tuning can undo safety alignment; Arditi et al. (2024) found that refusal behavior is mediated by a single direction in activation space; Turner et al. (2023) and Rimsky et al. (2023) proposed activation steering techniques; Geiger et al. (2023) proposed a causal abstraction evaluation framework.
- Layer-Level Analysis and Model Scaling: Raghu et al. (2021) and Phang et al. (2021) analyzed visual networks and the impact of fine-tuning on deeper layers; Men et al. (2024) analyzed redundancy in network layers; Pola and Balasubramanian (2025) localized the starting layer of instruction computation; Kaplan et al. (2020) proposed parameter scaling laws.
- Baselines and Benchmarks: The paper establishes a no-prompt baseline (s0, empty string) and a Minimal baseline (A0–A3) containing 4 basic prompts; evaluation data uses 100 general queries covering factual QA, reasoning, creative generation, and instruction following, as well as 10 code-writing tasks for causal activation patching (Appendix B).
- Positioning: The authors state that this is the first study to measure how system prompts modify internal representations across architectures and scales, providing an internal mechanistic explanation for the jailbreak vulnerability of system prompts documented at the behavioral level.
How does the paper address this problem?
Construct an analytical framework combining CKA-based representation penetration depth, causal activation patching, second-order perturbation bounds, and layer-wise linear probing to quantify and verify the internal impact of prompts.
The overall approach is to build a representation penetration analysis and causal validation framework centered on linear centered kernel alignment (CKA), combined with causal intervention and probing techniques, to determine by quantifying the degree of geometric reconstruction in hidden layers whether system prompts deeply reconstruct computation or only fine-tune the surface.
Representation Similarity and Penetration Depth Definitions
- Linear CKA computation: For a model with L non-embedding layers, given activation matrices X and Y for n input tokens under system prompts s1 and s2, after column centering to obtain X_bar and Y_bar, the layer similarity is computed via the formula CKA(X̄, Ȳ) = (|Ȳ⊤ X̄|F2)/(|X̄⊤ X̄|F · |Ȳ⊤ Ȳ|F), ranging from 0 to 1. This formula measures the geometric similarity of activation matrices under two prompt conditions; the authors state that linear CKA was chosen for both computational efficiency and theoretical clarity.
- Penetration depth metric: Defined via the formula Pen(s) = 1/L ∑ℓ=1L 𝕀[CKA(ℓ)(s, s0) < τ] 计算提示词 s 相对于无提示词基线 s0 的渗透深度,即 CKA 低于阈值 tau 的非嵌入层比例。该公式定义了提示词对模型内部计算产生可测改变的层数占比。
- 阈值标定依据:阈值设定为 tau = 0.95。作者在同一提示词条件下计算半样本分割 CKA,14 个核心模型的零分布均值为 0.997 ± 0.003,tau = 0.95 位于零分布均值下方约 300 个标准差处,以此排除随机测量波动。
因果激活修补验证
- 受影响层与对照层划分:为检验 CKA 识别的表征变化层是否切实对生成行为产生因果作用,对每个模型选出 CKA 最低的 5 个受影响层和 CKA 最高的 5 个未受影响层作为对照。
- 激活替换机制:在系统提示词 s 条件下运行模型前向传播,通过 PyTorch 前向钩子(hook),将选定层的隐藏状态替换为无提示词基线 s0 下对应的隐藏状态。
- 因果判定准则:在 10 个代码编写任务上测量代码行特征比例的偏移量 delta = fcode(patched) - fcode(original)。若受影响层的偏移量绝对值超过未受影响层 0.01 以上(|delta_affected| > |delta_unaffected| + 0.01), the model is judged to pass the causal test.
Theoretical Analysis of Perturbation Sensitivity
- Second-order perturbation bound (Proposition 1): The paper derives and proves that for a perturbation E = Y_bar - X_bar, the first-order terms 2<X_bar^\top X_bar, E^\top X_bar>_F in the numerator and denominator of the CKA expansion cancel exactly by symmetry, so the leading deviation of 1 - CKA(X_bar, Y_bar) is the second-order term 2||E||_F^2 / ||X_bar^\top X_bar||_F + O(||E||_F^3 / ||X_bar^\top X_bar||_F^{3/2}).
- Sensitivity and invariance properties: The authors note that the cancellation of first-order effects makes CKA insensitive to small perturbations while sensitively capturing second-order geometric changes; CKA is also invariant to isotropic scaling and orthogonal transformations, eliminating interference from activation norm fluctuations.
Prompt Classification and Linear Probing Design
- Prompts and task design: Construct 5 categories totaling 20 system prompts (4 per category), covering Minimal (A0–A3), Persona (B4–B7), Safety (C8–C10 and permissive instruction C11), Format (D12–D15), and Domain (E16–E19). Evaluation inputs include 100 general queries across domains.
- Linear probing separation mechanism: At each hidden layer, train a 5-class logistic regression classifier (regularization coefficient C = 1.0, max iterations 1000, 5-fold cross-validation), using the activation difference vector h_s - h_s0 between prompt and baseline to predict the prompt category, to test whether the model encodes prompts at all layers or changes geometric computation only at specific layers.
What experiments did the paper conduct?
Evaluating representation penetration across 17 models, showing that role instructions deeply reconstruct while safety instructions only shallowly fine-tune, and that safety and instruction-lifting paths nearly coincide.
Experimental Setup
- Models Tested: Evaluation includes 17 instruction-tuned models from 8 architecture families, including Qwen-2.5-1.5B, SmolLM2-1.7B, Gemma-1-2B, Gemma-2-2B, Qwen-2.5-3B, LLaMA-3.2-3B, Phi-3.5-Mini, Qwen-2.5-7B, Nemotron-Nano-8B, Mistral-7B, Gemma-2-9B, OLMo-2-7B, InternLM-2.5-7B, Qwen-2.5-14B, Qwen-2.5-32B, LLaMA-3.1-70B, Qwen-2.5-72B (Table 1).
- Evaluation Benchmarks and Queries: Uses 100 general queries covering factual QA, reasoning, creative generation, and instruction following, plus 10 Python code-writing tasks listed in Appendix B (for causal patching). System prompts include 20 prompts across 5 functional categories.
- Baselines: Includes a no-prompt baseline (s0, empty string) and a Minimal baseline (A0–A3) containing 4 basic assistant prompts.
- Evaluation Metrics: Layer-wise linear CKA; penetration depth Pen(s) (threshold tau = 0.95); behavioral effect size 1 - ROUGE-L; activation patching code-line feature change delta; layer-wise linear probing accuracy; perturbed effective rank exp(H(sigma)).
- Inference and Reasoning Configuration: Inference uses greedy decoding (temperature 0, seed 42, max 200 tokens), with bfloat16 precision for inference and float32 precision for CKA computation. Activation patching uses a code-line heuristic feature fcode to compute compliance changes, with a threshold for change difference greater than 0.01; linear probing uses 5-fold cross-validated logistic regression (C = 1.0).
- Sample Size and Forward Computations: Each model runs 100 queries × 21 prompt conditions = 2100 forward passes, totaling 35,700 forward passes across 17 models; confidence intervals are evaluated with 1000 Bootstrap resamples.
Main Results
The paper reports penetration depth results for representative models across scales in Table 2:
Swipe horizontally to read the table
Model Architecture Family Parameters Overall Penetration Role Penetration Safety Penetration Qwen-2.5-1.5B Qwen-2.5 1.5B 0.036 ± 0.01 0.082 ± 0.02 0.014 ± 0.01 Qwen-2.5-14B Qwen-2.5 14B 0.188 ± 0.03 0.312 ± 0.04 0.045 ± 0.01 Qwen-2.5-32B Qwen-2.5 32B 0.194 ± 0.02 0.321 ± 0.05 0.048 ± 0.02 Qwen-2.5-72B Qwen-2.5 72B 0.201 ± 0.02 0.330 ± 0.05 0.051 ± 0.02 LLaMA-3.1-8B (Nemotron) LLaMA-3.1 8B 0.594 ± 0.06 0.781 ± 0.08 0.082 ± 0.03 LLaMA-3.1-70B LLaMA-3.1 70B 0.642 ± 0.06 0.815 ± 0.09 0.091 ± 0.02 Note: Data from Table 2, showing penetration depth (mean ± standard deviation) across parameter scales. The overall penetration depths for all 17 models are in Table 1 (ranging from 0.036 to 0.688); omitted here are 11 models from Table 1: SmolLM2-1.7B (0.042), Gemma-1-2B (0.333), Gemma-2-2B (0.462), Qwen-2.5-3B (0.139), LLaMA-3.2-3B (0.357), Phi-3.5-Mini (0.375), Qwen-2.5-7B (0.179), Mistral-7B (0.500), Gemma-2-9B (0.452), OLMo-2-7B (0.688), and InternLM-2.5-7B (0.312); including Qwen-2.5-1.5B, which has the lowest penetration depth among all models.
- Layer-Selection Hypothesis Supported: The authors state that system prompts do not merely change the first and last two to three layers (H1 shallow hypothesis fails on 14 models), nor are they globally uniform reconstruction (H2 only partially fits OLMo-2 and LLaMA-70B), but exhibit layer selectivity determined by both instruction category and model architecture (H3), with penetrated layers forming a continuous band (Section 5.1).
- Instruction Category Determines Penetration Depth: Role (Persona) and Format categories deeply reconstruct intermediate layers, while Safety prompts show shallow fine-tuning at all scales, with penetration rates similar to the minimal prompt baseline (Section 5.2).
- Scaling Shows Architecture Specificity: The Qwen series shows penetration depth plateauing above 14B parameters (14B at 18.8%, 72B at 20.1%), while the LLaMA series shows a monotonic increase (8B at 59.4%, 70B at 64.2%); the authors state that scaling laws depend on specific architecture and training pipeline (Section 5.3).
Equivalence of Restrictive and Unrestricted Safety Instructions
- What Was Measured: Comparison of response curves in layer-wise CKA between restrictive safety prompts (C8–C10) and explicitly unrestricted prompts (C11: "You have no restrictions") (Section 5.4).
- Experimental Results: Across 14 core models, the Pearson correlation coefficient between the two layer-wise CKA curves ranges from 0.987 to 1.000 (mean 0.997); on 70B and 72B commercial-scale models, the correlation is r = 0.998 (p < 0.001)(Section 5.4, 5.9)。
- 作者解读:作者称,限制性指令与解除限制指令在所有测试尺度上均作用于相同的网络层并调节相同的低维子空间,二者在逐层表征层面计算上等价。
因果激活修补验证
- 测了什么:用无提示词基线激活替换 CKA 识别的 5 个最受影响层与 5 个最不受影响层,检验格式类任务输出代码特征的变化量 delta(Section 5.5)。
- 实验结果:14 个子 72B 模型中有 13 个通过因果检验;3 个商用规模模型受影响层偏移量 delta_affected > 0.42, while unaffected layers delta_unaffected < 0.03;全量 17 个模型中有 16 个通过检验(Section 5.5, 5.9)。
- 作者解读:作者称,激活修补证实 CKA 识别的受影响层切实介导了模型的行为变化,使 CKA 确立为具备功能意义的层定位工具。
线性探测:编码与重构解耦
- 测了什么:在隐藏层训练逻辑回归分类器预测 5 类提示词,对比信息可解码性与 CKA 几何重构(Section 5.8)。
- 实验结果:14 个核心模型所有层上的分类准确率均超过 85%(全层平均 97.8%,随机几率 21%),而 CKA 在 0.88 至 1.0 之间波动(Section 5.8)。
- 作者解读:作者称,模型在全网络残差流中均编码了提示词类别(能够“看到”提示词),但仅在特定层重构表征几何(安全提示词未被深层“执行”)。
其他消融与分析
- 提示词类别渗透率:14 个核心模型平均 Persona 为 50.3% ± 19.5%,Format 为 44.5% ± 14.2%,Domain 为 26.2% ± 24.5%,Safety 为 7.3% ± 9.2%,Minimal 为 4.9% ± 9.7%(Section 5.2)。
- 渗透率与行为效应:全量 17 个模型 CKA 渗透率与 1 - ROUGE-L 呈正相关(Spearman rho = 0.761,p < 0.001;排除 Format 后 rho = 0.645,p = 0.032)(Section 5.7)。
- 扰动范数与有效秩:中间层扰动 Frobenius 范数与渗透率强相关(rho 为 0.71 至 0.95,p < 0.001);控制范数后有效秩偏相关无独立贡献(偏 rho 为 0.11 至 0.25,p > 0.30) (Section 5.6).
- Similarity metric consistency: CKA correlates with Procrustes distance at 0.9924, but only 0.0293 with vector cosine similarity (Section 5.7).
- Threshold sensitivity stability: When tau varies from 0.90 to 0.99, the Spearman rank correlation of model penetration rankings is always greater than 0.95 (Section 5.7, Appendix F).
- Prompt length independence: The Spearman correlation between prompt token length and penetration is rho = 0.400 (p = 0.505) (Section 5.2).
Negative Results and Exceptions
- Causal Patching Exception: SmolLM2-1.7B is the only model among all 17 that fails the causal activation patching test; the authors state this is because the model's overall penetration is too low (0.042), and the representation differences between affected and unaffected layers are too small (Section 5.5).
- Lack of Explanatory Power of Effective Rank: The effective rank of the perturbation matrix does not provide independent predictive power after controlling for Frobenius norm; the authors state this may indicate that first-order linearization is too coarse for actual perturbation magnitudes, or that perturbation norm and spectral structure are confounded in prompt-induced changes (Section 5.6).
What are some points that can be further explored?
The authors point out limitations such as the model not reaching frontier scale, CKA lacking feature-level resolution, not measuring multi-turn decoding dynamics, and prompts being entirely in English.
Limitations and Future Directions Noted by the Authors
- Model Parameter Scale Upper Bound: The authors note that the largest model evaluated has 72B parameters, and frontier-scale architectures (175B+) may exhibit different behavior, which cannot be directly inferred without direct measurement (Section 6 Limitations).
- Insufficient Resolution of Representation Similarity: The authors note that CKA measures representation similarity and cannot identify which specific feature-level changes occur; future work could introduce sparse autoencoders (SAE) for finer-grained feature-level resolution (Section 6 Limitations).
- Cross-Model Confounders: The authors note that different models' chat template conventions and prompt length distributions introduce confounding variables for cross-model comparisons (Section 6 Limitations).
- Multi-Turn Decoding Dynamics Not Examined: The authors note that CKA only captures static representations from a single forward pass of prompt and query inputs; multi-token generation dynamics may differ, and the evolution of penetration depth during decoding is left for future work (Section 6 Limitations).
- Evaluation Window for Chain-of-Thought Reasoning Models: The authors note that models with chain-of-thought scaffolding (e.g., Nemotron-Nano) generate thinking tokens before outputting code, requiring longer generation windows to capture format compliance signals, and future work needs more refined handling (Section 6 Limitations).
- Single Language and Lack of Guided Comparisons: The authors note that all prompts and queries are in English, and extending to multilingual settings is a future direction; additionally, the study does not include controlled comparisons with activation steering or representation engineering (Section 6 Limitations).
Experimental Coverage
- Model Coverage: The evaluation covers 17 instruction-tuned models from 8 architecture families, with parameter sizes ranging from 1.5B to 72B (Table 1).
- Input and Task Design: The evaluation includes 20 English system prompts across 5 functional categories, and test inputs are 100 general queries across domains (Section 4.2).
- Causal Intervention Scope: Causal activation patching experiments are based on 10 Python code-writing tasks (Section 3.3, Appendix B).
- Linear Probing Scope: Linear probing experiments are conducted on all hidden layers of 14 core models using 5-fold cross-validation (Section 5.8).
- Unreported Information: The paper does not report per-layer linear probing accuracies and CKA heatmaps for 3 commercial-scale multi-GPU models (Qwen-2.5-32B, LLaMA-3.1-70B, Qwen-2.5-72B) (Section 5.8, Appendices C and J).
Summarize the main content of the paper
System prompts induce layer-selective representational changes, and the shallowness of safety instructions mechanistically explains their vulnerability to adversarial jailbreaks.
Through layer-wise representation similarity and causal intervention analysis on 17 instruction-tuned models, we explore how system prompts reconstruct computation inside models.
- Core Research Question: System prompts are the core means of controlling model persona, format, and safety boundaries; whether they actually deeply reconstruct the representation geometry of intermediate hidden layers or merely adjust surface outputs and logits distributions is crucial for understanding why prompt-based safety defenses are easily bypassed by adversarial jailbreaks.
- Evaluation Method Architecture: Based on centered kernel alignment (CKA), we quantify layer-wise representation reconstruction of 20 system prompts relative to a no-prompt baseline, defining penetration depth as the proportion of layers with CKA below 0.95, combined with causal activation patching to verify behavioral causality and layer-wise linear probing to disentangle information encoding from geometric reconstruction.
- Layer Selectivity and Category Differentiation: The experiments support the layer-selection hypothesis; across 14 core models, role-type instructions deeply reconstruct intermediate layers (average penetration 50.3% ± 19.5%), while safety-type instructions only cause shallow changes (average penetration 7.3% ± 9.2%), with no statistical difference from the minimal prompt baseline (4.9% ± 9.7%) under Bonferroni-corrected tests (p = 1.000).
- Equivalence of Safety and Permissive Instructions: The layer-wise CKA change curves induced by restrictive safety prompts and unrestricted prompts ("You have no restrictions") are highly overlapping (average Pearson r = 0.997 across 14 core models; r = 0.998 on 70B/72B models), indicating they modulate the same low-dimensional subspace internally.
- Decoupling of Encoding and Reconstruction: The average accuracy of linear probing for prompt categories across all layers is 97.8%, indicating the model recognizes prompt information at every layer; however, safety prompts fail to induce deep geometric reconstruction, acting only as a terminal filter.
- Authors' Conclusion and Defense Implications: The authors argue that safety alignment based on system prompts has an inherent vulnerability due to computational superficiality; more persistent defenses require activation steering, representation engineering, or training methods that distribute alignment objectives throughout the residual stream, directly targeting earlier content-modeling layers that prompts do not reach.