Training Classifiers with Natural Language Explanations

Braden Hancock, Paroma Varma, Stephanie Wang, Martin Bringmann, Percy Liang, Christopher Ré

Abstract

Training accurate classifiers requires many labels, but each label provides only limited information (one bit for binary classification). In this work, we propose BabbleLabble, a framework for training classifiers in which an annotator provides a natural language explanation for each labeling decision. A semantic parser converts these explanations into programmatic labeling functions that generate noisy labels for an arbitrary amount of unlabeled data, which is used to train a classifier. On three relation extraction tasks, we find that users are able to train classifiers with comparable F1 scores from 5-100x faster by providing explanations instead of just labels. Furthermore, given the inherent imperfection of labeling functions, we find that a simple rule-based semantic parser suffices.

Introduction

The primary bottleneck in modern machine learning is the acquisition of large-scale labeled datasets. Traditional labeling is a "low-bandwidth" process: a human annotator examines an example and provides a single bit of information (e.g., a binary label). However, humans often have a clear rationale for their decisions. For instance, an annotator might know two people are married because the word "wife" appears between their names. Standard protocols discard this reasoning, forcing models to rediscover these patterns from scratch through thousands of examples.

BabbleLabble aims to bridge this gap by allowing users to communicate with models using natural language. By capturing the logic behind a label, a single explanation can provide significantly more supervision than a single label, potentially accelerating the training process by orders of magnitude.

The BabbleLabble Framework

The BabbleLabble framework automates the process of turning human reasoning into machine learning supervision through a five-stage pipeline.

Example of an annotator providing a label and explanation, which is then parsed into a labeling function.
  1. Explanation Collection: Annotators provide a label and a natural language explanation for a small subset of data. For example, in a medical relation extraction task, an annotator might say, "True, because the words 'due to' occur between the chemical and the disease."
  2. Semantic Parsing: A rule-based parser converts these natural language sentences into programmatic Labeling Functions (LFs). These LFs are small code snippets that can be executed on large pools of unlabeled data.
  3. Filter Bank: To handle the ambiguity of natural language, the framework employs a "Filter Bank." A Semantic Filter discards LFs that are inconsistent with the original example's label. A Pragmatic Filter removes redundant or useless LFs (e.g., those that are always true or duplicates).
  4. Label Aggregation: The remaining LFs are applied to unlabeled data. Since LFs are heuristic and noisy, the system uses Data Programming (via the Snorkel framework) to estimate the accuracy and correlations of each LF without ground truth, producing probabilistic "noisy" labels.
  5. Discriminative Model Training: Finally, a standard classifier (e.g., a neural network) is trained on the large, noisily-labeled dataset. This allows the model to generalize beyond the specific rules provided by the user.
The BabbleLabble pipeline: from natural language explanations to a trained classifier via semantic parsing, filtering, and label aggregation.

Experimental Evaluation

The framework was evaluated on three distinct relation extraction tasks: Spouse (identifying married couples in news), Disease (identifying chemical-induced diseases), and Protein (identifying protein-kinase interactions).

The results demonstrate a massive speedup in human effort. On the Spouse task, users reached a comparable F1 score 100x faster using explanations than traditional labeling. Even on the complex Protein task, the speedup was 5x. The filter bank proved highly effective, removing 86% of incorrect parses, while the remaining LFs maintained an average accuracy of 86%.

Discussion and Insights

A key finding of this work is that high-bandwidth supervision—capturing the logic behind decisions—is far more efficient than simple labeling. Interestingly, a simple rule-based semantic parser was sufficient because the downstream label aggregator is robust to noise. This suggests that the framework is highly transferable; the same grammar worked across news and biomedical domains without task-specific tuning.

Furthermore, training a discriminative model on the noisy labels provided a significant performance boost (4.3 F1 points) over using the labeling functions directly. This indicates that the model learns to identify informative features that the user did not explicitly mention, effectively generalizing from the provided rules.

Conclusion and Future Work

BabbleLabble demonstrates that natural language explanations can significantly reduce the labeling burden for training classifiers. Future work could involve expanding the grammar to support more complex concepts, handling human errors in explanations more gracefully, and extending the framework to other data modalities like images or tables.

Summary updated

BibTeX
@inproceedings{hancock2018training,
  author = {Braden Hancock and Paroma Varma and Stephanie Wang and Martin Bringmann and Percy Liang and Christopher Ré},
  title = {{Training Classifiers with Natural Language Explanations}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  url = {https://openreview.net/forum?id=SyWwxpx_ZS},
}
Figure