Path-Level Structural and Semantic Alignment for Hierarchical Multi-Label Text Classification
Authors: Xindi Wang, Aifen Xiong, Baiyang Wang, Xuri Ge, Robert Mercer, Frank Rudzicz, Yifan Peng, Zhumin Chen, Hongjun Wang
Organizations: School of Artificial Intelligence, Shandong University, Jinan, China · School of Information Science and Engineering, Shandong University, Qingdao, China · Department of Computer Science, Western University, London, Ontario, Canada · Faculty of Computer Science, Dalhousie University, Halifax, Nova Scotia, Canada · Department of Population Health Sciences, Weill Cornell Medicine, New York, NY, USA
Hierarchical multi-label text classification (HMTC) requires models to capture both structural dependencies among labels and the fine-grained semantics of labels at different hierarchy levels. Existing methods often model hierarchy through prediction constraints or representations of individual labels and local relations. Structural and semantic supervision, however, are usually formulated separately. We instead use complete root-to-node label paths as a shared unit for both. Our framework introduces two auxiliary training objectives while retaining a standard multi-label classifier at inference. PathSimNCE aligns document representations with hierarchical paths using hierarchy-aware contrastive targets. These targets provide graded supervision for structurally related paths while preserving explicit supervision for the ground-truth paths. The complementary semantic objective uses LLM-generated, document-conditioned descriptions of the same positive paths. It thereby provides context-specific label semantics beyond static label representations. Experiments on three benchmarks show consistent improvements: structural alignment is particularly beneficial in deeper hierarchies, while semantic alignment provides additional gains for fine-grained labels.
Figures & tables
Figure 1: An example of HMTC. Labels are organized in a top-down hierarchy from coarse to fine. Labels sharing the same color correspond to nodes along the same hierarchical label path.
Figure 2: Overview of the proposed hierarchy-aware representation learning framework. (a) Instead of treating labels as isolated identifiers, each label is associated with its root-to-node path in the hierarchy. The model is jointly optimized with three objectives: binary cross-entropy (BCE), PathSimNCE, and description alignment. (b) Description alignment uses LLM-generated path descriptions to provide complementary semantic supervision during training only. (c) PathSimNCE performs hierarchy-aware contrastive learning by combining text–path and path–path similarities to generate soft structural supervision targets.
Model
WOS
BGC
NYT
Micro-F1
Macro-F1
Micro-F1
Macro-F1
Micro-F1
Macro-F1
RoBERTa-base
86.45
78.89
81.40
67.13
81.79
72.06
HGCLR ( Wang et al., 2022 )
86.90
80.98
81.24
67.00
81.08
71.45
HiTIN ( Zhu et al., 2023 )
86.63
80.92
80.45
66.22
80.30
69.80
HILL ( Zhu et al., 2024 )
87.35
82.04
81.15
66.03
80.96
70.21
HALB ( Zhang et al., 2024 )
86.97
81.26
81.34
67.00
80.70
70.93
Table 1: Performance comparison with previous methods on the WOS, BGC, and NYT datasets. To ensure a fair comparison, all reproduced methods use the same RoBERTa-base encoder, regardless of the encoders originally adopted in their respective papers. Results for our method are reported as mean ± standard deviation over three runs. Bold indicates the best result in each column. Except for HYDRA Local, whose results are taken from the original paper, all reported results are obtained from our own experiments.
Dataset
#Labels
Depth
Avg # label
Avg length
WOS
141
2
2.00
207.62
BGC
146
4
3.01
162.88
NYT
166
8
7.58
605.90
Table 2: Statistics of the datasets.
WOS
BGC
NYT
Model
Micro-F1
Macro-F1
Micro-F1
Macro-F1
Micro-F1
Macro-F1
BCE
86.45 ± 0.16
78.89 ± 0.18
81.40 ± 0.13
67.13 ± 0.30
81.79 ± 0.18
72.06 ± 0.22
BCE+PathSimNCE
87.53 ± 0.23
80.66 ± 0.33
81.68 ± 0.19
67.85 ± 0.29
82.29 ± 0.12
72.94 ± 0.31
BCE+DESC
87.11 ± 0.22
79.68 ± 0.32
81.60 ± 0.15
67.73 ± 0.30
82.14 ± 0.21
72.43 ± 0.33
No Description
87.53 ± 0.23
80.66 ± 0.33
81.68 ± 0.19
67.85 ± 0.29
82.29 ± 0.12
72.94 ± 0.31
Template Description
86.17 ± 0.14
77.76 ± 0.22
81.72 ± 0.19
67.90 ± 0.29
82.32 ± 0.13
72.98 ± 0.36
Table 3: Ablation results on the three datasets. The upper block examines the contributions of the training objectives, and the lower block compares different forms of semantic supervision while retaining BCE and PathSimNCE. Results are reported as mean ± standard deviation over three runs.
Figure 3: Depth-wise Micro-F1 and Macro-F1 on NYT. Labels at depths of four or greater are grouped into the 4+ category because of data sparsity. The virtual Top label at depth 0 is excluded.
Figure 4: Document–path cosine similarity heatmaps on BGC for (a) BCE+PathSimNCE and (b) the full model. Each row represents a group of test documents sharing the corresponding ground-truth path, and each column represents a selected path embedding. Both panels use the same color scale, and darker colors indicate higher average cosine similarity.
Parameter
Value
Micro-F1
Macro-F1
β
0.3
82.06
72.70
0.2
82.52
73.18
0.1
82.20
72.83
βdesc
0.2
82.32
72.88
0.1
82.52
73.18
τh
0.10
82.30
72.66
Table 4: Hyperparameter sensitivity on the NYT dataset. Bold indicates the hyperparameter settings used in the final model and their corresponding performance.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: Macro-F1 gains over the BCE baseline across label-frequency percentile groups on NYT. Labels are ranked by their numbers of training instances and divided into five equally sized groups from the most frequent to the least frequent. Positive values indicate improvements over BCE.
Item
Case 1: Count Zero
Case 2: Coriolanus
Input Text
A stylish, streetsmart, frighteningly probable parable of the future … A corporate mercenary wakes in a reconstructed body, a beautiful woman by his side. Then Hosaka Corporation reactivates him, for a mission more dangerous than the one he’s recovering from: to get a defecting chief of R&D—and the biochip he’s perfected—out intact. … But this proves to be of supreme interest to certain other parties—some of whom aren’t remotely human …
The legendary Pelican Shakespeare series features authoritative and meticulously researched texts paired with scholarship by renowned Shakespeareans. Each book includes an essay on the theatrical world of Shakespeare’s time, an introduction to the individual play, and a detailed note on the text used. … With more than 1,800 titles, Penguin Classics represents a global bookshelf of the best works throughout history and across genres and disciplines.
Table 5: Predicted label sets of four model variants on two BGC test cases.
Figure 7: T-SNE visualization of text and path representations on the BGC dataset using the same 15 representative paths as in Figure 4 . Circles of the same color denote text representations whose ground-truth label sets contain the corresponding path, while the star marker of the same color denotes that path representation. (a) BCE + PathSimNCE. (b) Full Model. The spatial proximity between each text group and its corresponding path representation provides a complementary view of the document–path alignment shown by the cosine-similarity heatmaps.
Department of Computer Science, Georgia State University, Atlanta, GA 30303, USA · Amazon, San Diego, CA, USA · School of Computer Science, Central China Normal University, Wuhan 430079, China