[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-124028-en":3,"doc-seo-124028-105":30,"detail-sidebar-cat-0-en-105":91},{"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":4,"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},124028,8796095461610,"Oliver","https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c",8,"Research & Report","Top Score on the Wrong Exam - On Benchmarking in Machine Learning for Vulnerability Detection","Machine learning for vulnerability detection (ML4VD) research often frames vulnerability identification as a function-level binary classification task: deciding whether an isolated function contains a security flaw. Analyzing widely used ML4VD datasets, the study shows that vulnerability status typically cannot be determined without additional calling-context information. It further demonstrates that strong benchmark accuracy can be achieved through spurious correlations such as word counts, undermining evidence of real vulnerability detection capability and motivating revised benchmarking and problem statements.","Top Score on the Wrong Exam: On Benchmarking in Machine Learning for Vulnerability Detection  \nNiklas Risse  \nSoftware Security Group MPI-SP Bochum, Germany  \nMarcel Bhme  \nSoftware Security Group MPI-SP Bochum, Germany  \narXiv :2408 . 12986v1 [ cs .CR] 23 Aug 2024  \nAbstract—According to our survey of the machine learning for vulnerability detection (ML4VD) literature published in the top Software Engineering conferences, every paper in the past 5 years defines ML4VD as a binary classification problem:  \nGiven a function, does it contain a security flaw?  \nIn this paper, we ask whether this decision can really be made without further context and study both vulnerable and nonvulnerable functions in the most popular ML4VD datasets. A function is vulnerable if it was involved in a patch of an actual security flaw and confirmed to cause the vulnerability. It is nonvulnerable otherwise. We find that in almost all cases this decision cannot be made without further context. Vulnerable functions are often vulnerable only because a corresponding vulnerabilityinducing calling context exists while non-vulnerable functions would often be vulnerable if a corresponding context existed.  \nBut why do ML4VD techniques perform so well even though there is demonstrably not enough information in these samples? Spurious correlations: We find that high accuracy can be achieved even when only word counts are available. This shows that these datasets can be exploited to achieve high accuracy without actually detecting any security vulnerabilities.  \nWe conclude that the current problem statement of ML4VDis ill-defined and call into question the internal validity of this growing body of work. Constructively, we call for more effective benchmarking methodologies to evaluate the true capabilities of ML4VD, propose alternative problem statements, and examine broader implications for the evaluation of machine learning and programming analysis research.  \nI. INTRODUCTION  \nIn recent years, the number of papers published on the topic of machine learning for vulnerability detection (ML4VD) has dramatically increased. Because of this rise in popularity, the validity and soundness of the underlying methodologies and datasets becomes increasingly important. So then, how exactly is the problem of ML4VD defined and thus evaluated?  \nIn our survey of all 22 ML4VD papers published at the Top-4 Software Engineering conferences over the last five years [1]–[22], we find that state-of-the-art ML4VD techniques exclusively define ML4VD as a binary classification problem: Given an isolated function f, decide whether f contains a security vulnerability. The technique with the lowest classification error on the evaluation dataset is considered the best at detecting security vulnerabilities.  \n1 TfLiteStatus ResizeOutputTensors(TfLiteContext* context, TfLiteNode* node, 2 const TfLiteTensor* axis,  \n3 const TfLiteTensor* input, int num_splits) {  \n4 int axis_value = GetTensorData\u003Cint>(axis)[0]; 5 // [   ]  \n6 const int input_size = SizeOfDimension(input, axis_value);  \n7  TF_LITE_ENSURE_MSG(context, input_size % num_splits == 0,   \n8 \"Not an even split \" );  \n9 const int slice_size = input_size / num_splits;  \n10 for (int i = 0; i \u003C NumOutputs(node); ++i) {  \n11 TfLiteIntArray* output_dims = TfLiteIntArrayCopy(input->dims);  \n12 output_dims->data[axis_value] = slice_size; 13 // [   ]  \n14 TF_LITE_ENSURE_STATUS(context->ResizeTensor(context, output, output_dims));  \n15 }  \n16 return kTfLiteOk; 17 }  \nFig. 1: Context-dependent vulnerability (CVE-2021-29599) in DiverseVul dataset. If the function is called with num_splits=0, it crashes with a division-by-zero in Line 7 .  \nHowever, based on our experience, we hypothesized that it might not always be possible to determine whether a function is vulnerable or not without additional context. We call these vulnerabilities context-dependent. Consider the example in Figure 1 . If this function from the DiverseVul benchmark dataset [2","cbCaierZjFpBeurC","https://ap.wps.com/l/cbCaierZjFpBeurC","pdf",440103,1,12,"English","en",105,"# Introduction\n## Problem formulation in prior ML4VD work\n## Context-dependent vulnerabilities and dataset limitations\n## Spurious correlations in benchmark performance","[{\"question\":\"How does prior ML4VD work typically define the problem and evaluation task?\",\"answer\":\"It defines ML4VD as a binary classification problem over isolated functions: decide whether a function contains a security vulnerability, and select the lowest classification error model on the evaluation dataset.\"},{\"question\":\"What are context-dependent vulnerabilities in this study?\",\"answer\":\"A function may appear vulnerable only when called with a specific context; without knowing whether such a calling context occurs, the vulnerability status cannot be reliably decided.\"},{\"question\":\"Why can ML4VD techniques still obtain high benchmark accuracy?\",\"answer\":\"The study finds spurious correlations: comparable accuracy can be achieved using features like word counts without truly detecting security vulnerabilities.\"}]","Top Score on the Wrong Exam - On Benchmarking in Machine Learning for Vulnerability Detection | PDF",1785819932,30,{"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":86,"head_meta":88,"extra_data":90,"updated_unix":28},"top-score-on-the-wrong-exam-on-benchmarking-in-machine-learning-for-vulnerability-detection","",{"@graph":36,"@context":85},[37,54,68],{"@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/top-score-on-the-wrong-exam-on-benchmarking-in-machine-learning-for-vulnerability-detection/124028/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":62,"encodingFormat":61,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-04",true,{"@type":65,"interactionType":66,"userInteractionCount":4},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"How does prior ML4VD work typically define the problem and evaluation task?","Question",{"text":75,"@type":76},"It defines ML4VD as a binary classification problem over isolated functions: decide whether a function contains a security vulnerability, and select the lowest classification error model on the evaluation dataset.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What are context-dependent vulnerabilities in this study?",{"text":80,"@type":76},"A function may appear vulnerable only when called with a specific context; without knowing whether such a calling context occurs, the vulnerability status cannot be reliably decided.",{"name":82,"@type":73,"acceptedAnswer":83},"Why can ML4VD techniques still obtain high benchmark accuracy?",{"text":84,"@type":76},"The study finds spurious correlations: comparable accuracy can be achieved using features like word counts without truly detecting security vulnerabilities.","https://schema.org",{"og:url":52,"og:type":87,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":89,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,122,127,130,134],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":29,"slug":121},"research-report",{"id":123,"doc_module":4,"doc_module_name":46,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":106,"slug":137},19,"General","general"]