arXiv:2609.10060cs.AISep 2026

Manuscript Offprint

arXiv:2609.10060

Reference-Based Bias Detection in LLMs via Relative Representations of Hidden States

Marek Jeliński, Jan Dubiński, Maciej Chrabaszcz, Sebastian Cygert

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Existing bias auditing methods typically rely on model outputs, requiring costly benchmarks or judge models and potentially missing internal shifts that never appear in generated text. We propose a reference-based method that audits bias in hidden-state representations across related model variants, for example before and after fine-tuning. Because fine-tuning reshapes representation geometry, absolute hidden states are not directly comparable, so we encode each sentence by its similarities to a fixed set of anchor sentences, yielding relative representations in a shared comparison space. There we measure how target groups shift in their association with positive and negative attributes, a quantity we call the Representational Bias Shift ΔB\Delta B. Across three model families and the Wild-GuardMix, DecodingTrust and ToxiGen benchmarks, ΔB\Delta B correlates with output-level bias change in 15 of the 18 settings we test, reaching ∣r∣=0.84|r| = 0.84 (p<0.001p < 0.001) under full fine-tuning and becoming more model-dependent under parameter-efficient adaptation. Thresholding ΔB\Delta B detects checkpoints whose bias increased with ROC AUC between 0.65 and 0.99, and on WildGuardMix and DecodingTrust it separates them better than a SEAT-based baseline for all three families. ΔB\Delta B is also stable under changes to the anchor set, attribute sets and target templates. Our method requires no task-specific evaluation data and audits a model in about three minutes, using 3−50×3-50\times less compute than the output-level benchmarks considered here. We view it as complementary to output-based auditing rather than a replacement for it. We open-source our code¹.

1 Introduction

LLMs are increasingly deployed in systems that shape how information is produced and interpreted.

As they are adapted through instruction tuning, safety tuning, domain fine-tuning, and system prompting, their behaviour can shift in ways that are difficult to anticipate and audit. One important concern is bias, since models may inherit harmful associations from pretraining data or fine-tuning, or may display new distortions due to targeted manipulation (Guo et al., 2025; Lu et al., 2025).

Most bias evaluations focus on model outputs. Common approaches use curated benchmark datasets (Liang et al., 2023; Wang et al., 2023) or LLM-as-a-judge evaluations (Lin et al., 2024). Both are useful, but limited: curated benchmarks are costly to build and hard to scale across harms, while judge-based evaluations may inherit the evaluator's own biases (Lin et al., 2025). More fundamentally, output-based auditing may miss internal changes that precede behavioural shifts not immediately visible in the generations.

Motivated by recent findings that even benign fine-tuning can compromise safety properties (Qi et al., 2024; Betley et al., 2025), we recognise that alignment can degrade in multiple, often unpredictable ways, making standard behavioural evaluation highly challenging. We hypothesise that a model's hidden representations contain latent signals indicative of these unintended shifts. Consequently, this work investigates post-fine-tuning behavioural changes through the lens of inner representations. To achieve that, we extend the Sentence Encoder Association Test (SEAT) (May et al., 2019), which measures bias in text representations (Garg et al., 2018; Brunet et al., 2019), to compare internal states of the audited and reference model (see Fig. 1).

Yet, comparing these internal states directly is difficult because fine-tuning reshapes latent geometry, rendering raw hidden states poorly comparable across model variants. We address this using relative representations (Moschella et al., 2023) of hidden states. Instead of encoding a sentence by

¹https://github.com/NASK-AISafety/Reference-Based-Bias-Detection

Figure

Figure 1: Overview of our bias evaluation pipeline. We use relative representations to project the hidden spaces of the fine-tuned model (Maud\mathcal{M}_{\text{aud}}) and the reference (base) model (Mref\mathcal{M}_{\text{ref}}) into a shared space via anchor sentences. Within this shared space, we calculate distances between target representations and sets of positive and negative sentences. By comparing these distances (ΔB\Delta B), our method can, for example, detect potential side-effects induced during fine-tuning without the need for curated datasets, by determining whether Maud\mathcal{M}_{\text{aud}} exhibits greater bias toward target groups than Mref\mathcal{M}_{\text{ref}}.

its embedding, we encode it by its similarities to a fixed set of anchor sentences. This maps both the audited and reference models into a shared space, enabling direct comparison. In that space, we measure whether target concepts shift more toward positive or negative attribute sets relative to the reference model, which we call the Representational Bias Shift ΔB\Delta B. Our method relies solely on constructing small sets of anchor, positive, and negative sentences, which are far easier to obtain than curated datasets, and therefore scales to new target groups without additional data collection.

We evaluate the approach on behavioural shifts induced by full and LoRA-based fine-tuning of Mistral, Llama, and Gemma models using bias benchmarks derived from prior work (Han et al., 2024; Wang et al., 2023; Hartvigsen et al., 2022). Overall, ΔB\Delta B tracks output-level bias change, reaching correlations up to ∣r∣=0.84|r| = 0.84 (p<0.001p < 0.001) under full fine-tuning. While the relationship is weaker and more model-dependent under LoRA, it remains significant in most settings. Thresholding ΔB\Delta B detects increased-bias checkpoints with ROC AUCs of 0.65–0.99. On WildGuardMix and DecodingTrust, our method is consistently more discriminative than a SEAT-based baseline across all three model families. Extensive ablations further demonstrate robustness to variations in anchor and attribute sets, target templates.

Representation-level metrics are not guaranteed to predict downstream behaviour (Goldfarb-Tarrant et al., 2021; Gonen and Goldberg, 2019). We therefore do not claim that representational geome-

try determines model behaviour. We ask a narrower, empirical question. When fine-tuning shifts a model's hidden-state associations, does that shift co-vary with the change in output-level bias measured against external benchmarks? Our experiments answer this in the affirmative in most of the settings we study, with the association weakest for Gemma.

This paper makes the following contributions:

  • We introduce a reference-based auditing framework that places an audited and a reference model in a shared comparison space through relative hidden-state representations, and define the Representational Bias Shift ΔB\Delta B, which measures how target groups change their association with positive and negative attributes relative to the reference (Sections 3.3 and 3.4).

  • We validate ΔB\Delta B against three output-level benchmarks across three model families and two fine-tuning regimes, using a graded merge spectrum so that bias is introduced in increments rather than as a single jump. ΔB\Delta B covaries with output-level bias in 15 of the 18 settings we test (∣r∣|r| up to 0.84) and flags increased-bias checkpoints with ROC AUC between 0.65 and 0.99 (Table 1, Figure 2).

  • Experiments validate relative representations against alternative approaches (Figure 3) and show ΔB\Delta B is stable across the anchor set, attribute sets and target templates (Section 4.5).