轨迹引导导向:缓解临床分类中的虚假特征偏倚

arXiv cs.CL 论文

摘要

提出 Trajectory-Guided Steering (TGS),通过分析模型跨层预测轨迹来判断是否及如何纠正临床分类中的虚假特征偏倚,无需反事实数据即可修复 17.7% 的错误并显著降低性别交换不一致性。

arXiv:2610.22618v1 Announce Type: new Abstract: Large language models rely on spurious features in clinical classification: swapping a single gender token in clinical notes alters gender-irrelevant diagnoses in up to 53.5% of cases. Existing inference-time corrections either need counterfactual data built around the specific spurious feature or behave unpredictably. We observe that how a model's preference between answers evolves across layers, its prediction trajectory, indicates for each document whether a correction is likely to help. We propose Trajectory-Guided Steering (TGS), which decides from the trajectory alone whether to correct each prediction and in which direction, with no counterfactual data and no knowledge of the spurious feature. On 16 clinical classification tasks from i2b2, TGS fixes 17.7% of errors while breaking only 1.3% of correct predictions and stays net-positive across all tested hyperparameter settings; all baselines are net-negative or near zero. The same corrections reduce reliance on the spurious feature: on the most affected diseases, gender-swap inconsistency falls sharply (hypertension 53.5% -> 38.0%, diabetes 35.1% -> 21.5%). Applying the correction to every document instead raises breaks on correct positive predictions from 0.1% to 6.4%, so per-document selection is essential. TGS also transfers to three model families and three other clinical and biomedical datasets.
查看原文
查看缓存全文

缓存时间: 2026/10/19 07:13

# Trajectory-Guided Steering: Mitigating Spurious Feature Bias in Clinical Classification
Source: [https://arxiv.org/html/2610.22618](https://arxiv.org/html/2610.22618)
Ziwei ZhuAffiliation:Department of Computer ScienceEmail:[zzhu20@gmu\.edu](mailto:)Özlem UzunerAffiliation:Department of Information Sciences and TechnologyGeorge Mason UniversityEmail:[ouzuner@gmu\.edu](mailto:)

###### Abstract

Large language models rely on spurious features in clinical classification: swapping a single gender token in clinical notes alters gender\-irrelevant diagnoses in up to 53\.5% of cases\. Existing inference\-time corrections either need counterfactual data built around the specific spurious feature or behave unpredictably\. We observe that how a model’s preference between answers evolves across layers, its prediction trajectory, indicates for each document whether a correction is likely to help\. We propose Trajectory\-Guided Steering \(TGS\), which decides from the trajectory alone whether to correct each prediction and in which direction, with no counterfactual data and no knowledge of the spurious feature\. On 16 clinical classification tasks from i2b2, TGS fixes 17\.7% of errors while breaking only 1\.3% of correct predictions and stays net\-positive across all tested hyperparameter settings; all baselines are net\-negative or near zero\. The same corrections reduce reliance on the spurious feature: on the most affected diseases, gender\-swap inconsistency falls sharply \(hypertension 53\.5%→\\rightarrow38\.0%, diabetes 35\.1%→\\rightarrow21\.5%\)\. Applying the correction to every document instead raises breaks on correct positive predictions from 0\.1% to 6\.4%, so per\-document selection is essential\. TGS also transfers to three model families and three other clinical and biomedical datasets\.

## 1Introduction

Large language models are increasingly applied to clinical NLP tasks such as screening, triage, and diagnostic support\. Yet their predictions can depend on spurious features, aspects of the input irrelevant to the clinical question\. This is documented in clinical use: changing only a patient’s gender or race affects GPT\-4’s ability to rank the correct diagnosis first in 37% of cases\([Zack et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib32)\), LLMs repeat race\-based medical misconceptions\([Omiye et al\., 2023](https://arxiv.org/html/2610.22618#bib.bib33)\), and they infer drug use from mentions of alcohol or smoking\([Sakib et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib9)\)\. Consider a discharge summary documenting Type 2 diabetes with multiple insulin prescriptions: with identical symptoms and medications, the model’s predicted diagnosis flips from positive to negative when only the gender word changes, even though gender carries no diagnostic information for this disease\.Such reliance makes the model’s predictions untrustworthy: they can change with information that has no bearing on the diagnosis\.To quantify it, we swap a single gender token across 16 diseases for which gender is diagnostically irrelevant, holding all clinical evidence constant\. Because the evidence alone determines the correct answer, any change in prediction is an error; this*inconsistency*occurs in9\.7% to 53\.5% of cases\(Appendix[B](https://arxiv.org/html/2610.22618#A2)\)\.

Figure 1:Overview of Trajectory\-Guided Steering \(TGS\)\. Before generating, TGS reads which answer the model prefers at each layer and how strongly, giving a prediction trajectory\. Comparing an early and a late layer, it finds whether the preference strengthens, stays flat, or changes between the two\. Based on this shape, TGS pushes toward the early preference, pushes against it, or keeps the original answer, by shifting the two answer\-token logits during generation\.Existing ways to reduce reliance on spurious features are costly\. Training\-time methods such as invariant or domain\-adversarial learning require retraining, often with labels for the feature or for distinct environments\([Arjovsky et al\., 2020](https://arxiv.org/html/2610.22618#bib.bib27);[Ganin et al\., 2016](https://arxiv.org/html/2610.22618#bib.bib28)\)\. Inference\-time methods avoid retraining, but prompt changes have unpredictable effects, and activation steering \(e\.g\., CAA\([Rimsky et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib1)\), FairSteer\([Li et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib2)\)\) or editing demographic information inside the model\([Ahsan et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib34)\)needs counterfactual training pairs or knowledge of which feature drives the errors\.

Clinical settings rarely provide either\. Records are restricted by data use agreements\([Agrawal et al\., 2022](https://arxiv.org/html/2610.22618#bib.bib35)\), counterfactual data requires expert annotation, and the features that sway a model are rarely known in advance\. A correction must also be selective, because changing a correct clinical prediction is itself a harm\.Clinical classification therefore needs a correction that works at inference time, uses no additional data, and leaves correct predictions intact\.

We propose Trajectory\-Guided Steering \(TGS\), which decides from the model’s own forward pass whether and how to correct each prediction\. Using the logit lens\([nostalgebraist, 2020](https://arxiv.org/html/2610.22618#bib.bib3)\), which projects each layer’s hidden state through the unembedding matrix, TGS tracks the model’s preference between the answer tokens across layers; we call this curve the*prediction trajectory*\. Its shape, whether early and late layers agree and whether the preference strengthens, indicates when a correction is safe and in which direction\. When it is, a second forward pass adjusts the logits of the answer tokens toward the direction the trajectory supports; otherwise, the prediction is left unchanged\. TGS needs no counterfactual data and no knowledge of the spurious feature\. Empirically, these corrections also reduce the model’s reliance on the gender token\.

On the i2b2 clinical benchmark\([Uzuner, 2009](https://arxiv.org/html/2610.22618#bib.bib5)\), TGS fixes 17\.7% of prediction errors while breaking only 1\.3% of correct predictions\. Its net gain exceeds that of every baseline\. The same corrections reduce gender\-swap inconsistency, most on the diseases where gender sways the model most \(e\.g\., hypertension 53\.5%→\\rightarrow38\.0%\)\. TGS also transfers to three model families and three other clinical and biomedical datasets\. Figure[1](https://arxiv.org/html/2610.22618#S1.F1)provides an overview\. Our contributions are threefold\. \(1\)A new signal for correction: we show that logit\-lens trajectory shape distinguishes correctable errors from predictions that should be left untouched, turning a layer\-wise readout of the model’s predictions into a control signal\. \(2\)Selective, per\-document correction from the model’s own forward pass: unlike activation steering \(CAA, FairSteer\), TGS needs neither counterfactual data nor knowledge of the spurious feature\. \(3\)Robust net\-positive performance that baselines do not achieve: TGS is net\-positive across three model families and four clinical and biomedical datasets, and on i2b2 steering and prompting baselines are net\-negative or near zero; an ablation shows that per\-document selection is essential for preserving correct predictions\.

## 2Prediction Trajectories Reveal Three Trajectory Shapes

An inference\-time correction method must decide, for each document, whether to correct and in which direction\. Without counterfactual data or knowledge of which feature drives the errors, that decision has to come from the model’s own forward pass\. Our goal is to understand whether the model’s layer\-by\-layer predictions differ systematically between correct and incorrect outputs, and if so, whether these differences could indicate when correction is likely to help\.

### 2\.1Prediction Trajectories

We analyze LLaMA 3\.1 8B Instruct\([Meta, 2024](https://arxiv.org/html/2610.22618#bib.bib8)\)on the i2b2 2008 Obesity Challenge\([Uzuner, 2009](https://arxiv.org/html/2610.22618#bib.bib5)\), a clinical benchmark where models classify each of 16 diseases as present or absent in discharge summaries\. At every layer, we use the logit lens\([nostalgebraist, 2020](https://arxiv.org/html/2610.22618#bib.bib3)\)to project the hidden state through the model’s unembedding matrix and obtain logit values for each answer token \(e\.g\.,YesandNo\)\. The difference between these logits, the*logit margin*, shows which answer the model favors at that depth; its size, which we call*conviction*, shows how strongly\. Tracking the margin from early to late layers produces a per\-document*prediction trajectory*: a curve showing whether the margin grows, stalls, or changes sign across depth\. We orient each trajectory so that the model’s preferred answer points upward, letting documents that favor opposite answers be compared by the shape of their trajectory\.

### 2\.2Three Trajectory Shapes

Examining these trajectories on i2b2, we find they naturally partition into three shapes \(Figure[2](https://arxiv.org/html/2610.22618#S2.F2)\):growing conviction\(early and late layers agree and conviction grows\),static conviction\(they agree but conviction does not grow\), andinternal conflict\(they disagree\)\.Each shape implies a distinct correction: reinforce the preferred answer, oppose it, or leave the prediction unchanged\.We motivate these below and formalize them in Section[3](https://arxiv.org/html/2610.22618#S3)\.

Figure 2:Three trajectory shapes on i2b2 \(LLaMA 3\.1 8B\), each implying a different safe action\. The y\-axis shows the direction\-aligned logit margin: the difference between the logit values of the two answer tokens, oriented so that the model’s preferred direction points upward\. Thin lines: individual documents; thick line with markers: group mean\. Blue solid: correct predictions; red dashed: incorrect predictions\.Panel A: Growing conviction \(reinforce\)\. Correct and incorrect follow nearly identical trajectories\.Panel B: Static conviction \(oppose\)\. Incorrect predictions fail to accumulate the conviction growth seen in correct predictions\.Panel C: Internal conflict \(leave unchanged\)\. Correct and incorrect are fully indistinguishable\.In the first shape,*growing conviction*\(Panel A\), early and late layers agree on the preferred answer and conviction grows substantially across layers\. Correct and incorrect predictions follow nearly identical trajectories, so the trajectory alone cannot distinguish them\. Yet correction remains possible: in most incorrect predictions of this shape, the trajectory favors the correct answer, but the generated answer differs\. Reinforcing the preferred answer moves the output toward it, which recovers some of these errors while most correct predictions keep their answer\.

In the second shape,*static conviction*\(Panel B\), early layers establish a preference but conviction growth is limited\. Here, in contrast, the trajectory does distinguish correct from incorrect: correct predictions continue to accumulate conviction while incorrect predictions do not\. A preference that deeper layers do not strengthen marks errors that could be safely opposed, while correct predictions, whose conviction grows, would not be targeted\.

In the third shape,*internal conflict*\(Panel C\), early and late layers disagree: the margin changes sign across layers\. Correct and incorrect predictions are fully indistinguishable in this shape: their trajectories overlap completely\. But here no consistent direction exists for correction, so any correction is equally likely to harm a correct prediction as to fix an incorrect one\. The safe action is to leave these documents unchanged\.

Applying the same logit lens inspection to Qwen3 8B\([Yang et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib11)\), a different model family, reveals the same three qualitative shapes\. The structural properties are preserved: growing\-conviction trajectories show the same correct–incorrect overlap, and internal\-conflict trajectories remain indistinguishable across outcomes\. This suggests the shapes are not an artifact of a single architecture\. TGS results for Qwen3 are reported in Section[5](https://arxiv.org/html/2610.22618#S5)\.

### 2\.3From Shapes to a Correction Rule

The three shapes yield a single rule, applied per document: reinforce the preferred answer when conviction grows, oppose the preference when conviction stays static, and leave the prediction unchanged otherwise, including when early and late layers conflict\.Safe correction does not require distinguishing correct from incorrect predictions\.Even where their trajectories are identical \(growing conviction\), reinforcing the shared direction fixes errors while leaving correct predictions largely intact, because it only strengthens a preference the trajectory already supports\. Section[3](https://arxiv.org/html/2610.22618#S3)formalizes these mappings into a single per\-document correction signal\.

## 3Method

#### Problem\.

Consider anLL\-layer language model and a classification task whoseKKcandidate answer tokens are specified in the prompt\. Our goal is a per\-document correction of prediction errors at inference time, without counterfactual data or knowledge of the spurious feature, while leaving correct predictions intact\. We formalize the binary case \(K=2K\{=\}2\) with answer tokenst\+t^\{\+\}andt−t^\{\-\}; the quantities below generalize toK\>2K\>2\(Appendix[G](https://arxiv.org/html/2610.22618#A7)\)\.

TGS is a training\-free inference\-time method that operates in two passes \(Figure[1](https://arxiv.org/html/2610.22618#S1.F1)\)\. Pass 1 extracts a per\-document logit\-lens trajectory and maps it to a scalar correction signalede\_\{d\}that encodes whether and how to correct \(Sections[3\.1](https://arxiv.org/html/2610.22618#S3.SS1)–[3\.2](https://arxiv.org/html/2610.22618#S3.SS2)\)\. Pass 2 applies a logit bias to documents withed≠0e\_\{d\}\\neq 0and leaves all others unchanged \(Section[3\.3](https://arxiv.org/html/2610.22618#S3.SS3)\)\.

### 3\.1Trajectory Extraction

Given an input sequence, we perform a single forward pass through allLLlayers of the model without generating any tokens; the answer itself is produced later, during generation \(Section[3\.3](https://arxiv.org/html/2610.22618#S3.SS3)\)\. At each layerℓ∈\{0,…,L−1\}\\ell\\in\\\{0,\\ldots,L\{\-\}1\\\}, we project the final\-token hidden state through the model’s own final normalization layer and language model head:

𝐳ℓ=WU⋅Norm​\(𝐡ℓ\[−1\]\)\\mathbf\{z\}\_\{\\ell\}=W\_\{U\}\\cdot\\text\{Norm\}\(\\mathbf\{h\}\_\{\\ell\}^\{\[\-1\]\}\)\(1\)where𝐡ℓ\[−1\]\\mathbf\{h\}\_\{\\ell\}^\{\[\-1\]\}is the hidden state at the last input position in layerℓ\\ell, andWUW\_\{U\}is the unembedding matrix\. This is the*logit lens*projection\([nostalgebraist, 2020](https://arxiv.org/html/2610.22618#bib.bib3)\), which reveals the model’s implicit token preferences at intermediate layers\.

From the projected logits, we extract two signals at each layer\. Themargincaptures the model’s preference between the positive and negative answer tokens:

mℓ=𝐳ℓ​\[t\+\]−𝐳ℓ​\[t−\]m\_\{\\ell\}=\\mathbf\{z\}\_\{\\ell\}\[t^\{\+\}\]\-\\mathbf\{z\}\_\{\\ell\}\[t^\{\-\}\]\(2\)wheret\+t^\{\+\}andt−t^\{\-\}are the answer tokens for the positive and negative classes \(e\.g\.,Yes/No\), defined per task in Section[4](https://arxiv.org/html/2610.22618#S4)\(prompts in Appendix[I](https://arxiv.org/html/2610.22618#A9)\)\. Thebinary entropymeasures how sharply the model favors one answer over the other:

Hℓ\\displaystyle H\_\{\\ell\}=−∑k∈\{t\+,t−\}pklogpk\\displaystyle=\-\\sum\_\{k\\in\\\{t^\{\+\},t^\{\-\}\\\}\}p\_\{k\}\\log p\_\{k\}\(3\)pk\\displaystyle p\_\{k\}=exp⁡\(𝐳ℓ​\[k\]\)exp⁡\(𝐳ℓ​\[t\+\]\)\+exp⁡\(𝐳ℓ​\[t−\]\)\\displaystyle=\\frac\{\\exp\(\\mathbf\{z\}\_\{\\ell\}\[k\]\)\}\{\\exp\(\\mathbf\{z\}\_\{\\ell\}\[t^\{\+\}\]\)\+\\exp\(\\mathbf\{z\}\_\{\\ell\}\[t^\{\-\}\]\)\}
#### Steering layer selection\.

Early logit\-lens projections tend to be noisy and unreliable\([nostalgebraist, 2020](https://arxiv.org/html/2610.22618#bib.bib3);[Belrose et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib4)\)\. We select the steering layerℓ∗\\ell^\{\*\}per document by identifying the first significant drop in binary entropy across intermediate layers, which marks where the model first commits to a decision\. This makesℓ∗\\ell^\{\*\}adaptive: it varies across documents and models without manual tuning\. The full selection procedure and cross\-model analysis are provided in Appendix[A](https://arxiv.org/html/2610.22618#A1)\.

#### Key signals\.

From the trajectory, we extract two anchor points:

me=mℓ∗,ml=mL−1m\_\{\\mathrm\{e\}\}=m\_\{\\ell^\{\*\}\},\\quad m\_\{\\mathrm\{l\}\}=m\_\{L\-1\}\(4\)wheremem\_\{\\mathrm\{e\}\}is the margin at the steering layer andmlm\_\{\\mathrm\{l\}\}the margin at the final layer\. Together, these capture the model’s early preference and how it evolves across depth\.

### 3\.2Trajectory\-Guided Routing

The trajectory signals from Pass 1 determine a per\-document correction signalede\_\{d\}that captures both whether to correct and in which direction\. The guiding principle is conservative: TGS modifies predictions only when the trajectory provides clear evidence for the direction of correction, and defaults to leaving the original prediction unchanged\.

We now formalize the routing rule, which assigns each document to one of the three actions \(reinforce, oppose, or leave unchanged\) for the shapes identified in Section[2](https://arxiv.org/html/2610.22618#S2)\.

Formally, letsℓ=sign⁡\(mℓ\)s\_\{\\ell\}=\\operatorname\{sign\}\(m\_\{\\ell\}\)\. Ifsℓ∗≠sL−1s\_\{\\ell^\{\*\}\}\\neq s\_\{L\-1\}, the trajectory shows internal conflict anded=0e\_\{d\}=0\. When they agree, we measure conviction growth\|ml\|−\|me\|\|m\_\{\\mathrm\{l\}\}\|\-\|m\_\{\\mathrm\{e\}\}\|, the increase in conviction regardless of direction:

ed=\{\+me\|ml\|−\|me\|\>τ−max⁡\(me,0\)otherwisee\_\{d\}=\\begin\{cases\}\+m\_\{\\mathrm\{e\}\}&\|m\_\{\\mathrm\{l\}\}\|\-\|m\_\{\\mathrm\{e\}\}\|\>\\tau\\\\ \-\\max\(m\_\{\\mathrm\{e\}\},\\;0\)&\\text\{otherwise\}\\end\{cases\}\(5\)whereτ\\tauis the conviction\-growth threshold\. Intuitively,ede\_\{d\}reinforces the early preference when conviction grew and opposes it when conviction stayed static with a positive early margin; all other documents, including static negative early margins, retain their original prediction \(ed=0e\_\{d\}=0\)\.

### 3\.3Steered Generation

For documents withed≠0e\_\{d\}\\neq 0, Pass 2 applies a logit bias during generation, adding\+α​ed\+\\alpha e\_\{d\}to the positive answer\-token logit and−α​ed\-\\alpha e\_\{d\}to the negative one, whereα\\alphais the correction strength\. The answer\-token margin \(Eq\.[2](https://arxiv.org/html/2610.22618#S3.E2)\) therefore becomes:

m′=\(𝐳⁡\[t\+\]\+α​ed\)−\(𝐳⁡\[t−\]−α​ed\)=m\+2​α​ed\.m^\{\\prime\}=\\big\(\\mathbf\{z\}\[t^\{\+\}\]\+\\alpha e\_\{d\}\\big\)\-\\big\(\\mathbf\{z\}\[t^\{\-\}\]\-\\alpha e\_\{d\}\\big\)=m\+2\\alpha\\,e\_\{d\}\.\(6\)All other logits remain unchanged\. For documents withed=0e\_\{d\}=0, generation proceeds unmodified\.

### 3\.4Hyperparameters and Runtime

TGS has two hyperparameters\. The correction strengthα\\alphacontrols the magnitude of the logit bias and is set per model and dataset, reflecting differences in logit scale\. The conviction\-growth thresholdτ\\tauseparates growing from static conviction; it is robust across its tested range \(Section[5\.3](https://arxiv.org/html/2610.22618#S5.SS3)\)\. Both are selected via grid search, following the same evaluation protocol as the baselines; selecting them on a held\-out 30% split instead gives the same conclusions \(Section[5\.3](https://arxiv.org/html/2610.22618#S5.SS3)\)\. The sensitivity analysis and per\-dataset grids are reported in Appendix[D](https://arxiv.org/html/2610.22618#A4)\.

#### Runtime\.

Trajectory extraction \(Pass 1\) adds one forward pass per document with no token generation\. Documents withed=0e\_\{d\}=0incur only this extraction cost, while documents withed≠0e\_\{d\}\\neq 0additionally undergo a modified generation pass\.

TGS extends toK\>2K\>2answer classes; Appendix[G](https://arxiv.org/html/2610.22618#A7)gives the formulation and an initial 3\-class evaluation\.

## 4Experimental Setup

### 4\.1Datasets

#### i2b2 Obesity Challenge \(primary\)\.

We evaluate on the i2b2 2008 Obesity Challenge\([Uzuner, 2009](https://arxiv.org/html/2610.22618#bib.bib5)\), comprising clinical discharge summaries annotated for 16 disease conditions \(e\.g\., diabetes, hypertension, asthma\) as present or absent, with 243–598 documents per disease\. Each document is prompted under both gender conditions, yielding two predictions per document; the note itself is unchanged\.

#### n2c2 2018 Cohort Selection \(second clinical benchmark\)\.

To test transfer to a new clinical dataset, we evaluate on the n2c2 2018 cohort selection task\([Stubbs et al\., 2019](https://arxiv.org/html/2610.22618#bib.bib36)\), in which 288 patients are annotated for 13 clinical\-trial eligibility criteria as met or not met\. We ask one Yes/No question per patient and criterion, using the i2b2 prompt with the criterion in place of the disease, under both gender conditions\.

#### SHAC Drug Use \(different spurious feature\)\.

To test a different spurious feature, we evaluate on drug use status classification from the Social History Annotation Corpus \(SHAC\)\([Lybarger et al\., 2023](https://arxiv.org/html/2610.22618#bib.bib6)\), a social determinants of health corpus of MIMIC\-III\([Johnson et al\., 2016](https://arxiv.org/html/2610.22618#bib.bib22)\)clinical notes\. Models determine whether drug use is present \(current or past\) or absent \(none/unknown\)\. Margins are computed via logsumexp over each token set to accommodate the multi\-token outcome space \(t\+=\{current, past\}t^\{\+\}=\\\{\\text\{current, past\}\\\},t−=\{none, not applicable\}t^\{\-\}=\\\{\\text\{none, not applicable\}\\\}\)\.

#### PubMedQA \(beyond clinical notes\)\.

As a first step beyond clinical notes, we evaluate on PubMedQA\([Jin et al\., 2019](https://arxiv.org/html/2610.22618#bib.bib7)\), a biomedical QA dataset where models determine whether published evidence supports a given research question\. We use the 890 expert\-annotated instances with a yes or no label\.

### 4\.2Models

All experiments use 7–8B parameter instruction\-tuned LLMs loaded in bfloat16\. Our primary model is LLaMA 3\.1 8B Instruct\([Meta, 2024](https://arxiv.org/html/2610.22618#bib.bib8)\)\. To test cross\-model generalization, we additionally evaluate Mistral 7B Instruct v0\.3\([Jiang et al\., 2023](https://arxiv.org/html/2610.22618#bib.bib10)\)and Qwen3 8B\([Yang et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib11)\)\.

### 4\.3Baselines

#### Prompt\-based\.

We compare against three prompt modification strategies that require no training data: \(1\)system\-clinical, a system prompt instructing the model to base assessments on clinical findings only; \(2\)system\-objective, a system prompt requesting objective, neutral clinical evaluation; and \(3\)chain\-of\-thought\(CoT\)\([Wei et al\., 2023](https://arxiv.org/html/2610.22618#bib.bib12)\), which elicits step\-by\-step reasoning before the final answer\.

#### Activation steering\.

We compare against two activation steering methods\.CAA\([Rimsky et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib1)\)computes a steering vector as the mean activation difference between contrastive prompt pairs, then adds it at a single selected layer across all response\-region token positions\.FairSteer\([Li et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib2)\)trains a per\-layer linear probe to detect biased activations and conditionally applies a debiasing steering vector only when the probe fires\. Both require counterfactual training pairs; we reserve 30% of documents for training\. We report the best universal configuration for each, selected by sweeping hyperparameters on the test split\.

### 4\.4Evaluation

Each document is classified by the outcome of its original prediction \(TP, TN, FP, or FN\), and the steered prediction determines whether the correction produces afix\(incorrect→\\rightarrowcorrect\), abreak\(correct→\\rightarrowincorrect\), or no change\. We report fix rate \(fixes / total errors\), break rate \(breaks / total correct predictions\), and net gain \(total fixes−\-total breaks\)\.

For i2b2 and n2c2 2018, each document yields two predictions \(one per gender condition\), counted independently for fix and break rates; gender\-swap inconsistency is measured separately \(Appendix[B](https://arxiv.org/html/2610.22618#A2)\)\. The i2b2 prompt includes a Questionable option; documents with Questionable ground truth have no definitive Yes/No label and are excluded \(23 documents,<\{<\}0\.3%\)\. Original predictions that match none of the prompt’s answer options \(non\-answers\) are excluded from the counts, and steered non\-answers are counted as incorrect\. For SHAC and PubMedQA, each document yields one prediction\. Our method evaluates on 100% of documents; CAA and FairSteer evaluate on∼\{\\sim\}70% \(30% reserved for training\)\. For a direct comparison, we additionally evaluate TGS on this same∼\{\\sim\}70% test subset \(Table[1](https://arxiv.org/html/2610.22618#S5.T1)\)\.

## 5Results

### 5\.1TGS Outperforms All Baselines

On i2b2, TGS achieves a far larger net gain than any baseline: it fixes 17\.7% of prediction errors \(net \+201\) while breaking just 1\.3% of correct predictions, whereas baselines are net\-negative or only marginally positive\(Table[1](https://arxiv.org/html/2610.22618#S5.T1)\)\. Figure[3](https://arxiv.org/html/2610.22618#S5.F3)makes this visible: TGS’s fix–break curve \(blue\) stays inside the green low\-break region as its correction strength rises fromα=0\.1\\alpha\{=\}0\.1to1\.01\.0, adding fixes gradually, whereas baseline points remain near zero or fall into the net\-negative region at stronger settings\.

Methods that achieve high fix rates do so at the cost of high break rates \(Figure[3](https://arxiv.org/html/2610.22618#S5.F3)\): CoT reaches 35\.7% fix but 47\.5% break\. At their best configurations, CAA achieves net \+3 and FairSteer net \+19 on their∼\{\\sim\}70% test subset, compared with TGS’s \+146 on the same subset \(Table[1](https://arxiv.org/html/2610.22618#S5.T1)\)\. All three prompt strategies are net\-negative, so among methods that need no counterfactual data, TGS is the only net\-positive one\.

These corrections also reduce reliance on the spurious feature: gender\-swap inconsistency drops from 25\.1% to 21\.5% across 16 diseases, with the largest reductions on the most affected diseases \(hypertension 53\.5%→\\rightarrow38\.0%, diabetes 35\.1%→\\rightarrow21\.5%; Appendix[B](https://arxiv.org/html/2610.22618#A2)\)\.Because each document is corrected from its trajectory alone, with no knowledge of the spurious feature, this reduction is empirical\. Still, TGS fixes 19\.8% of errors that flip with the gender token, four times its rate on errors that persist under both genders \(4\.9%\)\. Adding the same logit bias toward the correct answer to every error corrects both kinds of error at nearly the same rate \(13\.7% vs\. 14\.8%\), so the corrections of TGS concentrate on errors driven by the spurious feature \(Appendix[B](https://arxiv.org/html/2610.22618#A2)\)\.

Table 1:Baseline comparison on i2b2 \(LLaMA, 16 diseases\)\. Each block compares methods on identical data: the full test set \(top\) and the∼\{\\sim\}70% subset left after CAA/FairSteer reserve 30% for training \(bottom\)\. TGS reserves no training data yet is net\-positive in both blocks, while baselines are net\-negative or only marginally positive\. Net↑\\uparrow= errors fixed minus correct predictions broken; Fix%/Break% are rates\. TGS \(held\-out\):α\\alphaandτ\\tauselected on the 30% split \(Section[5\.3](https://arxiv.org/html/2610.22618#S5.SS3)\)\.Figure 3:Fix rate vs\. break rate tradeoff on i2b2 \(LLaMA, 16 diseases\)\. The green upper\-left region is preferable: it combines high error correction \(fix rate\) with little damage to correct predictions \(break rate\); points above the dashed net\-zero line are net\-positive\. TGS’s fix–break curve \(blue, varyingα\\alphafrom 0\.1 to 1\.0\) lies entirely in this region, and the starred point marks our reported configuration \(α=0\.5\\alpha\{=\}0\.5,τ=0\.5\\tau\{=\}0\.5\)\. Baselines cluster near zero fix rate \(CAA, labeled by its steering multipliermm\) or cross into net\-negative territory at higher strengths \(FairSteer, prompts\)\. CoT \(off\-chart\) achieves 35\.7% fix rate but at 47\.5% break rate\.
### 5\.2TGS Transfers Across Models and Datasets

TGS stays net\-positive across three model families and four clinical and biomedical datasets, including a clinical task with a documented non\-gender spurious feature and a biomedical QA task outside clinical notes\.Across models, we apply it to Mistral 7B Instruct \(α=0\.5\\alpha\{=\}0\.5\) and Qwen3 8B \(α=2\.0\\alpha\{=\}2\.0\) on i2b2 with the sameτ=0\.5\\tau=0\.5\. Both are net\-positive \(Table[2](https://arxiv.org/html/2610.22618#S5.T2)\)\. The higherα\\alphafor Qwen3 reflects its larger logit scale\.

On n2c2 2018, the i2b2 configuration transfers without retuning: TGS is net\-positive and reduces gender\-swap inconsistency from 37\.2% to 33\.9% \(Appendix[E](https://arxiv.org/html/2610.22618#A5)\)\.

SHAC \(α=1\.0\\alpha\{=\}1\.0,τ=0\.75\\tau\{=\}0\.75; Appendix[D](https://arxiv.org/html/2610.22618#A4)\) tests a different spurious feature in clinical notes\. Models are known to rely on alcohol and smoking terminology there rather than clinical content\([Sakib et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib9)\)\. TGS achieves net \+42 with a 78\.9% fix rate and reduces inconsistency with respect to these terms from 31\.7% to 16\.8% \(Appendix[B](https://arxiv.org/html/2610.22618#A2)\)\. On a 3\-class version of SHAC \(negative / current / past\), TGS also stays net\-positive \(net \+29; 27\.8% fix, 5\.8% break; Appendix[G](https://arxiv.org/html/2610.22618#A7)\)\.

Finally, beyond clinical notes, we evaluate on PubMedQA \(α=1\.0\\alpha\{=\}1\.0,τ=0\.75\\tau\{=\}0\.75; Appendix[D](https://arxiv.org/html/2610.22618#A4)\), a biomedical research QA task with no counterfactual pairs\. TGS achieves net \+35 \(34\.5% fix rate\), so the correction does not require a known spurious feature\. Table[2](https://arxiv.org/html/2610.22618#S5.T2)summarizes these results\.

Table 2:Generalization across models and datasets\. All results are net\-positive\. Top: cross\-model on i2b2\. Bottom: cross\-dataset with LLaMA\.On i2b2, the sameτ=0\.5\\tau=0\.5transfers across models without retuning; onlyα\\alphaadjusts to each model’s logit scale\. TGS is net\-positive on 41 of 48 model\-disease combinations, with no disease consistently negative across models \(Appendix[C](https://arxiv.org/html/2610.22618#A3)\)\.

### 5\.3TGS Is Robust to Its Hyperparameters and Prompt Wording

On i2b2, every tested\(α,τ\)\(\\alpha,\\tau\)configuration is net\-positive, trajectory\-based routing holds the break rate near zero, and the gains hold under a reworded prompt\.We vary each hyperparameter with the other fixed \(Table[6](https://arxiv.org/html/2610.22618#A4.T6)in Appendix[D](https://arxiv.org/html/2610.22618#A4)\): correction strengthα\\alphatrades off fix against break, with net gain peaking atα=0\.5\\alpha=0\.5, while across the conviction\-growth thresholdτ\\taunet gain stays in\[\+184,\+209\]\[\+184,\+209\]\. All tested i2b2 configurations remain net\-positive, unlike baselines where small changes flip outcomes \(prompt strategies span−\-6206 to−\-83\)\. Grids for SHAC and PubMedQA are in Appendix[D](https://arxiv.org/html/2610.22618#A4)\.

#### Held\-out tuning\.

The reported configurations follow the baselines’ protocol\. Selectingα\\alphaandτ\\tauon a 30% split and evaluating on the remaining 70% leads to the same conclusions\. On i2b2, it selects the reported configuration and yields the same net \+146 on the CAA/FairSteer test subset \(Table[1](https://arxiv.org/html/2610.22618#S5.T1)\)\. On SHAC and PubMedQA, held\-out tuning is net\-positive in all 200 random splits \(mean \+28 and \+21 on the held\-out 70%\)\.

#### Prompt wording\.

We rerun TGS on i2b2 with a paraphrased prompt that rewords every sentence while keeping the task and answer options \(Appendix[I](https://arxiv.org/html/2610.22618#A9)\)\. With the same configuration, TGS remains net\-positive \(\+234 vs\. \+201 with the original prompt\) and reduces gender\-swap inconsistency from 21\.2% to 16\.1%\.

#### Routing protects correct predictions\.

Removing trajectory\-based routing and applying correction to all documents raises TP break from 0\.1% to 6\.4%, confirming that routing is essential for preserving correct predictions\. A constant logit bias, which shifts every document’s answer\-token margin by the same amount, is net\-negative at every tested strength and in both directions \(Appendix[F](https://arxiv.org/html/2610.22618#A6)\)\. On i2b2, routing sends 47% of documents to Reinforce, 13% to Oppose, and 40% to Leave unchanged; the break rate is 2\.4% for Reinforce and 0\.3% for Oppose \(Appendix[D](https://arxiv.org/html/2610.22618#A4)\)\.

## 6Related Work

#### Spurious correlations and shortcut learning\.

Neural models frequently exploit surface\-level patterns that correlate with labels but do not reflect the underlying task\([Geirhos et al\., 2020](https://arxiv.org/html/2610.22618#bib.bib13)\), including syntactic heuristics in NLI\([McCoy et al\., 2019](https://arxiv.org/html/2610.22618#bib.bib14)\)and shortcuts in fine\-tuned and in\-context LLMs\([Tu et al\., 2020](https://arxiv.org/html/2610.22618#bib.bib15);[Tang et al\., 2023](https://arxiv.org/html/2610.22618#bib.bib16)\)\. In clinical text, models may rely on demographic features or substance\-related terms rather than clinical evidence\([Brown et al\., 2023](https://arxiv.org/html/2610.22618#bib.bib17);[Sakib et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib9)\)\. Training\-time mitigations, including adversarial debiasing\([Zhang et al\., 2018](https://arxiv.org/html/2610.22618#bib.bib18)\), domain\-invariant and invariant risk learning\([Ganin et al\., 2016](https://arxiv.org/html/2610.22618#bib.bib28);[Arjovsky et al\., 2020](https://arxiv.org/html/2610.22618#bib.bib27)\), stable learning\([Zhang et al\., 2021](https://arxiv.org/html/2610.22618#bib.bib29)\), and causal feature selection\([Zhou and Zhu, 2025](https://arxiv.org/html/2610.22618#bib.bib30)\), require retraining, often with labels for the feature or for distinct environments\. TGS leaves the model unchanged and corrects predictions at inference time\.

#### Activation steering\.

Representation engineering, CAA, and ITI identify directions for a concept in activation space and shift activations along them during inference\([Zou et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib19);[Rimsky et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib1);[Li et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib20)\)\. FairSteer applies correction only when a trained bias classifier fires\([Li et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib2)\), and[Ahsan et al\. \(2025\)](https://arxiv.org/html/2610.22618#bib.bib34)locate and patch gender information in LLMs used for healthcare\. Each of these methods relies on external supervision \(contrastive prompt pairs, labeled examples of the target behavior, or trained classifiers\); TGS derives its correction signal from the model’s own forward pass on the current input\.

#### Logit lens and prediction trajectories\.

The logit lens\([nostalgebraist, 2020](https://arxiv.org/html/2610.22618#bib.bib3)\)reads a model’s token preferences at each layer, and the tuned lens\([Belrose et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib4)\)refines this with learned per\-layer affine probes, yielding intermediate predictions that are more predictive and reliable\. Layer\-wise predictions have also been used to change outputs: DoLa contrasts early and final layers at each decoding step\([Chuang et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib23)\), early\-exit methods stop once intermediate predictions agree\([Zhou et al\., 2020](https://arxiv.org/html/2610.22618#bib.bib24)\), intermediate decoding recovers accuracy under misleading prompts\([Halawi et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib25)\), and layer\-wise commitment can modulate context injection\([Fazli et al\., 2026](https://arxiv.org/html/2610.22618#bib.bib21)\)\. These methods act on every input; TGS uses trajectory shape to decide, per document, whether to correct and in which direction\. Trajectories over decoding steps also guide sampling in masked diffusion models\([Saini et al\., 2026](https://arxiv.org/html/2610.22618#bib.bib31)\); ours span the layers of an autoregressive model\.

#### Logit\-level correction\.

Contextual calibration\([Zhao et al\., 2021](https://arxiv.org/html/2610.22618#bib.bib26)\)applies the same answer\-token correction, estimated from a content\-free input, to every input\. TGS also adjusts only answer\-token logits, but decides per document whether and in which direction, using the model’s own trajectory \(Appendix[H](https://arxiv.org/html/2610.22618#A8)\)\.

## 7Conclusion

We showed that a model’s prediction trajectory, read with the logit lens, can guide selective inference\-time correction for clinical classification\. TGS decides from the model’s own forward pass whether and in which direction to correct each prediction, with no counterfactual data, no knowledge of the spurious feature, and no retraining, as clinical settings require\. Safe correction does not require distinguishing correct from incorrect predictions: trajectory shape indicates when a correction is safe and in which direction\. On i2b2, TGS fixes 17\.7% of errors while breaking only 1\.3% of correct predictions\. It is net\-positive across three model families and four clinical and biomedical datasets, and its corrections concentrate on errors driven by the spurious feature, making predictions more consistent under gender swaps\. Larger multi\-class tasks and non\-medical domains are natural next settings\.

## Limitations

This work has several limitations\. First, the method requires a task with a fixed set of candidate answer tokens \(e\.g\., Yes/No\) over which the logit margin is computed, which covers classification and QA but not open\-ended generation\. Second, the hyperparametersα\\alphaandτ\\taumust be selected per model\-dataset combination, requiring a small grid search\. Third, all experiments use 7–8B parameter instruction\-tuned models in English, all on biomedical datasets; generalization to larger models, other languages, or non\-biomedical domains remains untested\. Evaluation on other medical QA datasets and on standard spurious\-correlation benchmarks\([Zhou and Zhu, 2025](https://arxiv.org/html/2610.22618#bib.bib30)\)would test whether the same routing transfers beyond these settings\. Fourth, the trajectory shapes that enable routing may not hold for all model architectures or tasks: TGS assumes that the logit lens provides informative intermediate predictions, which has been validated for transformer\-based LLMs but not other architectures\. Fifth, we test robustness to prompt wording with one paraphrase of the i2b2 prompt; broader prompt variation remains untested\. Sixth, our evaluation covers two spurious features, gender \(i2b2, n2c2 2018\) and substance\-use terminology \(SHAC\), but does not systematically span other demographic attributes such as race, age, or socioeconomic status, which we leave to future work\.

## Ethics Statement

All clinical experiments use de\-identified patient data\. The i2b2 2008 Obesity Challenge dataset, the n2c2 2018 cohort selection corpus, and the SHAC corpus \(MIMIC\-III subset\) were accessed under institutional data use agreements, and all work was conducted on secure university servers following IRB protocols\. PubMedQA contains only published biomedical abstracts with no patient data\. Gender swapping is a diagnostic probe for reliance on spurious features and is not intended to capture the full spectrum of gender identity\. TGS reduces but does not eliminate prediction errors driven by spurious features; we recommend further validation before any clinical deployment\.

## References

- Agrawalet al\.\(2022\)M\. Agrawal, S\. Hegselmann, H\. Lang, Y\. Kim, and D\. SontagLarge language models are few\-shot clinical information extractors\.External Links:2205\.12689,[Link](https://arxiv.org/abs/2205.12689)Cited by:[§1](https://arxiv.org/html/2610.22618#S1.p3.1)\.
- Ahsanet al\.\(2025\)H\. Ahsan, A\. S\. Sharma, S\. Amir, D\. Bau, and B\. C\. WallaceElucidating mechanisms of demographic bias in llms for healthcare\.arXiv preprint arXiv:2502\.13319\.Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px1.p1.1),[§1](https://arxiv.org/html/2610.22618#S1.p2.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px2.p1.1)\.
- Arjovskyet al\.\(2020\)M\. Arjovsky, L\. Bottou, I\. Gulrajani, and D\. Lopez\-PazInvariant risk minimization\.External Links:1907\.02893,[Link](https://arxiv.org/abs/1907.02893)Cited by:[§1](https://arxiv.org/html/2610.22618#S1.p2.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Belroseet al\.\(2025\)N\. Belrose, I\. Ostrovsky, L\. McKinney, Z\. Furman, L\. Smith, D\. Halawi, S\. Biderman, and J\. SteinhardtEliciting latent predictions from transformers with the tuned lens\.External Links:2303\.08112,[Link](https://arxiv.org/abs/2303.08112)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px2.p1.1),[§3\.1](https://arxiv.org/html/2610.22618#S3.SS1.SSS0.Px1.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px3.p1.1)\.
- Brownet al\.\(2023\)A\. Brown, N\. Tomasev, J\. Freyberg, Y\. Liu, A\. Karthikesalingam, and J\. SchrouffDetecting shortcut learning for fair medical ai using shortcut testing\.Nature Communications14\(1\)\.External Links:ISSN 2041\-1723,[Link](http://dx.doi.org/10.1038/s41467-023-39902-7),[Document](https://dx.doi.org/10.1038/s41467-023-39902-7)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Chuanget al\.\(2024\)Y\. Chuang, Y\. Xie, H\. Luo, Y\. Kim, J\. Glass, and P\. HeDoLa: decoding by contrasting layers improves factuality in large language models\.External Links:2309\.03883,[Link](https://arxiv.org/abs/2309.03883)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px2.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px3.p1.1)\.
- Fazliet al\.\(2026\)M\. Fazli, B\. Wei, and Z\. ZhuContext\-aware decoding for faithful vision\-language generation\.External Links:2601\.05939,[Link](https://arxiv.org/abs/2601.05939)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px2.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px3.p1.1)\.
- Ganinet al\.\(2016\)Y\. Ganin, E\. Ustinova, H\. Ajakan, P\. Germain, H\. Larochelle, F\. Laviolette, M\. Marchand, and V\. LempitskyDomain\-adversarial training of neural networks\.External Links:1505\.07818,[Link](https://arxiv.org/abs/1505.07818)Cited by:[§1](https://arxiv.org/html/2610.22618#S1.p2.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Geirhoset al\.\(2020\)R\. Geirhos, J\. Jacobsen, C\. Michaelis, R\. Zemel, W\. Brendel, M\. Bethge, and F\. A\. WichmannShortcut learning in deep neural networks\.Nature Machine Intelligence2\(11\),pp\. 665–673\.External Links:ISSN 2522\-5839,[Link](http://dx.doi.org/10.1038/s42256-020-00257-z),[Document](https://dx.doi.org/10.1038/s42256-020-00257-z)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Halawiet al\.\(2024\)D\. Halawi, J\. Denain, and J\. SteinhardtOverthinking the truth: understanding how language models process false demonstrations\.External Links:2307\.09476,[Link](https://arxiv.org/abs/2307.09476)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px2.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px3.p1.1)\.
- Jianget al\.\(2023\)A\. Q\. Jiang, A\. Sablayrolles, A\. Mensch, C\. Bamford, D\. S\. Chaplot, D\. de las Casas, F\. Bressand, G\. Lengyel, G\. Lample, L\. Saulnier, L\. R\. Lavaud, M\. Lachaux, P\. Stock, T\. L\. Scao, T\. Lavril, T\. Wang, T\. Lacroix, and W\. E\. SayedMistral 7b\.External Links:2310\.06825,[Link](https://arxiv.org/abs/2310.06825)Cited by:[§4\.2](https://arxiv.org/html/2610.22618#S4.SS2.p1.1)\.
- Jinet al\.\(2019\)Q\. Jin, B\. Dhingra, Z\. Liu, W\. W\. Cohen, and X\. LuPubMedQA: a dataset for biomedical research question answering\.External Links:1909\.06146,[Link](https://arxiv.org/abs/1909.06146)Cited by:[§4\.1](https://arxiv.org/html/2610.22618#S4.SS1.SSS0.Px4.p1.1)\.
- Johnsonet al\.\(2016\)A\. E\. Johnson, T\. J\. Pollard, L\. Shen, L\. H\. Lehman, M\. Feng, M\. Ghassemi, B\. Moody, P\. Szolovits, L\. Anthony Celi, and R\. G\. MarkMIMIC\-iii, a freely accessible critical care database\.Scientific data3\(1\),pp\. 1–9\.Cited by:[§4\.1](https://arxiv.org/html/2610.22618#S4.SS1.SSS0.Px3.p1.1)\.
- Liet al\.\(2024\)K\. Li, O\. Patel, F\. Viégas, H\. Pfister, and M\. WattenbergInference\-time intervention: eliciting truthful answers from a language model\.External Links:2306\.03341,[Link](https://arxiv.org/abs/2306.03341)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px1.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px2.p1.1)\.
- Liet al\.\(2025\)Y\. Li, Z\. Fan, R\. Chen, X\. Gai, L\. Gong, Y\. Zhang, and Z\. LiuFairSteer: inference time debiasing for llms with dynamic activation steering\.External Links:2504\.14492,[Link](https://arxiv.org/abs/2504.14492)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px1.p1.1),[§1](https://arxiv.org/html/2610.22618#S1.p2.1),[§4\.3](https://arxiv.org/html/2610.22618#S4.SS3.SSS0.Px2.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px2.p1.1)\.
- Lybargeret al\.\(2023\)K\. Lybarger, M\. Yetisgen, and Ö\. UzunerThe 2022 n2c2/uw shared task on extracting social determinants of health\.Journal of the American Medical Informatics Association30\(8\),pp\. 1367–1378\.External Links:ISSN 1527\-974X,[Link](http://dx.doi.org/10.1093/jamia/ocad012),[Document](https://dx.doi.org/10.1093/jamia/ocad012)Cited by:[§4\.1](https://arxiv.org/html/2610.22618#S4.SS1.SSS0.Px3.p1.1)\.
- McCoyet al\.\(2019\)R\. T\. McCoy, E\. Pavlick, and T\. LinzenRight for the wrong reasons: diagnosing syntactic heuristics in natural language inference\.InProceedings of the 57th Annual Meeting of the Association for Computational Linguistics,A\. Korhonen, D\. Traum, and L\. Màrquez \(Eds\.\),Florence, Italy,pp\. 3428–3448\.External Links:[Link](https://aclanthology.org/P19-1334/),[Document](https://dx.doi.org/10.18653/v1/P19-1334)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Meta \(2024\)MetaLlama\-3\.1\-8b\.Note:[https://huggingface\.co/meta\-llama/Llama\-3\.1\-8B](https://huggingface.co/meta-llama/Llama-3.1-8B)Hugging Face model card, accessed 2026\-03\-16Cited by:[§2\.1](https://arxiv.org/html/2610.22618#S2.SS1.p1.1),[§4\.2](https://arxiv.org/html/2610.22618#S4.SS2.p1.1)\.
- nostalgebraist \(2020\)nostalgebraistInterpreting gpt: the logit lens\.Note:[https://www\.lesswrong\.com/posts/AcKRB8wDpdaN6v6ru/interpreting\-gpt\-the\-logit\-lens](https://www.lesswrong.com/posts/AcKRB8wDpdaN6v6ru/interpreting-gpt-the-logit-lens)LessWrong postCited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px2.p1.1),[§1](https://arxiv.org/html/2610.22618#S1.p4.1),[§2\.1](https://arxiv.org/html/2610.22618#S2.SS1.p1.1),[§3\.1](https://arxiv.org/html/2610.22618#S3.SS1.SSS0.Px1.p1.1),[§3\.1](https://arxiv.org/html/2610.22618#S3.SS1.p1.2),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px3.p1.1)\.
- Omiyeet al\.\(2023\)J\. A\. Omiye, J\. C\. Lester, S\. Spichak, V\. Rotemberg, and R\. DaneshjouLarge language models propagate race\-based medicine\.NPJ Digital Medicine6\(1\),pp\. 195\.Cited by:[§1](https://arxiv.org/html/2610.22618#S1.p1.1)\.
- Rimskyet al\.\(2024\)N\. Rimsky, N\. Gabrieli, J\. Schulz, M\. Tong, E\. Hubinger, and A\. TurnerSteering llama 2 via contrastive activation addition\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),L\. Ku, A\. Martins, and V\. Srikumar \(Eds\.\),Bangkok, Thailand,pp\. 15504–15522\.External Links:[Link](https://aclanthology.org/2024.acl-long.828/),[Document](https://dx.doi.org/10.18653/v1/2024.acl-long.828)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px1.p1.1),[§1](https://arxiv.org/html/2610.22618#S1.p2.1),[§4\.3](https://arxiv.org/html/2610.22618#S4.SS3.SSS0.Px2.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px2.p1.1)\.
- Sainiet al\.\(2026\)S\. Saini, A\. Saha, B\. Adsumilli, N\. Birkbeck, Y\. Wang, and A\. C\. BovikTABES: trajectory\-aware backward\-on\-entropy steering for masked diffusion models\.External Links:2602\.00250,[Link](https://arxiv.org/abs/2602.00250)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px3.p1.1)\.
- Sakibet al\.\(2025\)F\. A\. Sakib, Z\. Zhu, K\. T\. Grace, M\. Yetisgen, and O\. UzunerSpurious correlations and beyond: understanding and mitigating shortcut learning in SDOH extraction with large language models\.InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics \(Volume 2: Short Papers\),W\. Che, J\. Nabende, E\. Shutova, and M\. T\. Pilehvar \(Eds\.\),Vienna, Austria,pp\. 1097–1106\.External Links:[Link](https://aclanthology.org/2025.acl-short.86/),[Document](https://dx.doi.org/10.18653/v1/2025.acl-short.86),ISBN 979\-8\-89176\-252\-7Cited by:[§1](https://arxiv.org/html/2610.22618#S1.p1.1),[§5\.2](https://arxiv.org/html/2610.22618#S5.SS2.p3.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Stubbset al\.\(2019\)A\. Stubbs, M\. Filannino, E\. Soysal, S\. Henry, and Ö\. UzunerCohort selection for clinical trials: n2c2 2018 shared task track 1\.Journal of the American Medical Informatics Association26\(11\),pp\. 1163–1171\.Cited by:[§4\.1](https://arxiv.org/html/2610.22618#S4.SS1.SSS0.Px2.p1.1)\.
- Tanget al\.\(2023\)R\. Tang, D\. Kong, L\. Huang, and H\. XueLarge language models can be lazy learners: analyze shortcuts in in\-context learning\.InFindings of the Association for Computational Linguistics: ACL 2023,A\. Rogers, J\. Boyd\-Graber, and N\. Okazaki \(Eds\.\),Toronto, Canada,pp\. 4645–4657\.External Links:[Link](https://aclanthology.org/2023.findings-acl.284/),[Document](https://dx.doi.org/10.18653/v1/2023.findings-acl.284)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Tuet al\.\(2020\)L\. Tu, G\. Lalwani, S\. Gella, and H\. HeAn empirical study on robustness to spurious correlations using pre\-trained language models\.Transactions of the Association for Computational Linguistics8,pp\. 621–633\.External Links:[Link](https://aclanthology.org/2020.tacl-1.40/),[Document](https://dx.doi.org/10.1162/tacl%5Fa%5F00335)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Uzuner \(2009\)Ö\. UzunerRecognizing obesity and comorbidities in sparse data\.Journal of the American Medical Informatics Association16\(4\),pp\. 561–570\.External Links:ISSN 1067\-5027,[Document](https://dx.doi.org/10.1197/jamia.M3115),[Link](https://doi.org/10.1197/jamia.M3115),https://academic\.oup\.com/jamia/article\-pdf/16/4/561/2302602/16\-4\-561\.pdfCited by:[§1](https://arxiv.org/html/2610.22618#S1.p5.1),[§2\.1](https://arxiv.org/html/2610.22618#S2.SS1.p1.1),[§4\.1](https://arxiv.org/html/2610.22618#S4.SS1.SSS0.Px1.p1.1)\.
- Weiet al\.\(2023\)J\. Wei, X\. Wang, D\. Schuurmans, M\. Bosma, B\. Ichter, F\. Xia, E\. Chi, Q\. Le, and D\. ZhouChain\-of\-thought prompting elicits reasoning in large language models\.External Links:2201\.11903,[Link](https://arxiv.org/abs/2201.11903)Cited by:[§4\.3](https://arxiv.org/html/2610.22618#S4.SS3.SSS0.Px1.p1.1)\.
- Yanget al\.\(2025\)A\. Yang, A\. Li, B\. Yang, B\. Zhang, B\. Hui, B\. Zheng, B\. Yu, C\. Gao, C\. Huang, C\. Lv, C\. Zheng, D\. Liu, F\. Zhou, F\. Huang, F\. Hu, H\. Ge, H\. Wei, H\. Lin, J\. Tang, J\. Yang, J\. Tu, J\. Zhang, J\. Yang, J\. Yang, J\. Zhou, J\. Zhou, J\. Lin, K\. Dang, K\. Bao, K\. Yang, L\. Yu, L\. Deng, M\. Li, M\. Xue, M\. Li, P\. Zhang, P\. Wang, Q\. Zhu, R\. Men, R\. Gao, S\. Liu, S\. Luo, T\. Li, T\. Tang, W\. Yin, X\. Ren, X\. Wang, X\. Zhang, X\. Ren, Y\. Fan, Y\. Su, Y\. Zhang, Y\. Zhang, Y\. Wan, Y\. Liu, Z\. Wang, Z\. Cui, Z\. Zhang, Z\. Zhou, and Z\. QiuQwen3 technical report\.External Links:2505\.09388,[Link](https://arxiv.org/abs/2505.09388)Cited by:[§2\.2](https://arxiv.org/html/2610.22618#S2.SS2.p5.1),[§4\.2](https://arxiv.org/html/2610.22618#S4.SS2.p1.1)\.
- Zacket al\.\(2024\)T\. Zack, E\. Lehman, M\. Suzgun, J\. A\. Rodriguez, L\. A\. Celi, J\. Gichoya, D\. Jurafsky, P\. Szolovits, D\. W\. Bates, R\. E\. Abdulnour,et al\.Assessing the potential of gpt\-4 to perpetuate racial and gender biases in health care: a model evaluation study\.The Lancet Digital Health6\(1\),pp\. e12–e22\.Cited by:[§1](https://arxiv.org/html/2610.22618#S1.p1.1)\.
- Zhanget al\.\(2018\)B\. H\. Zhang, B\. Lemoine, and M\. MitchellMitigating unwanted biases with adversarial learning\.External Links:1801\.07593,[Link](https://arxiv.org/abs/1801.07593)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Zhanget al\.\(2021\)X\. Zhang, P\. Cui, R\. Xu, L\. Zhou, Y\. He, and Z\. ShenDeep stable learning for out\-of\-distribution generalization\.External Links:2104\.07876,[Link](https://arxiv.org/abs/2104.07876)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1)\.
- Zhaoet al\.\(2021\)T\. Z\. Zhao, E\. Wallace, S\. Feng, D\. Klein, and S\. SinghCalibrate before use: improving few\-shot performance of language models\.External Links:2102\.09690,[Link](https://arxiv.org/abs/2102.09690)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px3.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px4.p1.1)\.
- Zhouet al\.\(2020\)W\. Zhou, C\. Xu, T\. Ge, J\. McAuley, K\. Xu, and F\. WeiBERT loses patience: fast and robust inference with early exit\.External Links:2006\.04152,[Link](https://arxiv.org/abs/2006.04152)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px2.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px3.p1.1)\.
- Zhou and Zhu \(2025\)Y\. Zhou and Z\. ZhuFighting spurious correlations in text classification via a causal learning perspective\.External Links:2411\.01045,[Link](https://arxiv.org/abs/2411.01045)Cited by:[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px1.p1.1),[Limitations](https://arxiv.org/html/2610.22618#Sx1.p1.1)\.
- Zouet al\.\(2025\)A\. Zou, L\. Phan, S\. Chen, J\. Campbell, P\. Guo, R\. Ren, A\. Pan, X\. Yin, M\. Mazeika, A\. Dombrowski, S\. Goel, N\. Li, M\. J\. Byun, Z\. Wang, A\. Mallen, S\. Basart, S\. Koyejo, D\. Song, M\. Fredrikson, J\. Z\. Kolter, and D\. HendrycksRepresentation engineering: a top\-down approach to ai transparency\.External Links:2310\.01405,[Link](https://arxiv.org/abs/2310.01405)Cited by:[Appendix H](https://arxiv.org/html/2610.22618#A8.SS0.SSS0.Px1.p1.1),[§6](https://arxiv.org/html/2610.22618#S6.SS0.SSS0.Px2.p1.1)\.

## Appendix ASteering Layer Selection

The steering layerℓ∗\\ell^\{\*\}is selected per document by detecting where the model first commits to a decision\. We compute binary entropy at each layer from the logit lens projection\. Within the range\[10,L−4\]\[10,L\{\-\}4\], we find the first layerℓ′\\ell^\{\\prime\}where the entropy decrease exceeds 50% of the maximum observed drop, and setℓ∗=max⁡\(10,ℓ′−2\)\\ell^\{\*\}=\\max\(10,\\;\\ell^\{\\prime\}\-2\), slightly before the detected transition\. This adaptive selection enables the same procedure to work across model families without manual layer tuning\.

Across models on i2b2, the selectedℓ∗\\ell^\{\*\}values are: LLaMA 10–19 \(median 14\), Mistral 10–25 \(median 14\), Qwen3 10–29 \(median 10\)\. While these defaults were used for all experiments, varying the threshold from 30% to 70% and the offset from 1 to 3 produces only minor changes, so the method is robust to these choices\.

## Appendix BPrediction Inconsistency

Table[3](https://arxiv.org/html/2610.22618#A2.T3)reports the prediction inconsistency rate for LLaMA 3\.1 8B Instruct on each i2b2 disease\. Inconsistency is measured as the fraction of documents where the model’s prediction changes when the gender token is swapped, with all other clinical content held constant\.

Table 3:Prediction inconsistency rates across 16 i2b2 diseases\. Each document is prompted under both male and female gender conditions;Differcounts cases where the prediction changes\. Sorted by inconsistency rate\.Table[4](https://arxiv.org/html/2610.22618#A2.T4)reports the change in inconsistency after applying TGS \(α=0\.5\\alpha\{=\}0\.5,τ=0\.5\\tau\{=\}0\.5\)\. TGS reduces inconsistency in 14 of 16 diseases, with the largest reductions on the most affected diseases\. The two diseases where inconsistency increases \(Hypertriglyceridemia, Venous Insufficiency\) are also the two most net\-negative in the fix/break evaluation\.

Table 4:Prediction inconsistency before and after TGS\. Sorted by improvement \(Δ\\Deltapp\)\. TGS reduces inconsistency in 14/16 diseases, with an overall reduction from 25\.1% to 21\.5%\.#### Which errors TGS corrects\.

An error of the original prediction is gender\-dependent if the other gender version of the same document is predicted correctly\. TGS fixes 19\.8% of gender\-dependent errors but only 4\.9% of errors that persist under both genders\. Gender\-dependent errors might simply be easier to flip, since the model already answers correctly for the other gender\. To test this, we add a uniform logit bias toward the correct answer for every error, applied in the same way as the TGS correction \(Section[3\.3](https://arxiv.org/html/2610.22618#S3.SS3)\)\. This uniform push corrects both kinds of error at nearly the same rate \(13\.7% vs\. 14\.8%\)\.

On SHAC, inconsistency with respect to alcohol and smoking mentions \(how often removing them from a note changes the prediction\) falls from 31\.7% to 16\.8% after TGS\.

## Appendix CPer\-Disease Results

Table[5](https://arxiv.org/html/2610.22618#A3.T5)reports the full per\-disease breakdown for LLaMA on i2b2 \(α=0\.5\\alpha\{=\}0\.5,τ=0\.5\\tau\{=\}0\.5\)\. Performance scales with disease error prevalence: diseases with many errors in the original predictions \(e\.g\., Diabetes, Hypertension\) show the largest net gains, while diseases with few errors yield smaller or negative net outcomes\. Across all three models, TGS is net\-positive on 41 of 48 model\-disease combinations\.

Table 5:Per\-disease results for TGS on i2b2 \(LLaMA,α=0\.5\\alpha\{=\}0\.5,τ=0\.5\\tau\{=\}0\.5\)\. Fix% and Break% are computed over all error types and all correct predictions, respectively\.
## Appendix DHyperparameter Grids

Table[6](https://arxiv.org/html/2610.22618#A4.T6)reports the i2b2 sensitivity analysis, and Tables[7](https://arxiv.org/html/2610.22618#A4.T7)and[8](https://arxiv.org/html/2610.22618#A4.T8)report the full hyperparameter sweep for SHAC and PubMedQA\. On PubMedQA, all 16 configurations are net\-positive\. On SHAC, every configuration withα≥0\.75\\alpha\\geq 0\.75is net\-positive \(\+21 to \+42\), whileα≤0\.50\\alpha\\leq 0\.50is net\-negative at everyτ\\tau\.

Table 6:Sensitivity analysis \(LLaMA, i2b2, 16 diseases\)\.α\\alphacontrols the fix–break tradeoff; performance is robust toτ\\tauwithin its tested range\.Table 7:Net gain acrossα×τ\\alpha\\times\\tauconfigurations on SHAC \(LLaMA\)\. Bold: reported configuration \(α=1\.0\\alpha\{=\}1\.0,τ=0\.75\\tau\{=\}0\.75\)\.Table 8:Net gain acrossα×τ\\alpha\\times\\tauconfigurations on PubMedQA \(LLaMA, 890 documents\)\. All configurations are net\-positive\. Bold: reported configuration \(α=1\.0\\alpha\{=\}1\.0,τ=0\.75\\tau\{=\}0\.75\)\.#### Routing distribution\.

For analysis, we group documents by which branch of Eq\.[5](https://arxiv.org/html/2610.22618#S3.E5)they take:Reinforce\(ed=\+mee\_\{d\}=\+m\_\{\\mathrm\{e\}\}\),Oppose\(ed=−max⁡\(me,0\)e\_\{d\}=\-\\max\(m\_\{\\mathrm\{e\}\},0\)\), andLeave unchanged\(ed=0e\_\{d\}=0\)\. On i2b2, 47% of documents are routed toReinforce, 13% toOppose, and 40% toLeave unchanged\. On PubMedQA, the distribution is 67%/12%/21%\. Per\-action break rates confirm the routing’s safety ordering:Reinforce, the most aggressive action, has a 2\.4% break rate on i2b2;Oppose, designed as a conservative correction, has 0\.3%;Leave unchangedchanges no predictions by design\.

## Appendix En2c2 2018 Cohort Selection

The corpus contains 288 patients annotated for 13 trial\-eligibility criteria\. We ask one Yes/No question per patient and criterion, using the i2b2 prompt with the criterion definition in place of the disease, and apply TGS with the i2b2 configuration \(α=0\.5\\alpha\{=\}0\.5,τ=0\.5\\tau\{=\}0\.5\)\. TGS is net\-positive \(\+51; 6\.6% fix, 1\.2% break\) and reduces gender\-swap inconsistency on 10 of 13 criteria \(37\.2%→\\rightarrow33\.9%\)\.

## Appendix FOutput\-Level Controls

We test two corrections that act on the answer tokens of every document in the same way, without trajectory information\. Both use the same i2b2 documents and scoring rule as TGS \(Section[4\.4](https://arxiv.org/html/2610.22618#S4.SS4)\)\.

#### Constrained decoding\.

We also run constrained decoding, which forces the model to answerYesorNo\. It leaves all existing Yes/No predictions unchanged and changes only outputs that were neither Yes nor No\.

#### Constant logit bias\.

We add the same bias to the answer\-token logits of every document, applied in the same way as the TGS correction \(Section[3\.3](https://arxiv.org/html/2610.22618#S3.SS3)\), towardYes\(\+\+\) orNo\(−\-\)\. Table[9](https://arxiv.org/html/2610.22618#A6.T9)shows that every nonzero strength is net\-negative\. Selecting the strength on the full test set or on the 30% split chooses no bias\.

Table 9:Constant logit bias on i2b2 \(LLaMA\)\. TGS: net \+201\.

## Appendix GMulti\-Class Extension

The core TGS quantities generalize toK\>2K\>2: the margin becomes the gap between the top and runner\-up tokens, agreement becomes whether the same token leads at both early and late layers, and conviction growth becomes the widening of this gap\. The logit bias \(Eq\.[6](https://arxiv.org/html/2610.22618#S3.E6)\) adjusts the top two competing tokens accordingly\.

As initial evidence that TGS extends past binary decisions, we evaluate this formulation on a 3\-class version of SHAC \(negative / current / past\), obtained by splitting the positive class into*current*and*past*\(α=1\.5\\alpha\{=\}1\.5,τ=0\.5\\tau\{=\}0\.5\)\. TGS remains net\-positive \(net \+29; 27\.8% fix, 5\.8% break\)\. A broader multi\-class study remains future work\.

## Appendix HExtended Related Work

This section gives more detail on the methods discussed in Section[6](https://arxiv.org/html/2610.22618#S6)\.

#### Activation steering\.

Representation engineering\([Zou et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib19)\)studies how high\-level concepts can be identified and manipulated in a model’s activation space, enabling targeted behavioral control\. Contrastive Activation Addition\([Rimsky et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib1)\)operationalizes this by computing steering vectors from paired prompts that differ in the target behavior, then adding these vectors uniformly during generation\. Inference\-Time Intervention\([Li et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib20)\)takes a similar approach for truthfulness, identifying intervention directions across attention heads whose activations are predictive of truthful responses\. FairSteer\([Li et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib2)\)adds selectivity via a trained classifier that detects bias signatures and applies correction only when triggered\. In healthcare,[Ahsan et al\. \(2025\)](https://arxiv.org/html/2610.22618#bib.bib34)show that gender information is localized in specific MLP layers of open LLMs and can be manipulated at inference time via patching\.

#### Logit lens and prediction trajectories\.

The logit lens\([nostalgebraist, 2020](https://arxiv.org/html/2610.22618#bib.bib3)\)projects intermediate hidden states through the unembedding matrix to reveal a model’s evolving token preferences across layers; the tuned lens\([Belrose et al\., 2025](https://arxiv.org/html/2610.22618#bib.bib4)\)learns a per\-layer affine probe for the same readout\. DoLa\([Chuang et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib23)\)contrasts final\- and early\-layer distributions at each decoding step to improve factuality, early\-exit methods stop computation once intermediate predictions agree\([Zhou et al\., 2020](https://arxiv.org/html/2610.22618#bib.bib24)\), decoding from an intermediate layer can recover accuracy lost in later layers under misleading prompts\([Halawi et al\., 2024](https://arxiv.org/html/2610.22618#bib.bib25)\), and[Fazli et al\. \(2026\)](https://arxiv.org/html/2610.22618#bib.bib21)use layer\-wise commitment to modulate context injection during decoding\.

#### Logit\-level correction\.

Contextual calibration\([Zhao et al\., 2021](https://arxiv.org/html/2610.22618#bib.bib26)\)reduces a model’s preference for particular labels by rescaling answer\-token probabilities with a correction estimated from a content\-free input, applied identically to every input and requiring no counterfactual data\. Our constant\-bias control \(Appendix[F](https://arxiv.org/html/2610.22618#A6)\) applies one such fixed shift to every document and is net\-negative at every tested strength \(Table[9](https://arxiv.org/html/2610.22618#A6.T9)\)\.

## Appendix IPrompt Templates

All experiments use the LLaMA 3\.1 chat template with a system message and user message\. Below are the templates for each dataset\.

#### i2b2\.

> System:You are a medical expert analyzing patient records\. User:Review this patient record: \[patient text\] The patient is a\[gender\]\. Based on both explicit mentions AND implicit clinical indicators, determine if the patient has\[disease\]\. Your task is to determine one of these judgments: – Yes: if there is clear evidence the patient has\[disease\] – No: if there is no evidence or evidence against\[disease\] – Questionable: if there are some indicators but insufficient evidence Respond with EXACTLY one of these words: Yes, No, or Questionable\.

#### Paraphrased i2b2 prompt \(Section[5\.3](https://arxiv.org/html/2610.22618#S5.SS3)\)\.

> System:You are a physician reviewing patient charts\. User:Examine this patient record: \[patient text\] The patient is a\[gender\]\. Considering both explicit documentation and implicit clinical evidence, determine whether the patient has\[disease\]\. Select one of these judgments: – Yes: there is clear evidence that the patient has\[disease\] – No: there is no evidence of\[disease\], or there is evidence against it – Questionable: there are some indicators, but not enough evidence Respond with EXACTLY one of these words: Yes, No, or Questionable\.

With this prompt, TGS fixes 35\.0% of errors and breaks 3\.2% of correct predictions\.

#### SHAC\.

> System:You are an AI assistant specialized in extracting and analyzing social history information from medical notes\. User:Choose the best StatusTime value for the⟨\\langleDrug Use⟩\\rangle\(Drug\) from the note by selecting one of the options below: \(a\) none\. \(b\) current\. \(c\) past\. \(d\) not applicable\. IMPORTANT: Respond with ONLY the letter and label of your choice, e\.g\., ‘\(a\) none\.’ Do not include any other text\. Note:\[clinical note\]

#### PubMedQA\.

> System:You are a biomedical research expert\. Your task is to answer research questions based on evidence from scientific abstracts\. User:Research Question:\[question\] Abstract:\[abstract text\] Based on the abstract, does the evidence support the research question? Respond with EXACTLY one word: Yes or No\.

### I\.1Prompt\-Based Baselines

The three prompt baselines modify the i2b2 prompt as follows\. The user message remains unchanged unless noted\.

#### System\-clinical\.

Replaces the system message:

> You are a medical expert analyzing patient records\. Base your assessment strictly on documented clinical findings, diagnoses, medications, laboratory results, and procedures\.

#### System\-objective\.

Replaces the system message:

> You are a medical expert analyzing patient records\. Be objective and evidence\-based\. Your assessment should rely solely on the clinical information documented in the record\.

#### Chain\-of\-thought\.

Replaces the final response instruction with:

> Before giving your final answer, reason step by step about the clinical evidence for and against this diagnosis\. After your reasoning, provide your final answer on a new line in the format: Final Answer: Yes, No, or Questionable

## Appendix JComputational Resources

No base\-LLM parameters are updated in any experiment\. TGS and the prompt baselines are inference\-only; CAA estimates steering vectors from its training subset, and FairSteer additionally trains per\-layer linear probes\. We evaluate three instruction\-tuned models \(LLaMA 3\.1 8B Instruct, Mistral 7B Instruct v0\.3, and Qwen3 8B\), loaded in bfloat16 on two NVIDIA A100 80GB GPUs\. TGS adds one forward pass per document to extract the logit\-lens trajectory; documents receiving a nonzero correction additionally undergo a modified generation pass\. The full set of experiments reported in this paper, including the baseline sweeps and the hyperparameter grids in Appendix[D](https://arxiv.org/html/2610.22618#A4), required approximately 100 GPU hours\.

相似文章

Genesis 引导:通过训练数据实现更好的激活引导

arXiv cs.LG

该论文提出了“创世引导”(genesis steering),一种从模型自身微调数据中的对比样本(或在无法获取此类数据时,使用基于成员推断的替代数据)中提取激活引导向量的方法。在 Tülu-3-8B 和 Llama-3.1-8B-Instruct 上,该方法展现出比使用外部数据集更强的安全引导效果。

流形引导注意力转向

arXiv cs.LG

提出了流形引导的注意力转向(MAGS),这是一种轨迹感知的推理时干预方法,通过将注意力输出投影回学习的正确性流形(当偏差超过阈值时)来纠正LLM中的推理错误,在数学、代码和分子基准测试中优于静态转向方法。

通过定向干预实现语言模型的多属性引导

arXiv cs.CL

MAT-Steer 提出了一种新颖的推理时干预框架,通过学习稀疏且正交的引导向量,选择性干预与每个属性相关的标记,从而在多属性冲突场景下引导大型语言模型,在问答任务和生成任务上的表现均优于现有方法。