An Agent-Based LLM Framework for Automatic Labeling in Hierarchical Statistical Nomenclatures
Conference
Format: CPS Abstract - IAOS 2026
Keywords: agent-based, hierarchical classification, nace
Session: Large Language Models & Machine Learning in official statistics
Tuesday 12 May 4:30 p.m. - 6 p.m. (Europe/Vilnius)
Abstract
Traditional supervised learning approaches for hierarchical classification in official statistics face significant challenges due to the scarcity of labeled training data and the high cost of manual annotation by domain experts. While Large Language Models (LLMs) have recently emerged as promising solutions due to their natural language understanding capabilities, their application to complex statistical taxonomies presents critical limitations. These include difficulty managing thousands of categories within constrained context windows, inconsistent predictions across multiple runs and limited explainability for audit requirements. These limitations are particularly problematic for official nomenclatures like NACE or COICOP, where consistency and traceability are essential to ensure the quality of the classification.
To address these challenges, this paper proposes GRAAL (Graph-based Research with Agents for Automatic Labelling), an exploratory graph-centric and agent-based framework designed for automatic classification within large hierarchical nomenclatures used by INSEE. GRAAL represents classification systems as knowledge graphs, where nodes correspond to classification codes and edges encode hierarchical and semantic relationships. Rather than relying solely on text generation, LLM-based agents are equipped with specialized tools to navigate, query, and reason over the graph structure.
The framework employs a multi-agent architecture: (1) a graph-navigation agent that iteratively traverses the classification hierarchy to identify relevant codes, (2) an agentic Retrieval-Augmented Generation (RAG) mechanism that leverages structured graph knowledge for contextual reasoning, and (3) an evaluation agent that assesses semantic relevance and confidence scores. This approach provides explainability through traceable navigation paths, robustness via structured exploration constrained by hierarchical relationships, and consistency by enforcing taxonomic rules during classification. Additionally, GRAAL enables the generation of synthetic labeled data by leveraging graph structure and agent reasoning to produce consistent training examples for downstream tasks.
This exploratory study examines how combining LLMs with knowledge graphs and agent-based reasoning can provide a scalable and reliable solution for automatic labeling in official statistical production, offering new perspectives for addressing data scarcity challenges in statistical classification systems.