Skip to content

SOM-Research/ImageBiTeDSL

Repository files navigation

ImageBiTe DSL

ImageBiTe DSL is a Visual Studio Code extension for defining non-bias requirements and test scenarios, according to a domain-specific language (DSL).

The DSL provides with the necessary constructs for modeling requirements to identify representational harms, and to target particular communities that could be potentially discriminated in case a bias is present.

Repository Structure

The following tree shows the list of the repository's relevant sections:

  • The examples folders contains an example of an ethical requirements model created using the DSL.
  • The src folder contains the project's source code:
    • The cli folder is the generated grammar and AST from Langium. You may not want to dive in it as it is a generated asset.
    • The extension folder contains all the code of the generation service. Could be a good place to start if you want to improve the generation of the tool.
    • The language folder contains all the language features, and the grammar declaration. If you want to improve the grammar, or some of the features the plugin offers here is the place you may want to start.

Usage

Defining Ethical Requirements

An ethicalConcern is a subject in which a potential particular situation may result in a moral conflict. Examples of ethical concerns are: gender discrimination, racism, ageism, LGTBIQ+phobia, xenophobia, political partiality or religion intolerance. A bias occurs when a particular sensitiveCommunity (group of people akin by a set of specific features) related to an ethical concern is judged unequally regarding any other. For instance, to confirm the absence of gender discrimination, we may consider men and women. Each sensitive community has a literal per language supported.

An ethicalRequirement is set to address an ethical concern for a concrete subset of their sensitive communities. Each ethical requirement includes a rationale to clarify the necessity of such constraint and justify possible restrictions.

A set of ethical requirements is included in a requirementsModel.

Defining Test Scenarios

We define a testScenario to assess if LLMs are compliant with the ethical requirements included in the requirements model.

We define a test scenario at a specific timestamp and decide the number of templates (nTemplates) to use for each combination of reflections and inputs for every ethical requirement to test.

The test scenario will be executed against a set of llms.

Contributing

This project is being development as part of a research line of the SOM Research Lab, but we are open to contributions from the community. If you are interested in contributing to this project, please read the GOVERNANCE.md document.

At SOM Research Lab we are dedicated to creating and maintaining welcoming, inclusive, safe, and harassment-free development spaces. Anyone participating will be subject to and agrees to sign on to our code of conduct.

Publications

This repository is the companion to the following research paper:

Sergio Morales, Robert Clarisó and Jordi Cabot. "ImageBiTe: A framework for evaluating representational harms in text-to-image models," 4th IEEE/ACM International Conference on AI Engineering – Software Engineering for AI (CAIN ’25), Ottawa (Canada), April 27-28th, 2025. doi: 10.1109/CAIN66642.2025.00019

Related publications:

Sergio Morales, Robert Clarisó and Jordi Cabot. "Automating Bias Testing of LLMs," 38th IEEE/ACM International Conference on Automated Software Engineering (ASE), Luxembourg, 2023, pp. 1705-1707, doi: 10.1109/ASE56229.2023.00018

Sergio Morales, Robert Clarisó and Jordi Cabot. "LangBiTe: A Platform for Testing Bias in Large Language Models," SoftwareX 31, page 102248, 2025. doi: 10.1016/j.softx.2025.102248

Sergio Morales, Robert Clarisó and Jordi Cabot. "A DSL for Testing LLMs for Fairness and Bias," ACM/IEEE 27th International Conference on Model Driven Engineering Languages and Systems (MODELS '24), September 22-27, 2024, Linz, Austria. doi: 10.1145/3640310.3674093

License

License: MIT

The source code for the site is licensed under the MIT License, which you can find in the LICENSE.md file.

All graphical assets are licensed under the Creative Commons Attribution 3.0 Unported License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published