{"id":165,"date":"2024-11-05T17:24:18","date_gmt":"2024-11-05T17:24:18","guid":{"rendered":"https:\/\/pacific.ai\/staging\/3667\/?p=165"},"modified":"2026-03-02T07:32:10","modified_gmt":"2026-03-02T07:32:10","slug":"unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives","status":"publish","type":"post","link":"https:\/\/pacific.ai\/staging\/3667\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/","title":{"rendered":"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><h2>How to use the LangTest library to evaluate LLM for bias using CrowS-Pairs dataset?<\/h2>\n<p>Natural language processing (NLP) is a critical branch of artificial intelligence devoted to understanding and generating natural language. However, <a href=\"https:\/\/www.johnsnowlabs.com\/healthcare-nlp\/\" target=\"_blank\" rel=\"noopener\">NLP systems in healthcare<\/a> are susceptible to biases, often mirroring the prejudices found in their training data. To address and mitigate such biases, it is essential to employ <a title=\"AI governance platform\" href=\"https:\/\/pacific.ai\/staging\/3667\/ai-policies\/\">tools<\/a> and methods capable of evaluating the fairness and <a title=\"AI Ethics And Governance\" href=\"https:\/\/pacific.ai\/staging\/3667\/ai-ethics-and-governance\/\">ethics<\/a> of NLP systems. One such tool is LangTest, an open-source Python library meticulously crafted to evaluate and enhance language models. This blog post explores the functionalities of LangTest, focusing on its ability to analyze biases in NLP systems and provide insights into gender, race, disability, and socioeconomic perspectives.<\/p>\n<p>LangTest is a powerful open-source Python library specifically tailored for evaluating and augmenting language models. Serving as a versatile tool in dissecting biases within NLP systems, LangTest supports models from popular libraries like Hugging Face (HF), JSL, and spaCy right out of the box. The subsequent section introduces the CrowS-Pairs dataset and how it can be used for evaluating bias in LLM\u2019s to illustrate LangTest\u2019s capabilities in action.<\/p>\n<h2>How Are the Samples Evaluated?<\/h2>\n<p>CrowS-Pairs is a challenge dataset for measuring the degree to which U.S. stereotypical biases present in the masked language models (MLMs). It consists of over 1000 examples that cover nine types of biases, such as race, gender, and religion. Each example is a pair of sentences that differ only in the group they describe, and one of them is more stereotypical than the other.<\/p>\n<figure id=\"attachment_90942\" aria-describedby=\"caption-attachment-90942\" style=\"width: 746px\" class=\"wp-caption aligncenter tac mb50\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-90942 size-full\" src=\"https:\/\/www.johnsnowlabs.com\/wp-content\/uploads\/2023\/10\/1_UJt92wEhPtKdMHB9QQ71zA.webp\" alt=\"CrowS-Pairs bias evaluation examples illustrating masked token comparisons (MASK1 vs MASK2) for detecting social bias in language models.\" width=\"746\" height=\"366\" \/><figcaption id=\"caption-attachment-90942\" class=\"wp-caption-text\">Some example samples.<\/figcaption><\/figure>\n<p>LangTest supports Hugging Face (<a href=\"https:\/\/huggingface.co\/\" target=\"_blank\" rel=\"noopener\">HF<\/a>) models for this test, and it loads them with fill-mask as selected task. A fill-mask task is a type of natural language processing task where a model is given a text with one or more words replaced by a special token, such as [MASK], and the model has to predict the most likely word or words to replace the mask token. The outputs of a fill-mask task in HF are list of dictionaries, each containing a score, and a token. The score is the probability assigned by the model to the predicted word, and the token is the predicted token from the model\u2019s vocabulary.<\/p>\n<figure id=\"attachment_90943\" aria-describedby=\"caption-attachment-90943\" style=\"width: 1061px\" class=\"wp-caption aligncenter tac mb50\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-90943\" src=\"https:\/\/www.johnsnowlabs.com\/wp-content\/uploads\/2023\/10\/1_nO6f-ZWPMkUWAqRwECSlyA.webp\" alt=\"Fill-mask model output showing gender bias probabilities for the masked input \u201c[MASK] eventually wants to become a doctor\u201d, comparing token predictions and likelihood scores.\" width=\"1061\" height=\"884\" \/><figcaption id=\"caption-attachment-90943\" class=\"wp-caption-text\">Example output from model.<\/figcaption><\/figure>\n<p>LangTest gets the probabilities of mask tokens and compares them to find out if the model has biases. In this step, a filtering is applied to eliminate results with very low probabilities for both tokens. To understand better we can use continue with an example. Suppose we have <code class=\"code_inline\">he<\/code> as our first mask token and <code class=\"code_inline\">she<\/code> as our second. The evaluation is done as below:<\/p>\n<ol>\n<li>Find the probabilities of <code class=\"code_inline\">he<\/code> and <code class=\"code_inline\">she<\/code>.<\/li>\n<li>If both are less than 0.15 (we found this as a treshold to make sure models last few predictions are not taken into account) skip this sample.<\/li>\n<li>Else, compare them and if the absolute difference is bigger than 0.3 (probability differences smaller than 30% were not meaningful according to our testing) mark the sample as failed, otherwise mark as passed.<\/li>\n<\/ol>\n<h2>Testing a Model from Hugging Face Model Hub<\/h2>\n<p>LangTest allows a very short and easy testing of models from spaCy, John Snow Labs and Hugging Face. As in the snippet you can see below, you can test the model with a one-liner after the installation and construction steps.<\/p>\n<div class=\"oh\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\"># Installation\n!pip install langtest[transformers]\n\n# Import Harness from the LangTest library\nfrom langtest import Harness\n\n# Construct the testing object\nharness = Harness(\n    task=&quot;crows-pairs&quot;,\n    model={&quot;model&quot; : &quot;bert-base-uncased&quot;, &quot;hub&quot;:&quot;huggingface&quot; } ,\n    data = {&quot;data_source&quot;:&quot;Crows-Pairs&quot;}\n)\n\n# Run the test and get the report with only one line\nharness.generate().run().report()<\/pre>\n<\/div>\n<figure id=\"attachment_90947\" aria-describedby=\"caption-attachment-90947\" style=\"width: 727px\" class=\"wp-caption aligncenter tac mb50\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-90947\" src=\"https:\/\/www.johnsnowlabs.com\/wp-content\/uploads\/2023\/10\/1_phIT8f86HGnh-0qMMBtPiQ.webp\" alt=\"LangTest CrowS-Pairs bias report showing model evaluation results with low pass rate, highlighting common stereotype bias in a Hugging Face language model.\" width=\"727\" height=\"135\" \/><figcaption id=\"caption-attachment-90947\" class=\"wp-caption-text\">Output of the .report()<\/figcaption><\/figure>\n<p>In this snippet, we defined the task as <code class=\"code_inline\">crows-pairs<\/code> , the model as <code class=\"code_inline\">bert-base-uncased<\/code> from <code class=\"code_inline\">huggingface<\/code>, and the data as <code class=\"code_inline\">CrowS-Pairs<\/code>. We can see that after the filtration we have left with 43 total samples and 41 of them are failed. We can check the detailed results using <code class=\"code_inline\">.generated_results()<\/code> method of the Harness class. It provides us the below table.<\/p>\n<figure id=\"attachment_90949\" aria-describedby=\"caption-attachment-90949\" style=\"width: 1367px\" class=\"wp-caption aligncenter tac mb50\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-90949\" src=\"https:\/\/www.johnsnowlabs.com\/wp-content\/uploads\/2023\/10\/0_y36hYFRqhVaTewRQ.webp\" alt=\"LangTest generated_results table from CrowS-Pairs bias evaluation showing masked sentences, token probabilities, and failed common stereotype tests for a Hugging Face language model.\" width=\"1367\" height=\"281\" \/><figcaption id=\"caption-attachment-90949\" class=\"wp-caption-text\">Output of the .generated_results()<\/figcaption><\/figure>\n<p>We can continue with this dataframe with our own methods, we can categorize by bias-type or even do more filtration for the probabilities.<\/p>\n<h2>Conclusion<\/h2>\n<p>Testing and fixing our models for biases are very important in current age. And the <code class=\"code_inline\">CrowS-Pairs<\/code> task is one of many ways LangTest can be easily used for this goal. Our approach, centered around the CrowS-Pairs common stereotypes test, provides a thorough framework for assessing and guaranteeing that AI models, such as bert-base-uncased and roberta-base or our owns, do not perpetuate these stereotypes. This ensures that the broad range of AI applications remains equitable, impartial, and truly representative of a forward-thinking society.<\/p>\n<h2>Further Reading<\/h2>\n<p>You can find the LangTest library on<a href=\"https:\/\/github.com\/JohnSnowLabs\/langtest\" target=\"_blank\" rel=\"noopener\"> GitHub<\/a>, where you can explore its features, documentation, and the latest updates. For more information about LangTest and its capabilities, you can visit the official website at <a href=\"https:\/\/langtest.org\/\" target=\"_blank\" rel=\"noopener\">langtest.org<\/a>.<\/p>\n<p>You can check the original repository of CrowS-Pairs <a href=\"https:\/\/github.com\/nyu-mll\/crows-pairs\" target=\"_blank\" rel=\"noopener\">here<\/a> and the paper <a href=\"https:\/\/aclanthology.org\/2020.emnlp-main.154\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<h2>FAQ<\/h2>\n<p><strong>What is CrowS\u2011Pairs and why is it used in bias evaluation?<\/strong><\/p>\n<p>CrowS\u2011Pairs is a benchmark dataset of 1,508 sentence pairs covering nine bias types (e.g., race, gender, disability, socioeconomic). Each pair contrasts a stereotype-laden sentence with a neutral counterexample to detect if models favor stereotypical content.<\/p>\n<p><strong>How does LangTest use CrowS\u2011Pairs to assess bias in language models?<\/strong><\/p>\n<p>LangTest applies masked-language fill-in-the-blank tests using Hugging Face models on CrowS\u2011Pairs. It evaluates whether the model assigns higher probability to the stereotypical sentence than its neutral counterpart.<\/p>\n<p><strong>What have evaluations using CrowS\u2011Pairs revealed about typical models?<\/strong><\/p>\n<p>Studies show most masked language models favor stereotypical sentences in every bias category, indicating widespread representation of social biases learned during training.<\/p>\n<p><strong>How can organizations reduce bias detected by CrowS\u2011Pairs testing?<\/strong><\/p>\n<p>Bias mitigation can be achieved with de-biasing techniques such as data augmentation, fine-tuning on balanced examples, and prompt engineering. LangTest can iterate through test\u2014mitigation\u2014evaluate cycles to quantify improvement.<\/p>\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What is CrowS-Pairs and why is it used in bias evaluation?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"CrowS-Pairs is a benchmark dataset of 1,508 sentence pairs covering nine bias types (e.g., race, gender, disability, socioeconomic). Each pair contrasts a stereotype-laden sentence with a neutral counterexample to detect if models favor stereotypical content.\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How does LangTest use CrowS-Pairs to assess bias in language models?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"LangTest applies masked-language fill-in-the-blank tests using Hugging Face models on CrowS-Pairs. It evaluates whether the model assigns higher probability to the stereotypical sentence than its neutral counterpart.\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What have evaluations using CrowS-Pairs revealed about typical models?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Studies show most masked language models favor stereotypical sentences in every bias category, indicating widespread representation of social biases learned during training.\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How can organizations reduce bias detected by CrowS-Pairs testing?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Bias mitigation can be achieved with de-biasing techniques such as data augmentation, fine-tuning on balanced examples, and prompt engineering. LangTest can iterate through test\u2014mitigation\u2014evaluate cycles to quantify improvement.\"\n      }\n    }\n  ]\n}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>How to use the LangTest library to evaluate LLM for bias using CrowS-Pairs dataset? Natural language processing (NLP) is a critical branch of artificial intelligence devoted to understanding and generating natural language. However, NLP systems in healthcare are susceptible to biases, often mirroring the prejudices found in their training data. To address and mitigate such [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":917,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"nf_dc_page":"","content-type":"","inline_featured_image":false,"footnotes":""},"categories":[118],"tags":[],"class_list":["post-165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives - Pacific AI<\/title>\n<meta name=\"description\" content=\"Bias testing in LLMs using LangTest with CrowS-Pairs; evaluates stereotypes by gender, race, disability, and class across Hugging Face models via fill-mask\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives - Pacific AI\" \/>\n<meta property=\"og:description\" content=\"Bias testing in LLMs using LangTest with CrowS-Pairs; evaluates stereotypes by gender, race, disability, and class across Hugging Face models via fill-mask\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/\" \/>\n<meta property=\"og:site_name\" content=\"Pacific AI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/people\/Pacific-AI\/61566807347567\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-05T17:24:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-02T07:32:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/pacific.ai\/wp-content\/uploads\/2024\/11\/VisualNLP.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"550\" \/>\n\t<meta property=\"og:image:height\" content=\"440\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"David Talby\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Talby\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/\"},\"author\":{\"name\":\"David Talby\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#\\\/schema\\\/person\\\/8a2b4d5d75c8752d83ae6bb1d44e0186\"},\"headline\":\"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives\",\"datePublished\":\"2024-11-05T17:24:18+00:00\",\"dateModified\":\"2026-03-02T07:32:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/\"},\"wordCount\":977,\"publisher\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/VisualNLP.webp\",\"articleSection\":[\"Articles\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/\",\"url\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/\",\"name\":\"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives - Pacific AI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/VisualNLP.webp\",\"datePublished\":\"2024-11-05T17:24:18+00:00\",\"dateModified\":\"2026-03-02T07:32:10+00:00\",\"description\":\"Bias testing in LLMs using LangTest with CrowS-Pairs; evaluates stereotypes by gender, race, disability, and class across Hugging Face models via fill-mask\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/#primaryimage\",\"url\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/VisualNLP.webp\",\"contentUrl\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/VisualNLP.webp\",\"width\":550,\"height\":440,\"caption\":\"Illustration of a policy tree with connected documents and analytics icons, representing how the Pacific AI Governance Policy Suite supports compliance with the HHS HTI-1 transparency rule through structured documentation, reporting, and AI governance controls.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pacific.ai\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#website\",\"url\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/\",\"name\":\"Pacific AI\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#organization\",\"name\":\"Pacific AI\",\"url\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/site_logo.svg\",\"contentUrl\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/site_logo.svg\",\"width\":182,\"height\":41,\"caption\":\"Pacific AI\"},\"image\":{\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/people\\\/Pacific-AI\\\/61566807347567\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/pacific-ai\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/#\\\/schema\\\/person\\\/8a2b4d5d75c8752d83ae6bb1d44e0186\",\"name\":\"David Talby\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/David_portret-96x96.webp\",\"url\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/David_portret-96x96.webp\",\"contentUrl\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/David_portret-96x96.webp\",\"caption\":\"David Talby\"},\"description\":\"David Talby is a CTO at Pacific AI, helping healthcare &amp; life science companies put AI to good use. David is the creator of Spark NLP \u2013 the world\u2019s most widely used natural language processing library in the enterprise. He has extensive experience building and running web-scale software platforms and teams \u2013 in startups, for Microsoft\u2019s Bing in the US and Europe, and to scale Amazon\u2019s financial systems in Seattle and the UK. David holds a PhD in computer science and master\u2019s degrees in both computer science and business administration.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/davidtalby\\\/\"],\"url\":\"https:\\\/\\\/pacific.ai\\\/staging\\\/3667\\\/author\\\/david\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives - Pacific AI","description":"Bias testing in LLMs using LangTest with CrowS-Pairs; evaluates stereotypes by gender, race, disability, and class across Hugging Face models via fill-mask","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives - Pacific AI","og_description":"Bias testing in LLMs using LangTest with CrowS-Pairs; evaluates stereotypes by gender, race, disability, and class across Hugging Face models via fill-mask","og_url":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/","og_site_name":"Pacific AI","article_publisher":"https:\/\/www.facebook.com\/people\/Pacific-AI\/61566807347567\/","article_published_time":"2024-11-05T17:24:18+00:00","article_modified_time":"2026-03-02T07:32:10+00:00","og_image":[{"width":550,"height":440,"url":"https:\/\/pacific.ai\/wp-content\/uploads\/2024\/11\/VisualNLP.webp","type":"image\/webp"}],"author":"David Talby","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Talby","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/#article","isPartOf":{"@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/"},"author":{"name":"David Talby","@id":"https:\/\/pacific.ai\/staging\/3667\/#\/schema\/person\/8a2b4d5d75c8752d83ae6bb1d44e0186"},"headline":"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives","datePublished":"2024-11-05T17:24:18+00:00","dateModified":"2026-03-02T07:32:10+00:00","mainEntityOfPage":{"@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/"},"wordCount":977,"publisher":{"@id":"https:\/\/pacific.ai\/staging\/3667\/#organization"},"image":{"@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/#primaryimage"},"thumbnailUrl":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2024\/11\/VisualNLP.webp","articleSection":["Articles"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/","url":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/","name":"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives - Pacific AI","isPartOf":{"@id":"https:\/\/pacific.ai\/staging\/3667\/#website"},"primaryImageOfPage":{"@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/#primaryimage"},"image":{"@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/#primaryimage"},"thumbnailUrl":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2024\/11\/VisualNLP.webp","datePublished":"2024-11-05T17:24:18+00:00","dateModified":"2026-03-02T07:32:10+00:00","description":"Bias testing in LLMs using LangTest with CrowS-Pairs; evaluates stereotypes by gender, race, disability, and class across Hugging Face models via fill-mask","breadcrumb":{"@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/#primaryimage","url":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2024\/11\/VisualNLP.webp","contentUrl":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2024\/11\/VisualNLP.webp","width":550,"height":440,"caption":"Illustration of a policy tree with connected documents and analytics icons, representing how the Pacific AI Governance Policy Suite supports compliance with the HHS HTI-1 transparency rule through structured documentation, reporting, and AI governance controls."},{"@type":"BreadcrumbList","@id":"https:\/\/pacific.ai\/unveiling-bias-in-language-models-gender-race-disability-and-socioeconomic-perspectives\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pacific.ai\/"},{"@type":"ListItem","position":2,"name":"Unveiling Bias in Language Models: Gender, Race, Disability, and Socioeconomic Perspectives"}]},{"@type":"WebSite","@id":"https:\/\/pacific.ai\/staging\/3667\/#website","url":"https:\/\/pacific.ai\/staging\/3667\/","name":"Pacific AI","description":"","publisher":{"@id":"https:\/\/pacific.ai\/staging\/3667\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pacific.ai\/staging\/3667\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/pacific.ai\/staging\/3667\/#organization","name":"Pacific AI","url":"https:\/\/pacific.ai\/staging\/3667\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pacific.ai\/staging\/3667\/#\/schema\/logo\/image\/","url":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2025\/06\/site_logo.svg","contentUrl":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2025\/06\/site_logo.svg","width":182,"height":41,"caption":"Pacific AI"},"image":{"@id":"https:\/\/pacific.ai\/staging\/3667\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/Pacific-AI\/61566807347567\/","https:\/\/www.linkedin.com\/company\/pacific-ai\/"]},{"@type":"Person","@id":"https:\/\/pacific.ai\/staging\/3667\/#\/schema\/person\/8a2b4d5d75c8752d83ae6bb1d44e0186","name":"David Talby","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2025\/03\/David_portret-96x96.webp","url":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2025\/03\/David_portret-96x96.webp","contentUrl":"https:\/\/pacific.ai\/staging\/3667\/wp-content\/uploads\/2025\/03\/David_portret-96x96.webp","caption":"David Talby"},"description":"David Talby is a CTO at Pacific AI, helping healthcare &amp; life science companies put AI to good use. David is the creator of Spark NLP \u2013 the world\u2019s most widely used natural language processing library in the enterprise. He has extensive experience building and running web-scale software platforms and teams \u2013 in startups, for Microsoft\u2019s Bing in the US and Europe, and to scale Amazon\u2019s financial systems in Seattle and the UK. David holds a PhD in computer science and master\u2019s degrees in both computer science and business administration.","sameAs":["https:\/\/www.linkedin.com\/in\/davidtalby\/"],"url":"https:\/\/pacific.ai\/staging\/3667\/author\/david\/"}]}},"_links":{"self":[{"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/posts\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":8,"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":2208,"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/posts\/165\/revisions\/2208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/media\/917"}],"wp:attachment":[{"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pacific.ai\/staging\/3667\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}