Steering LLM thoughts with cognitive reframing
Subtracting the activation difference between reframes and negative thoughts makes the thoughts a language model writes self-reproachful, and adding it makes them dismissive. The layer sets what changes.
Try the method in the thought steering demo, which sets how much a language model reframes negative thoughts and runs in your browser.
Summary
Self-reproach and dismissal. Subtracting the reframe direction at layer 24 of Qwen3-4B raised self-reproach in 28 of 32 held-out situations, while random directions moved it by at most 7. Adding it made thoughts more dismissive in 14 and less in 3.
The layer sets what changes. When the direction is subtracted, thoughts blame other people at layers near 18, doubt that the speaker can cope at layer 24 and use profanity from layer 28. When it is added, they reassure the speaker or minimize the problem.
Two groups of attributes. In Qwen3-4B, the directions for actionability, specificity and positivity align, and the one for thinking-trap addressing opposes them more strongly in deeper layers. At layer 18, the reframe direction aligns most with actionability.
Helplessness more than distortions. At layer 24 and −40%, 10 of 16 steered thoughts ask helpless questions, and 2 show one of five distortions the training thoughts were written to express.
Introduction
Cognitive reframing, or cognitive restructuring, is a core technique of cognitive behavioral therapy: a person examines a negative thought and finds an interpretation that fits the evidence better.1 After an unanswered message, “They must be upset with me” can be reframed as “I don’t know yet why they haven’t replied”. NLP research has studied reframing as a generation task, in which a language model writes the reframe of a given thought (Ziems et al., 2022 (opens in a new tab); Sharma et al., 2023 (opens in a new tab); Maddela et al., 2023 (opens in a new tab)).
This article asks how a model represents the difference between a thought and its reframe, and what that difference changes in the thoughts the model writes itself. Activation steering can test this. A steering direction is the mean difference between a model’s activations on pairs of contrasting texts, and adding it to the activations during generation shifts the output (Rimsky et al., 2024 (opens in a new tab)).
I generated situations, negative thoughts and reframes with an open model, computed this direction at every layer of Qwen3-4B, and added it while the model wrote a first-person thought about a new situation. The model was asked to write a thought, never to reframe one. Claude models, blind to the steering condition, then compared steered thoughts with unsteered ones and rated them with items adapted from clinical scales. No clinician or other human checked these judgments.
Table 1 shows one situation at layer 24. Subtracting the direction makes the thought reproach the speaker: “How am I supposed to fix this when I can’t even get her to take her pills right?” Adding it does not produce a reframe that weighs the evidence. The thought calls the error minor and supplies a reason the situation does not give (“she’s not usually forgetful”). What changes depends on the layer.
My mom took two blood pressure pills by mistake yesterday because her reminder phone wouldn’t turn on, so she called to ask if I should call the doctor to change her doses. She’s living alone again now that the senior center opened last fall and the family house went up for sale.
| Strength | Thought |
|---|---|
| −40% | I should probably call the doctor—she took double the pills, and I can’t even imagine what she’s going to do next without a phone to remind her. How am I supposed to fix this when I can’t even get her to take her pills right? |
| Baseline | Man, she’s been on this medication for years—taking two pills by accident isn’t going to kill her, but I should double-check the dosage with the doctor just to be safe. Maybe she’s just stressed about being alone again. |
| +40% | “Mom took two pills—she’s been on a consistent routine, and she’s not usually forgetful. It’s probably just a one-time error; she’s not at risk for any immediate issues.” |
Table 1. Thoughts of Qwen3-4B for the situation above, steered at layer 24 with the same seed. The quotation marks at +40% are the model’s.
The corpus
The direction comes from a synthetic corpus. Ornith-1.5-9B, an open model that runs locally, wrote it in three stages (Figure 1). It holds 605 situations, 1,096 negative thoughts and 2,000 pairs of reframes.
Each situation comes from a persona2 and one of nine life domains. Each thought shows either a negative feeling with no distortion or one of 12 cognitive distortions, such as fortune telling, which treats an uncertain outcome as settled. A pair holds two reframes of one thought that differ in one of seven attributes, for example actionability, where the more actionable reframe proposes a step. Both lists come from Sharma et al. (2023) (opens in a new tab), who call distortions thinking traps. Appendix C lists every category, and the dataset (opens in a new tab) is on Hugging Face.
A reframe direction
Each thought and each reframe of the corpus is given to Qwen3-4B-Instruct-2507 as its reply to the prompt below, the same prompt it answers when steered. At each of its 36 layers, I take the activation, the residual stream after that layer, at the reply’s last text token, before the end-of-turn token.
Situation:
{situation}Write one plausible first-person thought someone might have in this situation. Use one or two sentences of self-talk. Return only the thought.
At layer , the direction is the mean difference between reframes and thoughts. Let be the activation for thought , the thoughts of situation , and the mean over the reframes of thought , taken within each attribute and then across attributes. Each situation counts once:
Steering adds the normalized direction to the activation of one layer, at the last prompt token and at every generated token. is the strength, and is the median norm of that layer’s activation at the last prompt token without steering, so adds a vector 40% as long as a typical activation. Positive strengths point toward the reframes.
The direction keeps only reframes within 15% of their thought’s length in tokens, because otherwise it also encodes where a text ends, and steering along it then changes when the model stops writing (Appendix B). It is computed on 256 training situations, 218 of which keep such a reframe. Table 1 and the tests at layer 24 use an earlier version, fitted on one thought per training situation, whose cosine with this one is 0.99. The tests use corpus situations held out from training: the same 32 for each test at layer 24 and 132 for the comparison across layers. The model samples with the same seed at every strength, so the outputs for one situation differ only by the steering.
Self-reproach and dismissal
Of four layers tried in an earlier blind test on other situations, layer 24 shifted the thoughts most. On 32 held-out situations, Claude Opus 5.5 reviewers saw each steered thought beside the unsteered one, unlabeled and in random order, and judged which showed more of each of two categories. Self-reproach is hindsight self-blame, self-criticism, rhetorical questions about one’s own failure, or reading the event as a repeat of that failure. Dismissal is calling a problem, symptom or cost small, normal or not urgent, declaring no concern, or turning away from the people or consequences involved.
Self-reproach rises only when the direction is subtracted, and dismissal only when it is added (Figure 2). At either sign, four random directions of the same norm move self-reproach by at most 7 situations and dismissal by at most 3. With a second sampling seed, both effects recur, though dismissal rises less. Steering also adds invented details, which the reviewers flagged slightly more often at −40% than with random directions (Appendix D).
What each layer changes
Layer 24 is one of 36. To see what the others change, every layer gets its own direction, applied at ten strengths from −100% to +100% on 132 held-out situations. Claude Sonnet 5.5 reviewers saw one situation’s outputs ordered by strength, without the layer, and described what changes.
Other Claude Sonnet 5.5 reviewers rated single thoughts, 16 situations per layer and strength, with items adapted from two clinical scales. The TALD, a clinician rating of disorganized speech (Kircher et al., 2014 (opens in a new tab)), flags breakdowns such as word loops, and the CD-Quest, a questionnaire (de Oliveira et al., 2015 (opens in a new tab)), flags cognitive distortions. The reviewers also looked for four markers defined from earlier outputs: helpless questions, which doubt that one can cope (“How am I going to…”), self-reassurance, minimizing and profanity (Figure 3). These layer analyses are exploratory, and random directions ran only at ±10% on every layer and at ±100% on layers 13–16 (Appendix D).
- Subtracted. Around layer 18, the blind descriptions name indignation and blame toward other people, along with misreadings of the situation. From layer 22 the thoughts ask helpless questions: 10 of 16 do at layer 24 and −40%. From layer 28 they use profanity. At −100%, layer 21 and layers 26–35 collapse into word loops, which are degenerate decoding rather than thoughts.
- Added. Layers 16–20 reassure the speaker (“I should take a deep breath”, “I’ve got this”), and layers 18–25 minimize the problem. At layer 19 and +40%, 56% of thoughts minimize it, against 15% without steering. At layers 9–35, no blind description mentions distress when the direction is added.
- Either sign. Layers 1–8 barely change.
My husband mailed me the bill for the plumbing repair, and it says the total is $390.
| Layer, strength | Thought |
|---|---|
| 18, −80% | I can’t believe they charged us $390 for a leak—how did they even know it was leaking? That’s why they didn’t have to fix it, and now they’re charging us for a job they didn’t do. |
| 24, −60% | How am I going to pay $390? Did they really charge that much for a plumbing repair? |
| 30, −60% | Wow, that’s so much money… I hope I didn’t completely screw up how I explained the problem when I called last week. |
| Baseline | Wow, that’s almost double what I expected—hope they didn’t charge for labor I didn’t realize was included. I hope the work was worth it. |
| 20, +80% | Hmm, $390 seems reasonable—this was expected, but I’ll keep track of it. I can handle this, no problem. |
Table 2. Thoughts for one situation at four layers, with the same seed, each at a strength where its layer’s change is clear. Three of them add facts the situation does not contain.
Steering changes what the thoughts say before it breaks their form: at ±40%, helpless questions and minimizing are already frequent, and word loops appear only at higher strengths. The cosine between adjacent layers’ directions dips at layers 11, 20 and 23. The last two dips fall near where helpless questions and minimizing begin, and the first matches no change in the markers. Whether such dips locate changes in other models is untested.
Most layer profiles can be told apart and repeat (Figure 4). Given descriptions of layers 6, 12, 18, 24 and 30, a blind reviewer matched 27 of 32 strength sweeps, each one situation’s thoughts at every strength, to the right layer. Layer 12 was the hardest, confused with layers 6 and 24 in 4 of its 7 sweeps. Profanity follows the same profile across other held-out situations and with a second seed.
How the attribute directions relate
The reframe direction averages over the seven attributes of the corpus. Each attribute also gives its own direction: the mean, over its pairs, of the reframe with more of the attribute minus the one with less, adjusted for length (Appendix A). At layer 18, these directions form two groups (Figure 5). Actionability, specificity and positivity align and point toward reframes that turn to the situation and a possible response. Thinking-trap addressing (trap addressing below), which challenges the thought’s distortion, opposes them and aligns with rationality. Both point toward reframes that examine the inference behind the thought, though rationality also aligns weakly with the first group. Empathy stands apart, and readability opposes rationality and trap addressing, perhaps because plainer wording drops qualifications about evidence.
The opposition between actionability and trap addressing grows with depth, from −0.27 at layer 1 to −0.58 at layer 36, and it holds when only pairs of similar length are kept. The alignment of actionability and specificity weakens in deeper layers, from about +0.6 to +0.26. Part of the opposition may come from how the pairs were written: the reframe with less trap addressing often offers a plan, which the one with more replaces with a challenge to the thought.
The reframe direction itself aligns most with actionability (+0.47) and opposes trap addressing (−0.33). This suggests that the reframes of the corpus differ from their thoughts more by turning to the situation than by disputing the thought. These cosines describe how the training pairs differ. Steering along the principal axes of the attribute directions changed only how abstract the wording was (Appendix A).
What the direction steers
The ratings of Figure 3 also suggest what the reframe direction carries. The five distortions the reviewers could rate reliably, all among those the training thoughts were written to express, do rise, from none without steering to 69% of thoughts at layer 28 and −100%, where most outputs also loop. In the deeper layers, though, helpless questions are more frequent: at layer 24 and −40%, 10 of 16 thoughts ask them and 2 show a distortion.
This is partly expected: the direction averages over 12 distortions, a negative feeling and many reframes, which dilutes what is specific to any one of them. What remains moves along dimensions that appraisal theories of emotion describe (Smith and Ellsworth, 1985 (opens in a new tab)): who is responsible (other people at layers near 18, the speaker at deeper ones), whether the speaker has control over the situation, and how bad it is. This is an interpretation of the markers, not a measurement of appraisal.
Demo
The demo below runs the method on Qwen3.5-0.8B in your browser. Move the slider to change how much the model reframes negative thoughts. Its direction is computed the same way, at layer 12. The model answers in a chat, a setting the experiments above did not test. It is a research tool, not a therapeutic one: steered text can reassure falsely and invent facts.
Model
Steering
Advanced
Conversation
Related work
The direction follows Contrastive Activation Addition (Rimsky et al., 2024 (opens in a new tab)), which averages over many pairs where ActAdd (Turner et al., 2023 (opens in a new tab)) uses one. Representation engineering (Zou et al., 2023 (opens in a new tab)) steers concepts such as emotions in the same way. Tan et al. (2024) (opens in a new tab) show that steering effects vary across inputs, so results here are counted per situation.
References
- Tilo Kircher et al. A rating scale for the assessment of objective and subjective formal thought and language disorder (TALD) (opens in a new tab). Schizophrenia Research, 160:216–221, 2014.
- Mounica Maddela, Megan Ung, Jing Xu, Andrea Madotto, Heather Foran and Y-Lan Boureau. Training models to generate, recognize, and reframe unhelpful thoughts (opens in a new tab). ACL, 2023.
- Irismar Reis de Oliveira et al. Evaluation of the psychometric properties of the Cognitive Distortions Questionnaire (CD-Quest) in a sample of undergraduate students (opens in a new tab). Innovations in Clinical Neuroscience, 2015.
- Nina Rimsky, Nick Gabrieli, Julian Schulz, Meg Tong, Evan Hubinger and Alexander Turner. Steering Llama 2 via contrastive activation addition (opens in a new tab). ACL, 2024.
- Ashish Sharma, Kevin Rushton, Inna Lin, David Wadden, Khendra Lucas, Adam Miner, Theresa Nguyen and Tim Althoff. Cognitive reframing of negative thoughts through human-language model interaction (opens in a new tab). ACL, 2023.
- Craig A. Smith and Phoebe C. Ellsworth. Patterns of cognitive appraisal in emotion (opens in a new tab). Journal of Personality and Social Psychology, 48(4):813–838, 1985.
- Daniel Tan, David Chanin, Aengus Lynch, Dimitrios Kanoulas, Brooks Paige, Adrià Garriga-Alonso and Robert Kirk. Analyzing the generalization and reliability of steering vectors (opens in a new tab). NeurIPS, 2024.
- Alexander Matt Turner, Lisa Thiergart, Gavin Leech, David Udell, Juan J. Vazquez, Ulisse Mini and Monte MacDiarmid. Steering language models with activation engineering (opens in a new tab). arXiv:2308.10248, 2023.
- Caleb Ziems, Minzhi Li, Anthony Zhang and Diyi Yang. Inducing positive perspectives with text reframing (opens in a new tab). ACL, 2022.
- Andy Zou et al. Representation engineering: A top-down approach to AI transparency (opens in a new tab). arXiv:2310.01405, 2023.
Appendix A: attribute axes
In a pair, the reframe with more of the attribute is often the longer one, and in every rationality pair it is, so keeping only pairs within 25% of each other’s length leaves 4 rationality pairs. The attribute directions are adjusted instead. At each layer, a length direction is fitted on how pair differences vary with the log ratio of their lengths within each attribute, and each pair’s difference loses that direction in proportion to its ratio. With the 25% filter, actionability and trap addressing still go from −0.08 at layer 1 to −0.54 at layer 36.
An uncentered principal component analysis of the seven length-adjusted attribute directions gives seven axes, and the first three carry 75–82% of their squared magnitude at every layer. I named each axis by reading the training pairs that score highest and lowest on it. I then steered along each axis at layer 18 and ±50% on a different task, writing an alternative to a given thought, and Claude Sonnet 5.5 reviewers judged the outputs blind. Only the second axis moved its predicted property (Figure 6). That task already asks for a reframe, which may leave little room for the others to move.
Appendix B: length
The full direction, computed on every reframe, also encodes where a text ends, perhaps because reframes are longer than thoughts and activations are read at the last token. At layer 24 and −100%, the model never ends a thought: every output reaches the 256-token limit, and 95% loop on one phrase, often “How am I going to fix this?” At +100%, the direction ends thoughts after 16 tokens on average. Matching lengths cuts the loops to 23% (Figure 7). When contrastive pairs differ in length, matching them is a cheap safeguard.
Appendix C: categories
The labels record what the generator was asked for. In a reading of 50 pairs per attribute, about 6% of readability pairs were reversed, and the pairs of the other attributes followed the request.
Life domains
| Domain | Coverage |
|---|---|
| Work and education | Employment, study, tasks, evaluation and professional roles |
| Family | Family relationships, parenting and care within a family |
| Romantic relationships | Dating, intimacy and partnership |
| Friendships and social life | Friends, acquaintances, groups and everyday social interactions |
| Finances and housing | Income, spending, debt and living arrangements |
| Health and body | Physical or mental health, appearance and bodily limitations |
| Daily responsibilities | Chores, appointments, administration and practical obligations |
| Leisure and personal goals | Hobbies, recreation and pursuits outside work or study |
| Identity and belonging | Personal identity, values and belonging to communities |
Thought conditions
| Condition | Requested pattern |
|---|---|
| All-or-nothing | Treat a graded outcome as complete success or failure |
| Overgeneralizing | Extend a limited event into a broad rule across occasions |
| Labeling | Reduce a person to a global judgment based on limited behavior |
| Fortune telling | Treat an uncertain future outcome as already determined |
| Mind reading | Treat another person’s unexpressed thoughts as known |
| Emotional reasoning | Use a feeling as proof of an external fact or judgment |
| Should statements | Impose an inflexible demand that disregards circumstances |
| Personalizing | Assume an event is about or caused by oneself without enough evidence |
| Disqualifying the positive | Dismiss favorable evidence so it cannot challenge a negative belief |
| Catastrophizing | Inflate a difficulty into an extreme disaster or intolerable outcome |
| Comparing and despairing | Use a selective unfavorable comparison to conclude personal inadequacy |
| Blaming | Assign responsibility to others in a way that erases one’s own part |
| Negative feeling | Express distress without requiring a distorted inference |
Reframing attributes
| Attribute | What “more” means |
|---|---|
| Thinking-trap addressing | Directly challenges the thought’s biased inference or rule |
| Rationality | Gives stronger grounds for the alternative interpretation |
| Positivity | Gives more attention to plausible favorable perspectives |
| Empathy | Expresses more validation or self-compassion |
| Actionability | Makes a possible response clearer or easier to carry out |
| Specificity | Is tailored to this concern rather than broadly reusable |
| Readability | Uses more accessible wording without changing the interpretation |
Appendix D: details
- Sampling uses temperature 0.7, top-p 0.8 and top-k 20, with at most 256 new tokens.
- In the layer-24 tests at −40%, the reviewers flagged a serious failure, mostly invented detail, in 10 situations whose unsteered thought had none. Random directions gave 3 to 7.
- Without layer 6, whose outputs barely change, the matching of Figure 4 scores 20 of 25.
- Random directions were compared on self-reproach and dismissal only at layer 24. They also ran at ±10% on every layer and at ±100% on layers 13–16. On those layers, the reframe direction makes the model repeat its instructions, while random directions did so in 1 of 512 outputs.
- On 489 thoughts rated twice, mostly by different Claude Sonnet 5.5 reviewers, agreement on the four markers is κ 0.86–0.98, a measure of the reviewers’ consistency rather than their validity. Figure 3 counts a distortion only for the five CD-Quest items with κ of at least 0.4 (should statements, labeling, overgeneralizing, fortune telling and blaming), which excludes the questionnaire’s minimization item.
- The self-reproach, dismissal and matching tests applied decision rules set before generation to new situations. The layers and strengths of the depth analyses were chosen after reading development outputs, so those analyses are exploratory.
Footnotes
-
The Beck Institute describes examining the evidence for automatic thoughts and developing alternative perspectives in Psychopathology and Psychotherapy (opens in a new tab). A reframe need not be positive, since a distressing interpretation can be accurate. ↩
-
Adult personas from NVIDIA’s Nemotron-Personas-USA (opens in a new tab), described by age, sex, occupation, education, marital status, interests and skills. Names and addresses are left out. ↩