This is an interpretable information retrieval research project that implements and evaluates RAG (Retrieval-Augmented Generation) systems using three interpretability methods:
- Gradient-based methods - Using gradients to identify important tokens/sentences
- Perturbation-based methods - Measuring impact by removing or modifying text elements
- Surrogate-based methods - Using SHAP values to explain retrieval scores
The project evaluates these methods using the MS MARCO and SCIREX datasets.
IMPORTANT: PyTorch must be installed from source first (it will not work properly with conda).
After PyTorch is installed, create the conda environment:
conda env create -f environment.ymlThis creates an environment named interpretability_project with Python 3.10.18.
Activate the environment:
conda activate interpretability_projectComing soon
The permutation_method folder conaints the implementation and evaluation of permutation-based importance scoring. For methodology and results, see:
- pertubation_method/README.md Overview of the formulation and motivation of permutation-based importance scoring
- pertubation_method/permutation_scores_test.py Implementation of the pertubation based method and analysis in multiple different settings on two different datasets
The shap_method/ folder contains the complete implementation and evaluation of the SHAP-based surrogate method. For detailed methodology, results, and analysis, see:
- shap_method/README.md - Implementation documentation
- shap_method/SHAP_METHOD_REPORT.md - Evaluation report for SHAP method
- shap_method/notebooks/ - Jupyter notebooks with EDA and SHAP evaluation outputs
Note: Other methods will be added soon.
- MS MARCO v2.1 (microsoft/ms_marco) for retrieval evaluation
- SCIREX for entity-level evaluation (used in SHAP method)