Benchmarking Recommendation, Classification, and Tracing Based on Hugging Face Knowledge Graph

Qiaosheng Chen, Kaijia Huang, Xiaofang Zhou, Weiqing Luo, Yuanning Cui, Gong Cheng · DOI

Abstract

The rapid expansion of the Hugging Face ecosystem has democratized AI but created significant discovery challenges. We present HuggingKG, the first large-scale knowledge graph (KG) mapping the intricate relationships between models, datasets, and users within Hugging Face. To evaluate the utility of this structured data, we introduce HuggingBench, a benchmark comprising three critical tasks: resource recommendation, task classification, and model tracing. Our analysis reveals that while graph structure is valuable, integrating semantic textual information is essential for navigating the sparse landscape of open-source machine learning assets.

Introduction

Platforms like Hugging Face have become the central hubs for modern AI development. However, as the number of hosted models and datasets reaches into the millions, finding the right tool for a specific job has become increasingly difficult. Current discovery mechanisms rely primarily on keyword searches and flat tags, ignoring the rich web of relationships—such as model lineage, dataset provenance, and user collaboration—that define the ecosystem.

The lack of a structured representation hinders advanced resource management and reproducibility. To address this, the authors developed HuggingKG to transform unstructured community data into a queryable, relational format, enabling more sophisticated AI-driven discovery tools.

HuggingKG Construction and Benchmarking

The construction of HuggingKG followed a rigorous three-step pipeline: schema definition, data acquisition, and verification. The researchers identified 8 primary node types (e.g., Model, Dataset, User, Organization, Task) and 30 distinct relation types (e.g., Finetune, Like, Follow, Cite). Data was harvested using the huggingface_hub API, capturing both structural metadata and the rich semantic content of README files.

Overview of HuggingKG construction and the three benchmark tasks in HuggingBench.

To test the practical utility of HuggingKG, the authors established HuggingBench, which focuses on three core Information Retrieval (IR) challenges:

  1. Resource Recommendation: Predicting user "Likes" based on historical interaction and graph topology.
  2. Task Classification: Automatically assigning functional categories (e.g., "text-classification") to resources.
  3. Model Tracing: Identifying the evolutionary lineage of models, such as tracing a quantized variant back to its base model.

Dataset Characteristics

HuggingKG represents a significant leap in scale compared to previous efforts to map the machine learning landscape. With 2.6 million nodes and 6.2 million edges, it provides a comprehensive view of the community's activity.

Comparison of HuggingKG with existing machine learning knowledge graphs, highlighting its superior scale.

The benchmark datasets derived from HuggingKG are equally substantial. The recommendation set includes approximately 1 million interactions from 38,000 users, while the classification set covers 152,000 nodes across 52 task types. The tracing task focuses on 20,000 triples representing model evolution through finetuning, merging, and quantization.

Experimental Insights and Results

Experiments highlighted several unique characteristics of the Hugging Face ecosystem:

  • The Sparsity Challenge: Unlike academic or e-commerce KGs, HuggingKG is relatively sparse. Standard recommendation algorithms that rely on dense multi-hop paths often underperform. Contrastive learning methods like KGCL proved more robust in this environment.
  • The Power of Text: For task classification, graph structure alone was insufficient (Micro-F1 of 0.18). However, incorporating pre-trained text embeddings (e.g., BERT) from model descriptions boosted performance to 0.88, indicating that README files contain critical semantic signals.
  • Lineage and Geometry: In model tracing, the simple geometric model TransE outperformed complex neural architectures. This is likely because model evolution is often a direct one-to-one relationship (one parent to one child), which TransE's translational approach models efficiently.
  • Cross-Domain Synergy: Data analysis revealed unexpected user interests; for instance, users engaging with robotics datasets often show high interest in NLP models, reflecting the trend toward LLM-driven embodied AI.

Future Directions

While HuggingKG is currently focused on Hugging Face, future iterations aim to integrate data from GitHub and Kaggle to create a more universal ML knowledge graph. The authors also plan to introduce human-annotated complex Question Answering (QA) tasks to further challenge LLM agents. Ultimately, they envision "HuggingKG-aware" agents capable of autonomously navigating and combining ML resources to solve complex problems more effectively than current keyword-based systems.

Summary updated

BibTeX
@inproceedings{chen2025benchmarking,
  author = {Qiaosheng Chen and Kaijia Huang and Xiaofang Zhou and Weiqing Luo and Yuanning Cui and Gong Cheng},
  title = {{Benchmarking Recommendation, Classification, and Tracing Based on Hugging Face Knowledge Graph}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2025},
  doi = {10.1145/3726302.3730277},
}
Figure