Abstract
Commit classification (CC) is essential for software maintenance, but traditional discriminative models struggle with data scarcity and architectural rigidity. We present IPCK, a framework that reformulates CC as a generative text-to-text task using the T5 model. By integrating prompt-tuning and external knowledge graphs via a knowledgeable verbalizer, IPCK achieves state-of-the-art performance, particularly in few-shot scenarios.
Introduction
Understanding the intent behind code changes—whether they are bug fixes, new features, or security updates—is critical for automated software engineering. Traditional machine learning approaches for Commit Classification (CC) typically rely on discriminative architectures that require extensive labeled data and task-specific output layers. These models often lack the flexibility to generalize across different classification schemes or adapt to low-resource environments.
As shown in Figure 1, the transition from traditional feature-based or fine-tuning approaches to prompt-tuning allows for a more efficient use of pre-trained linguistic knowledge by framing classification as a natural language completion task.
Methodology: The IPCK Framework
The IPCK (Incorporating Prompt-tuning for Commit classification with prior Knowledge) framework shifts the paradigm from label prediction to text generation.
Generative Text-to-Text Backbone
IPCK utilizes the T5 (Text-to-Text Transfer Transformer) architecture. Unlike BERT, which is primarily discriminative, T5 treats every task as a "text-to-text" problem. A commit message is wrapped in a natural language template (e.g., [Commit Message] This commit is [MASK].), and the model is tasked with generating the word that best fills the mask.
Knowledgeable Verbalizer
The core innovation of IPCK is the "Knowledgeable Verbalizer." Standard prompt-tuning maps mask predictions to a fixed set of label words. IPCK enhances this by incorporating an external knowledge graph. This allows the model to recognize synonyms and semantically related terms (e.g., "safe" or "assurance" for a "SECURE" label), effectively injecting prior knowledge into the classification process.
The workflow illustrated in Figure 2 details how templates and knowledge-based mappings are integrated into the prompt-tuning pipeline.
Experimental Evaluation
The authors evaluated IPCK on two benchmarks:
- Dataset I (Binary): 12,694 instances focused on security classification (SECURE vs. INSECURE).
- Dataset II (Multi-class): 1,793 instances categorized into Corrective, Adaptive, and Perfective maintenance types.
Key Results
IPCK demonstrated significant performance gains over traditional baselines:
- Dataset I: The IPCK-K_T5 model achieved a 90.15% F1-score, a substantial improvement over the previous state-of-the-art (83.9%).
- Dataset II: It reached an 83.43% F1-score, outperforming BERT-based deep neural networks (79.7%).
- Few-Shot Performance: The model proved resilient in data-scarce environments, maintaining over 70% accuracy with as few as 50 training samples.
Discussion and Conclusion
The success of IPCK highlights the power of treating labels as semantic entities rather than abstract indices. By leveraging the pre-trained knowledge of T5 and augmenting it with domain-specific knowledge graphs, IPCK overcomes the "data hunger" typical of traditional CC models.
Future work will focus on integrating "code diffs" alongside commit messages and exploring "soft prompts" to further optimize the tuning process. IPCK represents a significant step toward more flexible and knowledge-aware automated software maintenance tools.
Summary updated