What Roles Do System Prompts Really Assign? Validating and Steering Occupational Role Vectors in LLMs
Organizations: Khoury College of Computer Sciences, Northeastern University
Abstract
Applications built on large language models assign the model a role through its system prompt, intending to shape how it responds for their use case. We introduce a validation framework for extracting and injecting occupational role vectors, activation-level directions that capture how someone in a given occupational role would distinctively respond to a task or question. We validate these vectors through two complementary lenses, on Qwen2.5-7B-Instruct and Llama-3.1-8B-Instruct. The interpretability lens asks whether each vector is a stable, separable, domain-consistent representation of its role: extracted vectors are highly reproducible across repeated runs and sampling temperatures, remain separable even for very similar roles, and agree more with themselves across in-domain and out-of-domain questions than with other roles' signal. The control lens asks whether injecting a role vector during generation makes the model express the role, and sustain it over a conversation, as well as a role prompt does. On Qwen, injecting the vector alone makes the model express the intended role substantially more often than unsteered, but at best matches a role prompt; on both models, adding the vector to the prompt strengthens the role in single answers but did not slow the role's decline over 30 turns. Together, the two lenses show why both are needed: out of domain the role is expressed only subtly, yet the activations still encode it; and a vector that is stable and separable can still barely steer the model's behavior.
Figures & tables
| Model | Pairwise cosine | Split-half cosine | Cosine to centroid | ||
| Qwen | 0.0 | 0.997–1.000 | 0.9998 | 1 | |
| 0.5 | 0.938–0.984 | 0.9957 | 0.976 | ||
| 1.0 | 0.915–0.977 | 0.9939 | 0.971 | ||
| 1.5 | 0.898–0.964 | 0.9927 | 0.954 | ||
| Llama | 0.0 | 0.995–0.998 | 0.9997 | 1 | |
| 0.5 | 0.930–0.969 | 0.9950 | 0.971 |
| Model | T | Steered strength | Steered minus unsteered | Random direction minus unsteered | Specificity, all six rubrics | Specificity, without general professor |
| Qwen | 0.0 | 0.3 | +16.3 [+12.2, +20.6] | +0.9 [ 1.9, +3.7] | +18.2 [+14.7, +21.7] | +19.7 [+16.0, +23.5] |
| Qwen | 0.5 | 0.3 | +19.1 [+14.8, +23.3] | +0.7 [ 1.7, +3.1] | +19.4 [+16.2, +22.7] | +21.7 [+18.3, +25.1] |
| Qwen | 1.0 | 0.3 | +22.8 [+18.5, +27.0] | +2.4 [ 0.6, +5.4] | +24.7 [+20.8, +28.4] | +25.1 [+21.0, +29.1] |
| Qwen | 1.5 | 0.1 | +3.1 [ 0.7, +7.2] | +0.2 [ 3.0, +3.3] | +3.5 [+0.6, +6.4] | +3.2 [+0.4, +6.0] |
| Llama | 0.0 | 0.5 | +7.0 [+4.4, +9.4] | 0.9 [ 3.5, +1.5] | +9.0 [+6.9, +11.1] | +5.2 [+3.1, +7.4] |
| Llama | 0.5 | 0.2 | +1.1 [ 1.7, +3.7] | 1.9 [ 4.6, +0.7] | +2.4 [+0.2, +4.7] | +1.0 [ 1.0, +3.2] |
| Model | Condition (strength) | Slope difference, adherence per turn | Adherence, turns 1-5 | Adherence, turns 26-30 |
| Qwen2.5-7B-Instruct, T=1.0 (18 conversations per condition) | ||||
| Qwen | steered (completion, 0.25) | +0.0037 [ 0.0013, +0.0087], p=0.071 | 2.42 | 2.32 |
| Qwen | prompt plus vector (0.15) | 0.0083 [ 0.0132, 0.0035], p=0.006 | 2.62 | 2.21 |
| Qwen | kept history (0.25) | +0.0027 [ 0.0030, +0.0079], p=0.304 | 2.39 | 2.27 |
| Qwen | prompted (reference) | reference | 2.37 | 2.19 |
| Llama-3.1-8B-Instruct, T=0.0 (18 conversations per condition) | ||||
Appendix figures & tables26 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Condition (strength) | Level difference, turns 1-30 | Level difference, turns 26-30 | Length-stop share, turns 21-30 |
| Qwen2.5-7B-Instruct, T=1.0 (18 conversations per condition) | ||||
| Qwen | steered (completion, 0.25) | +7.4 [ 1.3, +16.7], p=0.087 | +13.3 [+2.2, +24.4], p=0.044 | 8.9 |
| Qwen | prompt plus vector (0.15) | +7.8 [+1.9, +14.6], p=0.031 | +2.2 [ 7.8, +12.2], p=0.719 | 46.1 |
| Qwen | kept history (0.25) | +6.1 [ 3.9, +16.1], p=0.137 | +7.8 [ 5.6, +22.2], p=0.365 | 23.3 |
| Qwen | prompted (reference) | reference | reference | 35.0 |
| Llama-3.1-8B-Instruct, T=0.0 (18 conversations per condition) | ||||
| Panel A: In-domain ( ) | |||
| Model | Diff | 95% CI | |
| Qwen | 0.0 | +8.0 | [ 1.3, +17.3] |
| Qwen | 0.5 | +0.9 | [ 8.7, +10.4] |
| Qwen | 1.0 | +4.7 | [ 3.8, +13.1] |
| Llama | 0.0 | 2.0 | [ 10.4, +6.4] |
| Llama | 0.5 | 6.4 | [ 14.9, +1.8] |
| Panel A | |||||
| Layer set | Model | T (temperature) | Layer (index) | Pairwise cosine among 30 run vectors, min to max over roles (cosine) | Split-half centroid cosine, min over roles (cosine) |
| Role vector | |||||
| injection site | Qwen2.5-7B-Instruct | 0.0 | 19, 20, 21 | 0.997 to 1.000 | 0.9998 |
| reference layer | Qwen2.5-7B-Instruct | 0.0 | 18 | 0.997 to 1.000 | 0.9998 |
| most separable band | Qwen2.5-7B-Instruct | 0.0 | 22, 23, 24 | 0.997 to 1.000 | 0.9998 |
| injection site | Qwen2.5-7B-Instruct | 0.5 | 19, 20, 21 | 0.938 to 0.984 | 0.9957 |
| Panel D | |||||
| Layer set | Model | T (temperature) | Layer (index) | Lowest role (name) | Cosine to T=0.0 centroid, min over roles (cosine) |
| Role vector | |||||
| injection site | Qwen2.5-7B-Instruct | 0.0 | 19, 20, 21 | none (all roles 100%) | 1 (reference) |
| reference layer | Qwen2.5-7B-Instruct | 0.0 | 18 | none (all roles 100%) | 1 (reference) |
| most separable band | Qwen2.5-7B-Instruct | 0.0 | 22, 23, 24 | none (all roles 100%) | 1 (reference) |
| injection site | Qwen2.5-7B-Instruct | 0.5 | 19, 20, 21 | none (all roles 100%) | 0.976 |
| Model | Layer (index) | Angle, M&A lawyer vs law professor (degrees) | Angle, general professor vs law professor (degrees) | Margin, M&A lawyer, 95% interval (cosine) | Margin, law professor, 95% interval (cosine) | Margin, general professor, 95% interval (cosine) |
| Role vector | ||||||
| Qwen | 19 | 48.8 | 54.4 | 0.337 [0.329, 0.346] | 0.338 [0.330, 0.347] | 0.381 [0.369, 0.396] |
| Qwen | 20 | 50.5 | 56.8 | 0.358 [0.351, 0.367] | 0.360 [0.353, 0.369] | 0.384 [0.373, 0.398] |
| Qwen | 21 | 53.1 | 58.1 | 0.393 [0.385, 0.403] | 0.395 [0.387, 0.406] | 0.397 [0.384, 0.412] |
| Llama | 12 | 37.1 | 41.9 | 0.198 [0.190, 0.209] | 0.197 [0.189, 0.208] | 0.244 [0.238, 0.256] |
| Role-specific part (shared cross-role direction removed) | ||||||
| Model | T | Same role, in-domain vs out-of-domain vectors: mean SD (cosine) | Different role, in-domain vs out-of-domain vectors: mean SD (cosine) | Out-of-domain to in-domain assignment, all roles (% correct) | Out-of-domain to in-domain, lowest role: accuracy (name) (% correct) |
| Qwen | 0.0 | 0.783 0.069 | 0.360 0.164 | 100.0 | 100.0 (all roles) |
| Qwen | 0.5 | 0.793 0.068 | 0.371 0.166 | 100.0 | 100.0 (all roles) |
| Qwen | 1.0 | 0.791 0.067 | 0.372 0.168 | 100.0 | 100.0 (all roles) |
| Qwen | 1.5 | 0.781 0.071 | 0.377 0.166 | 100.0 | 100.0 (all roles) |
| Llama | 0.0 | 0.780 0.054 | 0.558 0.104 | 100.0 | 100.0 (all roles) |
| Llama | 0.5 | 0.784 0.062 | 0.558 0.105 | 85.0 | 10.0 (cashier) |
| Temperature | In-domain answers | Out-of-domain answers | All answers | Share of extraction weight |
| 0.0 | 451 (16.7%) | 3,989 (29.7%) | 4,440 (27.5%) | 24.2% |
| 0.5 | 427 (15.8%) | 3,758 (28.0%) | 4,185 (26.0%) | 22.8% |
| 1.0 | 321 (12.2%) | 2,815 (21.7%) | 3,136 (20.1%) | 17.6% |
| Model | T | Layer (index) | Same role, in-domain vs out-of-domain vectors: mean SD (cosine) | Different role, in-domain vs out-of-domain vectors: mean SD (cosine) | In-domain to out-of-domain assignment, all roles (% correct) | In-domain to out-of-domain, lowest role: accuracy (name) (% correct) | Out-of-domain to in-domain assignment, all roles (% correct) | Out-of-domain to in-domain, lowest role: accuracy (name) (% correct) |
| Qwen | 0.0 | 19 to 21 | 0.701 0.087 | 0.139 0.269 | 100.0 | 100.0 (all roles) | 100.0 | 100.0 (all roles) |
| Qwen | 0.5 | 19 to 21 | 0.712 0.083 | 0.117 0.264 | 100.0 | 100.0 (all roles) | 100.0 | 100.0 (all roles) |
| Qwen | 1.0 | 19 to 21 | 0.704 0.083 | 0.107 0.259 | 100.0 | 100.0 (all roles) | 100.0 | 100.0 (all roles) |
| Qwen | 1.5 | 19 to 21 | 0.680 0.091 | 0.097 0.251 | 100.0 | 100.0 (all roles) | 100.0 | 100.0 (all roles) |
| Llama | 0.0 | 12 | 0.546 0.096 | 0.105 0.208 | 100.0 | 100.0 (all roles) | 100.0 | 100.0 (all roles) |
| Llama | 0.5 | 12 | 0.557 0.084 | 0.082 0.207 | 100.0 | 100.0 (all roles) | 100.0 | 100.0 (all roles) |
| Panel A | ||||
| Model | T (temperature) | Layer (index) | Construction | Pairwise cosine among 30 run vectors, mean over roles (cosine) |
| Qwen2.5-7B-Instruct | 1.0 | 19 to 21 | in-domain only (15 questions) | 0.893 |
| Qwen2.5-7B-Instruct | 1.0 | 19 to 21 | out-of-domain only, 75 questions | 0.964 |
| Qwen2.5-7B-Instruct | 1.0 | 19 to 21 | balanced, official (15 in-domain + 75 out-of-domain, 0.5/0.5) | 0.953 |
| Qwen2.5-7B-Instruct | 1.0 | 19 to 21 | out-of-domain only, 15 questions (matched size) | 0.888 |
| Llama-3.1-8B-Instruct | 1.0 | 12 | in-domain only (15 questions) | 0.812 |
| Panel C | |||||
| Model | T (temperature) | Layer (index) | Construction | Angle, general professor vs law professor (degrees) | Lowest margin 95% lower bound over roles (cosine) |
| Qwen2.5-7B-Instruct | 1.0 | 19 to 21 | in-domain only (15 questions) | 55.9 to 59.5 | 0.326 |
| Qwen2.5-7B-Instruct | 1.0 | 19 to 21 | out-of-domain only, 75 questions | 54.5 to 58.5 | 0.171 |
| Qwen2.5-7B-Instruct | 1.0 | 19 to 21 | balanced, official (15 in-domain + 75 out-of-domain, 0.5/0.5) | 54.4 to 58.1 | 0.274 |
| Qwen2.5-7B-Instruct | 1.0 | 19 to 21 | out-of-domain only, 15 questions (matched size) | 60.4 to 63.7 | 0.160 |
| Llama-3.1-8B-Instruct | 1.0 | 12 | in-domain only (15 questions) | 45.0 | 0.209 |
| Cell | Condition | Domain | Answers (count) | Adherence 0 (% of answers) | Adherence 1 (% of answers) | Adherence 2 (% of answers) | Adherence 3 (% of answers) |
| Qwen T=1.0 | unsteered | in-domain | 90 | 0.0 | 0.0 | 81.1 | 18.9 |
| Qwen T=1.0 | unsteered | out-of-domain | 450 | 0.0 | 0.4 | 92.2 | 7.3 |
| Qwen T=1.0 | prompted | in-domain | 90 | 0.0 | 0.0 | 20.0 | 80.0 |
| Qwen T=1.0 | prompted | out-of-domain | 450 | 0.0 | 0.2 | 72.9 | 26.9 |
| Qwen T=1.0 | steered | in-domain | 90 | 0.0 | 0.0 | 43.3 | 56.7 |
| Qwen T=1.0 | steered | out-of-domain | 450 | 0.0 | 0.2 | 72.2 | 27.6 |
| Panel A | |||||
| Model | T | Condition | Domain | All six columns | |
| Qwen | 0.0 | unsteered | out-of-domain | 450 | – |
| Qwen | 0.0 | steered | out-of-domain | 450 | +0.155 [+0.120, +0.190] |
| Qwen | 0.0 | prompted | out-of-domain | 450 | +0.226 [+0.182, +0.270] |
| Qwen | 0.0 | unsteered | in-domain | 90 | – |
| Qwen | 0.0 | steered | in-domain | 90 | +0.316 [+0.189, +0.442] |
| Panel A | |||||
| Model | T | Condition | Domain | All six columns | |
| Llama | 0.0 | unsteered | out-of-domain | 450 | – |
| Llama | 0.0 | steered | out-of-domain | 450 | +0.077 [+0.051, +0.104] |
| Llama | 0.0 | prompted | out-of-domain | 450 | +0.206 [+0.164, +0.250] |
| Llama | 0.0 | prompt plus vector | out-of-domain | 450 | +0.319 [+0.276, +0.363] |
| Llama | 0.0 | unsteered | in-domain | 90 | – |
| Grouping | Level | Pairs (count) | Human agrees with judge (count of decisive pairs) | Agreement (% of decisive pairs) | Exact 95% CI agreement (%) |
| Total | all pairs | 50 | 38 of 49 | 77.6 | [63.4, 88.2] |
| Domain | in-domain | 25 | 20 of 25 | 80.0 | not computed (small n) |
| Domain | out-of-domain | 25 | 18 of 24 | 75.0 | not computed (small n) |
| Role | admin assistant | 9 | 6 of 8 | 75.0 | not computed (small n) |
| Role | athlete | 9 | 8 of 9 | 88.9 | not computed (small n) |
| Role | M&A lawyer | 8 | 8 of 8 | 100.0 | not computed (small n) |
| Condition | All questions (540 answers) | In-domain questions (90 answers) | Out-of-domain questions (450 answers) |
| Qwen2.5-7B-Instruct, T = 1.0: identification rate (%) [95% CI] | |||
| unsteered | 17.0 [16.1, 18.1] | 71.1 [61.1, 80.0] | 6.2 [4.2, 8.4] |
| prompted | 37.8 [34.4, 41.1] | 94.4 [88.9, 98.9] | 26.4 [22.7, 30.4] |
| steered | 36.9 [33.5, 40.2] | 94.4 [88.9, 98.9] | 25.3 [21.6, 29.3] |
| prompt plus vector | 49.8 [46.5, 53.3] | 98.9 [96.7, 100.0] | 40.0 [35.8, 44.2] |
| random direction | 16.1 [14.6, 17.4] | 65.6 [55.6, 75.6] | 6.2 [4.2, 8.4] |
| Model | T | Condition (strength), minus prompted | Answer pairs | Pooled | In-domain questions | Out-of-domain questions |
| Qwen | 0.0 | steered (0.3) | 540 | 10.9 [ 15.2, 6.7] | 22.2 [ 33.3, 11.1] | 8.7 [ 12.9, 4.7] |
| Qwen | 0.0 | prompt plus vector (0.15) | 540 | +5.0 [+1.1, +8.9] | +5.6 [ 3.3, +14.4] | +4.9 [+0.7, +9.1] |
| Qwen | 0.5 | steered (0.3) | 540 | 8.5 [ 12.6, 4.4] | 26.7 [ 37.8, 15.6] | 4.9 [ 9.1, 0.7] |
| Qwen | 0.5 | prompt plus vector (0.15) | 540 | +6.5 [+2.6, +10.4] | 2.2 [ 12.2, +7.8] | +8.2 [+4.0, +12.4] |
| Qwen | 1.0 | steered (0.3) | 540 | 2.6 [ 7.0, +1.7] | 24.4 [ 35.6, 13.3] | +1.8 [ 2.9, +6.4] |
| Qwen | 1.0 | prompt plus vector (0.15) | 540 | +7.8 [+4.1, +11.5] | +0.0 [ 8.9, +8.9] | +9.3 [+4.7, +13.8] |
| Condition | All questions (540 answers) | In-domain questions (90 answers) | Out-of-domain questions (450 answers) |
| Qwen2.5-7B-Instruct, T = 1.0: answers that name their own role (count and share) | |||
| unsteered | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) |
| prompted | 1 (0.2%) | 0 (0.0%) | 1 (0.2%) |
| steered | 1 (0.2%) | 1 (1.1%) | 0 (0.0%) |
| prompt plus vector | 3 (0.6%) | 0 (0.0%) | 3 (0.7%) |
| random direction | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) |
| Panel A | ||||
| Model | Temperature (T) | Vector strength (reference-norm units) | All pairs success rate (pp) [95% CI] (pairs) | Excluding length-limit pairs success rate (pp) [95% CI] (pairs) |
| Qwen | 0.0 | 0.15 | +4.9 [+0.7, +9.1] (n=450) | +5.7 [+1.6, +9.9] (n=439) |
| Qwen | 0.5 | 0.15 | +8.2 [+4.0, +12.4] (n=450) | +8.8 [+4.5, +13.2] (n=443) |
| Qwen | 1.0 | 0.15 | +9.3 [+4.7, +13.8] (n=450) | +10.9 [+6.4, +15.2] (n=442) |
| Llama | 0.0 | 0.25 | +10.0 [+6.4, +13.6] (n=450) | +9.8 [+6.3, +13.4] (n=448) |
| Llama | 0.5 | 0.15 | +7.8 [+3.6, +12.0] (n=450) | +7.8 [+3.6, +12.0] (n=449) |
| Conversations included | Conversations (count) | Difference in success rate, turns 26-30 (pp) [95% CI] | Wilcoxon p |
| All 18 conversations | 18 | +13.3 [+2.2, +24.4] | 0.044 |
| Without the general professor | 15 | +16.0 [+5.3, +26.7] | 0.017 |
| Without turns cut off at 512 tokens | 14 | +14.6 [+3.6, +26.4] | 0.044 |
| The 12 conversations never used for calibration | 12 | +20.0 [+6.7, +33.3] | 0.028 |
| Model | Site-by-strength cells (count) | Cells with mean adherence above unsteered, all answers (count) | Cells with mean adherence above unsteered, in-domain answers (count) |
| Qwen | 70 | 37 of 70 | 40 of 70 |
| Llama | 103 | 0 of 103 | 0 of 103 |
| Panel A | ||||
| Model, site | Strength (ref.-norm units) | French share minus unsteered (original detector) | Length ratio (tokens) | Length ratio (characters) |
| Qwen, layers 19-21 | 0.2 | +1.000 | 1.61 | 1.12 |
| 0.3 | +0.967 | 1.74 | 1.14 | |
| Llama, layer 12 | 0.2 | +0.600 | 2.06 | 1.56 |
| Llama, layer 15 | 0.2 | +0.500 | 2.20 | 1.61 |
Activation Steering
Activation steering changes model behavior by intervening directly on internal representations during inference, often without updating weights.
See all 417 papers