NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ExpBERT: Representation Engineering with Natural Language Explanations

Shikhar Murty, Pang Wei Koh, Percy Liang

Introduction

Modern deep learning models like BERT have revolutionized natural language processing by moving away from manual feature engineering toward end-to-end "black box" learning. However, this shift has made it difficult for developers to inject domain-specific knowledge or "inductive biases" into their models. While previous research attempted to use semantic parsers to convert human explanations into executable code, these methods are often brittle and struggle with the inherent nuances of natural language.

ExpBERT addresses this challenge by allowing developers to provide natural language explanations (e.g., "they went on a honeymoon") as inductive biases. By leveraging a pre-trained language model to "interpret" these explanations, ExpBERT bridges the gap between human intuition and neural network representations.

The ExpBERT Framework

The core innovation of ExpBERT is treating the interpretation of an explanation as a Natural Language Inference (NLI) task. The framework consists of several key components:

  1. The Interpreter: A BERT model fine-tuned on the MultiNLI dataset. It treats the input sentence as a "premise" and the human explanation (e.g., "{o1} and {o2} are a couple") as a "hypothesis" to determine entailment.
  2. Feature Extraction: For each input sentence, the model "executes" a set of $n$ explanations. The [CLS] token output from BERT provides a 768-dimensional vector representing how well the explanation fits the input.
  3. Representation Engineering: The model constructs two primary vectors: $u(x)$, a base representation comparing the input to label descriptions, and $v(x)$, formed by concatenating the BERT outputs for all user-provided explanations.
  4. The Classifier: A Multi-Layer Perceptron (MLP) processes both $u(x)$ and $v(x)$ to produce the final prediction.
The ExpBERT architecture uses a frozen BERT interpreter to process input sentences alongside textual descriptions and human-provided explanations.

Notably, the BERT interpreter remains frozen during training, allowing features to be pre-computed and significantly reducing computational overhead.

Experimental Results

ExpBERT was evaluated across three relation extraction tasks: Spouse (identifying married entities), Disease (identifying chemical-disease relations), and TACRED (a large-scale benchmark with 41 relation types).

Data Efficiency and Performance

The framework demonstrates remarkable data efficiency. On the Spouse task, ExpBERT matched the performance of a standard BERT baseline while using 20x less labeled data. On the TACRED benchmark, it required 3x less data to achieve comparable results. Furthermore, when provided with the same amount of labeled data as the baseline, ExpBERT improved F1 scores by 3 to 10 points.

F1 score performance of ExpBERT compared to a NoExp baseline across different percentages of training data for the Spouse and TACRED datasets.

Key Insights

  • Soft Logic: Unlike binary semantic parsers, ExpBERT provides high-dimensional "soft" interpretations that capture linguistic nuance.
  • High-Bandwidth Supervision: A single explanation can provide as much signal as hundreds of labeled examples.
  • Paraphrasing: Providing multiple ways to express the same idea (e.g., "is married to" vs. "had a wedding") significantly boosts model performance.

Conclusion and Future Work

ExpBERT proves that natural language explanations are a powerful tool for guiding neural models. While the current implementation faces some inference speed constraints due to multiple BERT passes, it sets a new standard for data-efficient relation extraction. Future work may explore fine-tuning the interpreter on target tasks or developing more efficient ways to aggregate large sets of explanations.

Summary updated

BibTeX
@inproceedings{murty2020expbert,
  author = {Shikhar Murty and Pang Wei Koh and Percy Liang},
  title = {{ExpBERT: Representation Engineering with Natural Language Explanations}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.190},
}
Figure