My Bachelor Thesis

python
xai
transformers
shap
gradio
captum
academic
  • My bachelor thesis about XAI, LLMs, and ChatBots
  • Built in Python with Huggingface, Gradio, and SHAP/CAPTUM
  • Analyzing how LLM output and ChatBots can be more understandable

About the Project

When the time came to write my thesis, the topic of Explainable AI (XAI) was suggested to me by one of my professors at the university. I decided to specifically look into ChatBots, as they are pivotal in the field of LLM applications. The official topic of my thesis was:

Building an Interpretable Natural Language AI Tool based on Transformer Models and approaches of Explainable AI.

The result of this work is a 70-page thesis that explores how techniques of XAI can be applied to LLMs and ChatBots. I examined several different approaches and open-source implementations after outlining all the important fundamentals.

Additionally, I developed a working prototype aimed at interpreting and explaining the decisions of a Mistral 7B Instruct Model within a chat interface. This prototype is designed to improve explainability for common users.

Features

The thesis project includes several key features:

  • Comprehensive Research: Detailed exploration of XAI techniques applied to LLMs and ChatBots.
  • Prototype Development: Creation of a prototype to interpret and explain LLM decisions.
  • User-friendly Interface: Designed to make AI decisions understandable to non-experts.
  • Extensive Documentation: A 70-page thesis documenting the research and development process.

Technology

PythonJupyter NotebooksHuggingfaceGradioCaptum

The implementation of my thesis relied on several open-source technologies due to their availability and robustness. The key technologies used include:

  • Huggingface Transformers: Utilized for model implementation and handling.
  • Captum and SHAP: Employed for XAI implementation, with KernelSHAP used for interpreting the Mistral model.
  • Gradio: Used for building the user interface and interaction layer.
  • FastAPI: Used for developing the backend and API services.

Architecture

The architecture of the project is designed to facilitate research and prototyping in a flexible and efficient manner:

  • Programming Language: Python, chosen for its extensive libraries and community support.
  • Model Framework: Huggingface Transformers for handling transformer models.
  • XAI Tools: Captum and SHAP for explainability, providing insights into model decisions.
  • UI Framework: Gradio for building interactive user interfaces.
  • Backend: FastAPI for creating robust backend services.
  • Development Environment: Jupyter Notebooks for iterative development and documentation.