Distilling Task-specific Logical Rules from Large Pre-trained Models

Tao Chen, Luxin Liu, Xuepeng Jia, Baoliang Cui, Haihong Tang, Siliang TangarXiv 2022

Abstract

Logical rules, both transferable and explainable, are widely used as weakly supervised signals for many downstream tasks such as named entity tagging. To reduce the human effort of writing rules, previous researchers adopt an iterative approach to automatically learn logical rules from several seed rules. However, obtaining more seed rules can only be accomplished by extra human annotation with heavy costs. Limited by the size and quality of the seed rules, the model performance of previous systems is bounded. In this paper, we develop a novel framework STREAM to distill task-specific logical rules from large pre-trained models. Specifically, we borrow recent prompt-based language models as the knowledge expert to yield initial seed rules, and based on the formed high-quality instance pool that acts as an intermediary role, we keep teaching the expert to fit our task and learning task-specific logical rules. Experiments on three public named entity tagging benchmarks demonstrate the effectiveness of our proposed framework. With several predefined prompt templates, our system has gained significant improvements over previous state-of-the-art methods.

Introduction

Named Entity Recognition (NER) is a fundamental task in natural language processing, but its reliance on massive human-annotated datasets remains a significant bottleneck. Weak supervision offers a solution by using "logical rules" (e.g., pattern matching or dictionary lookups) to label data. However, traditional automated rule-learning systems suffer from a "cold start" problem: they require a small set of high-quality, human-written "seed rules" to begin the iterative process of rule discovery. Writing these seeds is labor-intensive and requires deep domain expertise.

To address this, we propose STREAM (diStill Task-specific logical Rules from large prE-trAined Models), a framework that leverages the latent knowledge within Large Language Models (LLMs) to generate these seed rules automatically, effectively removing the human from the loop.

Methodology

The STREAM framework operates through a three-phase iterative process:

  1. Zero-shot Seed Rule Generation: We utilize a pre-trained model (e.g., RoBERTa) as a "knowledge expert." By applying prompt templates like [LC] [mask] such as E [RC], the model predicts entity categories. To ensure reliability, we employ a consistency check: an instance is only accepted as a seed rule if multiple prompts yield the same label with high confidence.
  2. Iterative Rule Distillation: These seeds populate a "High-quality Instance Pool" (PLs). We train a task-specific model on this pool and use it to identify similar instances in unlabeled data. From this expanded pool, we distill new logical rules based on lexical features, POS tags, and dependency relations.
  3. Prompt Fine-tuning: The high-quality instances are used to fine-tune the prompt-based expert using "soft prompts" (learnable virtual tokens). This creates a self-improving cycle where better data leads to more accurate prompts, which in turn generate higher-quality rules.
The STREAM framework overview, showing the flow from unlabeled data and prompts to the logical rule pool and specific task model.

Experiments and Results

We evaluated STREAM on three benchmark NER datasets: BC5CDR (biomedical chemicals/diseases), CHEMDNER (chemicals), and CoNLL2003 (news).

STREAM significantly outperforms previous state-of-the-art (SOTA) weakly supervised methods. On the BC5CDR dataset, STREAM achieved an F1-score of 70.11, compared to 66.73 for the previous best system, TALLOR.

A key finding is the efficiency of our automated approach. As shown in Figure 5, the previous SOTA (TALLOR) requires approximately 825 manually written seed rules to match the performance that STREAM achieves with zero human-written rules. This demonstrates that LLMs can effectively replace hours of expert labor.

Performance comparison on BC5CDR: STREAM achieves high F1-scores without manual seed rules, whereas TALLOR requires hundreds of human-written rules to reach comparable performance.

Discussion and Conclusion

The success of STREAM highlights that LLMs already contain the domain knowledge necessary to act as experts for rule generation. By using consistency as a proxy for truth and employing soft prompts for task adaptation, we can distill explainable logical rules that are both accurate and transferable. While the system still requires initial prompt templates, it represents a major step toward fully autonomous, weakly supervised NER systems. Future work will focus on automating template discovery and improving computational efficiency.

Summary updated

BibTeX
@misc{chen2022distilling,
  author = {Tao Chen and Luxin Liu and Xuepeng Jia and Baoliang Cui and Haihong Tang and Siliang Tang},
  title = {{Distilling Task-specific Logical Rules from Large Pre-trained Models}},
  year = {2022},
  eprint = {2210.02768},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.02768},
}
Figure