Cluster Purge Loss: Structuring Transformer Embeddings for Equivalent Mutants Detection

📅 2025-07-26
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
Existing code pre-trained models (e.g., UniXCoder) exhibit limited performance in equivalent mutant detection due to coarse-grained embedding space structure after fine-tuning, hindering the modeling of intra-class fine-grained semantic equivalence. To address this, we propose a novel joint classification and metric learning framework, centered on the Cluster Purge Loss—a key innovation that dynamically tightens intra-class margins and explicitly encodes semantic equivalence, thereby enhancing both discriminability and interpretability of the learned embeddings. Our method integrates cross-entropy loss with deep metric learning and incorporates a clustering purification strategy to refine embedding geometry. Evaluated on equivalent mutant detection, our approach significantly outperforms standard fine-tuning and state-of-the-art metric learning baselines, achieving new SOTA performance. The resulting representations demonstrate superior fine-grained discriminative capability for semantically equivalent code variants.

Technology Category

Machine Learning: Representation LearningComputer Vision: Representation Learning for VisionSearch and Optimization: Learning to Search

Application Category

Graph Algorithms and Modeling for the Web: Graph embeddings and representation learning for Web-related graphsSemantics and Knowledge: Methods to enhance, augment, integrate or synergize semantic models such as knowledge graphs and LLMsSearch and Retrieval-Augmented AI: Web evaluation methodologies and metrics
📝 Abstract
Recent pre-trained transformer models achieve superior performance in various code processing objectives. However, although effective at optimizing decision boundaries, common approaches for fine-tuning them for downstream classification tasks - distance-based methods or training an additional classification head - often fail to thoroughly structure the embedding space to reflect nuanced intra-class semantic relationships. Equivalent code mutant detection is one of these tasks, where the quality of the embedding space is crucial to the performance of the models. We introduce a novel framework that integrates cross-entropy loss with a deep metric learning objective, termed Cluster Purge Loss. This objective, unlike conventional approaches, concentrates on adjusting fine-grained differences within each class, encouraging the separation of instances based on semantical equivalency to the class center using dynamically adjusted borders. Employing UniXCoder as the base model, our approach demonstrates state-of-the-art performance in the domain of equivalent mutant detection and produces a more interpretable embedding space.
Problem

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

Improving embedding space structure for equivalent mutants detection
Addressing fine-grained intra-class semantic relationship challenges
Enhancing model performance with Cluster Purge Loss framework
Innovation

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

Integrates cross-entropy with deep metric learning
Dynamically adjusts borders for semantic separation
Uses UniXCoder for equivalent mutant detection