Researchers propose a reference-based relative representation bias detection method for hidden statesReference-Based Bias Detection in LLMs via Relative Representations of Hidden States
The authors compare hidden states before and after fine-tuning using relative representations, define a representation bias shift ∆B, and test its correlation with output-layer bias changes across three model families.
- Output-layer bias audits rely on expensive benchmarks or review models and may miss internal shifts that have not yet appeared in generated text. Fine-tuning changes representation geometry, making absolute hidden states difficult to compare directly.
- Using fixed anchor sentences, project the audited model's and reference model's sentence vectors into a shared relative representation space, then compare the Euclidean distance differences between target groups and positive/negative attributes to obtain the representational bias shift ΔB.
- Across three model families and WildGuardMix, DecodingTrust, ToxiGen, ∆B correlates with output-layer bias changes in 15 of 18 settings, with |r| up to 0.84 under full fine-tuning. ROC AUC for threshold detection ranges from 0.65 to 0.99.
- ΔB is relative to a reference model; it cannot audit a single checkpoint alone, nor does it prove outputs are more unbiased. Sentence sets are English coarse-grained groups; the signal weakens under LoRA, especially for Gemma. Whether it is causal, larger scale, and natural fine-tuning remain open.
- Evaluated models
- Llama 3.1-8B-InstructMistral-7B-Instruct-v0.3Gemma 3-4B-IT
- Benchmarks
- WildGuardMixDecodingTrustToxiGen
- Metrics
- Pearson rROC AUCMAE∆B∆Bias Score∆Toxicity
The researchers propose a reference-based bias audit method that detects bias changes in model variants (e.g., before and after fine-tuning) through relative representations of hidden states. Because fine-tuning reshapes representation geometry, absolute hidden states are not directly comparable; the method encodes each sentence by its similarity to fixed anchor sentences, and in a shared comparison space measures the shift in association between target groups and positive/negative attributes, called representational bias shift ΔB. Across three model families and WildGuardMix, DecodingTrust, and ToxiGen benchmarks, ΔB correlates with output-level bias changes in 15 of 18 test settings, reaching |r| = 0.84 (p < 0.001) under full fine-tuning, and is more model-specific under parameter-efficient adaptation. Thresholding ΔB can identify bias-increasing checkpoints, with ROC AUC between 0.65 and 0.99, and on WildGuardMix and DecodingTrust it outperforms SEAT-based baselines in distinguishing across all three model families. The authors consider this method complementary to, not a replacement for, output-based audits.
Paper analysis
What problem does this paper attempt to solve?
Can hidden state bias shifts after fine-tuning be audited in a shared relative space and correspond to output-layer changes.
After fine-tuning changes hidden state geometry, how can representational bias shifts be compared between related model variants without relying on task evaluation data.
- Scenario and importance: The authors argue that instruction fine-tuning, safety fine-tuning, domain fine-tuning, and system prompts cause behavior to change in unpredictable ways; bias can come from pretraining, fine-tuning, or targeted manipulation. Most audits only look at outputs, building benchmarks is costly and hard to cover new harms, and LLM reviewers may introduce their own biases and miss internal changes not yet reflected in generations. The authors also cite existing findings that "benign fine-tuning can also harm safety" as motivation for focusing on fine-tuning side effects.
- Shortcomings of existing methods: According to the authors, methods like SEAT measure the association between targets and positive/negative attributes in each model's own absolute embeddings, but fine-tuning reshapes the latent space, making absolute hidden states not directly comparable, and scores may reflect geometric artifacts. Representational metrics also do not guarantee prediction of downstream behavior, so the authors do not claim that geometry itself is discriminatory behavior.
- Core hypothesis: The authors hypothesize that the hidden states actually computed by the audited model contain signals of these unintended shifts, and ask: when fine-tuning changes the hidden state association between target groups and positive/negative attributes, does this shift covary with output-layer bias changes on external benchmarks.
- Proposed method: The authors propose a reference-model-based audit framework. Using a fixed set of anchor sentences, they encode sentences from the audited model Maud and the reference model Mref into relative representations, and in a shared space compute the change in association between target groups and positive/relative negative attributes, called representational bias shift ΔB. The method only needs anchor sentences, positive attribute sentences, and negative attribute sentences; the authors claim auditing a model takes about three minutes, with computational cost about 1/3 to 1/50 of the output-layer benchmarks in the paper, and view it as complementary to output-layer audits.
What related research exists?
The work lies at the intersection of three lines: representation bias measurement, fine-tuning misalignment, and cross-model representation comparison, and aligns SEAT with relative representations.
Bias in LLMs.
- Ferrara (2023), Blodgett et al. (2020) define bias as systematic distortion favoring particular groups or viewpoints, reproducing stereotypes, or relying on unfounded assumptions; Beukeboom and Burgers (2019) discuss how stereotypes are shared through language.
- The authors also mention political bias (Rettenberger et al., 2025) and geographic and cultural bias (Tao et al., 2024).
- Direct measurement in representation spaces began with WEAT (Caliskan et al., 2017) and gender directions in word embeddings (Bolukbasi et al., 2016); May et al. (2019) extended it from words to sentence encoders, i.e., SEAT.
LLM manipulation and unintended misalignment.
- Lin et al. (2024, 2025), Lu et al. (2025), and Guo et al. (2025) address adversarial misuse such as media manipulation, propaganda, and covert brand promotion.
- Betley et al. (2025), Wang et al. (2025), and Qi et al. (2024) discuss that narrow-data fine-tuning or unintentional user fine-tuning can also harm alignment. The authors state this motivates detection methods that do not require curated datasets for each new harm.
- The authors explicitly do not study adversarial attacks directly, but instead interpolate between models fine-tuned on harmful and harmless data to create graded shifts.
Cross-model comparison and intrinsic/extrinsic bias.
- ModelDiff by Shah et al. (2023) and the survey by Klabunde et al. (2025) distinguish representation (intermediate activations) from functional (output) comparisons; because functional comparisons require curated evaluation sets, the authors use sentence embeddings to look at representation changes.
- Approaches to make spaces comparable include orthogonal Procrustes transformations (Schönemann, 1966) and CKA (Kornblith et al., 2019). The authors adopt relative representations from Moschella et al. (2023), encoding sentences by similarity to shared anchor sentences without fitting a cross-model mapping.
- Goldfarb-Tarrant et al. (2021) compare embedding-space metrics with downstream task metrics and find no correlation that holds stably across tasks and languages; Gonen and Goldberg (2019) point out that debiasing may only hide bias as defined by the metric. Cao et al. (2022) and Delobelle et al. (2022) report similar tensions in contextual representations. In the other direction, Jin et al. (2021) report that upstream debiasing transfers to downstream fine-tuned models, and Orgad et al. (2022) state that intrinsic metrics on internal representations are more faithful to debiasing effects than embedding-space WEAT. The authors consider the evidence inconclusive and note that the strongest negative results come from static word vectors detached from specific models, whereas this paper measures hidden states actually computed when the model processes text, and measures fine-tuning-induced shifts.
Baseline methods and benchmarks. Comparison baselines are SEAT, Procrustes-SEAT, and CKA drift. Output-layer benchmarks are WildGuardMix (Han et al., 2024) social stereotypes and unfair discrimination subclass, DecodingTrust (Wang et al., 2023) stereotype evaluation, and ToxiGen (Hartvigsen et al., 2022).
The authors position this paper as: extending SEAT to compare internal states between an audited model and a reference model, using relative representations to address the incomparability of absolute hidden states after fine-tuning; and renaming the intrinsic/extrinsic distinction as representation/functional because the framework is comparative model auditing.
How does the paper address this problem?
Align the two models' hidden spaces using anchor sentence relative representations, and define ΔB relative to the reference using Euclidean distance.
Reference-Based Bias Detection projects the audited model and a reference model into a shared relative space via the same set of anchor sentences, then defines ∆B using the difference in distances of target sentences to positive and negative attribute sentences.
Problem Setup and Formalization
- Three sentence sets: T is the target sentences (e.g., neutral sentences related to social groups), P and N are positive and negative attribute sentences. By default, sentences in T are averaged for aggregation.
- Sentence embeddings: For any sentence x, e(x) is the average of the model's final hidden states over all tokens. The authors discuss this choice and alternatives in the Limitations. Similarity uses cosine, distance uses Euclidean distance dE.
- SEAT on absolute embeddings: For each s, S+(s) and S−(s) are its average cosine similarity to P and N, respectively; B is the mean of their difference over T. The sign of B indicates whether the target set is closer to positive or negative attributes. The authors argue that fine-tuning reshapes the latent space, and SEAT scores may be geometric artifacts, so SEAT is used only as a baseline; the main metric is the relative version below.
Bias in Relative Representations
- Relative representations: Given an anchor sentence set A, the i-th dimension of r(x) is cos(e(x), e(ai)). Anchor sentences are shared in sentence form, and each model encodes them with its own parameters, so coordinate meanings are consistent without fitting a cross-model mapping. The authors cite Moschella et al. (2023): fine-tuning preserves relative geometry more than absolute positions.
- Why switch to Euclidean distance: The components of r(x) are already cosine similarities; applying cosine again would compare similarity profiles, losing direct geometric interpretation. Association in the relative space is instead defined as the negative of Euclidean distance, to maintain the sign convention that larger means closer; Brel is the mean over T of the difference between Srel+ and Srel−. Positive values indicate stronger association with positive attributes, negative values with negative attributes.
∆B with a Relative Reference Model
- Definition: Compute mean bias Bref and Baud on the reference model (unmodified) and the audited model (fine-tuned), respectively; ∆B = Baud − Bref. Either B or Brel can be used; the main method uses the relative representation version.
- Granularity and interpretation: T is instantiated per target group; each model has one ∆B per group; a pair of one checkpoint and one target group is one observation in the correlation analysis. A negative ∆B indicates the group is closer to negative attributes, which the authors read as increased bias. The authors emphasize that ∆B is a proxy: encoding differences are not evidence of discriminatory behavior; validity depends on its empirical relationship with output-layer bias.
Audit Procedure and Implementation Choices
- Default anchor sentences: Unless otherwise stated, both models are projected onto 1,000 neutral anchor sentences from the same social group domain as the target sentences (Appendix F). Embeddings are taken from the final Transformer layer: layer 32 for Llama and Mistral, layer 34 for Gemma.
- Graded fine-tuning spectrum: Each model is fully fine-tuned and LoRA-tuned on the harmless split and the synthetic harmful split of WildGuardMix, then the two checkpoints are linearly merged at five interpolation ratios (Wortsman et al., 2022), plus the two endpoints for a total of seven checkpoints, so bias is introduced incrementally rather than in one jump.
- How output-layer baselines are constructed: WildGuardMix uses ALLENAI/WILDGUARD to score generated responses; prompts do not contain group labels, so harmfulness is aggregated over 9 topics mapped from the 24 groups in DecodingTrust. DecodingTrust runs its stereotype evaluation, measuring stereotype agreement rather than response harmfulness. ToxiGen is the only benchmark with a one-to-one correspondence to demographic groups, requiring no aggregation; it uses its nine groups that map to the paper's target sets, and scores continuations with the authors' TOXIGEN_ROBERTA classifier. Relative changes from the base are denoted ∆Bias Score and ∆Toxicity (ToxiGen), respectively.
- Detection rule: Models with external scores above a fixed operating point are counted as more biased: 0.1 for WildGuardMix and DecodingTrust, 0.03 for ToxiGen. Threshold classification is performed on ∆B, with ∆B below a cutoff judged as a harmful checkpoint. Correlation uses Pearson with two-tailed significance, and MAE of the linear fit is reported, estimated by the mean over 1,000 bootstrap resamples.
What experiments did the paper conduct?
Across three model families, two fine-tuning methods, and three output benchmarks, ∆B correlates with behavioral change in 15/18 settings.
Experimental Setup
- Models tested: Llama 3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, Gemma 3-4B-IT. The reference condition is each base model; the audited objects are checkpoints obtained by full fine-tuning or LoRA followed by linear merging.
- Fine-tuning data and spectrum: Two 8k-sample splits derived from WildGuardMix: wildguard_unharmful, and wildguard_synth_even_8k with half harmful and half synthetic samples. Merge ratios are harmless/synthetic 10/90, 30/70, 50/50, 70/30, 90/10, plus the two endpoints for seven checkpoints total. Shared hyperparameters are 3 epochs, effective batch size 32, AdamW, bfloat16, max length 1024; LoRA learning rate 1×10−4, r=16, α=32; full fine-tuning learning rate 2×10−5.
- Output benchmarks and scoring: WildGuardMix's SOCIAL STEREOTYPES AND UNFAIR DISCRIMINATION subclass, scored by ALLENAI/WILDGUARD, then aggregated into 9 topics; 5 responses generated per prompt (temperature 0.7, top-p 1.0, max 256 new tokens). DecodingTrust uses its stereotype pipeline from the repository. ToxiGen samples 5 continuations per group from few-shot hate prompts, scored by TOXIGEN_ROBERTA on the first generated statement, taking the proportion of toxic continuations per group.
- Internal metrics: Default 1,000 same-domain neutral anchor sentences, final-layer mean pooling. Main metrics are Pearson r (two-tailed) of ∆B with external ∆Bias Score or ∆Toxicity, ROC AUC for threshold classification, and MAE of the linear fit.
- Baselines: SEAT (unaligned embedding spaces per model), Procrustes-SEAT (optimal orthogonal mapping then comparison with reference attribute sets), CKA drift (1−CKA, no direction). The paper does not report the number of observations in each correlation.
- Hardware: All experiments were run on a single NVIDIA A100 (40 GB).
Main Results
Table 1 gives the correlation, ROC AUC, and MAE of the RR version of ∆B with external changes on three benchmarks. In terms of arrow direction, more negative Pearson indicates more consistency, because ∆B decreases as bias increases.
Swipe horizontally to read the table
Benchmark Model Full r Full AUC LoRA r LoRA AUC WildGuardMix Mistral −0.67*** 0.93 −0.61*** 0.78 WildGuardMix Llama −0.68*** 0.89 −0.65*** 0.92 WildGuardMix Gemma −0.37** 0.78 −0.04 0.77 DecodingTrust Mistral −0.82*** 0.75 −0.77*** 0.99 DecodingTrust Llama −0.84*** 0.91 −0.75*** 0.92 DecodingTrust Gemma −0.34*** 0.76 −0.14 0.65 ToxiGen Mistral −0.19 0.78 −0.43*** 0.86 ToxiGen Llama −0.62*** 0.91 −0.50*** 0.74 Per Table 1. Gemma on ToxiGen has full r=−0.31*, AUC 0.69, LoRA r=−0.25*, AUC 0.69. Significance markers are * p<0.05, ** p<0.01, *** p<0.001. MAE is comparable within a benchmark but not across benchmarks: for example, under full fine-tuning on WildGuardMix, Mistral and Llama both have 0.12, Gemma 0.17; under full fine-tuning on ToxiGen, Mistral has 0.058, Llama 0.013, Gemma 0.023.
- Authors' interpretation: Under full fine-tuning, all three families show negative and statistically significant correlations on WildGuardMix; in Figure 2(a), Llama's points align with the external benchmark in the same direction by merge ratio. Negative ∆Bias Score occurs where the base is already biased toward a group and harmless-data fine-tuning lowers it.
- LoRA: Mistral and Llama keep the same direction, but the relationship is noisier; Gemma has r=−0.04 on WildGuardMix and r=−0.14 on DecodingTrust, neither marked significant. The authors state that low-rank updates limit how much the latent geometry can move, so measurable ∆B is smaller; but Gemma is weakest across all three benchmarks and both regimes, so the low-rank explanation alone is insufficient. The authors believe the most likely cause is scale: Gemma-3-4B is about half the size of the audited Mistral and Llama; the correlation sign matches the other two families, with weak rather than reversed signal. Tokenization and final-layer geometry may also matter, but the authors state neither was controlled.
- Exceptions: On ToxiGen under full fine-tuning, Mistral's r=−0.19 (p=0.14) is not significant. The authors state its generation toxicity saturates at more harmful merged checkpoints, compressing the upper half of the spectrum into a narrow band. When all three families are pooled, r=−0.49 (p<0.001). Under LoRA, all three families are significant on ToxiGen, with detection AUC between 0.69 and 0.86. The authors describe the comparison of RR with SEAT on ToxiGen as a replication rather than further evidence supporting RR over SEAT, because the ranking of the two methods varies across families.
Relative Representations vs. Three Other Approaches
- What was measured: On Llama, RR is compared with SEAT, Procrustes-SEAT, and CKA drift, scanning bias score thresholds (Figure 3). Point estimates given in the text are SEAT ROC AUC 0.778 on WildGuardMix, RR 0.964; CKA drift 0.864 and 0.753 (two benchmarks), still below RR.
- Results: The authors state RR is above all baselines across the entire threshold scan on both benchmarks; Procrustes-SEAT is at chance level on both. In Appendix H, RR-based classifiers are above SEAT on all three families and both benchmarks.
- Authors' interpretation: The gain comes from relative representations rather than alignment itself. Orthogonal mapping preserves all angles within the audited space and cannot relate two spaces beyond rigid transformations. CKA drift has no direction; it measures how far rather than which way, so ∆B cannot be reduced to representation displacement.
Robustness, Anchor Sentences, and Computational Cost
- Anchor sentence sources (Figure 4, Llama): Compare original word anchors, Alpaca samples, Tulu mixture, and same-domain neutral sentences. Neutral sentences are best, with ROC AUC 0.892 at 1k anchors; word anchors are a stable baseline, and the two SFT mixtures are slightly lower. The authors state that out-of-domain sets still have discriminative power; anchor sentences only define the projection frame and are never scored as targets or attributes.
- Wording and pooling: Average ROC AUC across six attribute constructions is 0.863±0.030, and across six target templates is 0.902±0.008 (Tables 5a, 5b), with binary labels from thresholding Bias Score at 0.1. Rankings are unchanged under mean, max, and last pooling; RR is always better than SEAT, and the default mean is strongest (Appendix E.4). Repeated training with different random seeds yields nearly identical ∆B (Appendix E.5).
- Time (Table 3, Appendix D): The method takes about 3 minutes per model, nearly equal across the three families, split into embedding generation and bias shift computation. WildGuardMix Harmfulness takes 9–14 minutes, ToxiGen 33–76 minutes, DecodingTrust 44–156 minutes. The authors state this is roughly a 3- to 50-fold difference in computation, because output benchmarks require generating and scoring thousands of continuations; new target groups require no annotation. Embedding generation time: Llama 2 min 16 s, Mistral 2 min 37 s, Gemma 2 min 22 s; computing ∆B takes 35 s, 35 s, and 50 s, respectively.
Other Ablations and Analyses
- Operating points: 0.1 for WildGuardMix and DecodingTrust, 0.03 for ToxiGen, because its ∆Toxicity scale is smaller.
- The authors state that on WildGuardMix and DecodingTrust, the method is more discriminative than SEAT-based baselines for all three families; on ToxiGen, they do not treat RR's advantage over SEAT as additional evidence.
- Negative ∆B is read as leaning toward negative attributes, i.e., increased bias; the authors also emphasize this is only a proxy.
- Gemma has the lowest absolute correlations across all Table 1 settings; under LoRA, correlations on WildGuardMix and DecodingTrust are not significant, but ROC AUC is still 0.77 and 0.65.
- Detailed per-group scatter plots are in Appendix H; main-text Figure 2 only shows Llama full fine-tuning on the three benchmarks.
- The paper does not give full Pearson r for each method in Appendix G in the main text, only the above AUC point estimates and a pointer to Table 7.
What are some points that can be further explored?
ΔB depends on a reference model; English coarse-grained templates and 4B–8B synthetic harmful fine-tuning are the current boundaries.
Limitations and future directions noted by the authors
- Context embeddings and prompts: The method inherits SEAT's sensitivity to unstable context embeddings and may be less reliable for models that strongly depend on prompt design and token position (Limitations).
- Requires a reference model: ΔB is a relative quantity, reporting movement relative to a reference; it cannot prove that any model is unbiased, nor can it audit a single checkpoint alone (Limitations).
- Pooling and layers: By default, mean pooling is applied to the final layer hidden states; the RR advantage persists under max and last pooling (Table 6), but pooling and layer choices warrant systematic study (Limitations).
- Sentence set coverage: Target, attribute, and anchor sentences are English templates on coarse-grained single-axis groups from DecodingTrust; other languages, intersectional groups, and harms not named in these sets fall outside the metric (Limitations).
- Models and induction method: The audited models are three decoder-only instruction models from 4B to 8B, with bias induced by fine-tuning on synthetic harmful splits; Gemma's weak results under LoRA show that the signal can degrade. Larger-scale, naturally occurring fine-tuning, and whether the correlation with output-layer bias is causal remain open (Limitations).
- Not a training objective or safety proof: The Discussion states that using ΔB as a monitoring signal in fine-tuning (e.g., early stopping) is a natural extension, but turning it into a training objective is not straightforward because a model optimized to have smaller ΔB need not be less biased in outputs. Ethical Considerations state that a small ΔB should be read as undetected representational shift, not evidence of safety; the method could be used to optimize adversarially, and the authors do not release these harmful checkpoints.
Experimental coverage
- The tested models are Llama 3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, and Gemma 3-4B-IT, each with full fine-tuning and LoRA spectra, with seven merged checkpoints per spectrum (Section 4.1, Appendix C).
- Output comparisons are WildGuardMix (aggregated to 9 topics), the DecodingTrust stereotype pipeline, and nine corresponding groups from ToxiGen; internal comparisons are SEAT, Procrustes-SEAT, and CKA drift (Section 4, Figure 3).
- Robustness analyses on Llama vary anchor sentence source and count, six attribute constructions, six target templates, mean/max/last pooling, and repeat with different random seeds (Section 4.5).
- Detection uses fixed operating points of 0.1 or 0.03; correlations are two-tailed Pearson, and MAE comes from 1,000 bootstrap resamples (Section 4.1, Table 1).
- The paper does not report the number of observations for each correlation, nor agreement with human judgments; the Discussion states that the audited model need not come from the reference model, allowing audit of independently trained checkpoints, but in experiments the references are always the corresponding base models.
Summarize the main content of the paper
ΔB on relative representations covaries with output-layer bias changes across three benchmarks in most fine-tuning settings.
Reference-Based Bias Detection compares hidden states before and after fine-tuning using anchor-sentence relative representations, defining a representation bias shift ∆B to audit related model variants without building a new output benchmark for each harm.
- Problem: Absolute hidden states are not directly comparable after fine-tuning; looking only at generation may miss internal shifts, and both benchmarks and review models are expensive. The authors ask whether changes in hidden-state associations covary with external bias changes, not whether geometry determines behavior.
- Approach: Sentence embeddings are the mean of final-layer token hidden states. Each dimension of the relative representation is the cosine similarity to one anchor sentence; association in that space is computed using negative Euclidean distance. ∆B is the difference in mean bias between the audited and reference models, computed per target group. Negative values are read as closer to negative attributes. Default is 1,000 same-domain neutral anchor sentences.
- Setup: Llama 3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, Gemma 3-4B-IT are fully fine-tuned and LoRA-tuned on WildGuardMix's harmless and synthetic harmful splits, then linearly merged into seven levels. External baselines are WildGuardMix harmfulness, DecodingTrust stereotype agreement, and ToxiGen toxicity.
- Results: Of the 18 settings in Table 1, 15 correlations reach the significance marked in the paper. Under full fine-tuning, the highest is Llama on DecodingTrust with r=−0.84 (p<0.001). ROC AUC for threshold detection ranges from 0.65 to 0.99; the highest is 0.99 for DecodingTrust, Mistral, LoRA. Non-significant cases are Gemma's two LoRA correlations and Mistral on ToxiGen under full fine-tuning (r=−0.19, p=0.14). On Llama, RR's ROC AUC in the threshold scan of Figure 3 is above SEAT, Procrustes-SEAT, and CKA drift; AUC with 1k neutral anchors is 0.892. About 3 minutes per model, which the authors state is roughly 1/3 to 1/50 of the computation of the output benchmarks in the paper.
- Authors' conclusion: Relative representations provide a usable comparison space for related variants with unaligned latent spaces; ∆B is fairly stable to anchor sentences, attributes, and templates, but requires a meaningful reference model and weakens under parameter-efficient adaptation, especially for Gemma. They view it as a complement to output-layer bias evaluation. A small ∆B only means no representation shift was detected.