East Carolina University
Test Generation for Fairness Fault Detection in Large Language Models
Abstract
dc:description.abstractLanguage models have evolved rapidly, with modern Large Language Models (LLMs) demonstrating exponential growth in their capabilities. As these systems become increasingly integral to daily life, the demand for the reliability, correctness, and fairness of their outputs is at an all-time high. Because of their sophisticated and complex nature, the outputs generated by LLMs must be subjected to rigorous and uncompromising testing phases to ensure they are dependable and safe for public use. However, evaluating LLMs is significantly hindered by the "test oracle problem." In traditional software development, a test oracle is a mechanism used to verify the absolute correctness of a program's output for a given test case. For LLMs, establishing a definitive oracle is exceptionally difficult, as verifying correctness is often highly subjective, context-dependent, or practically impossible. Consequently, end-users may be entirely unaware of whether the information provided by an LLM is accurate or flawed, which severely diminishes user confidence. Compounding this issue is the pervasive challenge of algorithmic bias. LLMs frequently exhibit fairness violations, yielding conflicting or discriminatory outputs based merely on the syntactic structure or sensitive attributes embedded within a prompt. This inconsistency highlights a critical need for advanced testing methodologies that can identify these hidden biases without relying on a perfect test oracle. To address these dual challenges, this research leverages Metamorphic Testing (MT), an effective methodology that bypasses the oracle problem. Instead of verifying absolute correctness, MT evaluates the consistency between a source test case and a transformed follow-up test case via predefined metamorphic relations. By systematically modifying the initial source test case into a new follow-up one, the structure of the LLM's output should remain consistent with the expected metamorphic relation. If the relationship between the two outputs violates this expectation, a failure is detected. This approach is particularly powerful for LLMs, as it allows for the systematic evaluation of model behavior even when the ground truth is unknown. Specifically, this research explores the efficient creation of well-structured source test cases within MT frameworks to identify fairness issues. We focus on the development of robust source inputs and the application of targeted input transformations to expose fairness bugs that may otherwise go unnoticed through traditional testing methods. By applying specific rules and transformations to sensitive attributes contained in the input—such as gender, ethnicity, and socioeconomic status—we can systematically force the LLM to reveal inconsistent or biased behaviors. Ultimately, the insights gained from this research are intended to improve the robustness of LLMs by providing more effective testing strategies for fairness. By systematically identifying and mitigating these biased behaviors, our approach reduces the risk of discriminatory outputs in real-world applications, fostering a more reliable, equitable, and trustworthy AI ecosystem.
Degree
thesis:*- Name thesis:degree_name
- M.S.
- Department dc:contributor.department
- Computer Science
- Grantor
- East Carolina University
- Year dc:date.issued
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Jubril, Adegboyega Olajuwon
- Advisor dc:contributor.advisor
-
- Srinivasan Madhusudan
- Committee members dc:contributor.committeemember
-
- Dr. Tabrizi Nasseh
- Dr. David Hart
- Dr. Andrew Earle
Subjects
dc:subject × 1Rights
- Language dc:language.iso
- English
Identifiers
dc:identifier.*- Handle dc:identifier.uri
- https://hdl.handle.net/10342/14925