Walking in Others’ Shoes: How Perspective-Taking Guides Large Language Models in Reducing Toxicity and Bias (2024)

Abstract: The common toxicity and societal bias in contents generated by large language models (LLMs) necessitate strategies to reduce harm. Present solutions often demand white-box access to the model or substantial training, which is impractical for cutting-edge commercial LLMs. Moreover, prevailing prompting methods depend on external tool feedback and fail to simultaneously lessen toxicity and bias. Motivated by social psychology principles, we propose a novel strategy named perspective-taking prompting (PeT) that inspires LLMs to integrate diverse human perspectives and self-regulate their responses. This self-correction mechanism can significantly diminish toxicity (up to 89%) and bias (up to 73%) in LLMs’ responses. Rigorous evaluations and ablation studies are conducted on two commercial LLMs (ChatGPT and GLM) and three open-source LLMs, revealing PeT’s superiority in producing less harmful responses, outperforming five strong baselines.

## introduction large language models (llms; @xcite @xcite excel in numerous nlp tasks, enhancing the efficiency of our work and life @xcite . meanwhile, recent research pointed out that llms inevitably give objectionable responses, as they are pre-trained on a vast amount of unsanitized web text @xcite . for instance, llms could output toxic content with harmful attributes (e.g., rude, disrespectful, insulting sentences) @xcite . they may also generate content with societal bias @xcite , which exhibits two shortcomings two limitations white-box access huge training cost single-issue focus external tool reliance unable to deploy on commercial llms results are hard to reproduce inadvertently exacerbate bias complicates deployment and adaptation stereotypes towards particular demographic groups, e.g., "asians are good at math."). it remains an ongoing endeavor to make llms deliver harmless and unbiased content @xcite @xcite . while many efforts have been devoted to alleviating toxicity and bias @xcite , existing measures exhibit two shortcomings when applied to state-of-theart commercial llms, e.g., @xcite . @xcite impractical requirement of white-box access. many solutions require access to the model's internal representations @xcite or control decoding processes @xcite , which is impossible to deploy on commercial llms that only reveal limited logits. (2) huge training cost. some solutions require domain-specific training, which is very costprohibitive @xcite . while they may work for older models like gpt-2, it is difficult to extend them to up-to-date llms @xcite , which have significantly distinct behaviors and features (c.f. driven by these issues, in this study, we concentrate on the black-box scenario. however, we notice two limitations of existing measures. @xcite single-issue focus. one issue is their focus on addressing a single type of problematic behavior while neglecting the need for concurrent adjustments across various problematic attributes. more seriously, @xcite point out some detoxification techniques @xcite may inadver-tently exacerbate bias. (2) external tool reliance. existing measures @xcite require external tool feedback to adjust responses. this dependence can vary effectiveness, hinder adaptability, and slow deployments due to the varying speed restrictions 1 of external tools. to combat the aforementioned drawbacks (c.f. figure 1 ) and explore the potential of llms, we propose perspective-taking prompting (pet), a prompting schema for llms to self-reduce the toxic and biased contents in their responses. inspired by social psychology theories, we leverage perspective-taking @xcite , a core emotional intelligence skill, that can empower individuals to self-regulate by leveraging self-awareness and empathy. particularly, our solution consists of two methods: pet-io (perspective-taking: imagine others) and pet-is (perspective-taking: imagine self). the former elicits the llm to imagine how others feel, while the latter instructs the llm to feel as others (see § 3.2 for details). then, we use the above two methods to explore llm's ability to self-adjust its responses for mitigating toxic and biased generations concurrently. we conduct extensive experiments on two commercial llms, @xcite and glm @xcite . we observe that perspective-taking prompting significantly outperforms the intrinsic self-correct scheme investigated by @xcite and also outperforms two strong baselines with external feedback @xcite . our key insight drawn from the exemplary performance of pet is: llms show the potential to generate responses with reduced toxicity and bias solely on their own. ## experiments we apply perspective-taking prompting (pet) to two representative facets in harmful content reduction, detoxification, and debiasing. ## concluding remarks our study introduces perspective-taking prompting (pet), a social psychology-inspired approach, to enable large language models (llms) to selfregulate and simultaneously diminish the toxicity and societal bias in their outputs. this approach, requiring no white-box control or further retraining of the llm, has shown through extensive testing on two advanced llms to surpass 5 existing baselines. to sum up, our findings underscore the potential of llms to minimize harmful content generation on their own, presenting a promising avenue for improving ai safety without external intervention.