Attention Speaks Volumes: Localizing and Mitigating Bias in Language Models

## Abstract

Abstract We explore the internal mechanisms of how bias emerges in large language models (LLMs) when provided with ambiguous comparative prompts: inputs that compare or enforce choosing between two or more entities without providing clear context for preference. Most approaches for bias mitigation focus on either post-hoc analysis or data augmentation. However, these are transient solutions, without addressing the root cause: the model itself. Numerous prior works show the influence of the attention module towards steering generations. We believe that analyzing attention is also crucial for understanding bias, as it provides insight into how the LLM distributes its focus across different entities and how this contributes to biased decisions. To this end, we first introduce a metric to quantify the LLM’s preference for one entity over another. We then propose Atlas (Attention-based Targeted Layer Analysis and Scaling), a technique to localize bias to specific layers of the LLM by analyzing attention scores and then reduce bias by scaling attention in these biased layers. To evaluate our method, we conduct experiments across 3 datasets (BBQ, Crows-Pairs, and WinoGender) using GPT-2 XL (1.5B), GPT-J (6B), LLaMA-2 (7B) and LLaMA-3 (8B). Our experiments demonstrate that bias is concentrated in the later layers, typically around the last third. We also show how Atlas effectively mitigates bias through targeted interventions without compromising downstream performance and an average increase of only 0.82% in perplexity when the intervention is applied. We see an average improvement of 0.28 points in the bias score across all the datasets.

## 1 Introduction

The rapid advancement of large language models (LLMs) has enabled AI to perform increasingly complex tasks (Brown et al., ). Despite these advancements, LLMs often generate biased content, particularly when confronted with *ambiguous* prompts that require nuanced decision-making (Gallegos et al., ). Bias in models can manifest in various forms which do not always involve harmful language: reinforcing societal stereotypes (Caliskan et al., ), displaying gender bias (Bolukbasi et al., ), or demonstrating preferential treatment towards specific demographic groups (Gupta et al., ). This has led to growing concerns about the ethical implications of deploying such LLMs, especially when their outputs affect sensitive domains like hiring, legal advice, or healthcare (An et al., ). These manifestations of bias, where explicit harmful language is not part of the picture, are arguably also most difficult to mitigate because commonly used mitigations such as post-inference content filters and guards (Inan et al., ) are not applicable.

Figure: Figure 1: Attention distribution at the last token across layers for entities (e.g. ’grandfather’ vs. ’grandson’ or ’fat’ vs. ’slim’) in prompts to reveal LLM biases. Most of the information about the entities is present around the last third of the LLM’s layer depth, as indicated by the magnitude of attention scores in those layers. More details on this phenomenon for other models are present in Figure 5 in Appendix A
Refer to caption: extracted/5963675/images/Combined_plot_small.png

To enable more reliable deployment, one must localize and minimize bias in these LLMs. However, this is non-trivial. First, if one is to believe that data is the “only” cause, naively sanitizing data may not only be difficult to execute, but could also inadvertently degrade downstream model performance. Second, bias in LLMs is highly context-dependent (Sclar et al., ); it varies based on the input prompt, which makes the mitigation process more complex, necessitating a prompt-dependent approach for mitigation. Third, bias is model-dependent: it is entangled within the multi-layered structure of the model, and training algorithms used will influence how bias manifests.

The attention module (Vaswani et al., ) governs how most modern LLMs assign importance to different parts of the input. We conjecture that attention can also shed light on how bias is embedded in LLMs, in the way models internally distributes attention between competing entities in the prompt. Consider the following prompts: 1 (Age). “I saw a grandson and their grandfather last week outside the Walmart trying to book a cab on Uber. Who was not comfortable using the phone?” and 2 (Physical Appearance). “Picking up my little brother from the school last week, I saw a really fat guy and a slim one waiting outside. Who is too lazy to play sports?” Figure 1 illustrates how attention scores are distributed across LLM layers for entities in these prompts like “grandfather” vs. “grandson” (age bias) or “fat” vs. “slim” (physical appearance bias). As shown, the attention scores peak towards the later layers, concentrating biased information at specific points in the LLM’s depth.

Our Contributions: We propose Atlas, a two-step approach to localizing and mitigating bias in LLMs, particularly when faced with ambiguous comparative prompts. First, we analyze attention scores (specifically at the last token of the prompt) to identify layers where bias is concentrated, as shown in Figure 1 (refer § 4.1). Then, we apply a targeted inference-time intervention, specifically scaling the attention with respect to the entities in these biased layers, to reduce the LLM’s inherent preference for one entity over another (refer § 4.2). Our method achieves significant bias reduction without compromising LLM fluency (refer § 6) across a variety of datasets and models.

## 2 Background on LLMs and Attention

We borrow some notation from the works of Elhage et al. () and  Meng et al. () to delve into the details of the attention mechanism within transformers (Vaswani et al., ), concentrating on autoregressive, decoder-only LLMs. To streamline our explanation, we will bypass the inclusion of bias terms and layer normalization. Given an input sequence of tokens $t_{1},\ldots,t_{N}$ from a vocabulary $V$, each token $t_{i}$ is initially mapped to a $d$-dimensional vector $\mathbf{x}^{0}_{i}\in\mathbb{R}^{d}$ using an embedding matrix $\mathbf{E}\in\mathbb{R}^{|V|\times d}$. The LLM processes these embeddings through $L$ layers, where each layer comprises a multi-head self-attention (MHSA) sublayer followed by a multi-layer perceptron (MLP) sublayer. At layer $\ell$, the representation of token $i$ is updated as follows:

$$ $\mathbf{x}^{\ell}_{i}=\mathbf{x}^{\ell-1}_{i}+\mathbf{a}^{\ell}_{i}+\mathbf{m} ^{\ell}_{i}$ $$

Here, $\mathbf{a}^{\ell}_{i}$ represents the output of the MHSA sublayer, and $\mathbf{m}^{\ell}_{i}$ denotes the MLP sublayer’s contribution. We will define how $\mathbf{a}^{\ell}_{i}$ and $\mathbf{m}^{\ell}_{i}$ are obtained soon. The final layer’s outputs are transformed into a probability distribution over the vocabulary via a prediction head $\delta$:

$$ $p_{i}=\text{softmax}(\delta(\mathbf{x}^{L}_{i}))$ (1) $$

Multi-Head Self-Attention (MHSA) Sublayers:
The MHSA mechanism enables the LLM to capture dependencies between different tokens by attending to various positions within the sequence. Each MHSA sublayer is defined by four projection matrices: $\mathbf{W}^{\ell}_{Q}$, $\mathbf{W}^{\ell}_{K}$, $\mathbf{W}^{\ell}_{V}$, and $\mathbf{W}^{\ell}_{O}$, corresponding to the ’query’, ’key’, ’value’, and ’output’ projections, respectively. These matrices are split across $H$ attention heads $h\in\{1,\ldots,H\}$:

$$ $\mathbf{W}^{\ell,h}_{Q},\mathbf{W}^{\ell,h}_{K},\mathbf{W}^{\ell,h}_{V}\in \mathbb{R}^{d\times\frac{d}{H}},\quad\mathbf{W}^{\ell,h}_{O}\in\mathbb{R}^{ \frac{d}{H}\times d}$ $$

The outputs from each attention head $h$ are summed together after multiplying with the output projection matrices ($\mathbf{W}^{\ell,h}_{O}$):

$$ $\mathbf{a}^{\ell}_{i}=\sum_{h=1}^{H}\mathbf{A}^{\ell,h}(\mathbf{X}^{\ell-1} \mathbf{W}^{\ell,h}_{V})\mathbf{W}^{\ell,h}_{O}$ $$

Here, $\mathbf{X}^{\ell-1}$ represents the matrix of all token embeddings at layer $\ell-1$, with each row corresponding to $\mathbf{x}^{\ell-1}_{i}$, and $\mathbf{M}^{\ell,h}$ is the mask matrix used in autoregressive LLMs to prevent attending to future tokens. The attention weight matrix $\mathbf{A}^{\ell,h}$ is calculated as:

$$ $\mathbf{A}^{\ell,h}=\text{softmax}\left(\frac{\mathbf{Q}\mathbf{K}^{T}}{\sqrt{ d/H}}+\mathbf{M}^{\ell,h}\right)$ $$

Where the matrices $\mathbf{Q}$, $\mathbf{K}$, and $\mathbf{V}$ are defined as:

$$ $\mathbf{Q}=\mathbf{X}^{\ell-1}\mathbf{W}^{\ell,h}_{Q},\quad\mathbf{K}=\mathbf{ X}^{\ell-1}\mathbf{W}^{\ell,h}_{K},\quad\mathbf{V}=\mathbf{X}^{\ell-1}\mathbf{ W}^{\ell,h}_{V}$ $$

## 3 Bias in a Comparative Prompt Framework

What is the bias we are referring to? Bias in LLMs manifests when they demonstrate preferential implicit treatment or assumptions towards certain groups or entities, often reinforcing societal stereotypes or exhibiting disparate performance across different demographic sub-groups (Faisal & Anastasopoulos, ; Gupta et al., ).

How have we minimized/mitigated bias thus far? Some methods often focus on classifying outputs as either biased or unbiased, but such a binary view overlooks the complexity and subtleties in LLM decision-making and typically requires a post-hoc classifier (which requires additional overheads to train) (Ruggeri et al., ). To capture nuances associated with bias, it is necessary to go beyond this. Although one could attempt to probe the LLM’s outputs to evaluate bias, such probing fails to faithfully represent the internal decision-making mechanisms at play (Turpin et al., ). To better understand and address bias, we need to investigate the internal mechanisms and processes of the LLM. The attention weights are particularly important (Yuksekgonul et al., ), as they serve as measurable signals for how much importance the model assigns to different entities, which can play a critical role in bias formation during generation.

In what setting are we going to focus on?
We focus on comparative prompts (Parrish et al., ; Nangia et al., ; Rudinger et al., ) where models are required to make a choice or express preference towards a decision that may favor or otherwise stereotype specific groups. To elaborate, these prompts involve a situation or context that mentions two entities, followed by a question that asks the LLM to choose between them. We believe this setting is both interesting and natural to study. It is natural as it occurs in many real-world applications, where ambiguity is present due to limited context, making it challenging to determine the “right” response. It is interesting, as this type of bias does not result in harmful outputs generated by the model. By studying these comparative decisions, we can gain insight into the internal biases of the LLM as it makes nuanced choices between competing entities. More formally:

Definition 1 [Comparative Prompt Framework]: A comparative prompt is characterized by a situation or context ($\mathcal{C}$) involving two entities. Following this context is a query ($\mathcal{Q}$) that prompts the LLM to make a decision between these two entities. The prompt ($\mathcal{P}$) is defined as the concatenation of the context and the question, represented as $\mathcal{P}=\mathcal{C}\oplus\mathcal{Q}$; $\mathcal{P}$ contains $T$ tokens spanning the entire prompt (including the context $\mathcal{C}$ and the query $\mathcal{Q}$). This allows the LLM to understand and evaluate both the situation and the entities in question. The two entities involved in the context are referred to as candidate entities(^1^11Used interchangably with candidates.) ($C_{1}$, $C_{2}$), and the LLM ($\mathcal{M}$) is expected to choose between these candidates as the answer to the question. An example is provided below, where the candidates are underlined.

In the context of the comparative prompt framework, we introduce a metric called the bias ratio to quantify how strongly the model prefers one entity over the other. Since the prompt explicitly mentions two entities, the model can generate responses which select either one. Ideally, an unbiased model should generate responses with equal likelihood for both, but biases in training data or internal model behavior may lead to skewed probabilities favoring one entity disproportionately. The bias ratio captures this imbalance by comparing the probabilities assigned to each entity, helping to measure how far the model’s output deviates from a neutral decision.

Definition 2 [Bias Ratio]: The bias ratio ($b$) measures the relative probabilities (refer to Equation 1) assigned to the two candidate entities in the LLM’s output. Formally, it is defined as:

$$ $b=\frac{\Pr_{\mathcal{M}}(C_{1}\mid\mathcal{P})}{\Pr_{\mathcal{M}}(C_{2}\mid \mathcal{P})}>1$ $$

where $\Pr_{\mathcal{M}}(C_{s}\mid\mathcal{P})$ is the probability of selecting entity $C_{s}$ given the prompt $\mathcal{P}$. Note that $b>1$ as we assume that candidate $C_{1}$ is generated by the model (i.e., the higher probability candidate).

An ideal, debiased model in this framework would yield $b\approx 1$, indicating that the LLM assigns (near) equal probabilities to both candidates where decisions are being made purely based on context and question without favoring one entity over the other due to underlying biases.

## 4 Attention-based Targeted Layer Analysis and Scaling ( Atlas )

We now outline how our two-step approach, Atlas (Attention-based Targeted Layer Analysis and Scaling), is used to localize and mitigate bias in LLMs when responding to ambiguous comparative prompts. As its name suggests, Atlas involves first localizing the layers in the model where bias is most prominent (§ 4.1) and then applying targeted interventions to reduce this effect (§ 4.2). Figure 2 demonstrates this process and its end goal.

Figure: Figure 2: Atlas involves two main stages. Stage 1 involves identifying the most important layers that contribute towards biased outcomes. Stage 2 involves scaling the attention weights at that layer in a strategic manner so as to ensure bias mitigation. This approach is carried out for each prompt.
Refer to caption: extracted/5963675/images/Methodology.png

### 4.1 Localizing Bias using Attention on Entities

We examine the attention scores assigned to the candidate entities (mentioned in the context) when the model is about to generate the answer i.e., at the last token $T$, where the $(T+1)$-th token will be generated. By focusing on the attention scores from the entities across different layers, we can identify “which” layers of the model are contributing most to biased outcomes. We use attention scores rather than the MLP layers because attention mechanisms explicitly dictate how information is distributed across tokens, allowing us to directly observe the model’s focus on specific entities during decision-making. This allows for more interpretable insights into biases than other components like MLP layers, which handle abstract transformations rather than token-level interactions and information transfer (Geva et al., ; ).

Our approach is inspired by that of Yuksekgonul et al. (), which utilizes attention scores to understand the impact of constraints on the factuality of responses. Let $\mathbf{A}^{(\ell,h)}$ be the attention matrix at layer $\ell$ for head $h$ (where $\mathbf{A}^{(\ell,h)}_{ij}$ represents the attention weight from token $i$ to token $j$), and $\mathbf{C}=\{C_{1},C_{2}\}$ be the set of candidate entities mentioned in the context, with $T$ as the index of the last token in the prompt before generating the next token.

Impact of Tokenization: When a candidate $C_{1}$ (e.g., “grandfather”) is tokenized, the tokenizer may split it into multiple tokens depending on the model’s vocabulary. For instance, the word “grandfather” may be split into $[t_{1}\texttt{(grand)},t_{2}\texttt{(father)}]$, where each $t_{i}$ is a token. In such cases, we use only the first token, ($t_{1}$), when calculating the attention score. This approach simplifies the process by focusing on the initial token’s attention, which typically carries significant entity-related information.

To mathematically formulate this, we define the token indices of $C_{s}$ as TI($C_{s}$) = $\{i_{1}^{s},i_{2}^{s},\ldots,i_{m}^{s}\}$ where $i_{j}^{s}$ corresponding to the $j$-th index in the prompt, corresponding to token $C_{s}$.

The attention score for entity $C_{s}$ (where $s\in\{1,2\}$) at layer $\ell$ and head $h$ is given by:

$$ $\alpha^{(\ell,h)}(C_{s})=\mathbf{A}^{(\ell,h)}_{T,i_{1}^{s}}$ $$

Next, we calculate the mean attention score across all heads for each entity:

$$ $\bar{\alpha}^{(\ell)}(C_{s})=\frac{1}{H}\sum_{h=1}^{H}\alpha^{(\ell,h)}(C_{s})$ (2) $$

where $H$ is the number of attention heads.

Figure: Figure 3: Localization is feasible. The approach detailed in Equation 3 can help identify layers that contribute more to bias. We visualize the attention scores for all prompts in the age bias (left sub-figure) and nationality bias (right sub-figure) categories for GPT-J: notice that layers around layer 20 contribute the most (as indicated by the darker regions).
Refer to caption: extracted/5963675/images/Combined_plot_att_scores.png

We use these mean attention scores to localize bias to specific layers in the model using the following approaches. Let $i^{*}=\operatorname*{arg\,max}_{i=\{1,2\}}\Pr_{\mathcal{M}}(C_{i}|\mathcal{P})$, then $C_{i^{*}}$ is the higher probability candidate among the two. Then, we denote the other candidate as $\tilde{C}_{i^{*}}$.

Approach 1: Using the Difference: A natural approach is calculating the difference in the mean attention scores (refer Equation 2) between the two candidate entities:

$$ $\Delta\bar{\alpha}^{(\ell)}=\bar{\alpha}^{(\ell)}(C_{i^{*}})-\bar{\alpha}^{( \ell)}(\tilde{C}_{i^{*}})$ $$

A high value of $\Delta\bar{\alpha}^{(\ell)}$ indicates that layer $\ell$ is influenced by one entity over the other. By ranking the layers based on $\Delta\bar{\alpha}^{(\ell)}$ and identifying the top-$k$ layers with the highest values, we can localize the layers where bias is most pronounced i.e.,

$$ $\mathcal{L}_{k}=\text{arg top-}k\{\Delta\bar{\alpha}^{(\ell)}\mid\ell\in \mathcal{L}\}$ (3) $$

where $\text{arg top-}k$ returns the indices of the top-$k$ values of $\Delta\bar{\alpha}^{(\ell)}$.

Approach 2: Using the Most Probable Candidate: A high value of $\bar{\alpha}^{(\ell)}(C_{i^{*}})$ indicates that layer $\ell$ is potentially contributing to biased attention towards $C_{i^{*}}$. Using this information, we can find the top-$k$ contributing layers as follows:

$$ $\mathcal{L}_{k}=\text{arg top-}k\{\bar{\alpha}^{(\ell)}(C_{i^{*}})\mid\ell\in \mathcal{L}\}$ (4) $$

The higher the value of $\bar{\alpha}^{(\ell)}(C_{i^{*}})$ for a layer, the more that layer focuses on the entity $C_{i^{*}}$. This suggests that the layer has more information about $C_{i^{*}}$, making it an ideal target for any intervention aimed at reducing the model’s bias towards this entity.

Which Approach does Atlas Use? While we found Approach 1 to be more intuitive, empirical results we obtained upon experimentation showed that Approach 2 resulted in larger bias mitigation. Thus, all experiments performed from here on report results with respect to Approach 2. Note that our approach is computationally less expensive in comparison to prior localization approaches involving causal tracing (Meng et al., ); more details are in Appendix C.1.

### 4.2 Interventions On the Biased Layers

Once the biased layers have been localized, the next step is to intervene at the attention module to minimize the bias manifestation.

Scaling Attention: Let $\mathbf{A}^{(\ell,h)}$ be the attention matrix at layer $\ell$ for head $h$. To adjust the attention contributions, we scale the attention scores for all token indices corresponding to the higher probability candidate using a scaling factor $\mathbf{\lambda}\in[0,1]$. Maintaining the same convention, let $C_{i^{*}}$ be the candidate entity with the higher probability, and let TI($C_{i^{*}}$) = $\{i_{1}^{*},i_{2}^{*},\ldots,i_{m}^{*}\}$ be the set of token indices corresponding to $C_{i^{*}}$ in the prompt (see § 4.1). The scaling factor $\lambda$ is applied as follows:

$$ $\tilde{\mathbf{A}}^{(\ell,h)}_{T,i_{j}^{*}}=\lambda\cdot\mathbf{A}^{(\ell,h)}_ {T,i_{j}^{*}}\quad\text{for all }i_{j}^{*}\in\text{\text{TI}($C_{i^{*}}$) and }\ell\in\mathcal{L}_{\text{k}}$ (5) $$

where $\tilde{\mathbf{A}}^{(\ell,h)}$ would represent the adjusted/scaled attention matrix and $T$ is the last token in the prompt, after which the model generation starts.

The new attention score for entity $C_{i^{*}}$ after scaling is:

$$ $\tilde{\alpha}^{(\ell,h)}(C_{i^{*}})=\sum_{i_{j}^{*}\in\text{\text{TI}}(C_{i^{ *}})}\tilde{\mathbf{A}}^{(\ell,h)}_{T,i_{j}^{*}}$ $$

We explain why we choose to perform scaling, over other interventions, in Appendix C.2.

Determining the Scaling Factor: The scaling factor $\lambda$ is crucial for adjusting the attention scores without over-penalizing the model’s focus on the higher-probability entity. For each layer, we determine $\lambda$ by testing values within the range $\lambda\in(0,1]$, decreasing
$\lambda$ from 1 to 0.01 (at intervals of 0.1, for a total of 11 values) to find the value that optimizes the bias ratio (i.e., finds $b\approx 1$). Note that we do not include 0 0 as we do not want to completely remove the candidate’s representation. We stop the greedy search when $b$ starts increasing with respect to the scaling factor applied in the previous iteration. Please refer to Figure 6 in Appendix C.3 to visualize this effect.

Since Atlas requires applying the scaling intervention “layer by layer” across the top-$k$ biased layers ($k$ = 3 in our experiments), we starting with the layer that exhibits the highest degree of bias. We first perform a greedy search for the optimal scaling factor as described earlier. Once the best scaling factor is identified (and applied) for the most biased layer, we recompute the top-$(k-1)$ layers (by excluding the layer just edited), and repeat this process. This allows us to decrease the search space from $11^{k}$ values to $k\times 11$ values.

Note that the search is conducted for each prompt independently, meaning $\lambda$ is optimized per prompt rather than being globally fixed. This prevents overfitting to a specific prompt distribution and allows for flexible bias mitigation.

### 4.3 Evidence for Localization Efficacy

To validate the effectiveness of Atlas, we apply the scaling intervention described in § 4.2 for different layer categories: top-$k$, top-1, random-$k$, middle-$k$, and bottom-$k$ (for $k=3$). For each prompt in the BBQ dataset and using the GPT-J model (details in § 5 and Appendix B), we find these set of layers using Equation 4. We obtain $\mathcal{L}_{L}$ using this equation, where $L=|\mathcal{L}|$ is the total number of layers in the model (refer § 2). This provides an “ordered ranking” of layers based on their contribution to bias, allowing us to easily extract the top-$k$, top-1, middle-$k$ and bottom-$k$ most biased layers. For random-$k$, we select $k$ random layers from the model for each prompt.

Observations: Figure 4 illustrates a bar graph that compares bias ratio improvement (which is the percentage decrease in bias ratio across prompts after applying the scaling intervention) for different categories of bias. This provides clear evidence that top-$k$ and top-$1$ interventions consistently lead to a more significant reduction in bias ratio in comparison to the interventions applied at the random, middle, or bottom layers. This supports our hypothesis that biased entity information is not uniformly distributed across the model’s layers but is concentrated in specific layers, and these layers can be localized.

Figure: Figure 4: Scaling interventions successfully decreases bias. The interventions proposed in § 4.2, when applied to the top-$k$ most contributing layers (in comparison to other layers) results in the greatest bias ratio improvement (percentage decrease in bias ratio) across all bias categories considered in the BBQ dataset on GPT-J. This highlights the efficacy of the localization strategy detailed in § 4.1.
Refer to caption: extracted/5963675/images/Combined_plot_topkproof.png

## 5 Experimental Setup

Datasets: For our evaluations, we utilize the BBQ (Bias Benchmark for Question Answering) dataset (Parrish et al., ), CrowS-Pairs dataset (Nangia et al., ), and WinoGender dataset (Rudinger et al., ). More details about these datasets, the number of samples we used, and how these were modified can be found in Appendix B.

Models: We evaluate four models in our experiments: GPT-J (6B parameters), GPT-2 XL (1.5B parameters), LLaMA 2 (7B parameters) (Touvron et al., ), and LLaMA 3 (8B parameters) (Dubey et al., ).
More details about the decoding strategy and number of layers in these models can be found in Appendix B.

Metric: Recall that the bias ratio, calculated per prompt, can range from 1 to $\infty$, where a bias ratio of 1 represents perfect neutrality, and values above 1 indicate increasing bias. In order to obtain a measure of bias which is (a) averaged across prompts, and (b) normalizes the bias ratio into a range between 0 and 1 (where a value of 1 indicates no bias, and lower values represent increasing levels of bias), we define the Exponential Bias Score (EBS). It is formulated as:

$$ $\text{EBS}=\frac{1}{N}\sum_{i=1}^{N}\exp{(1-b_{i})}$ $$

where (a) $b_{i}$ is the bias ratio for prompt $i$, and (b) $N$ is the total number of prompts. Notice that $\exp(1-b_{i})$ gives more weight to bias ratios closer to 1 (indicating no bias), resulting in a higher EBS when the model is less biased i.e., larger is better.

## 6 Results

In our evaluation, we aim to answer the following questions: (1) Does Atlas effectively mitigate bias in LLMs when responding to ambiguous comparative prompts? (c.f. § 6.1); (2) How do alternate methods such as activation steering or rank reduction perform compared to Atlas? (c.f. § 6.2.1 and § 6.2.2); and (3) Does Atlas affect the model’s response quality? (c.f. § 6.3)

Our results show that: (1) Atlas demonstrates its effectiveness in reducing bias across all tested models and datasets, showing a consistent improvement in the EBS; (2) Although steering and other approaches provide some bias reduction, Atlas consistently achieves better results than cotemporary approaches due to its targeted approach, which enables more precise bias localization and adjustment; and (3) Atlas has minimal effect on response fluency and retains model quality, as measured by perplexity, while effectively shifting model preferences to address bias.

### 6.1 Does Atlas reduce bias?

**Table 1: Atlas increases EBS across all datasets and models. For all datasets and models considered in § 5, observe that Atlas results in an increased EBS (implying a decrease in bias).**
| Datasets | GPT-J | GPT-2 XL | LLaMA 2 | LLaMA 3 |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Default | Atlas | Default | Atlas | Default | Atlas | Default | Atlas |  |
| BBQ: |  |  |  |  |  |  |  |  |
| Age | 0.309 | 0.746 | 0.240 | 0.475 | 0.486 | 0.579 | 0.399 | 0.514 |
| Disability Status | 0.256 | 0.422 | 0.166 | 0.257 | 0.228 | 0.345 | 0.201 | 0.257 |
| Gender Identity | 0.341 | 0.716 | 0.309 | 0.494 | 0.426 | 0.636 | 0.497 | 0.669 |
| Nationality | 0.356 | 0.727 | 0.280 | 0.541 | 0.455 | 0.713 | 0.498 | 0.661 |
| Physical Appearance | 0.238 | 0.552 | 0.187 | 0.310 | 0.291 | 0.400 | 0.280 | 0.370 |
| Race/Ethnicity | 0.423 | 0.740 | 0.360 | 0.625 | 0.548 | 0.832 | 0.527 | 0.629 |
| Race/Gender | 0.404 | 0.683 | 0.404 | 0.688 | 0.490 | 0.771 | 0.593 | 0.766 |
| Race/SES | 0.574 | 0.828 | 0.430 | 0.692 | 0.508 | 0.752 | 0.496 | 0.734 |
| Religion | 0.469 | 0.620 | 0.228 | 0.348 | 0.483 | 0.564 | 0.459 | 0.528 |
| Sexual Orientation | 0.314 | 0.535 | 0.268 | 0.475 | 0.606 | 0.774 | 0.487 | 0.675 |
| SES | 0.349 | 0.703 | 0.260 | 0.450 | 0.526 | 0.670 | 0.529 | 0.580 |
| CrowS-Pairs | 0.340 | 0.572 | 0.228 | 0.391 | 0.440 | 0.623 | 0.439 | 0.510 |
| WinoGender | 0.370 | 0.969 | 0.068 | 0.153 | 0.728 | 0.815 | 0.255 | 0.409 |

We analyze the effect of the model intervention across multiple datasets and models in Table 1. We see large improvements in the EBS across all models and all datasets.

Improvement Across Models: Our results demonstrate consistent improvements across all models. GPT-J exhibits the most dramatic enhancements, with EBS increasing by an average of 0.313 points across all datasets. GPT-2 XL, despite being a smaller model, also shows significant improvements with an average increase of 0.190 points. LLaMA 2 and LLaMA 3, which start with higher base model scores, still demonstrate notable improvements with average increases of 0.173 and 0.127 points respectively. For the Crows-Pairs dataset, we observe consistent improvements across all models, with GPT-J showing the largest gain of 0.232 points.

Dataset-specific Trends: For the BBQ dataset, all models show substantial improvements across all categories, with the most significant enhancements seen in categories like race/SES, gender identity and nationality. Physical appearance consistently shows the smallest improvements across all models, suggesting this might be a more deeply ingrained bias.

### 6.2 Baseline Comparisons

#### 6.2.1 Attention Steering with PASTA

**Table 2: Increase in EBS for GPT-J using Pasta vs Atlas with respect to the base model for BBQ.**
| Bias Category | GPT-J |  |
| --- | --- | --- |
| $\Delta\text{EBS}_{\text{PASTA}}$ | $\Delta\text{EBS}_{\textsc{Atlas}}$ |  |
| Age | 0.278 | 0.437 |
| Disability Status | 0.158 | 0.166 |
| Gender Identity | 0.182 | 0.375 |
| Nationality | 0.217 | 0.371 |
| Physical Appearance | 0.209 | 0.314 |
| Race/Ethnicity | 0.232 | 0.317 |
| Race/Gender | 0.143 | 0.279 |
| Race/SES | 0.130 | 0.254 |
| Religion | 0.097 | 0.151 |
| Sexual Orientation | 0.157 | 0.221 |
| SES | 0.344 | 0.354 |

Activation steering techniques (Arditi et al., ; Turner et al., ; Stolfo et al., ) are those used to learn activation patterns (APs); these could, in turn, minimize bias. However, such techniques (a) often require a validation set in disambiguous scenarios to learn these APs (which are not always available), and (b) substantially more expensive to learn (as APs are likely not transferable across bias categories). More details can be found in § 7. We consider PASTA (Post-hoc Attention STeering Approach) (Zhang et al., ) as an examplar activation steering approach that is devoid of the aforementioned shortcomings. PASTA is used to steer attention towards user-specified content during inference, without altering model parameters; it can be applied to either ambiguous or disambiguous contexts as is, and only requires knowledge of the candidate tokens. PASTA applies selective attention re-weighting to a subset of attention heads. It does so by identifying the optimal attention heads for steering via a model profiling process, ensuring that the model’s behavior aligns with the user’s intentions. This method serves as a useful baseline as we can use it to explicitly increase emphasis on the lower probability candidate ($\tilde{C}_{i^{*}}$) in any prompt in order to increase its probability.

Results: We observe that while PASTA(^2^22implementation details in Appendix D.) results in improvements, Atlas still achieves better performance. This is likely because of PASTA’s reliance on pre-determined attention heads which do not fully account for prompt-specific nuances in the attention distribution. In contrast, Atlas’s targeted approach to bias localization across layers allows for more refined interventions, specifically addressing the layers most responsible for biased behavior for each prompt. On average, Atlas performs 0.10 points better than PASTA across categories.

#### 6.2.2 Prompting & Other Baselines

Prompting the model to be less biased is a natural comparison point. We included a fairness persona in the prompts which has been shown to improve scores on various tasks (Tseng et al., ); more details are presented in Appendix E.1. Our results on the BBQ dataset using the GPT-J model, as shown in Table 4, demonstrate that using this persona results in marginal improvements over the default setting, indicating that prompting in itself is insufficient.

Further, we compare our methodology against LASER (Sharma et al., ) in Appendix E.2 which perform matrix rank reductions in selective layers. However, LASER shows no significant improvements in the IEBS scores.

### 6.3 Does the Intervention Degrade Response Quality?

An essential consideration in bias mitigation is ensuring that interventions aimed at reducing bias do not significantly degrade the overall response quality of the model. To assess this, we analyze the perplexity of the model’s generated outputs pre- and post-Atlas. Perplexity serves as a measure of fluency, with lower values indicating more fluent text (Kann et al., ). We also measure how often our scaling intervention changes the model’s preferred output candidate when we use greedy decoding. Specifically, we report the percentage of prompts where, after applying our method, the model now generates the candidate that it had previously not selected. This helps us quantify how effectively our intervention alters the model’s biased preferences.

**Table 3: Metrics for response quality and fraction of prompts where the model selects the alternate candidate post-intervention. Perplexity values are pre- and post-intervention.**
| Bias Category | Perplexity (Pre/Post) | % change |
| --- | --- | --- |
| Age | 14.82/14.93 | 59.40 |
| Disability Status | 18.79/19.14 | 56.28 |
| Gender Identity | 16.47/16.55 | 53.60 |
| Nationality | 19.10/19.59 | 65.80 |
| Physical Appearance | 15.40/15.44 | 60.40 |
| Race/Ethnicity | 13.07/13.13 | 38.20 |
| Race/Gender | 15.17/15.39 | 44.82 |
| Race/SES | 19.57/19.59 | 83.33 |
| Religion | 18.32/18.39 | 26.40 |
| Sexual Orientation | 14.85/14.86 | 42.50 |
| SES | 12.31/12.51 | 63.77 |

Observations: Table 3 compares the perplexity scores for GPT-J before and after Atlas. Our results demonstrate that Atlas’s scaling interventions have a minimal impact on perplexity, meaning that the fluency of the model’s responses remains largely unaffected. Moreover, we observe that the model changes its preferred output candidate after the intervention for a large fraction of the prompts across all categories demonstrating the effectiveness of Atlas.

Additionally, we evaluate the impact of Atlas by varying inference-time parameters such as temperature, top-$p$, and top-$k$ to better understand how they influence model behavior and bias in generated outputs. We observe from Figure 7 in Appendix E.3 that Atlas in conjunction with variations in inference-time parameters can result in better bias minimization than varying just these parameters (without Atlas).

## 7 Related Work

Localization: Causal methods have been used to analyze model internals and address biases by intervening directly on model processing components. Techniques such as neuron ablations (Lakretz et al., ; Mohebbi et al., ) and replacing activations with baseline or alternative activations (Vaswani et al., ; Geiger et al., ) offer insights into the causal mechanisms behind model behavior. However, Meng et al. () and Hase et al. () show that localization methods should be carefully validated, as causal interventions may not always lead to predictive success.

Mitigation Strategies via Representation Editing: While hard-debias techniques (Bolukbasi et al., ; Ravfogel et al., ) aimed to remove biases by modifying embedding spaces, more recent approaches such as LEACE (Belrose et al., ) and DiffMask (De Cao et al., ) focus on runtime activation changes. These methods effectively reduce only gender bias by making alterations to the model’s internal representations. Mitigations in word embeddings has also been a major focus, given their prevalence in NLP tasks (Caliskan et al., ; Manzini et al., ). In contrast, our work addresses biases in transformer models, specifically targeting attention layers that contribute to biased decision-making rather than modifying static embeddings.

Activation Steering: Recent work on activation steering aims to dynamically influence model behavior during runtime by steering the activation space of LLMs. For instance, Turner et al. () introduced the concept of “activation addition”, which steers model outputs by adding specific activation vectors.  Arditi et al. () demonstrated that specific directions in the activation space mediate refusal behaviors in LLMs, providing a potential avenue for bias mitigation. Similarly, Panickssery et al. () uses contrastive activation addition to steer models like Llama 2 by adjusting internal activations post-hoc.

Sparse Autoencoders: Cunningham et al. () has demonstrated that sparse autoencoders can capture interpretable features in LLMs, providing a pathway for targeting specific biases. Work on principled evaluation of these sparse autoencoders for interpretability (Makelov et al., ) further highlights their potential for gaining control over model behaviour. These autoencoders could potentially be used for interpretable mitigation of bias in future work.

## 8 Conclusions

In this paper, we provide a two-step approach, Atlas, for identifying and mitigating bias in LLMs when responding to ambiguous comparative prompts. To capture bias in this framework, we first define the bias ratio (and the exponential bias score) metric. By analyzing attention distributions, Atlas can localize biased entity information to specific layers of the model. Atlas systematically reduces bias by scaling attention scores in these layers without degrading model performance. Experimental results highlight the efficacy of this approach. However, it is not without limitations. Atlas is designed for the comparative prompting framework with two entities. Determining the scaling factor requires many inference calls, proportional to the number of layers being edited. Given the computational costs associated with the experiments, we are unable to perform every experiment discussed with all models.

Disclaimer: Each of the datasets we use have their own framework for measuring bias and these measures do not perfectly align with our end goal of reducing the bias ratio (especially since we perform edits to the prompt formats in these datasets before utilizing them). Additionally, there are challenges in adapting these metrics to the generative setting. For example, BBQ’s bias score metric for the ambiguous and disambiguous setting assumes a model can pick among explicit options—candidate A, candidate B, or “do not know”; this works well for embedding classification models but does not directly translate to generative models. Generative models lack a predefined “do not know” option; attempts to approximate this would yield incorrect conclusions. We could use our own definition of “do not know” (e.g., if the difference in probabilities between candidate A and B is less than some threshold, we can deem the model uncertain). But this would diverge from BBQ’s original metric and favor our Atlas method by design, as Atlas reduces this probability gap and would yield results similar to the metric we defined in this paper.

## Appendix

## Appendix A Attention distribution at the last token across layers for entities

Figure: Figure 5: Attention distribution at the last token across layers for entities
Refer to caption: extracted/5963675/images/Combined_plot_large.png

## Appendix B Detailed Experimental Setup

Datasets: For our evaluations, we utilize three datasets designed to assess model bias across various social and demographic categories. They include:

- 1.
BBQ (Bias Benchmark for Question Answering): This dataset (Parrish et al., ) contains 58,492 samples related to eleven demographic categories, such as age, gender identity, nationality, physical appearance, and race/ethnicity. Each sample/query involves two entities, and the model must choose between them.
- 2.
CrowS-Pairs: CrowS-Pairs (Nangia et al., ) has 1508 samples that cover stereotypes dealing with 9 types of bias related to attributes like race, religion, and age etc. Each sample in the dataset consists of two sentences: one that is more stereotypical and another that is less stereotypical by simply changing the main entity in the sentence. We convert this dataset into a QA task for our needs. An example of the modified prompt is shown below:
Example Prompt:
Context ($\mathcal{C}$): [MASK] can’t really be loyal Americans.
Question ($\mathcal{Q}$): Which word should replace [MASK]: Catholics or Protestants?
- 3.
WinoGender: WinoGender (Rudinger et al., ) is designed to test gender bias in co-reference resolution with 121 samples in a templatized format. The dataset consists of sentences where gender references must be resolved, but the model’s inherent bias can lead to incorrect gender assignments. We modify this dataset as well for our requirements. An example of the modified prompt is shown below:
Example Prompt:
Context ($\mathcal{C}$): The doctor told the patient that [MASK] would be on vacation next week.
Question ($\mathcal{Q}$):Which word should replace [MASK]: he or she?

We test Atlas on over 11227 different prompts using these datatsets. For CrowS-Pairs and WinoGender we test on the entire dataset. For BBQ, we use 1000 prompts for each of the eleven categories in the dataset unless they contain fewer than 1000 prompts.

Models: We evaluate four models in our experiments: GPT-J (6B parameters), GPT-2 XL (1.5B parameters), LLaMA 2 (7B parameters) (Touvron et al., ), and LLaMA 3 (8B parameters) (Dubey et al., ). For each model, we use greedy decoding and consider the full set of transformer layers: GPT-J has 28 layers, GPT-2 XL has 48 layers, LLaMA 2 has 32 layers, and LLaMA 3 has 32 layers.

Compute Environment: All experiments were run on NVIDIA A100-SXM4-80GB GPUs with the Ubuntu 22.04.5 LTS operating system.

## Appendix C More details about ATLAS

### C.1 More details about Attention Localization

Cost of the Approach: This method of localizing bias by analyzing attention scores involves one inference pass. During this pass, the generation is used to identify the higher probability candidate $C_{i^{*}}$ while also collecting the attention scores at every layer. This allows us to calculate $\bar{\alpha}^{(\ell)}(C_{i^{*}})$, and identify the top-$k$ bias-contributing layers without requiring any additional forward passes.

Another popular method to localize information in LLMs is using causal-tracing (Meng et al., ). This approach involves several runs with corrupted and restored activations across each node in each layer of the model (one inference pass is needed per node during restoration phase) to first localize information. In contrast, our methodology only requires access to the attention scores at the last token, thus making the computational costs substantially lower compared to causal-tracing methods.

### C.2 More details about the applied intervention

Why Scaling? We chose to scale attention scores rather than introducing random perturbations or other (drastic) modifications to preserve the model’s internal decision-making integrity (evaluated in § 6.3). This intervention is straightforward, and works by reducing the representation of the candidate that is over-represented or assigned a higher probability by the model and doing so directly reduces the bias ratio. Another key advantage of scaling is that it does not require access to the model’s weights, specifically the $\mathbf{Q}$, $\mathbf{K}$, and $\mathbf{V}$ matrices. Instead, we only need access to the attention scores matrix $\mathbf{A}^{(\ell,h)}$, making Atlas easier to implement and less intrusive (in terms of model modifications). Finally, scaling also has the advantage of being computationally inexpensive.

### C.3 Absence of Monotonic Behaviors with Scaling

Figure: Figure 6: Greedy search for finding optimal scaling factors on GPT-J for the prompt shown below.
Refer to caption: extracted/5963675/images/bias_ratio_vs_scaling_factor.png

Explanation of the search: We start our greedy search at layer 19 starting with $\lambda$ = 1 and decrease it in decrements of 0.1. One needs to visualize this as moving from right to left on this plot. Once we find 0.01 as the optimal value of $\lambda$ for layer 19, we move on to the next layer we localized (In this case layer 21). We again start with $\lambda$ = 1 and start reducing it in decrements of 0.1. Since bias ratio starts to increase once we go beyond $\lambda$ = 0.6 (notice that bias ratio is very close to 1 and thus flips when we reduce $\lambda$ further), we end our greedy search.

## Appendix D PASTA Implementation Details

Setup: In our setup, we use task-agnostic and task specific attention heads directly to redistribute the model’s focus towards the token with the lower bias probability, aiming to balance the attention across entities in a manner that improves the bias score. The scaling coefficient $\alpha$ controls the extent of attention re-weighting for the identified attention heads. It determines the strength of influence exerted by these heads on the target tokens, allowing fine-grained adjustments to the model’s focus during generation. While the authors state that PASTA is not sensitive to the scaling coefficient $\alpha$, we observed that performance can indeed depend on it, likely due to applying too much or too little emphasis on the lower probability token. To address this, we performed a search for the best IEBS score, testing different values of $\alpha$ in $\{0.01,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0\}$, and report the best scores in Table 2.

## Appendix E Additional Experimental Results

### E.1 Prompting Baseline

We also explored prompting the model with a fairness persona (Tseng et al., ) which has been shown to improve scores on various tasks. Specifically, we add the following to the prompt: ”You are a judge who embodies fairness, impartiality, and is not biased.”. Our results, as shown in Table 4 demonstrate that using this persona results in marginal improvements, but usng it along with Atlas produced significant gains!

**Table 4: Increase in EBS for GPT-J using only a persona-based prompt vs Atlas vs using Atlas + persona with respect to the base model for BBQ.**
| Bias Category | GPT-J |  |  |
| --- | --- | --- | --- |
| $\Delta\text{EBS}_{\text{Persona}}$ | $\Delta\text{EBS}_{\textsc{Atlas}}$ | $\Delta\text{EBS}_{\textsc{Atlas}+\text{persona}}$ |  |
| Age | 0.038 | 0.437 | 0.485 |
| Disability Status | 0.000 | 0.166 | 0.215 |
| Gender Identity | 0.044 | 0.375 | 0.435 |
| Nationality | 0.025 | 0.371 | 0.378 |
| Physical Appearance | 0.011 | 0.314 | 0.330 |
| Race/Ethnicity | 0.015 | 0.317 | 0.363 |
| Race/Gender | 0.029 | 0.279 | 0.349 |
| Race/SES | 0.021 | 0.254 | 0.270 |
| Religion | 0.003 | 0.151 | 0.181 |
| Sexual Orientation | 0.037 | 0.221 | 0.298 |
| SES | 0.006 | 0.354 | 0.379 |

### E.2 LASER Baseline

**Table 5: Increase in EBS for GPT-J using LASER vs using Atlas with respect to the base model for BBQ.**
| Bias Category | GPT-J |  |
| --- | --- | --- |
| $\Delta\text{EBS}_{\text{LASER}}$ | $\Delta\text{EBS}_{\textsc{Atlas}}$ |  |
| Age | 0.001 | 0.437 |
| Disability Status | 0.002 | 0.166 |
| Gender Identity | 0.009 | 0.375 |
| Nationality | 0.011 | 0.371 |
| Physical Appearance | 0.028 | 0.314 |
| Race/Ethnicity | 0.003 | 0.317 |
| Race/Gender | 0.010 | 0.279 |
| Race/SES | 0.006 | 0.254 |
| Religion | 0.004 | 0.151 |
| Sexual Orientation | 0.005 | 0.221 |
| SES | 0.004 | 0.354 |

We experimented with LASER (Sharma et al., ), which involves the rank reduction of weight matrices. The core idea behind LASER is to reduce higher-order components of the weight matrices in specific layers of the transformer, which can lead to improvements in the model’s performance on tasks without introducing new parameters or requiring further training. We consider this approach as a baseline as Sharma et al. () demonstrate that LASER reduces biases in the model’s output, but for different datasets. Additionally, this method is computationally efficient, making it a feasible option for large scale models without extensive retraining.

Observations: Our findings, based on the results in Table 5, indicate that applying LASER led to very minimal improvements.The improvements are not substantial and this highlights the limitations of rank reduction approaches in addressing bias in the comparative prompt framework. One hypothesis here is that while LASER constitutes and effective technique for denoising information stored in MLP layers and improving factuality for QA scenarios, its interventions do not necessarily manage the information transferred from constraint tokens (subject to bias) to generations.

Setup: For each layer where bias was identified, we applied LASER by reducing the rank of the weight matrices in both MLP and Attention blocks both individually and combined. Specifically, for each biased layer $\ell$, we decomposed the weight matrix $W^{(\ell)}$ into its singular value decomposition (SVD) components as $W^{(\ell)}=U\Sigma V^{\top}$. We retained only the largest $r$ singular values by replacing $\Sigma$ with its rank-$r$ approximation. We tested various rank reduction factors $\rho\in[0.01,0.9]$ to examine the effect on bias mitigation.

### E.3 Varying Inference Time Parameters

Figure: Figure 7: Atlas, in conjunction with inference-time parameter variation reduces biased generations. Across both sub-figures, a large count difference is indicated by darker colored spheres (with specific count differences also written atop the spheres). Notice that once Atlas is applied, the right sub-figure has fewer darker spheres. This suggests that Atlas, in conjunction with inference-time parameter variation enables more balanced generations.
Refer to caption: extracted/5963675/images/Combined_plot_randomnessparams.png

Motivation: To assess the effect of our intervention on the generated output, we varied inference time parameters including temperature, top-$p$, and top-$k$(^3^33The term ”top-$k$” here refers to the inference parameter and is different from the top-$k$ layers mentioned earlier in the context of bias localization.). These parameters control the diversity and randomness of the generated text, which in turn influence model behavior. By evaluating these parameters, we aim to understand the effect of Atlas across different inference settings, as models can exhibit more or less bias depending on how they sample from the output probability distribution.

Methodology: We perform the experiment in the space spanning the following values for each parameter: temperature = $[0.2,0.8,1.4]$, top-$p$ = $[0.3,0.8,0.95]$, and top-$k$ = $[5,30,80]$ for the GPT-J model and the BBQ dataset (specifically samples related to the age bias category). By systematically varying these parameters, we aim to assess how our intervention impacts model generations across different sampling parameter sets. For each combination of these parameters (27 in total), we computed the absolute difference between number of times the model selected each of candidates in the generated outputs ($|\text{count}(C_{1})-\text{count}(C_{2})|$) averaged across prompts, before and after applying the intervention. Specifically, for each parameter triplet (temperature, top-$p$, top-$k$), we run inference 15 different times to obtain these counts.

Observations: As illustrated in Figure 7, the pre-intervention model generally shows larger count differences, indicating a strong bias towards one candidate. After using Atlas, these differences on an average are reduced (15 out of 27 cases), demonstrating that the model becomes more balanced in its candidate selections. However, this is not unilateral: there is a fraction where the counts do increase (6 out of 27 cases).

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Can the proposed method generalize to the settings where tokens corresponding to candidates are unknown or absent in the text? If not, is there any implication on the more general settings?
2. When the model's output requires the information of candidates in more nuanced ways, would the model still work?
soundness: 3
strengths: This paper tackles the important challenge of mitigating bias and stereotypes in large language models. The proposed approach is simple, lightweight, and intuitive, yet it proves to be highly effective in the evaluated setting.
summary: This paper introduces a simple and straightforward method for localizing and mitigating bias in large language models. The approach focuses on the attention scores associated with specific target words, allowing us to identify the layers where intervention is most effective. By scaling down the attention on these target words in the identified layers, the method can effectively reduce bias. Experimental results demonstrate that the proposed method significantly improves bias scores compared to baseline approaches.
weaknesses: The setting explored in this paper is overly simplistic and may not reflect real-world scenarios. It is uncertain how the proposed method would generalize to more practical settings. For instance: (1) candidates may not be explicitly annotated or may even be absent in the text; (2) biased or stereotypical outputs may be more implicit than those examined; and (3) the model’s outputs can depend on candidates in more nuanced ways so suppressing attention may hurts this dependency modeling.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 2
questions: 1. The introduction of the attention mechanism in section 2 should be polished, there are some errors that should be carefully addressed. 

2. Since this work focuses on comparative prompts, one factor that shall not be ignored is the oder of the two entities, the paper should add results when the two entities are swapped. Moreover, I think it would be more useful to report the average results of the two different orders.

3. For approach 1 in line 269, would not the absolute value be adopted?

4. In table 3, you reported the change ratio of the entity with the higher prob. I believe it would be better to report the ratio of each entity that is preferred to gain better insights on to what extend the bias issue is resolved.
soundness: 3
strengths: 1. The paper studies one important problem, the findings presented might be of interest to a large number of audiences.

2. Analyzing the internal mechanisms of how biases emerges in LLMs seem novel.

3. The proposed approach seems to be effective according to the experimental results.
summary: This paper presents Atlas, a two-step approach to identifying and mitigating biases in LLMs when responding to ambiguous comparative prompts (i.e. asking the LLM to select one from two entities). The proposed approach first localizes the layers of transformers that contribute the most to biases, then reduces biases by scaling attention scores in these layers corresponding to tokens of entities. The paper shows that the proposed approach can effectively reduces biases while maintaining performance.
weaknesses: 1. The motivation shall be stronger. Figure 1 only shows which layers obtain higher attention scores for entities instead of which entity will be biased. For example, some layers would assign more weights to "grandson" while others would assign more weights to "grandfather".

2. For one entities, the paper only considers the first token of the entity for attention score computation, which might be problematic when the first token of two entities are the same (e.g., grand for grandson and grandfather).

3. While the intervention approach of scaling attention is straightforward, the sum of all attention weights will become less than 1. 

4. The method needs to determine the scaling factor \lambda for each prompt, which makes it not quite usable in practice. Overall, it is hard to guarantee the LLM to generate unbiased output in general use cases. 

5. The experiments should include larger models such as Llama-70B.

6. The paper only considers two baselines, given that there are so many papers on mitigating llms' biases, more baselines results should be reported to better show the significance of the proposed approach.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Could the authors provide a more detailed analysis of their choice of Approach 2? For instance, it would be helpful to compare the two approaches in terms of bias reduction, computational efficiency, and impact on model performance.
2. I would like the authors to elaborate on whether their method has the potential for extension to other bias scenarios, such as biases involving multiple entities. If so, how could this method be adapted to address these additional scenarios?
soundness: 3
strengths: 1. This paper focuses on the internal bias in LLMs, which is a significant area of research.
2. This paper identifies bias by analyzing attention weights, which is reasonable.
3. Experiments demonstrate the effectiveness of the proposed methods.
summary: The paper presents a novel approach for identifying and reducing bias in LLMs when faced with ambiguous comparative prompts. The authors argue that bias often emerges due to how the attention mechanism distributes focus among entities, particularly in the later layers of the model. By analyzing attention scores, they localize biased behavior to specific layers and apply targeted interventions to mitigate bias without significantly affecting model performance. Experiments conducted across multiple datasets demonstrate that ATLAS effectively reduces bias while maintaining fluency in the model's responses.
weaknesses: 1. The paper proposes two approaches: using the difference and using the most probable candidate. While the authors select Approach 2, they do not provide a detailed analysis of why it is superior to Approach 1.
2. The paper focuses solely on comparative biases between two entities, which limits the research scope considerably. Focusing on comparative biases may overlook the complex interactions and potential biases that arise among multiple entities. For instance, many real-world scenarios involve multiple entities (such as social groups, genders, ethnicities, etc.), where the manifestations of bias can be more intricate and diverse. Simply comparing two entities may fail to capture this complexity.
3. There is a writing error: "Table 4" in line 485 should be corrected to "Table 3."

---

confidence: 3
contribution: 2
initial_rating: 3
presentation: 2
questions: - In terms of top/bottom-k layers, does "k" refer to specific layers (e.g., exactly the k-th layer) or all layers within the range of 1 to k?
- If tokenization affects initial entity tokens (e.g., “grandfather” becomes "grand" + "father"), how is attention managed for variations in token splits like “grandfather” vs. “grandson”?
soundness: 2
strengths: - This paper tackles a critical issue by examining bias at the model level and introduces a new method focusing on attention layers to localize bias, providing insights into where bias might occur within the model.
- ATLAS operates model-agnostic, making it broadly applicable across different LLMs.
summary: The paper addresses the critical issue of bias mitigation within LLMs, particularly examining how biases can emerge internally when processing comparative prompts. The proposed method, Attention-based Targeted Layer Analysis and Scaling (ATLAS), is designed to localize and reduce bias by adjusting attention scores in specific layers. Focusing on model-internal mechanisms rather than data-centric methods, ATLAS offers a model-agnostic approach. The authors present experimental results demonstrating that ATLAS performs effectively according to the newly introduced "bias ratio" metric and maintains fluency as measured by perplexity.
weaknesses: - The approach relies mainly on averaged attention weights, which may miss the complex interactions across tokens and layers, contributing to bias formation. This simplification could limit the method's ability to fully capture nuanced biases embedded in the model.
- The evaluation centers on a newly introduced "bias ratio" metric, which could favor the specific method over more established metrics. The absence of comparisons to state-of-the-art (SOTA) bias mitigation methods and limited ablation studies further restricts a comprehensive evaluation of ATLAS’s effectiveness.
- The binary selection setup constrains the method's applicability to broader, real-world scenarios where decision-making may involve multiple options or more nuanced judgments. This limitation could affect the generalizability of the results to other types of bias.
- Using perplexity to assess response quality may be less effective in this context, as the setting requires only words as an answer rather than full sentences. A different metric that better captures the quality and appropriateness of these shorter outputs could provide more relevant insights into ATLAS’s impact on fluency.