[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-82115-en":3,"doc-seo-82115-105":29,"detail-sidebar-cat-0-en-105":90},{"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":13,"seo_description":14,"update_tm":27,"read_time":28},82115,1099514067415,"Rowan","https://ap-avatar.wpscdn.com/avatar/100002539d78ffe74a7?x-image-process=image/resize,m_fixed,w_180,h_180&k=1779092875211072502",8,"Research & Report","Toward Inferring Accurate Context-free Grammars for Big Languages in a Black-box Setting","Black-box context-free grammar inference supports program analysis, reverse engineering, program understanding, fuzzing, and security, yet existing methods face scalability limits, reduced accuracy, and poor grammar readability for large languages. This paper introduces XVADA, a deterministic TREEVADA-style technique with iterative parse-tree construction, indirect learning of non-recursive rules, efficient batch generalization, hierarchical delta debugging, and LLM-based nonterminal naming. Empirical evaluation avoids recent pitfalls and shows higher accuracy and compactness than TREEVADA.","Toward Inferring Accurate Context-free Grammars for Big Languages in a Black-box Setting  \nMohammad Rifat Arefin∗ , Nuhiat Arefin†, Shanto Rahman‡, Christoph Csallner∗  \n∗ Dept. of Computer Science and Engineering, University of Texas at Arlington, USA [mxa7262@mavs.uta.edu](mxa7262@mavs.uta.edu), [csallner@uta.edu](csallner@uta.edu)  \n† Dept. of Computer Science and Engineering, Islamic University of Technology, Gazipur, Bangladesh  \n[nuhiatarefin@iut-dhaka.edu](nuhiatarefin@iut-dhaka.edu)  \n‡ Dept. of Computer Science, University of Texas at Austin, USA  \n[shanto.rahman@utexas.edu](shanto.rahman@utexas.edu)  \narXiv :2607 .08959v 1 [ cs . SE] 9 Jul 2026  \nAbstract—Black-box context-free grammar inference is crucial for program analysis, reverse engineering, program understanding, fuzzing, and security. However, existing approaches such as ARVADA, TREEVADA, KEDAVRA, and CRUCIO struggle with scalability, accuracy, and grammar readability, especially on larger languages. To address this challenge, we introduce XVADA with several new techniques for deterministic inference of context-free grammars. In an empirical comparison that avoids several pitfalls of recent studies, XVADA improves on the highest-scoring competitor (TREEVADA) both in grammar accuracy and grammar compactness. XVADA also found a CVEin the widely used Python Liquid engine. Fuzzing based on the XVADA-inferred grammar found five more bugs, which the Python Liquid developers fixed based on our bug reports. XVADA and all experimental data and scripts are publicly available.  \nIndex Terms—black-box grammar inference, LLM-based nonterminal naming, hierarchical delta-debugging  \nI. INTRODUCTION  \nBlack-box inference of context-free grammars from sample programs faces two key challenges. First, existing approaches do not scale to larger languages, at best producing grammars of low accuracy. Second, inferred grammars are excessively large and cryptic, making inferred grammars difficult for humans to interpret and use.  \nThese two challenges are important as, first, many languages of practical use are large and complex [1] . Second, besides fuzzing [2], [3] and security analysis [4], other key usecases of grammar inference include reverse engineering [5], documentation, and human understanding of rare and underdocumented commercial languages [6], so readability is also very important. At a high level, these challenges are important as context-free grammars are widely used in programming language design, documentation, and as an input for fuzzing systems that search for parser bugs [7], [8], [9] .  \nBlack-box grammar inference is a fundamentally hard problem [10], as we only have access to a black-box parser of an unknown language L and a few sample L programs. The sample programs may not cover all L language features andwill almost certainly not cover all possible combinations of these language features.  \nRecent advances in black-box context-free grammar inference include ARVADA [11], TREEVADA [12], KEDAVRA [13],  \nand CRUCIO [14] . The pioneering ARVADA infers grammars directly from complete input strings while exploring multiple generalization paths. ARVADA suffers from low accuracy, inefficient processing, and poor grammar readability. The more recent TREEVADA, KEDAVRA, and CRUCIO succeed at improving upon ARVADA. However, these improvement still do not scale to large and complex languages though. They also only partially address ARVADA ’s grammar readability issues. Specifically, even if the inferred grammar only partially covers the target “golden” grammar, the inferred grammar has many more rules and relies on a cryptic naming scheme.  \nXVADA is a deterministic automated TREEVADA-style black-box grammar inference technique. XVADA contains several new techniques for iterative parse-tree construction, including treating each bracketed token sequence as a candidate grammar rule alternative, adding indirection to enable learning of non-recursive rules, and batch gramma","cbCaij2gzS5Vu4cB","https://ap.wps.com/l/cbCaij2gzS5Vu4cB","pdf",314546,1,12,"English","en",105,"# Introduction\n## Challenges in Black-box Grammar Inference\n## Related Work\n## XVADA Approach\n## Empirical Comparison and Contributions","[{\"question\":\"What problem does the paper address in black-box context-free grammar inference?\",\"answer\":\"It addresses two major issues: poor scalability to large languages and overly large, cryptic inferred grammars that are hard for humans to interpret and use.\"},{\"question\":\"How does XVADA differ from earlier TREEVADA-style approaches?\",\"answer\":\"XVADA uses deterministic iterative parse-tree construction, candidate grammar rule alternatives from bracketed token sequences, indirection to learn non-recursive rules, batch grammar generalization to avoid expensive re-ranking, hierarchical delta debugging, and LLM queries for descriptive nonterminal naming.\"},{\"question\":\"What validation results does the paper report for XVADA?\",\"answer\":\"In comparisons across 17 languages, XVADA processes all languages, achieves similar accuracy on smaller languages while improving average accuracy on larger ones, produces more compact grammars, discovers a CVE in Python Liquid, and enables fuzzing to find additional bugs that were subsequently fixed.\"}]",1784178287,30,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":27},"toward-inferring-accurate-context-free-grammars-for-big-languages-in-a-black-box-setting","",{"@graph":35,"@context":84},[36,53,67],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/toward-inferring-accurate-context-free-grammars-for-big-languages-in-a-black-box-setting/82115/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-16",true,{"@type":64,"interactionType":65,"userInteractionCount":4},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"What problem does the paper address in black-box context-free grammar inference?","Question",{"text":74,"@type":75},"It addresses two major issues: poor scalability to large languages and overly large, cryptic inferred grammars that are hard for humans to interpret and use.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"How does XVADA differ from earlier TREEVADA-style approaches?",{"text":79,"@type":75},"XVADA uses deterministic iterative parse-tree construction, candidate grammar rule alternatives from bracketed token sequences, indirection to learn non-recursive rules, batch grammar generalization to avoid expensive re-ranking, hierarchical delta debugging, and LLM queries for descriptive nonterminal naming.",{"name":81,"@type":72,"acceptedAnswer":82},"What validation results does the paper report for XVADA?",{"text":83,"@type":75},"In comparisons across 17 languages, XVADA processes all languages, achieves similar accuracy on smaller languages while improving average accuracy on larger ones, produces more compact grammars, discovers a CVE in Python Liquid, and enables fuzzing to find additional bugs that were subsequently fixed.","https://schema.org",{"og:url":51,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":91},[92,96,100,104,109,114,119,121,126,129,133],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":105,"doc_module":4,"doc_module_name":45,"category_name":106,"show_sort_weight":107,"slug":108},5,"Comic",60,"comic",{"id":110,"doc_module":4,"doc_module_name":45,"category_name":111,"show_sort_weight":112,"slug":113},6,"Technology",50,"technology",{"id":115,"doc_module":4,"doc_module_name":45,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":28,"slug":120},"research-report",{"id":122,"doc_module":4,"doc_module_name":45,"category_name":123,"show_sort_weight":124,"slug":125},9,"Religion & Spirituality",20,"religion-spirituality",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":127,"show_sort_weight":124,"slug":128},"World Cup","world-cup",{"id":130,"doc_module":4,"doc_module_name":45,"category_name":131,"show_sort_weight":130,"slug":132},10,"Lifestyle","lifestyle",{"id":134,"doc_module":4,"doc_module_name":45,"category_name":135,"show_sort_weight":105,"slug":136},19,"General","general"]