Dual Debiasing: Remove Stereotypes and Keep Factual Gender for Fair Language Modeling and Translation Tomasz Limisiewicz, David Mareček, Tomáš Musil Abstract Mitigation of biases, such as language models’ reliance on gender stereotypes, is a crucial endeavor required for the creation of reliable and useful language technology. The crucial aspect of debiasing is to ensure that the models preserve their versatile capabilities, including their ability to solve language tasks and equitably represent various genders. To address this issue, we introduce streamlined Dual Dabiasing Algorithm through Model Adaptation ( 2DAMA ). Novel Dual Debiasing enables robust reduction of stereotypical bias while preserving desired factual gender information encoded by language models. We show that 2DAMA effectively reduces gender bias in English and is one of the first approaches facilitating the mitigation of stereotypical tendencies in translation. The proposed method’s key advantage is the preservation of factual gender cues, which are useful in a wide range of natural language processing tasks. 1 Introduction Gender representation in large language models (LLMs) has been the topic of significant research effort Stanczak and Augenstein (2021) ; Kotek et al. (2023) . Past studies have predominantly focused on such representation to identify and mitigate social biases. Admittedly, biases are a challenging issue limiting the reliability of LLMs in real-world applications. Yet, we argue that preserving particular types of gender representation is crucial for fairness and knowledge acquisition in language models. the hairdresser Marie Curie she the nurse die Ärztin he the scientist der Arzt they the doctor the doctor Figure 1 : Dual character of gender signals encoded in language models: stereotypical cues are shown on the left, and factual gender cues are shown on the right-hand side. “ Die Ärztin ” and “ der Arzt ” are respectively female and male German translation for “ the doctor ”. To provide a more detailed perspective, we draw examples of both unwanted and beneficial types of gender signals in LLMs. Undesirable biases are typically inherited from stereotypes and imbalances in the training corpora and tend to be further amplified during the model training ( Van Der Wal et al., 2022 ; Gallegos et al., 2024 ) . Biases are manifested in multiple ways, including unequal representation (models are more likely to generate mentions of a specific overrepresented gender), stereotypical associations (particular contexts are associated with one gender based on stereotypical cues, e.g., “ politics and business are male domains ”, while “ family is a female domain ”). It has been shown that, due to bias, LLMs struggle with high-stakes decision-making and are prone to produce discriminatory predictions. Examples of such a sensitive application are the automatic evaluation of CVs and biographical notes ( De-Arteaga et al., 2019 ) , where some professions are stereotypically associated with a specific gender. Therefore, individuals of that gender could benefit from unfair advantage when assessed by an LLM-based evaluator. Nevertheless, LLMs should understand and represent gender signals. For instance, chatbots should be persistent in addressing the user with their preferred gender pronouns after they are revealed Limisiewicz and Mareček (2022) . Adequate representation of gender is also required for knowledge acquisition, for example, in question answering (QA), to correctly answer “ Maria Skłodowska-Curie ” to the question “ Who was the first woman to win a Nobel Prize? ”. Gender sensitivity is even more critical in morphologically rich languages, where gender mentions are much more ubiquitous, e.g., through morphological markings (as in German, Czech, or Russian) Hellinger and Bußmann (2002) . Examples of dual characters of gender encoding are shown in Figure 1 . 1.1 Solution To address these intricate ways gender signals are present in natural language, we introduce a new method 2DAMA that post-hoc modifies pre-trained language models to represent gender in an equitable way, i.e., without stereotypical bias but with factual gender information. The approach leverages recent effective methods for model adaptation Limisiewicz et al. (2024) ; Meng et al. (2022) , and concept erasure Belrose et al. (2023) . As the core contribution, we introduce the novel method of Dual Debiasing that aims at our core problem of decreasing bias while keeping equitable factual gender representation . We present a strong theoretical backing of the effectiveness of our new method 2DAMA in Section 2 . Subsequently, we show the experimental approach in the results for applying the method to the aforementioned case of gender: stereotypical vs. factual (Sections 3 , 4 ). Furthermore, we are the first to mitigate LLMs’ multilingual gender bias manifested in translation from English to three morphologically rich languages, presented in Section 5 . 1.2 Research Questions In the experimental part, we present an extensive analysis of the observed patterns in gender representation in four models and the effect of different design choices in the debiasing approach. The analysis specifically answers the research questions, grouped into four areas: A. How extensive the update of parameters should be to erase gender bias? Can the extent of the update be implicitly learned by the debiasing method? B. To what extent, after debiasing, can we preserve model performance in both gender-related and other tasks? C. What are the similarities and differences in the distribution of two analyzed signals (bias and factual gender) in models’ weights? D. Does 2DAMA generalize to other languages? Is the distribution of bias signal in a model shared across distinct languages? Upon publication of the work, we will release the code and instances of debiasd models. 2 Methodology and Theoretical Background In this section, we introduce Dual Debaising Algorithm through Model Adaptation ( 2DAMA ), a new dual debiasing method. We first describe the 2DAMA ’s intended function, i.e., how it should alter the pre-trained language model, and describe the algorithmic components that efficiently fulfill these aims. Then, we provide theoretical backing for the presented approach. Appendix A contains the proofs and further terminological explanations. 2.1 Motivations for 2DAMA The key idea of debiasing through model adaptation is that we can perform a targeted and efficient parameter change in a model to erase the unwanted signals encoded in it. The main risk of such an approach is that erasing bias can also affect the encoded knowledge. We can draw a specific example of such a tradeoff from gender debiasing. We aim to reduce the models’ reliance on stereotypes in predictions, e.g., given a stereotypical prompt as the one in Figure 3(a) : “ The salesperson laughed because ”, we intend to coerce equitable probabilities of possible gender predictions manifested by pronouns “ he ”, “ she ”, or “ them ”. On the contrary, when considering a prompt containing factual gender information: “ The king laughed because ” the desired output distribution would assign a high probability to the male pronoun. We call the issue mentioned above Dual Debiasing problem. 2DAMA is designed to alter language models to reduce their reliance on stereotypes while maintaining sensitivity to factual gender. 2.2 Composing 2DAMA Approach In practice, 2DAMA leverage on the combination of new ( Dual Debiasing ) and previously introduced algorithms ( DAMA , LEACE ). We shortly describe each of 2DAMA ’s components and the role they fulfill: DAMA Debiasing Algorithm through Model Adaptation Limisiewicz et al. (2024) is a method for adapting parameters of language models to mitigate the encoding of harmful biases without affecting their general performance. The method employs model editing techniques Meng et al. (2022) to disassociate specific signals provided in a prompt with the model outputs, i.e., stereotypes in prompts and gendered output. In this work, we use most of DAMA design choices, such as the adaptation of mid-upper feed-forward layers and algorithm to distill the stereotypical and gender-related parts of the latent representation (as depicted in Figure 3 ). LEACE LEAst-squares Concept Erarsuer ( Belrose et al., 2023 ) is a method of concept erasure (such as bias signal) in latent representation. In Section 2.3 , we show that combining DAMA and LEACE is possible and simplifies model adaptation. The simplification is obtained by replacing the Partial Least Squares concept erasure used in DAMA , which required pre-defining the dimensionality of erased signals. Moreover, in Section 4 , we show that DAMA with LEACE obtain comparable or better results. 2D Dual Debiasing is a new algorithm that we formally introduce in Section 2.4 . The method uses covariance matrix decomposition to identify correlates related to bias and protected feature signals. A concept erasure algorithm (based on LEACE ) is modified to erase bias while preserving protected features, in our case, factual gender. 2.3 Model Adaptation with LEACE LEACE provides guarantees of erasing specific variable (concept Z ) influence on another random variable (signal X ). In the language of neural networks, we can consider latent vectors output by an intermediate layer as a sample drawn from the distribution given by X . LEACE aims to de-correlate latent vectors with an unwanted signal (e.g., gender bias), whose distribution is represented as another random vector Z . Theorem 1 ( LEACE ) . We consider random vectors X and Z taking values in \Real^{n} . Both random vectors are centered, each with a finite moment. Then the objective: \argmin_{\bm{P}\in\Real^{n\times n}}\E\left[||\bm{P}X-X||^{2}\right] subject to: \cov(\bm{P}X,Z)=0 is solved by: \bm{P}^{*}=\Iden-\bm{W}^{\dotplus}\bm{P}_{\bm{W}\bm{\Sigma}}\bm{W}, where \bm{W} is the whitening transformation (\Sigma^{1/2}_{V,V})^{\dotplus} ; \bm{P}_{\bm{W}\bm{\Sigma}} is an orthogonal projection matrix onto colspace of \bm{W}\bm{\Sigma}_{V,Z} . 1 1 1 Notation: ∔ denotes Moonrose-Penrose psuedoinverse. For brevity, we use \bm{\Sigma}_{V,Z} for covariance matrix \cov(V,Z) . The complete terminological note can be found in Appendix A The proof can be found in Belrose et al. (2023) . We extend this theoretical finding to erase the concept in linear transformations instead of latent vectors. We are specifically interested in transformation minimizing the error between input (keys: U ) and predicted variable (values: V ), as depicted in Figure 3(b) . We reasonably assume that dense layers of trained neural networks (e.g., feed-forward layers in Transformer) fulfill this purpose, i.e.: V=\bm{S}U-\epsilon, (1) where \bm{S} is a linear transformation and \epsilon a vector of errors. Due to gradient optimization in the model’s pre-training, we assume that the feed-forward layer approximates the least solution, i.e., FF\approx\bm{S} . Taking this assumption, we can present a theorem guaranteeing concept erasure in the model adaptation algorithm ( DAMA ): Theorem 2 ( DAMA-LEACE ) . We consider random vectors: U taking values in \Real^{m} , V and Z taking values in \Real^{n} , where m\geq n . Under assumptions that: A) random vectors U , V , Z are centered, and each of them has finite moment; B) the regression relation between U and V fulfill the assumption of ordinary least squares, and there exist least squares estimator V=\bm{S}U-\epsilon . Then the objective: \argmin_{\bm{P}\in\Real{n\times m}}\E\left[||\bm{P}U-V||^{2}\right], subject to: \cov(\bm{P}U,Z)=0 is solved by: \bm{P}^{*}=\left(\Iden-\bm{W}^{\dotplus}\bm{P}_{\bm{W}\bm{\Sigma}}\bm{W}\right)\bm{S}, where \bm{W} is the whitening transformation (\Sigma^{1/2}_{\bm{S}U,\bm{S}U})^{\dotplus} ; \bm{P}_{\bm{W}\bm{\Sigma}} is an orthogonal projection matrix onto colspace of \bm{W}\bm{\Sigma}_{\bm{S}U,Z} ; \bm{S} is a least squares estimator of V given U : \bm{S}=\bm{\Sigma}_{U,V}\bm{\Sigma}_{U,U}^{-1} . Based on the theorem and the assumption that FF\approx\bm{S} applying projections would break the correlation between stereotypical keys and gendered values with minimal impact on other correlations stored by the feed-forward layer. We call the algorithm realizing such adaptation in a neural network: DAMA - LEACE . 2 2 2 Noteworthy, Belrose et al. (2023) also proposed using LEACE to alter language model predictions. Yet they applied the algorithm to latent representation instead of altering model parameters as in DAMA - LEACE . 2.4 Dual Debiasing In Dual Debiasing , we extend the concept erasure problem by considering two type signals and corresponding random variables: Z_{b} bias to be erased and Z_{f} feature to be preserved. We posit that: Theorem 3 ( DUAL-DEBIASING ) . We consider random vectors X , Z_{b} , and Z_{f} in \Real^{n} . Under the assumptions that: A) Z_{b} and Z_{f} Z_{b}\perp Z_{f}|X , i.e., Z_{b} and Z_{f} are conditionally independent, given X ; B) \bm{\Sigma}_{X,Z_{b}}\bm{\Sigma}_{X,Z_{f}}^{T} , i.e., the variable X is correlated with Z_{f} and Z_{b} through mutually orthogonal subspaces of \Real^{n} . The solution of the objective: \argmin_{\bm{P}\in\Real^{n\times n}}\E\left[||\bm{P}X-X||^{2}\right], subject to: \cov(\bm{P}X,Z_{b})=0, satisfies: \cov(\bm{P}X,Z_{f})=\cov(X,Z_{f}). The theorem shows that the correlation with the conditionally independent features is left intact by applying LEACE erasure to a bias signal. However, the assumption of conditional independence is strong and unlikely to hold when considering the actual signals encoded in the model. Thus, for practical applications, we need to relax the requirements. In Dual Debiasing , we abandon theoretical guarantees of the theorem to consider bias and feature signals that can be conditionally correlated. In constructing the debiasing projection ( \bm{P}* ), we must decide whether specific dimensions should be nullified or preserved. We propose to nullify dimensions of X with t times higher correlation with Z_{f} than Z_{b} , where the threshold t (later referred to as bias-to-feature threshold ) is empirically chosen. To analyze the correlations we consider correlation matrix \bm{W}\bm{\Sigma}_{X,[Z_{f},Z_{b}]} . By using singular value decomposition, we can identify the share of variance in each column’s first n rows (associated with Z_{f} ) and the latter n rows (associated with Z_{b} ). In modified colspace projection \bm{\tilde{P}}_{\bm{W}\bm{\Sigma}} , we only consider the column with t times higher variance with Z_{f} than with Z_{b} . Thus the final Dual Debiasing LEACE projection \bm{\tilde{P}}^{*}=\left(\Iden-\bm{W}^{\dotplus}\bm{\tilde{P}}_{\bm{W}\bm{\Sigma}}\bm{W}\right) will to large extent preserve the protected feature while reliably erasing bias. In Section 4.2 , we study the impact of feature-to-bias threshold t in practice. 3 Experimental Setting EN: “The salesperson laughed because { he | she }” \text{EN: ``The {\color[rgb]{0.0547,0.5,0.5352}{saleseperson}} is not working today.''}\rightarrow\text{DE: \lx@text@lbrace Der | Die \lx@text@rbrace''} \text{EN: ``That {\color[rgb]{0.0547,0.5,0.5352}{saleseperson}} is not working today.''}\rightarrow\text{CS: \lx@text@lbrace Ten | Ta \lx@text@rbrace''} (a) (b) (c) (d) Figure 3 : Schema (b) shows DAMA intervention in a language model layer. (a) We show the model’s behavior when presented with a stereotypical prompt in three languages. Specifically, (c) shows the projections of the feed-forward latent vector ( \vec{u} ) onto the output space. With DAMA ( lower arrow ), we nullify the gender component of the representation. It results in balanced probabilities of gendered tokens in the model’s output, as shown in (d). Adapted from Limisiewicz et al. (2024) . This section presents an empirical setting to examine the practical application of model editing methods. Specifically, we describe models, data, and evaluation metrics for gender bias and general performance. 3.1 Models In experiments, we focus on Llama family models Touvron et al. (2023) ; Dubey et al. (2024) , which are robust and publically available language models developed by Meta AI. We analyze Llama 2 models of sizes 7 and 13 billion parameters and Llama 3 with 8 billion parameters. In multilingual experiments, we use ALMA-R 13 billion parameter model Xu et al. (2024) . ALMA-R is based on an instance of the Llama 2 model that was fine-tuned to translate using Contrastive Preference Optimization. ALMA-R covers translation between English and five languages (German, Czech, Russian, Icelandic, and Chinese) and shows competitive translation quality results. In model editing experiments, we adapt the layers starting from the one found in the two-thirds of the layer stack counted from the input to the output. It is the 26th layer for 13 billion parameter models and the 21st layer for smaller models. For example, the adaptation of 11 mid-upper layers in the 13B model modifies the layers from 26th through 37th. 3.2 Data for Dual Debiasing Following Limisiewicz et al. (2024) , we feed prompts to the model in order to obtain the latent embeddings in the input of latent layers. We treat these embeddings as key vectors ( U ) containing stereotypical or factual gender signals. To obtain the gendered value vectors ( V ), we find the layer’s output vector that would maximize the probability of predicting tokens corresponding to gender. Language Modeling Prompts For debiasing language models, we use solely English prompts. We design 11 prompt templates, such as “ The X laughed because ___ ”, where “ X ” should be replaced by profession name. This prompt construction provokes the model to predict one of the gendered pronouns (“ he ”, “ she ”, or “ them ”). To distinguish stereotypical signals for debiasing, we use 219 professions without factual gender that were annotated as stereotypically associated with one of the genders by Bolukbasi et al. (2016) . Multilingual Prompts For debiasing machine translation, we use prompts instructing the model to translate sentences containing the same set of 219 professions to a target language that has the grammatical marking of gender, e.g., “ English: The X is there. German: ___ ”. The translation model would naturally predict one of the German determiners, which denotes gender (“ Der ” for male or “ Die ” for female). For each model, we adjust the template to include instructions suggested by the model’s authors. We construct the translation prompts for two target languages, Czech and German, proposing 11 templates for each. Factual Prompts Dual debiasing requires using factual prompts to identify the signal to be preserved. For that purpose, we use the same prompt templates as defined above (both English and multilingual) with the distinction of entities used to populate them. For that purpose, we propose 13 pairs of factually male and female entities, e.g., “ king ” – “ queen ”, “ chairman ” – “ chairwoman ”. The examples of language modeling and multilingual prompts are given in Figure 3(a) . We list all of the prompt templates in Appendix B 3.3 Bias Evaluation Language Modeling We assess the bias in language generation following the methodology of Limisiewicz et al. (2024) . From the dataset of Bolukbasi et al. (2016) , we select the held-out set of professions that were not included in the 219 used for debiasing. Each profession was assigned two scores: factual score x_{f} and stereotypical score x_{s} . The scores define how strongly a word (or a prompt) is connected with the male or female gender, respectively, through factual or stereotypical cues. By convention, scores range from -1 for female-associated words to 1 for male ones. We measure the probabilities for gendered prediction for a given prompt P_{M}(o|X) . For that purpose, we use pronouns o_{+}=\text{``he''} and o_{-}=\text{``she''} , as they are probable continuations for given prompts. Subsequently for each prompt, we compute empirical score y=P_{M}(o_{+}|X)-P_{M}(o_{-}|X) . To estimate the relationship between the observed score and annotated ones x_{s} and x_{f} , we construct a linear model: y=a_{s}\cdot x_{s}+a_{f}\cdot x_{f}+b_{0} (2) The linear fit coefficients have the following interpretations: a_{s} is an impact of stereotypical signal on the model’s predictions; a_{f} is an impact of the factual gender of the word. Noticeably, y , x_{s} , and x_{f} take the values in the same range. The slope coefficient tells how shifts in annotated scores across professions impact the difference in prediction probabilities of male and female pronouns. The intercept b_{0} measures how much more probable the male pronouns are than the female pronouns when we marginalize the subject. Bias in LM WinoBias \downarrow a_{s} \uparrow a_{f} \downarrow b \downarrow \Delta S \downarrow \Delta G Llama 2 7B 0.234 0.311 0.090 33.6 7.3 DAMA 0.144 0.205 0.032 27.3 6.8 DAMA+LEACE 0.118 0.171 0.028 22.9 5.4 2DAMA 0.128 0.187 0.042 22.9 5.7 Llama 2 13B 0.244 0.322 0.097 35.0 0.3 DAMA 0.099 0.160 0.030 26.4 2.4 DAMA+LEACE 0.098 0.159 0.026 26.5 2.4 2DAMA 0.119 0.206 0.023 27.0 1.9 Llama 3 8B 0.262 0.333 0.082 36.8 2.7 DAMA 0.069 0.090 0.144 20.3 4.2 DAMA+LEACE 0.084 0.157 0.082 18.8 2.7 2DAMA 0.140 0.209 0.051 18.7 2.4 Table 1 : Bias evaluation for the Llama family models, and their adaptation with different debiasing algorithms ( DAMA , DAMA with LEACE , and 2DAMA ). The debiasing adaptation was applied to 12 mid-upper layers for the 13B model and 9 mid-upper layers for the smaller ones. In 2DAMA , we set bias-to-feature threshold to t=0.05 . Other Bias Manifestations in English We evaluate the bias in coreference resolution based on WinoBias dataset ( Zhao et al., 2018 ) . We use metrics \Delta G and \Delta S to evaluate representational and stereotypical bias, respectively. \Delta G measures the difference in coreference identification correctness (accuracy) between masculine and feminine entities; similarly, \Delta S measures the difference in accuracy between pro-stereotypical and anti-stereotypical instances of gender role assignments. LM ARC \downarrow ppl \uparrow acc (C) \uparrow acc (E) Llama 2 7B 21.28 70.2 42.5 DAMA 21.51 69.8 42.8 DAMA+LEACE 23.81 68.3 41.2 2DAMA 23.66 67.5 42.0 Llama 2 13B 19.68 72.6 46.8 DAMA 18.94 71.6 45.0 DAMA+LEACE 19.67 71.3 46.4 2DAMA 19.90 71.2 46.1 Llama 3 8B - 67.1 39.9 DAMA - 64.6 38.1 DAMA+LEACE - 63.0 39.8 2DAMA - 63.5 37.9 Table 2 : General performance in language modeling and reasoning on ARC C halange and E asy subset. We present results for Llama family models, and their adaptation with different debiasing algorithms ( DAMA , DAMA with LEACE , and 2DAMA ). We do not present perplexity for Llama 3 because the model has different vocabulary and the results are not comparable. The hyperparameters are the same as in Table 1 Translation ( Stanovsky et al., 2019 ) proposed using Winograd Challenge sentences for evaluating bias in translation from English into eight languages with morphological marking of gender (e.g., German, Spanish, Russian, Hebrew). In WinoMT , the correctness of the translation is computed by the F1 score of correctly generating gender inflection of profession words in the target language. The evaluation of gender bias is analogical, as in WinoBias. \Delta G and \Delta S measure the difference in F1 scores: male vs. female and pro- vs. anti-stereotypical sets of professions, respectively. The more recent BUG Levy et al. (2021) dataset is based on the same principle of bias evaluation, with the distinction that it contains naturally occurring sentences instead of generic templates used in WinoMT. 3.4 General Performance Evaluation Language Modeling We evaluate perplexity on general domain texts from Wikipedia-103 corpus ( Merity et al., 2016 ) . Reasoning Endtask To assess the models’ reasoning capabilities, we compute accuracy on AI2 Reasoning Challenge (ARC) ( Clark et al., 2018 ) in both easy and challenging subsets. Translation To monitor the effect of debiasing on translation quality, we evaluate models on WMT-22 ( Kocmi et al., 2020 ) parallel corpora with German, Czech, and Russian sentences and their translations in English. We estimate the quality by two automatic metrics: COMET-22 Rei et al. (2022) and chrf Popović (2015) . Figure 4 : Visualization of dimensions and their variances related to stereotypical and factual gender signals identified by Dual Debiasing algorithm in 26th layer of Llama 2 13B. The red dots denote the bias-to-feature threshold t=0.05 . In 2DAMA , the dimension is preserved if stereotypical covariance is below the threshold. 4 Debiasing Language Models In the first batch of the experiments, we evaluate the effectiveness of debiasing language models with model editing. In these experiments, we solely focus on tasks in English. We specifically analyze three model editing approaches: DAMA as a baseline; DAMA in combination with LEACE ; and 2DAMA , which employs Dual Debiasing to preserve factual gender information. 4.1 Main Results Model editing reduces bias and preserves the model’s performance. All of the considered methods reduce gender bias both in language modeling and coreference resolution (Table 1 ). Remarkably, we observe that the model’s overall performance, i.e., unrelated to gender, is not significantly affected, as demonstrated by perplexity and question-answering results (Table 2 ). Relatively worse performance preservation was observed for Llama 3, which could be caused by intervening in too many layers. Layer Bias Dimesnions Variance Erased Erased Preserved Bias Factual 26 712 12 99.6% 69.4% 27 774 18 99.4% 64.0% 28 782 22 99.0% 62.4% 29 750 17 99.5% 65.4% 30 713 19 99.5% 64.0% 31 304 12 99.3% 57.6% 32 387 16 99.2% 57.0% 33 469 17 99.2% 60.1% 34 716 21 99.2% 61.3% 35 621 18 99.2% 62.2% 36 406 20 98.9% 54.0% 37 409 18 99.1% 57.2% Table 3: Number of erased and preserved orthogonal dimensions with 2DAMA in each feed-forward layer. We call a dimension “ biased ” when it belongs to col-space spanned by covariance matrix between latent representation and bias signal ( \bm{W}\bm{\Sigma}_{\bm{S}U,Z} ). We present the percentage of erased covariance with stereotypical bias and factual gender as the result of the intervention in the layers. The bias-to-feature threshold was set at t=0.05 . Streamlining the approach with LEACE . We observe that DAMA - LEACE reduces bias to a larger extent than baseline DAMA . The more substantial debiasing effect comes in pair with a slightly higher drop in general performance, as shown in Table 2 . Yet, the deterioration is still insignificant compared to the original models’ scores. The crucial benefit of DAMA - LEACE is that projection dimensionality does not need to be pre-defined because it is learned implicitly (details in Section 2.3 ). 3 3 3 In baseline DAMA , the projection dimensionality is pre-set to d=256 for the 7B model and d=512 for the 13B models. That motivates us to use DAMA - LEACE in further experiments. (a) Bias-to-feature threshold fixed at 0.05 (b) Number of layers fixed at 12 Figure 5 : The hyperparameter analysis for 2DAMA applied to Llama 2 13B model on performance and bias in language modeling. We measured bias on gendered prompts by linear coefficients: a_{s} and a_{f} , the language modeling capabilities are measured by perplexity. Stars mark the performance of the best setting. The dashed line corresponds to the scores of the original model. Preserving factual gender with Dual Debiasing . The coefficients a_{s} and a_{f} from Table 1 indicate how much the models’ prediction is affected by gender present through stereotypical and factual cues, respectively. We see that 2DAMA enables, to a significant extent, preserving factual gender information with a slight increase in susceptibility to gender bias. In the remainder of this Section, we describe the relationship between stereotype and factual gender encoding in the model and the role of parameter choice in 2DAMA . 4.2 Relationship between Seterotypical and Factual Signals With Dual Debiasing , we can analyze the covariance of the latent orthogonal dimensions in the model’s feed-forward layers with the stereotypical and factual signals (as detailed in Section 2.4 ). In Figure 4 , we plot these covariances for each dimension. The visualization reveals that the factual gender is represented by relatively few dimensions with high covariance. In contrast, stereotypical bias is encoded in more-dimensional subspaces, yet each dimension has low covariance. In Table 3 , we demonstrate that in 2DAMA with low bias-to-feature threshold t=0.05 preserves only a few dimensions responsible for stereotypical bias in each layer. Such intervention in the model erases \approx 99\% of covariance with a stereotypical signal while keeping over 30\% of covariance with a factual gender signal. 4.3 Choice of Hyperparameters We present the impact of two parameters on the effectiveness of 2DAMA in Figure 5 . The first is the bias-to-feature threshold t . We observe that its choice controls the trade-off between mitigating bias and preserving factual information. We set it a low value of 0.05 because our primary objective is the reduction of bias. The second hyperparameter is the number of layers that should be edited. We confirm the findings of Limisiewicz et al. (2024) that adaptation should applied to approximately one-third of the midd-upper layers. Notably, the top two layers (38th and 39th) should be left out. 5 Beyond English: Multilingual Debiasing In a multilingual setting, we debias a model fine-tuned for translation: ALMA-R 13B Xu et al. (2024) by employing the collection of the new multilingual debiasing prompts. We specifically focus on gender bias and quality of translation between English and Czech, German, and Russian. 5.1 Main Results Model editing generalizes to the multilingual settings. Analogically to experiments in English, we show that model editing reduces bias in translation and has a mediocre impact on the translation quality (as shown in Table 4 ). We observe some differences in results between the two analyzed languages. Overall, the scores after debiasing are better for German than Czech, indicating that German prompts are better quality. Language Translation to English Translation from English WinoMT BUG \uparrow comet \uparrow chrf \uparrow comet \uparrow chrf \downarrow \Delta S \downarrow \Delta G \downarrow \Delta S \downarrow \Delta G German ALMA-R 13B 85.0 57.0 86.7 58.1 30.5 3.7 7.8 32.5 DAMA+LEACE 85.0 56.7 85.3 55.4 20.5 10.0 5.4 33.6 2DAMA ( t=0.05 ) 84.9 56.7 85.1 54.8 22.6 3.3 4.4 27.8 2DAMA ( t=1.00 ) 84.9 56.6 85.4 55.4 22.1 -10.1 7.7 28.4 Czech ALMA-R 13B 87.0 68.6 89.7 53.8 26.3 2.1 11.7 9.2 DAMA+LEACE 86.9 68.2 88.6 50.1 21.6 17.7 10.4 18.0 2DAMA ( t=0.05 ) 86.9 68.1 88.5 49.9 18.0 14.6 4.5 11.0 2DAMA ( t=1.00 ) 86.9 68.1 88.8 50.4 22.4 7.2 8.6 9.8 Table 4 : Evaluation of gender bias and quality of translation. In all the methods, ALMA-R was used as the base model. Adaptations were applied to 11 mid-upper feed-forward layers. Translation quality was evaluated on the WMT-22 dataset. Prompt Lang. \downarrow German Czech Russian \emptyset 3.7 2.1 25.7 English 11.1 7.9 31.4 German 3.3 21.6 31.3 Czech 6.2 14.6 32.0 All Above 8.1 23.2 33.4 (a) Representational bias ( \Delta G ) Prompt Lang. \downarrow German Czech Russian \emptyset 30.5 26.3 10.2 English 28.5 21.2 7.0 German 14.4 15.1 4.0 Czech 24.3 17.2 3.9 All Above 24.0 18.7 1.3 (b) Stereotypical bias ( \Delta S ) Table 5 : Bias evaluation based on WinoMT challenge-set. The evaluation language is shown at the top of each column. Each row corresponds to a set of languages for which prompts were used in model adaptation. The debiasing adaptation was performed with 2DAMA on 11 mid-upper layers with the bias-to-feature threshold set to t=0.05 . Dual Debiasing is required to mitigate representational bias. Our methods are more effective for the stereotypical manifestation of bias \Delta S than the representational one \Delta G . In the representational bias, we sometimes observe bias increase after model editing. To remedy that, we use 2DAMA with higher values of feature-to-bias threshold ( t=1.00 instead of t=0.05 ), which tends to preserve more factual signal. Factual gender understanding is especially essential for equitable representation of factual gender in morphologically rich languages, as evidenced by \Delta G scores for t=1.00 setting. This finding emphasizes the utility of 2DAMA in a multilingual setting. The extended study of hyperparameters in translation debiasing is presented in Appendix C . 5.2 Cross-lingual Debiasing An intriguing question of multilingual bias is whether its encoding is shared across languages Gonen et al. (2022) . We test this hypothesis by editing models with prompts in one or multiple languages and testing on another language. The results show evidence of effectiveness in cross-lingual mitigation of stereotypical gender bias. In Table 5(b) , we observe that some languages are more effective in debiasing than others, e.g., German prompts offer the strongest \Delta S reduction for both Czech and German. Whereas to control representational bias mitigation ( \Delta G ), it is recommended to use in-language prompts, as indicated by Czech, German, and Russian results in Table 5(a) . 6 Related Work We refer to the related work grouped into three areas. 6.1 Model Editing and Concept Erasure Model editing is a method of applying targeted changes to the parameters of the models to modify information encoded in them. Notable examples of model editing include targeted changes in the model’s weight Mitchell et al. (2022) ; Meng et al. (2023) ; Meng et al. (2022) or adaptation with added modules (adapters) Houlsby et al. (2019) ; Hu et al. (2022) . The technique showed promising results as the tool to erase specific information Patil et al. (2024) . In the literature, bias mitigation was perceived as a theoretically interesting and practical application for concept erasure. Ravfogel et al. (2020) ; Ravfogel et al. (2022) ; Belrose et al. (2023) proposed effective linear methods of erasing gender bias from the latent representation of language models. Other approaches aimed to edit pre-trained language models to reduce their reliance on stereotypes. They include: causal intervention ( Vig et al., 2020 ) , model adapters ( Fu et al., 2022 ) , or targeted weight editing Limisiewicz et al. (2024) . As the name indicates, 2DAMA primarily builds on the last method. 6.2 Debiasing Machine Translation Machine translation systems have been shown to exhibit gender bias in their predictions Savoldi et al. (2021) . The problem is especially severe in translation from languages that do not grammatically mark gender (e.g., English, Finish) to ones that do (e.g., German, Czech, Spanish) because translation requires predicting gender, which is not indicated in the reference Stanovsky et al. (2019) . There have been a few past attempts to mitigate biases in translation systems ( Saunders and Byrne, 2020 ; Iluz et al., 2023 ; Zmigrod et al., 2019 ) . Nevertheless, these approaches are based on fine-tuning for non-stereotypical sentences, which increases the model’s specialization but significantly reduces usability, e.g., in tasks unrelated to gender ( Luo et al., 2023 ) . One key constraint of multilingual debiasing is the scarcity of bias annotations in various languages. Notable datasets were introduced by Levy et al. (2021) ; Névéol et al. (2022) . The difficulty of obtaining reliable cross-lingual bias resources stems from the need for deep knowledge of culture in addition to understanding a language. For instance, in different cultures, the same mentions tend to be associated with distinct sets of stereotypes: the word “ doctor ” in English is strongly associated with the male gender due to the overrepresentation of men in this profession in the US and the UK. While in many Slavic and Baltic languages, the “ doctor ’’s are to a lesser extent biased or even associated with the female gender, due to the higher proportion of women in medical professions. 4 4 4 According to OECD (2023) : in 2021, women made up over 70% of medical doctor numbers in Lithuania, Latvia, and Estonia, while only 36% in the US . To the best of our knowledge, we are the first to propose a method for debiasing LLM in machine translation tasks. 6.3 Controlled Debiasing Sound practice in model debiasing involves carefully monitoring performance in bias-unrelated tasks and diverse manifestations of bias. The former aspect is needed for the reliability and usefulness of the models after debiasing. The latter’s importance is highlighted by the observations that different bias metrics are mutually weakly or even negatively correlated ( Delobelle et al., 2022 ; van der Wal et al., 2024 ) , raising the need for holistic evaluation. The aspect of preserving useful features correlated with bias is especially underresearched. A noteworthy study of interactions between factual gender and gender bias was conducted by Limisiewicz and Mareček (2022) . To our knowledge, we are the first to show that keeping factual gender can help mitigate diverse types of bias. 7 Disussion and Conclusion We highlight the importance of considering the dual character of gender encoding in model editing. Our theoretical and empirical results show that the novel model editing methods: 2DAMA effectively reduces the impact of stereotypical bias on the predictions while preserving equitable representation of (factual) gender based on grammar and semantics. Maintaining the factual component of gender representation is crucial for debiasing in languages other than English, which denote gender more ubiquitously. Furthermore, our method does not significantly deteriorate the high performance of LLMs in various evaluation settings unrelated to gender. To answer the research questions. The results show that novel 2DAMA is an effective debiasing method that can implicitly learn the extent (dimensionality) of bias signals (re: A). Thus, it is easier to apply to new models. Specifically, we do not require setting the number of erased bias dimensions in latent space thanks to changing the underlying erasure to LEACE . Furthermore, our method has minimal impact on gender-unrelated tasks (re: B), and thanks to Dual Debiasing , it can also identify and preserve factual signals, even though it is significantly correlated with bias (re: C). Lastly, we show that 2DAMA can be applied to a multilingual setting, and we observe the evidence of bias sharing across languages (re: D). Appendix A Proofs A.1 Terminological Note For brevity of theorems and proofs, we adopt the following notation convention: Definition 1 ( Moore-Penrose Pseudoinvers ) . We denote Moore-Penrose pseudoinverse of matrix \bm{M} as \bm{M}^{\dotplus} : \bm{M}^{\dotplus}=(\bm{M}^{T}\bm{M})^{-1}\bm{M}^{T} Definition 2 ( Matrix Square Root ) . We denote a positive semi-definite square root of positive semi-definite matrix \bm{M} as \bm{M}^{1/2} . Definition 3 ( Covariance Matrix ) . For two random vectors: X\in\Real^{m} and Y\in\Real^{n} . We denote the covariance matrix as: \bm{\Sigma}_{X,Y}=\cov(X,Y) A.2 Proof for DAMA-LEACE Theorem We formalize the requirements and implications of that assumption in the following theorem: Theorem 4 ( Gauss-Markov: Probabilistic Least Squares ) . We consider random vectors: U taking values in \Real^{m} , V , and Z taking values in \Real^{n} ; both are centered and have finite second moments. We seek the linear regression model given by: V=\bm{S}U-\epsilon, given the following assumptions: A No Multicollinearity : there is no linear relationship among the independent variables, i.e., matrix \Sigma_{U,U} is of full rank m . B Exogeneity : the expected value of error terms given independent variables \E[\epsilon|U]=0 , this also implies that \cov(\epsilon,U)=0 . C Homoscedasticity : the covariance of the error terms is constant and does not depend on the independent variables \cov(\epsilon,\epsilon|U)=\sigma\Iden . Then, the ordinary least squares estimator is given by the formula: \bm{S}^{*}=\bm{\Sigma}_{U,V}\bm{\Sigma}_{U,U}^{-1} Such estimator is best linear unbiased estimator and minimizes the variance of error terms: Tr(\cov(\epsilon,\epsilon)) . The proof of the Theorem 4 can be found in the classical statistics literature. For instance, Eaton (1983) presents proof for the multivariate case presented above. Equipped with the theorems above, we are ready to present the theorem that is the main theoretical contribution of this work: Theorem 2 . We consider random vectors: U taking values in \Real^{m} , V and Z taking values in \Real^{n} , where m\geq n . Under assumptions that: A) random vectors U , V , Z are centered, and each of them has finite moment; B) the regression relation between U and V fulfill the assumption of ordinary least squares, and there exist least squares estimator V=\bm{S}U-\epsilon . Then the objective: \argmin_{\bm{P}\in\Real{n\times m}}\E\left[||\bm{P}U-V||^{2}\right], subject to: \cov(\bm{P}U,Z)=0 is solved by: \bm{P}^{*}=\left(\Iden-\bm{W}^{\dotplus}\bm{P}_{\bm{W}\bm{\Sigma}}\bm{W}\right)\bm{S}, where \bm{W} is the whitening transformation (\Sigma^{1/2}_{\bm{S}U,\bm{S}U})^{\dotplus} ; \bm{P}_{\bm{W}\bm{\Sigma}} is an orthogonal projection matrix onto colspace of \bm{W}\bm{\Sigma}_{\bm{S}U,Z} ; \bm{S} is a least squares estimator of V given U : \bm{S}=\bm{\Sigma}_{U,V}\bm{\Sigma}_{U,U}^{-1} . Proof. For simplicity, we will decompose the problem into independent optimization objectives corresponding to each dimension in \Real^{n} . For the i th dimension, we write the objective as: \argmin_{\bm{P}_{i}\in\Real^{n}}\E\left[\bm{P}_{i}^{T}V-V_{i}\right]^{2}\quad\text{s.t.}\quad\cov(\bm{P}_{i}U,Z)=0, (3) where \bm{P}_{i} is i th column of matrix \bm{P} . From the assumption (B) of the theorem, we can represent the linear relation between U and V , as \bm{S}U=V+\epsilon , where \epsilon is an error term of regression. We use this property to rewrite the minimization objective from expression 3 , as: \argmin_{\widetilde{\bm{P}_{i}}\in\Real^{n},\bm{S}\in\Real^{m\times n}}\E\left[\widetilde{\bm{P}_{i}}^{T}\bm{S}U-V_{i}\right]^{2} (4) We manipulate the term under \argmin to rewrite it as a sum of three terms: \begin{split}\E\left[\widetilde{\bm{P}_{i}}^{T}\bm{S}U-V_{i}\right]^{2}=\E\left[\widetilde{\bm{P}_{i}}^{T}(V+\epsilon)-V_{i}\right]^{2}=\\ =\E\left[\widetilde{\bm{P}_{i}}^{T}(V+\epsilon)-(V_{i}+\epsilon_{i})+\epsilon_{i}\right]^{2}=\\ =\underbrace{2E\left[\left(\widetilde{\bm{P}_{i}}^{T}(V+\epsilon)-(V_{i}+\epsilon_{i})\right)\epsilon_{i}\right]}_{\text{I}}+\\ +\underbrace{\E[\epsilon_{i}]^{2}}_{\text{II}}+\underbrace{\E\left[\widetilde{\bm{P}_{i}}^{T}(V+\epsilon)-(V_{i}+\epsilon_{i})\right]^{2}}_{\text{III}}\end{split} (5) We will now consider each of the three summands one by one to find the solution to the optimization objective P^{*}=\widetilde{P}^{*}S^{*} . Summand I zeros out. We show that by observing that the summand is doubled covariance 5 5 5 From the fact that both factors under \E are centered. : \begin{split}E\left[\left(\widetilde{\bm{P}_{i}}^{T}(V+\epsilon)-(V_{i}+\epsilon_{i})\right)\epsilon_{i}\right]=\\ =\cov\left(\widetilde{\bm{P}_{i}}^{T}(V+\epsilon)-(V_{i}+\epsilon_{i}),\epsilon_{i}\right)=\\ =\left(\widetilde{\bm{P}_{i}}^{T}-\mathds{1}_{i}^{T}\right)\cov(V-\epsilon,\epsilon)=\\ =\left(\widetilde{\bm{P}_{i}}^{T}-\mathds{1}_{i}^{T}\right)\bm{S}\cov(U,\epsilon)\end{split} (6) From assumption B of Theorem 4 (exogeneity) and, by extension, assumption of this theorem, we have that \cov(U,\epsilon)=0 and thus summand I zeros out. Summand II by the conclusion of Theorem 4 is minimized by setting: \bm{S}^{*}=\bm{\Sigma_{U,V}}\bm{\Sigma_{U,U}}^{-1} (7) We can also set \bm{S} to \bm{S}^{*} in summand III, as the variable under \E is independent of \epsilon , as shown in the previous paragraph. By finding \bm{S}^{*} , we have solved part of the objective in expression 4 . Summand III we find the matrix \widetilde{P} minimizing the value of the summand under constraines. By rewriting \cov(P_{i}U),Z) as \cov(\widetilde{\bm{P}_{i}}(V+\epsilon,Z) , we observe that minimizing the value of summand III under constraint is analogical to solving the problem stated in LEACE (Theorem 1 ): \begin{split}\argmin_{\widetilde{\bm{P}_{i}}\in\Real^{n}}\E\left[\widetilde{\bm{P}_{i}}^{T}(V+\epsilon)-(V_{i}+\epsilon)\right]^{2}\\ \text{such that}\quad\cov(\widetilde{\bm{P}}_{i}(V+\epsilon),Z)=0\end{split} (8) We find the solution based on Theorem 1 , where we substitute X with V+\epsilon and find \widetilde{\bm{P}}^{*}=\Iden-\bm{W}^{\dotplus}\bm{P}_{\bm{W}\bm{\Sigma}}\bm{W} , where \bm{W} is the whitening transformation (\Sigma^{1/2}_{V+\epsilon,V+\epsilon})^{\dotplus} ; \bm{P}_{\bm{W}\bm{\Sigma}} is an orthogonal projection matrix onto colspace of \bm{W}\bm{\Sigma}_{V+\epsilon,Z} Conclusion for summands II and III, we independently found the matrices minimizing their values. We obtain the matrix P^{*} solving our original objective in expression 3 by multiplying them: P^{*}=\widetilde{P}^{*}S^{*}=\left(\Iden-\bm{W}^{\dotplus}\bm{P}_{\bm{W}\bm{\Sigma}}\bm{W}\right)\bm{\Sigma}_{U,V}\bm{\Sigma}_{U,U}^{-1} (9) ∎ A.3 Proof for Dual-Debiasing Theorem Theorem 3 . We consider random vectors X , Z_{b} , and Z_{f} in \Real^{n} . Under the assumptions that: A) Z_{b} and Z_{f} Z_{b}\perp Z_{f}|X , i.e., Z_{b} and Z_{f} are conditionally independent, given X ; B) \bm{\Sigma}_{X,Z_{b}}\bm{\Sigma}_{X,Z_{f}}^{T} , i.e., the variable X is correlated with Z_{f} and Z_{b} through mutually orthogonal subspaces of \Real^{n} . The solution of the objective: \argmin_{\bm{P}\in\Real^{n\times n}}\E\left[||\bm{P}X-X||^{2}\right], subject to: \cov(\bm{P}X,Z_{b})=0, satisfies: \cov(\bm{P}X,Z_{f})=\cov(X,Z_{f}). Proof. First, we observe that the assumption A) can be generalized to any coordinate system. For an orthogonal matrix \bm{W} , we have: \bm{\Sigma}_{\bm{W}X,Z_{b}}\bm{\Sigma}_{\bm{W}X,Z_{f}}^{T}=\bm{W}\bm{\Sigma}_{X,Z_{b}}\bm{\Sigma}_{X,Z_{f}}^{T}\bm{W}^{T}=0 (10) This guarantees the orthogonality of spaces spanned by columns of two orthogonality matrices. The property will be useful for the second part of the proof: Col(\bm{\Sigma}_{\bm{W}X,Z_{b}})\perp Col(\bm{\Sigma}_{\bm{W}X,Z_{f}}) (11) Secondly, we remind the reader that the solution to the objective provided in the theorem (based on Theorem 1 ) is as follows: \bm{P}^{*}=\Iden-\bm{W}^{\dotplus}\bm{P}_{\bm{W}\bm{\Sigma}}\bm{W} (12) Now, we evaluate the covariance matrix between \bm{P}^{*}X and Z_{f} to check that it is the same as the covariance matrix between X and Z_{f} . \begin{split}\cov(\bm{P}^{*}X,Z_{f})=\bm{\Sigma}_{X,Z_{f}}-\bm{W}^{\dotplus}\bm{P}_{\bm{W}\bm{\Sigma}}\bm{W}\bm{\Sigma}_{X,Z_{f}}=\\ =\bm{\Sigma}_{X,Z_{f}}-\bm{W}^{\dotplus}\bm{P}_{\bm{W}\bm{\Sigma}}\bm{\Sigma}_{\bm{W}X,Z_{f}}\end{split} (13) we note that \bm{P}_{\bm{W}\bm{\Sigma}} is the projection matrix onto the column space of \bm{\Sigma}_{\bm{W}X,Z_{f}} . From that fact and Equation 11 , we have: \bm{P}_{\bm{W}\bm{\Sigma}}\bm{\Sigma}_{\bm{W}X,Z_{f}}=0 (14) Thus the last component in Equation 13 nullifies and we conclude that: \cov(\bm{P}^{*}X,Z_{f})=\bm{\Sigma}_{X,Z_{f}}=\cov(X,Z_{f}) (15) ∎ Appendix B Prompts B.1 Monolingual Prompts The list of 11 prompt templates is given in Table 6 . The term is substituted by 219 professions without factual gender (from Bolukbasi et al., 2016 ) and 26 gendered entities, 6 6 6 “ man ”, “ boy ”, “ gentleman ”, “ father ”, “ son ”, “ brother ”, “ husband ”, “ king ”, “ prince ”, “ uncle ”, “ nephew ”, “ groom ”, “ duke ”, “ grandfather ”, “ widower ”, “ hero ”, “ wizard ”, “ baron ”, “ emperor ”, “ anchorman ”, “ clergyman ”, “ chairman ”, “ alumnus ”, “ woman ”, “ girl ”, “ lady ”, “ mother ”, “ daughter ”, “ sister ”, “ wife ”, “ queen ”, “ princess ”, “ aunt ”, “ niece ”, “ bride ”, “ duchess ”, “ grandmother ”, “ widow ”, “ heroine ”, “ witch ”, “ baroness ”, “ empress ”, “ anchorwoman ”, “ clergywomen ”, “ chairwomen ”, “ alumna ” which makes 2409 stereotypical and 286 factual prompts in total used for Dual Debiasing . B.2 Multilingual Prompts For debiasing the translation models, we use 11 English-German and 11 English-Czech prompt templates shown in Table 7 . These prompts were designed to be as general as possible, and so that the target language prefix does not include any gender information, while the proposed completions, which are always one-token words, do specify the gender. In German, these completions may be determiners. Czech does not use determiners, but gender is included, for example, in the past form of the verb “to be”. We use the same sets of professions, and therefore, we generate additional data of equal size for each language. To match the intended use, we wrap them into ALMA-R translation prompt template: Translate this from {src_lang} to {tgt_lang}: {src_lang}: {tgt_lang}: English prompt Completions The wanted that [he, she, they] The laughed because [he, she, they] The went home because [he, she, they] The desired that [he, she, they] The wished that [he, she, they] The cried because [he, she, they] The ate because [he, she, they] The said that [he, she, they] The ran because [he, she, they] The stayed up because [he, she, they] The whispered that [he, she, they] Table 6 : Monolingual English prompt templates. English source German prefix Completions This is the . Das ist ___ [der, die] There is the . Da ist ___ [der, die] The is not working today. ___ [Der, Die] The was fired. ___ [Der, Die] The is busy. ___ [Der, Die] Do you know the Kennen Sie ___ [den, die] I was there with the Ich war dort mit ___ [dem, der] I asked the . Ich fragte ___ [den, die] We met the . Wir trafen ___ [den, die] I answered the . Ich antwortete ___ [dem, der] The salary of the has increased. Das Gehalt ___ [des, der] English source Czech prefix Completions This is that . To je ___ [ten, ta] There is that . Tam je ___ [ten, ta] That is not working today. ___ [Ten, Ta] That was fired. ___ [Ten, Ta] That is busy. ___ [Ten, Ta] I was a two years ago. Před dvěma lety jsem ___ [byl, byla] You were a two years ago. Před dvěma lety jste ___ [byl, byla] If only I were a . Kdybych tak ___ [byl, byla] I was a at that time. V té době jsem ___ [byl, byla] You were a at that time. V té době jsi ___ [byl, byla] You were a at that time. V té době jste ___ [byl, byla] Table 7 : Multilingual prompt templates for English-to-German and English-to-Czech translation Appendix C Additional Results (a) Bias-to-feature threshold fixed at 0.05 (b) Number of layers fixed at 12 Figure 6 : The hyperparameter analysis for 2DAMA applied to ALMA-R 13B model on performance and bias in translation to German. We measured bias via WinoMT metrics \Delta S and \Delta G . The translation quality to Germna is measured by chrf on WMT-22. Stars mark the performance of the best setting. The dashed line corresponds to the scores of the original model. C.1 Stereotypical and Factual Signals across Layers (a) Layer 28 (b) Layer 31 (c) Layer 34 (d) Layer 37 Figure 7 : Visualization of dimensions and their variances related to stereotypical and factual gender signals identified by Dual Debiasing algorithm across different layers of Llama 2 13B. In Figure 7 , we observe the variances with stereotypical and factual gender signals in subsequent layers. We see that the number of biased dimensions differs across layers. Nevertheless, we observe the same pattern in each layer: stereotypical signal is encoded in a relatively small number of dimensions with high variance, while the stereotypical variance is spread across more dimensions with lower values in each. C.2 Choice of Hyperparameters in Translation Analogically to Section 4.3 , we present the impact of bias-to-feature threshold t and the number of edited layers on translation to German in Figure 6 . We observe that stronger factual regularization (high t ) helps in reducing representational bias ( \Delta G ) yet offers weaker stereotypical bias mitigation ( \Delta S ). Similar to the results in language modeling, the best performance is obtained when editing 12 mid-upper layers with t=0.05 .