[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-128041-en":3,"doc-seo-128041-105":30,"detail-sidebar-cat-0-en-105":92},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},128041,5909887256941,"Levi","https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc",8,"Research & Report","Uncovering the Limits of Machine Learning for Automatic Vulnerability Detection","Recent results in ML4VD show that, given only source code, models can identify security flaws with accuracy up to about 70%. Experiments also reveal a critical inconsistency: the same top-performing models fail to tell vulnerable functions from equivalent code where vulnerabilities have been patched. The work attributes this to overfitting to unrelated features and out-of-distribution generalization gaps, and it proposes improved evaluation via augmented benchmarks and patch-aware test sets.","Uncovering the Limits of Machine Learning for Automatic Vulnerability Detection  \nNiklas Risse MPI-SP, Germany  \nMarcel Böhme MPI-SP, Germany  \narXiv :2306 . 17 193v2 [ cs .CR] 6 Jun 2024  \nAbstract  \nRecent results of machine learning for automatic vulnerability detection (ML4VD) have been very promising. Given only the source code of a function f , ML4VD techniques can decide iff contains a security flaw with up to 70% accuracy. However, as evident in our own experiments, the same top-performing models are unable to distinguish between functions that contain a vulnerability and functions where the vulnerability is patched. So, how can we explain this contradiction and how can we improve the way we evaluate ML4VD techniques to get a better picture of their actual capabilities?  \nIn this paper, we identify overfitting to unrelated features and out-of-distribution generalization as two problems, which are not captured by the traditional approach of evaluating ML4VD techniques. As a remedy, we propose a novel benchmarking methodology to help researchers better evaluate the true capabilities and limits of ML4VD techniques. Specifically, we propose (i) to augment the training and validation dataset according to our cross-validation algorithm, where a semantic preserving transformation is applied during the augmentation of either the training set or the testing set, and (ii) to augment the testing set with code snippets where the vulnerabilities are patched.  \nUsing six ML4VD techniques and two datasets, we find (a) that state-of-the-art models severely overfit to unrelated features for predicting the vulnerabilities in the testing data,(b) that the performance gained by data augmentation does not generalize beyond the specific augmentations applied during training, and (c) that state-of-the-art ML4VD techniques are unable to distinguish vulnerable functions from their patches.  \n1 Introduction  \nRecently several different publications have reported high scores on vulnerability detection benchmarks using machine learning (ML) techniques [1, 12–15, 28] . The resulting models seem to outperform traditional program analysis methods, e.g. static analysis, even without requiring any hard-coded knowledge of program semantics or computational models. So, does  \nthis mean that the problem of detecting security vulnerabilities in software is solved? Are these models actually able to detect security vulnerabilities, or do the reported scores provide a false sense of security?  \nEven though ML4VD techniques achieve high scores on vulnerability detection benchmark datasets, there are still situations in which they fail to meet expectations when presented with new data. For example, it is possible to apply small semantic preserving changes to augment the testing dataset of a state-of-the-art model and then measure whether the model changes its predictions. If it does, it would indicate a dependence of the prediction on unrelated features. Examples of such transformations are identifier renaming [18, 38, 39,41,42], insertion of unexecuted statements [18, 35, 39, 41] or replacement of code elements with equivalent elements [2, 21] . The impact of augmenting testing data using these transformations has been explored for many different softwarerelated tasks and the results seem to be clear: Learningbased models fail to perform well when testing data gets augmented using semantic preserving transformations of code [2, 5, 18, 30, 35, 38, 39, 41, 42] .  \nIn our own experiments, we were able to reproduce the findings of the literature and made additional observations: ML4VD techniques that were trained on typical training data for vulnerability detection are also unable to distinguish between vulnerable functions and their patched counterparts. If a patched function is also predicted as vulnerable, this indicates that the prediction critically depends on features unrelated to the presence of a security vulnerability.  \nIt has previously been proposed t","cbCaitHMa4anCpD1","https://ap.wps.com/l/cbCaitHMa4anCpD1","pdf",1066923,1,18,"English","en",105,"# Introduction\n## Problem with benchmark results\n## Proposed benchmarking methodology\n## Empirical validation setup","[{\"question\":\"What contradiction do ML4VD models show in practice?\",\"answer\":\"Models that perform well on vulnerability detection benchmarks often cannot distinguish vulnerable code from patched code, even when the vulnerabilities are fixed.\"},{\"question\":\"What causes the evaluation mismatch in ML4VD?\",\"answer\":\"The paper identifies overfitting to unrelated features and out-of-distribution generalization as key issues not captured by traditional benchmark evaluation.\"},{\"question\":\"How do the proposed algorithms improve ML4VD evaluation?\",\"answer\":\"Algorithm 1 varies semantic-preserving transformations between training and testing to expose overfitting to unrelated features, while Algorithm 2 adds patched-vulnerability examples to measure generalization to modified settings.\"}]","Uncovering the Limits of Machine Learning for Automatic Vulnerability Detection | PDF",1785944356,45,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":87,"head_meta":89,"extra_data":91,"updated_unix":28},"uncovering-the-limits-of-machine-learning-for-automatic-vulnerability-detection","",{"@graph":36,"@context":86},[37,54,69],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/uncovering-the-limits-of-machine-learning-for-automatic-vulnerability-detection/128041/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":63,"encodingFormat":61,"isAccessibleForFree":64,"interactionStatistic":65},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-23","2026-08-05",true,{"@type":66,"interactionType":67,"userInteractionCount":20},"InteractionCounter",{"@type":68},"ViewAction",{"@type":70,"mainEntity":71},"FAQPage",[72,78,82],{"name":73,"@type":74,"acceptedAnswer":75},"What contradiction do ML4VD models show in practice?","Question",{"text":76,"@type":77},"Models that perform well on vulnerability detection benchmarks often cannot distinguish vulnerable code from patched code, even when the vulnerabilities are fixed.","Answer",{"name":79,"@type":74,"acceptedAnswer":80},"What causes the evaluation mismatch in ML4VD?",{"text":81,"@type":77},"The paper identifies overfitting to unrelated features and out-of-distribution generalization as key issues not captured by traditional benchmark evaluation.",{"name":83,"@type":74,"acceptedAnswer":84},"How do the proposed algorithms improve ML4VD evaluation?",{"text":85,"@type":77},"Algorithm 1 varies semantic-preserving transformations between training and testing to expose overfitting to unrelated features, while Algorithm 2 adds patched-vulnerability examples to measure generalization to modified settings.","https://schema.org",{"og:url":52,"og:type":88,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":90,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":93},[94,98,102,106,111,116,121,124,129,132,136],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":95,"show_sort_weight":96,"slug":97},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":99,"show_sort_weight":100,"slug":101},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":103,"show_sort_weight":104,"slug":105},"Exam",70,"exam",{"id":107,"doc_module":4,"doc_module_name":46,"category_name":108,"show_sort_weight":109,"slug":110},5,"Comic",60,"comic",{"id":112,"doc_module":4,"doc_module_name":46,"category_name":113,"show_sort_weight":114,"slug":115},6,"Technology",50,"technology",{"id":117,"doc_module":4,"doc_module_name":46,"category_name":118,"show_sort_weight":119,"slug":120},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":122,"slug":123},30,"research-report",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":126,"show_sort_weight":127,"slug":128},9,"Religion & Spirituality",20,"religion-spirituality",{"id":127,"doc_module":4,"doc_module_name":46,"category_name":130,"show_sort_weight":127,"slug":131},"World Cup","world-cup",{"id":133,"doc_module":4,"doc_module_name":46,"category_name":134,"show_sort_weight":133,"slug":135},10,"Lifestyle","lifestyle",{"id":137,"doc_module":4,"doc_module_name":46,"category_name":138,"show_sort_weight":107,"slug":139},19,"General","general"]