Deep learning has recently achieved initial success in program analysis tasks such as bug detection. Lacking real bugs, most existing works construct training and test data by injecting synthetic bugs into correct programs. Despite achieving high test accuracy (e.g., 90%), the resulting bug detectors are found to be surprisingly unusable in practice, i.e., <10% precision when used to scan real software repositories. In this work, we argue that this massive performance difference is caused by a distribution shift, i.e., a fundamental mismatch between the real bug distribution and the synthetic bug distribution used to train and evaluate the detectors. To address this key challenge, we propose to train a bug detector in two phases, first on a synthetic bug distribution to adapt the model to the bug detection domain, and then on a real bug distribution to drive the model towards the real distribution. During these two phases, we leverage a multi-task hierarchy, focal loss, and contrastive learning to further boost performance. We evaluate our approach extensively on three widely studied bug types, for which we construct new datasets carefully designed to capture the real bug distribution. The results demonstrate that our approach is practically effective and successfully mitigates the distribution shift: our learned detectors are highly performant on both our test set and the latest version of open source repositories. Our code, datasets, and models are publicly available at https://github.com/eth-sri/learning-real-bug-detector.
SIFT: Robust Meta-Faithfulness Verification of Chain-of-Thought Reasoning Under Distribution Shift
Istanbul Technical University(伊斯坦布尔理工大学);Pabna University of Science and Technology(帕布纳科技大学);American International University-Bangladesh(美国国际大学-孟加拉);Deakin University(迪肯大学);North South University(南北大学)
Rethinking AI-Generated Text Detection: A Strong Baseline and the Distribution-Shift Problem That Remains
Department of Computer Science, University of California, Santa Barbara(加利福尼亚大学圣塔芭芭拉分校计算机科学系);School of ECEE, Arizona State University(亚利桑那州立大学电子、计算机与能源工程学院)
When AUC Misleads: Polarization-Aware Evaluation of Deepfake Detectors under Domain Shift
CVI$^2$(CVI²实验室);SnT, University of Luxembourg(SnT,卢森堡大学);Cristal Laboratory, National School of Computer Sciences, University of Manouba(Cristal实验室,马努巴国家计算机科学学院)
Enhancing Regime Shift Detection Using Unstructured Data: A Study on the Treasury Market
School of Engineering Mathematics and Technology, University of Bristol, UK(布里斯托大学工程数学与技术学院);Propellant Digital B.V., Amsterdam, Netherlands(荷兰阿姆斯特丹Propellant Digital公司);School of Mathematics, Cardiff University, UK(卡迪夫大学数学学院)