← Latest papers
💬 NLP

KG-HTC: Integrating Knowledge Graphs into LLMs for Effective Zero-shot Hierarchical Text Classification

The paper proposes KG-HTC, a zero-shot hierarchical text classification method that integrates knowledge graphs with large language models via retrieval-augmented generation to effectively address challenges like large label spaces and long-tail distributions, demonstrating significant performance improvements over baselines on multiple datasets.

Original authors: Qianbo Zang, Christophe Zgrzendek, Igor Tchappi, Afshin Khadangi, Johannes Sedlmeir

Published 2026-05-18
📖 4 min read☕ Coffee break read

Original authors: Qianbo Zang, Christophe Zgrzendek, Igor Tchappi, Afshin Khadangi, Johannes Sedlmeir

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a librarian trying to file a new book into a massive, multi-story library. This isn't just any library; it's a Hierarchical Text Classification (HTC) system.

In a normal library, you might just put a book in "Fiction." But in this hierarchical library, you have to be precise. You can't just say "Fiction." You have to say:

  • Level 1: Fiction
  • Level 2: Science Fiction
  • Level 3: Cyberpunk
  • Level 4: Dystopian

The problem is, this library has thousands of categories, and many of them are very rare (like a book about "19th-century underwater basket weaving"). Also, the librarian (an AI called a Large Language Model or LLM) has never seen this specific book before and has no training manual (no labeled data). This is called a "Zero-Shot" scenario.

If you just ask the AI, "Where does this go?", it often gets overwhelmed. It might guess "Fiction" correctly but fail at the deeper levels, or it might get confused by the sheer number of options.

The Problem: The "Overwhelmed Librarian"

The paper argues that standard AI librarians struggle with three things:

  1. Too many choices: The list of categories is huge.
  2. Rare items: Most categories have very few books (long-tail distribution), so the AI hasn't "seen" them enough to know where they belong.
  3. No training: In the real world, we often don't have a list of "correct answers" to teach the AI.

The Solution: KG-HTC (The "Smart Map" System)

The authors, Zang and colleagues, built a system called KG-HTC. Think of this as giving the AI librarian a dynamic, smart map of the library instead of just a giant list of names.

Here is how it works, step-by-step, using a simple analogy:

1. The Knowledge Graph (The Library Blueprint)

First, they take the entire list of categories and organize them into a Knowledge Graph. Imagine this as a family tree or a subway map where every category is a "station," and the lines connecting them show the parent-child relationships (e.g., "Cyberpunk" is connected to "Science Fiction," which is connected to "Fiction").

2. The RAG System (The "Spotlight" Search)

When a new book review (the input text) comes in, the AI doesn't try to read the entire map at once. That would be too much information. Instead, it uses a Retrieval-Augmented Generation (RAG) approach.

Think of this as shining a spotlight on the map.

  • The AI looks at the book's text (e.g., a review about a dishwasher).
  • It quickly scans the map to find the few stations that are semantically close to "dishwasher."
  • It pulls out just that small section of the map—a subgraph—containing "Home," "Cleaning," and "Dishwashing."

3. The Upward Propagation (Tracing the Path)

Once it has this small, relevant map section, the system traces the lines upwards from the specific item to the root. It creates a clear path:
Dishwashing -> Household Cleaning -> Household Supplies -> Home

4. The Prompt (The "Cheat Sheet")

The AI then turns this path into a simple sentence (a prompt) and feeds it back to the main LLM. It's like handing the librarian a cheat sheet that says: "Based on the text, the item is likely related to Dishwashing. Here is the full path from the top of the library down to Dishwashing. Please pick the correct final category."

Why This Works Better

The paper tested this on three real-world datasets (Amazon product reviews, scientific papers, and Wikipedia articles).

  • The Result: The "Smart Map" system (KG-HTC) was much better at finding the right spot than the AI working alone or using previous methods.
  • The Deep Dive: The biggest win was at the deeper levels of the hierarchy. While other methods got lost when trying to find the specific "Dishwashing" category, KG-HTC stayed on track because it had the structural map to guide it.
  • The Analogy: It's the difference between guessing a word in a game of "20 Questions" by randomly shouting words, versus having a flowchart that eliminates half the possibilities with every question.

The Bottom Line

The paper claims that by combining the "brain" of a Large Language Model with the "structure" of a Knowledge Graph, they created a system that can accurately sort text into complex, multi-level categories without needing any pre-written training data.

It solves the problem of the AI getting lost in a sea of options by giving it a focused, structured map of the most relevant paths, allowing it to navigate even the most obscure corners of the library with confidence.

Note: The paper strictly focuses on text classification (sorting documents/reviews). It does not claim to work for medical diagnosis, clinical uses, or other applications outside of organizing text data.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →