Extracting human interpretable structure-property relationships in chemistry using XAI and large language models

Geemi Wellawatte, Philippe Schwaller

TL;DR

This paper introduces XpertAI, a novel framework that combines Explainable AI (XAI) techniques with Large Language Models (LLMs) to automatically generate human-interpretable explanations of structure-property relationships in chemistry. By bridging the gap between complex AI models and scientific literature, XpertAI makes chemical insights more accessible to a wider audience, fostering trust and accelerating discovery.

What Problem Does This Paper Address?

In chemistry, understanding how a molecule's structure dictates its properties is fundamental. Machine learning (ML) models have become powerful tools for predicting these relationships, but their "black-box" nature often leaves chemists skeptical. While Explainable AI (XAI) aims to shed light on these models, existing XAI methods are typically geared towards technical users and can be difficult to interpret. This creates a barrier to adoption and limits the ability of non-experts to leverage AI-driven chemical insights. The paper addresses this by developing a system that not only identifies key structural features influencing a property but also translates these findings into clear, scientifically grounded explanations using natural language and scientific literature.

Methods

The XpertAI framework integrates several key components:

  • Machine Learning Model Training: An initial ML model (XGBoost is used here) is trained on raw chemical data (featurized molecular structures and target properties) to act as a surrogate for mapping inputs to outputs.
  • XAI for Feature Importance: Techniques like SHAP and LIME are employed to identify the most "impactful" features from the trained ML model, providing local and global explanations of feature importance.
  • Large Language Models (LLMs) for Explanation Generation: LLMs (specifically GPT-4 is mentioned) are used to synthesize the XAI findings with information from scientific literature. This involves querying literature databases, summarizing relevant findings, and generating natural language explanations.
  • Literature Integration: The framework leverages the LangChain Python package and a vector database (Chroma) to access and process scientific literature. Users can provide their own literature datasets or scrape from sources like arXiv.
  • Maximal Marginal Relevance (MMR) Search: This technique is used to select the most relevant literature excerpts to support the XAI findings.
  • Chain-of-Thought Prompting: This advanced prompting strategy is used to guide the LLM in generating step-by-step, interpretable explanations.

The novelty lies in the seamless integration of these components to go beyond simply identifying important features; XpertAI aims to provide a comprehensive, scientifically validated narrative.

Datasets

The paper utilizes several publicly available datasets for its case studies:

  • CoRE MOF 2019 database: Used for studies on Metal-Organic Frameworks (MOFs), providing crystal structures.
  • Tox21 database: Used for toxicity prediction of small molecules.
  • AqSolDB dataset: Used for predicting the aqueous solubility of small molecules.
  • UFL dataset: Used for predicting the upper flammability limit of organic molecules.

In addition to these datasets, curated literature datasets (containing 19, 18, 17, and 11 publications for respective case studies) were also provided to XpertAI to enrich its explanations.

Key Insights and Ideas

  • Bridging the XAI-LLM Gap: The core insight is that combining XAI's ability to pinpoint important features with LLMs' capacity to synthesize information from literature creates a powerful synergy for generating interpretable explanations.
  • Beyond Model Predictions: XpertAI doesn't just explain why a model made a prediction; it aims to uncover underlying structure-property relationships by grounding XAI findings in scientific literature.
  • Tailored Explanations: A key advantage is XpertAI's ability to generate explanations specific to the user's dataset, rather than generic statements from broader literature.
  • Democratizing Chemical Knowledge: By making complex AI insights accessible through natural language, XpertAI has the potential to democratize chemical knowledge extraction and accelerate scientific progress.
  • Literature Quality Matters: The accuracy and specificity of XpertAI's explanations are directly dependent on the quality and relevance of the provided literature dataset.

Key Results

  • Successful Case Studies: XpertAI was evaluated across five diverse case studies: presence of open metal sites in MOFs, pore limiting diameter in MOFs, toxicity of small molecules, solubility of small molecules, and upper flammability limit of organic molecules.
  • Human Expert Validation: Human experts rated XpertAI's explanations as specific to the given task/dataset, scientifically justified, and accessible to non-technical users.
  • Superiority over Baselines: In most cases, XpertAI's explanations were rated as more accurate and interpretable than those generated by ChatGPT alone or by XAI plots alone.
  • Specific and Scientific Explanations: XpertAI successfully combined the strengths of LLMs and XAI to generate explanations that were both specific to the data and scientifically sound, often including literature citations.
  • One Case Study Anomaly: In one case study (upper flammability limit), ChatGPT's explanation was rated higher, potentially due to limitations in the trained ML model's performance on that specific dataset, leading to spurious correlations.

Limitations and Future Work

  • Surrogate Model Dependence: XpertAI's performance is contingent on the quality of the underlying ML model. If the surrogate model learns spurious relationships, the explanations will be inaccurate.
  • Hyperparameter Hardcoding: In the current version, hyperparameters are hardcoded, which might limit flexibility for advanced users.
  • Future Work: The authors plan to:
  • Incorporate other ML models and enable user-provided models to make XpertAI model-agnostic.
  • Integrate automated hyperparameter optimization.
  • Develop a fully open-source version without GPT-4 dependencies.
  • Continue to improve the framework to enhance accessibility and accelerate scientific discovery.

Summary updated

BibTeX
@inproceedings{wellawatte2023extracting,
  author = {Geemi Wellawatte and Philippe Schwaller},
  title = {{Extracting human interpretable structure-property relationships in chemistry using XAI and large language models}},
  booktitle = {XAIA @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=cBXiaGUcK8},
}
Figure