Uncovering and Quantifying Social Biases in Code Generation
- URL: http://arxiv.org/abs/2305.15377v1
- Date: Wed, 24 May 2023 17:37:33 GMT
- Title: Uncovering and Quantifying Social Biases in Code Generation
- Authors: Yan Liu, Xiaokang Chen, Yan Gao, Zhe Su, Fengji Zhang, Daoguang Zan,
Jian-Guang Lou, Pin-Yu Chen, Tsung-Yi Ho
- Abstract summary: We propose a new paradigm to construct code prompts and successfully uncover social biases in code generation models.
We develop a dataset along with three metrics to evaluate the overall social bias and fine-grained unfairness across different demographics.
We conduct analysis to provide useful insights for further choice of code generation models with low social bias.
- Score: 71.96047133403688
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: With the popularity of automatic code generation tools, such as Copilot, the
study of the potential hazards of these tools is gaining importance. In this
work, we explore the social bias problem in pre-trained code generation models.
We propose a new paradigm to construct code prompts and successfully uncover
social biases in code generation models. To quantify the severity of social
biases in generated code, we develop a dataset along with three metrics to
evaluate the overall social bias and fine-grained unfairness across different
demographics. Experimental results on three pre-trained code generation models
(Codex, InCoder, and CodeGen) with varying sizes, reveal severe social biases.
Moreover, we conduct analysis to provide useful insights for further choice of
code generation models with low social bias. (This work contains examples that
potentially implicate stereotypes, associations, and other harms that could be
offensive to individuals in certain social groups.)
Related papers
- The Devil is in the Neurons: Interpreting and Mitigating Social Biases in Pre-trained Language Models [78.69526166193236]
Pre-trained Language models (PLMs) have been acknowledged to contain harmful information, such as social biases.
We propose sc Social Bias Neurons to accurately pinpoint units (i.e., neurons) in a language model that can be attributed to undesirable behavior, such as social bias.
As measured by prior metrics from StereoSet, our model achieves a higher degree of fairness while maintaining language modeling ability with low cost.
arXiv Detail & Related papers (2024-06-14T15:41:06Z) - SocialStigmaQA: A Benchmark to Uncover Stigma Amplification in
Generative Language Models [8.211129045180636]
We introduce a benchmark meant to capture the amplification of social bias, via stigmas, in generative language models.
Our benchmark, SocialStigmaQA, contains roughly 10K prompts, with a variety of prompt styles, carefully constructed to test for both social bias and model robustness.
We find that the proportion of socially biased output ranges from 45% to 59% across a variety of decoding strategies and prompting styles.
arXiv Detail & Related papers (2023-12-12T18:27:44Z) - Bias Testing and Mitigation in LLM-based Code Generation [23.787124657688267]
This paper presents a novel bias testing framework specifically designed for code generation tasks.
Our findings reveal that 20.29% to 44.93% code functions generated by the models under study are biased when handling bias sensitive tasks.
To mitigate bias for code generation models, we evaluate five bias mitigation prompt strategies.
arXiv Detail & Related papers (2023-09-03T07:14:49Z) - Exposing Bias in Online Communities through Large-Scale Language Models [3.04585143845864]
This work uses the flaw of bias in language models to explore the biases of six different online communities.
The bias of the resulting models is evaluated by prompting the models with different demographics and comparing the sentiment and toxicity values of these generations.
This work not only affirms how easily bias is absorbed from training data but also presents a scalable method to identify and compare the bias of different datasets or communities.
arXiv Detail & Related papers (2023-06-04T08:09:26Z) - Uncovering and Categorizing Social Biases in Text-to-SQL [28.07279278808438]
Large pre-trained language models are acknowledged to carry social biases towards different demographics.
Existing Text-to- models are trained on clean, neutral datasets, such as Spider and Wiki.
This work aims to uncover and categorize social biases in Text-to- models.
arXiv Detail & Related papers (2023-05-25T17:08:56Z) - Gender Biases in Automatic Evaluation Metrics for Image Captioning [87.15170977240643]
We conduct a systematic study of gender biases in model-based evaluation metrics for image captioning tasks.
We demonstrate the negative consequences of using these biased metrics, including the inability to differentiate between biased and unbiased generations.
We present a simple and effective way to mitigate the metric bias without hurting the correlations with human judgments.
arXiv Detail & Related papers (2023-05-24T04:27:40Z) - The Tail Wagging the Dog: Dataset Construction Biases of Social Bias
Benchmarks [75.58692290694452]
We compare social biases with non-social biases stemming from choices made during dataset construction that might not even be discernible to the human eye.
We observe that these shallow modifications have a surprising effect on the resulting degree of bias across various models.
arXiv Detail & Related papers (2022-10-18T17:58:39Z) - Towards Understanding and Mitigating Social Biases in Language Models [107.82654101403264]
Large-scale pretrained language models (LMs) can be potentially dangerous in manifesting undesirable representational biases.
We propose steps towards mitigating social biases during text generation.
Our empirical results and human evaluation demonstrate effectiveness in mitigating bias while retaining crucial contextual information.
arXiv Detail & Related papers (2021-06-24T17:52:43Z) - Measuring Coding Challenge Competence With APPS [54.22600767666257]
We introduce APPS, a benchmark for code generation.
Our benchmark includes 10,000 problems, which range from having simple one-line solutions to being substantial algorithmic challenges.
Recent models such as GPT-Neo can pass approximately 15% of the test cases of introductory problems.
arXiv Detail & Related papers (2021-05-20T17:58:42Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.