Thermostat: A Large Collection of NLP Model Explanations and Analysis Tools

Nils Feldhus, Robert Schwarzenberg, Sebastian Möller

Introduction

While deep neural networks have revolutionized Natural Language Processing (NLP), they remain largely "black boxes." Their decision-making processes are complex and opaque, leading researchers to rely on feature attribution methods (or "explainers") to highlight which specific tokens drive a model's conclusion. However, generating these explanations is a significant bottleneck; state-of-the-art explainers are computationally expensive, often requiring hundreds of model passes for a single sentence. Furthermore, the lack of standardized sharing for raw attribution maps leads to redundant computation and hinders direct comparisons across different research efforts.

The THERMOSTAT Framework

To address these challenges, the authors introduce THERMOSTAT, a massive open-source data hub and toolkit designed to democratize and standardize explainability research. The framework consists of two primary components:

  1. A Data Hub: A centralized repository of pre-generated feature attribution maps. Each entry is defined by "three coordinates": the Dataset, the Model, and the Explainer.
  2. An Analysis Library: A Python package built on the Hugging Face datasets library that provides tools for visualizing explanations as heatmaps and calculating comparative statistics like rank correlation.

THERMOSTAT utilizes five prominent explainers: (Layer) Gradient x Activation, Integrated Gradients, LIME, Occlusion, and Shapley Value Sampling. By providing these pre-computed maps, the project saves the research community an estimated 10,000+ GPU hours of redundant computation.

Dataset Coverage and Scale

THERMOSTAT currently spans four major NLP benchmarks across five model architectures, including ALBERT, BERT, ELECTRA, RoBERTa, and XLNet. The benchmarks include IMDb (sentiment analysis), MultiNLI (natural language inference), XNLI (cross-lingual NLI), and AG News (topic classification). The collection includes nearly 50,000 instances, resulting in over 200,000 individual explanations.

Overview of THERMOSTAT coverage across datasets, models, and explainers.

Key Insights: Green XAI and Democratization

The authors advocate for "Green NLP" by centralizing the compute-heavy process of explanation generation. By spending over a year of compute time upfront, THERMOSTAT significantly reduces the carbon footprint of future interpretability research. This approach also democratizes the field; researchers without access to massive GPU clusters can now perform sophisticated cross-model debugging and qualitative analysis using only a standard laptop.

Furthermore, THERMOSTAT enables standardization. By forcing various explainers into a common format, it allows for "apples-to-apples" comparisons between different algorithms, a process that was previously fragmented and difficult to replicate.

Ease of Use and Visualization

A core strength of the THERMOSTAT library is its accessibility. Loading a dataset and rendering a token-level heatmap requires only four lines of Python code. This simplicity allows researchers to quickly identify "disagreement" cases—instances where different models arrive at the same prediction but rely on entirely different linguistic cues.

Loading and rendering a token-level heatmap with the THERMOSTAT library.

Limitations and Future Work

While THERMOSTAT is a significant step forward, it is currently limited to text classification tasks. The authors acknowledge that extending these tools to more complex tasks like Machine Translation or Question Answering remains an open challenge. Future work will focus on expanding task variety and integrating with interactive visualization platforms like the Language Interpretability Tool (LIT) to provide deeper analytical capabilities.

Summary updated

BibTeX
@inproceedings{feldhus2021thermostat,
  author = {Nils Feldhus and Robert Schwarzenberg and Sebastian Möller},
  title = {{Thermostat: A Large Collection of NLP Model Explanations and Analysis Tools}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-demo.11},
}
Figure