El presente proyecto de fin de grado (PFG) tiene como objetivo diseñar y desarrollar una metodología sistemática para la evaluación y detección automática de sesgos en modelos LLM, mediante la generación automatizada de prompts. Haciendo uso de Python y plantillas JavaScript Object Notation (JSON) parametrizadas.
La herramienta EQUITIA permite abordar preocupaciones éticas desde múltiples escenarios, adaptándose al contexto y las comunidades sensibles definidas por el usuario. El enfoque proporciona una evaluación precisa, reproducible y flexible para auditar el comportamiento de los modelos LLM en situaciones muy específicas.
La generación de casos de prueba se realiza automáticamente mediante metaprompts, orientados a distintos tipos de evaluación. Estos metaprompts son procesados por un modelo LLM para crear múltiples y variados prompts. Cada tipo de evaluación busca activar diferentes capacidades del modelo, permitiendo un análisis más profundo y detallado de su comportamiento desde diferentes perspectivas.
Este sistema ofrece trazabilidad completa del proceso de evaluación, desde la configuración inicial de los prompts hasta la obtención de las métricas finales, así como la generación de gráficos que ayudan a entender visualmente cómo se han comportado los modelos LLM evaluados.
Entre los resultados obtenidos, se han identificado comportamientos sesgados hacia ciertas comunidades que no serían detectables con metodologías tradicionales, así como dificultades en la generación de ciertos tipos de respuesta, como aquellas que implican estereotipos.
Este trabajo ofrece una base sólida para futuras auditorías éticas y estudios comparativos de modelos LLM. Alineándose con los retos actuales en materia de inteligencia artificial (IA) responsable y explicable, a nivel europeo y mundial.
Abstract:
This project aims to design and develop a systematic methodology for the evaluation and automatic detection of bias in Large Language Models (LLMs), through the automated generation of prompts using Python and parametrized JSON templates.
The EQUITIA tool enables the assessment of ethical concerns across multiple scenarios, adapting to the context and the sensitive communities defined by the user. The approach offers a precise, reproducible, and flexible framework to audit the behavior of Large Language Models in highly specific situations.
Test cases are generated automatically via metaprompts, designed for various types of evaluation. These metaprompts are processed by a dedicated Large Language Model to produce diverse and targeted prompts. Each type of evaluation aims to activate different reasoning mechanisms in the model, allowing a more comprehensive and detailed analysis of its behavior from multiple angles.
The system ensures full traceability throughout the evaluation process, from initial prompt configuration to the generation of final metrics and visual summaries that help interpret the evaluated models’ behavior.
The results highlight biased behaviors toward specific communities that would remain undetected through traditional one-dimensional methods, as well as generation difficulties for certain response types, particularly those involving stereotypes.
This work provides a robust foundation for future ethical audits and comparative studies of Large Language Models, aligned with current global and European challenges in the pursuit of responsible and explainable AI.
El presente proyecto de fin de grado (PFG) tiene como objetivo diseñar y desarrollar una metodología sistemática para la evaluación y detección automática de sesgos en modelos LLM, mediante la generación automatizada de prompts. Haciendo uso de Python y plantillas JavaScript Object Notation (JSON) parametrizadas.
La herramienta EQUITIA permite abordar preocupaciones éticas desde múltiples escenarios, adaptándose al contexto y las comunidades sensibles definidas por el usuario. El enfoque proporciona una evaluación precisa, reproducible y flexible para auditar el comportamiento de los modelos LLM en situaciones muy específicas.
La generación de casos de prueba se realiza automáticamente mediante metaprompts, orientados a distintos tipos de evaluación. Estos metaprompts son procesados por un modelo LLM para crear múltiples y variados prompts. Cada tipo de evaluación busca activar diferentes capacidades del modelo, permitiendo un análisis más profundo y detallado de su comportamiento desde diferentes perspectivas.
Este sistema ofrece trazabilidad completa del proceso de evaluación, desde la configuración inicial de los prompts hasta la obtención de las métricas finales, así como la generación de gráficos que ayudan a entender visualmente cómo se han comportado los modelos LLM evaluados.
Entre los resultados obtenidos, se han identificado comportamientos sesgados hacia ciertas comunidades que no serían detectables con metodologías tradicionales, así como dificultades en la generación de ciertos tipos de respuesta, como aquellas que implican estereotipos.
Este trabajo ofrece una base sólida para futuras auditorías éticas y estudios comparativos de modelos LLM. Alineándose con los retos actuales en materia de inteligencia artificial (IA) responsable y explicable, a nivel europeo y mundial.
Abstract:
This project aims to design and develop a systematic methodology for the evaluation and automatic detection of bias in Large Language Models (LLMs), through the automated generation of prompts using Python and parametrized JSON templates.
The EQUITIA tool enables the assessment of ethical concerns across multiple scenarios, adapting to the context and the sensitive communities defined by the user. The approach offers a precise, reproducible, and flexible framework to audit the behavior of Large Language Models in highly specific situations.
Test cases are generated automatically via metaprompts, designed for various types of evaluation. These metaprompts are processed by a dedicated Large Language Model to produce diverse and targeted prompts. Each type of evaluation aims to activate different reasoning mechanisms in the model, allowing a more comprehensive and detailed analysis of its behavior from multiple angles.
The system ensures full traceability throughout the evaluation process, from initial prompt configuration to the generation of final metrics and visual summaries that help interpret the evaluated models’ behavior.
The results highlight biased behaviors toward specific communities that would remain undetected through traditional one-dimensional methods, as well as generation difficulties for certain response types, particularly those involving stereotypes.
This work provides a robust foundation for future ethical audits and comparative studies of Large Language Models, aligned with current global and European challenges in the pursuit of responsible and explainable AI. Read More


