Smart Contract Vulnerabilities Detection with Adaptive Loss Weight and Entropy Weight

Authors: Jingyuan Hu, Peng Su, and Xuanxia Yao
Conference: ICIC 2025 Posters, Ningbo, China, July 26-29, 2025
Pages: 1401-1416
Keywords: Smart Contract, Vulnerability Detection, Adaptive Loss Weight, Entropy Weight.

Abstract

Smart contract security constitutes the foundational cornerstone for ensuring the trusted operational integrity of blockchain ecosystems. In recent years, multi-task learning MTL architectures have been widely adopted in smart contract vulnerability detection, owing to their context-aware optimization and superior generalization capabilities compared to single-task learning STL frameworks. However, MTL-based approaches for smart contract vulnerability detection face two persistent challenges: 1 The negative transfer phenomenon, the mitigation of negative transfer via adaptive loss weighting in smart contract vulnerability detection remains underexplored in existing research. 2 Performance degradation caused by the homogeneous contribution assumption where undifferentiated contract representations impair expert layer learning efficacy. To overcome these limitations, we propose a novel detection framework incorporating adaptive loss weight and entropy-based feature enhancement. Our dual-weighting mechanism introduces: 1 dynamic loss coefficients that automatically balance task-specific optimization objectives based on evolving learning complexity and task significance, and 2 entropy-aware attention weights that prioritize high-information contract features during expert network training. Comprehensive evaluations on real-world smart contract datasets demonstrate the framework's superior detection performance compared to three state-of-the-art adaptive weighting baselines. Experimental results reveal significant improvements in F1-score across multiple vulnerability types, validating the effectiveness of our approach in mitigating negative transfer while maintaining robust concurrent detection capabilities. The experimental code will be systematically organized and made publicly available on GitHub shortly.
📄 View Full Paper (PDF) 📋 Show Citation