Generate with CodeXHug: A Dataset to Enhance Model Cards with Code Usage Patterns

📅 2026-06-22
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the gap between pre-trained models and their practical adoption by systematically linking real-world usage code from GitHub with Hugging Face model cards. Existing model documentation often lacks concrete, interpretable code examples, hindering effective utilization by developers. To bridge this gap, the authors construct CodeXHug—the first structured dataset capturing code usage patterns of pre-trained models—by collecting 7,325 models and 20,545 associated Python files. Through code parsing, clustering, and statistical analysis, they extract reusable, representative coding paradigms that reflect how models are actually employed in practice. This empirical resource provides actionable insights for enhancing the usability and comprehensibility of model documentation, thereby supporting more effective integration of pre-trained models into real-world applications.
📝 Abstract
Pre-trained models (PTMs) are becoming increasingly popular in the software engineering community. Their usage is facilitated by model repositories, e.g., HuggingFace, which collect, store, and maintain a wide range of PTMs. However, the actual adoption of these models in real-world projects is still an open question, i.e., many of them are used in toy projects or simply as a mirror for the HF repository. In addition, most of the available model cards and textual documents that contain critical information about their usage do not include explanatory code patterns, thus increasing the difficulty for newcomers. Thus, we see the need for a curated codebase related to PTMs to support developers and practitioners who are interested in using them in their projects. In this paper, we present CodeXHug, a curated dataset of HuggingFace PTMs exploited in the Github ecosystem and the related code usage patterns. Starting from the latest HF dump, we first conduct a data curation to collect PTMs with a tag and a model card. Then, the Github platform has been queried to find actual usages of the identified PTMs, resulting in 7,325 different models and 20,545 Python files. To demonstrate a concrete application of CodeXHug, we propose a usage scenario focused on extracting representative code usage patterns for specific PTMs through a statistical analysis and clustering techniques applied to relevant code snippets.
Problem

Research questions and friction points this paper is trying to address.

pre-trained models
model cards
code usage patterns
HuggingFace
software engineering
Innovation

Methods, ideas, or system contributions that make the work stand out.

Code Usage Patterns
Pre-trained Models
Model Cards
Dataset Curation
Code Clustering
🔎 Similar Papers
No similar papers found.