Abstract
Zero-shot Multi-label Text Classification (ZS-MTC) involves categorizing text into multiple, previously unseen labels that are typically organized in a hierarchical structure. While pretrained language models like BERT provide strong semantic baselines, they often fail to respect the logical constraints of label hierarchies, leading to "class-membership inconsistencies." We present a novel framework that combines pretrained models with Reinforcement Learning. By framing label hierarchy navigation as a Markov Decision Process (MDP) with path-based rewards and introducing an Inference Rollback algorithm, our approach significantly improves classification performance and logical consistency across multiple real-world datasets.
Introduction
In Multi-label Text Classification (MTC), instances are assigned to multiple categories from a predefined set. In many domains, these categories are structured hierarchically (e.g., Active Life $\rightarrow$ Bike Rentals). The Zero-shot (ZS) variant of this task is particularly demanding, as the model must generalize to labels not encountered during training.
Current state-of-the-art approaches often utilize pretrained models like BERT to treat classification as a textual entailment task. However, these models typically treat labels as a flat list, ignoring the structural dependencies. This oversight results in logical errors where a model might predict a granular sub-category (e.g., "Bikes") while failing to identify its mandatory parent category (e.g., "Sporting Goods").
Methodology
To address these challenges, we propose two primary mechanisms: Reinforced Label Hierarchy Reasoning (RLHR) and an Inference Rollback algorithm.
Reinforced Label Hierarchy Reasoning (RLHR)
We model the classification process as an MDP where an agent navigates the label tree starting from the root. At each node, the agent chooses to move to a child node or terminate the path. To ensure convergence, the policy network is first pretrained in a "flat" mode before initiating the reinforcement learning phase.
Crucially, we shift from traditional label-based rewards to path-based rewards. In this scheme, the agent receives a positive reward ($\lambda$) only if the entire deduction path aligns with the ground truth. If the path is logically inconsistent or incorrect, a penalty (-1) is applied. This encourages the model to learn the interdependencies between parent and child labels, ensuring that specific classifications are supported by their broader context.
Inference Rollback Algorithm
Standard hierarchical inference often follows a top-down approach, which is "brittle"---a single error at a high level prevents the model from reaching correct lower-level labels. Our proposed Inference Rollback algorithm mitigates this by first performing a "flat" prediction across all labels. If a child label is predicted with high confidence, the algorithm "rolls back" up the tree to automatically include all its parent labels. This ensures that the final output is always logically consistent with the defined hierarchy.
Experimental Evaluation
We evaluated our approach on three datasets: Yelp (business reviews), WOS (scientific abstracts), and QCD (e-commerce queries).
The results demonstrate that the BERT+RLHR+Rollback configuration achieves state-of-the-art performance. On the Yelp dataset, the Example-based F1 (EBF) score rose from 34.59 (vanilla BERT) to 50.01. Furthermore, the logical error rate (Err) saw a marked decrease across all datasets. For instance, on the QCD dataset using DistilBERT, the error rate dropped from 1.0854 to 0.8389, confirming that our method effectively enforces hierarchical constraints.
Conclusion
This work demonstrates that integrating reinforcement learning with pretrained language models can effectively bridge the gap between semantic understanding and structural reasoning. By rewarding valid deduction paths and implementing a rollback mechanism for inference, we significantly enhance the robustness of zero-shot multi-label classification. Future research will focus on improving the training stability of the RL agent and optimizing the computational efficiency for larger taxonomies.
Summary updated