H ier P rompt: Zero-Shot Hierarchical Text Classification with LLM -Enhanced Prototypes (2025)

Abstract: Hierarchical Text Classification is a challenging task which classifies texts into categories arranged in a hierarchy. Zero‐Shot Hierarchical Text Classification (ZS-HTC) further assumes only the availability of hierarchical taxonomy, without any training data. Existing works of ZS-HTC are typically built on the prototype-based framework by embedding the category names into prototypes, which, however, do not perform very well due to the ambiguity and impreciseness of category names. In this paper, we propose HierPrompt, a method that leverages hierarchy-aware prompts to instruct LLM to produce more representative and informative prototypes. Specifically, we first introduce Example Text Prototype (ETP), in conjunction with Category Name Prototype (CNP), to enrich the information contained in hierarchical prototypes. A Maximum Similarity Propagation (MSP) technique is also proposed to consider the hierarchy in similarity calculation. Then, the hierarchical prototype refinement module is utilized to (i) contextualize the category names for more accurate CNPs and (ii) produce detailed example texts for each leaf category to form ETPs. Experiments on three benchmark datasets demonstrate that HierPrompt substantially outperforms existing ZS‐HTC methods.

## introduction hierarchical text classification (htc) @xcite , which assigns text data to categories within a hierarchical taxonomy, is a fundamental task in natural language processing. it plays a crucial role in a wide range of real-world applications, such as product categorization in e-commerce @xcite , document organization @xcite , web content classification @xcite and so * corresponding author on. most of the existing htc methods rely on labeled data, which is expensive and time-consuming. moreover, as the hierarchical taxonomies may vary considerably due to evolving categorization standards, it's unrealistic to relabel the data every time. therefore, interest in zero-shot hierarchical text classification (zs-htc) arises, which aims to classify texts into hierarchical categories using only the provided hierarchical taxonomy-without any labeled or unlabeled training data @xcite . a common approach for zero-shot classification (zsc) is to solve a 1-nearest neighbor problem @xcite , where the category names are embedded as prototypes and the input text is projected to the same embedding space as prototypes. the similarity between the text embedding and the prototypes is then calculated to determine the category of the text. to leverage the hierarchical information of category names in htc, usp @xcite proposes a similarity propagation technique, which transmits similarity scores from leaf nodes upward through the hierarchy. more recently, hila @xcite proposes to use large language models (llm) to generate more fine-grained categories for the leaf categories and then use the generated categories to estimate the similarities for better accuracy. despite the effectiveness of these methods, they are all built on the assumption of high-quality prototypes, which, however, are not easy to achieve in current methods for the following reasons. 1) lack of representativeness: the category names defined in the taxonomy are often overly general and imprecise, leading to ambiguous meaning. for instance, 'work' can be interpreted as either 'job' or 'creative content' without providing contextual information. as a result, directly encoding these decontextualized and imprecise category names leads to unrepresentative prototypes. 2) lack of stylistic information: category names are usually overly software video games the horrendous parade is an action puzzle video game designed by stefano gualeni… dbpedia games video games …the family spent hours over the holiday playing this game. a great, inexpensive buy! amazon same category name in different datasets corresponds to texts with different style ## method in this section, we first introduce the common approach for zs-htc, which embeds category names as prototypes for the text 1-nearest neighbor problem. subsequently, our refined framework with additional prototypes and different similarity calculation technique is illustrated. finally, we leverage llms and introduce hierarchical prototype refinement module, including category name extension and example text generation, with hierarchy-aware prompts. we follow the notation defined by @xcite , as is described in ## conclusion in this paper, hierprompt, a method to leverage hierarchy-aware prompts to instruct llm for producing more representative and informative prototypes in zs-htc task, is proposed. specifically, the zsc framework is refined by introducing example text prototype (etp) on the basis of category name prototype (cnp) and by designing maximum similarity propagation. then, with the help of llm and hierarchy-aware prompts, the category names are contextualized and the example texts are generated, forming the refined prototypes. experiment on three public benchmark demonstrated the superiority in zs-htc of hierpompt.