[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-82529-en":3,"doc-seo-82529-105":28,"detail-sidebar-cat-0-en-105":89},{"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":11,"language":21,"language_code":22,"site_id":23,"html_lang":22,"table_of_contents":24,"faqs":25,"seo_title":13,"seo_description":14,"update_tm":26,"read_time":27},82529,549758146520,"Patrick","https://ap-avatar.wpscdn.com/avatar/80002397d8c0411e94?_k=1775819394049821470",8,"Research & Report","A Methodology for Investigating AI Patterns Prevalence in Software Repositories","AI-based applications increasingly rely on reusable AI patterns, yet the real prevalence of these patterns in production-quality code remains largely unvalidated. The methodology mines 44 AI pattern-related sources to identify 14 AI pattern classes, then applies active learning to detect the most common class across 100 open-source GitHub repositories. Prevalence estimation provides accuracy bounds on occurrence frequency. The classifier reaches 56% accuracy and 55% recall in an 8-way task, far above an 11% random baseline, enabling empirically grounded analysis of pattern utility.","A Methodology for Investigating AI Patterns Prevalence in Software Repositories  \nSrinath Perera 1 , Hasinthaka Piyumal 1 , Frank Leymann2 , and Rania Khalaf1  \nWSO2 1 , University of Stuttgart2  \nSanta Clara, CA, USA 1 , WSO2, Stuttgart, Germany2  \ne-mail: {srinath, hasinthaka, [rania}@wso2.com](rania}@wso2.com1)[1](rania}@wso2.com1) , [frank.leymann@iaas.uni-stuttgart.de](frank.leymann@iaas.uni-stuttgart.de2)[2](frank.leymann@iaas.uni-stuttgart.de2)  \narXiv :2607 .00558v 1 [ cs . SE] 1 Jul 2026  \nAbstract—As Artificial Intelligence(AI)-based applications takeoff, a clear understanding of AI patterns can uplift the quality of AI applications. Many AI patterns have been proposed in the literature; however, their prevalence in real-life code has not yet been validated. Understanding the actual use of those patterns in practice can clarify our understanding both of the significance of these patterns and their utility. In this paper, we present a methodology to a) identify relevant patterns by mining the literature and then to b) validate their presence and prevalence in actual code repositories using active learning. To that end, we identify 14 AI pattern classes by mining 44 published AI patternrelated sources. Then we use an active learning approach to determine the prevalence of the most common pattern class across 100 GitHub open AI repositories. Using prevalence estimation, we propose bounds on the accuracy of the occurrences. The model achieves 56% accuracy and 55% recall in an 8-way classification task, significantly outperforming the 11% random-chance baseline. Furthermore, the prevalence estimation offers usable bounds for analyzing pattern applications. This methodology provides a robust foundation to start understanding how AI patterns are used in practice, a field that currently lacks empirical data.  \nKeywords-patterns;pattern analysis; software; software engineering  \nI. INTRODUCTION  \nLarge Language Models (LLMs) [1] now provide generalpurpose, high-quality Artificial Intelligence (AI) capabilities that require little to no user-provided training data. These models have unlocked many previously infeasible use cases. Several patterns and abstractions including RetrievalAugmented Generation (RAG) [2], ReAct [3], and agent-based frameworks [4] now help developers build AI applications. Software Design patterns [5] document recurring problems and solution templates, thereby improving software quality by enabling, communicating, and educating best practices.  \nAs we will discuss in the related work section, many AI patterns have been proposed in the literature. Those patterns aim to capture the authors’ observations and experiences. Validating those patterns by understanding their usage frequency in practice can clarify their relative importance, thereby improving the quality of AI-based applications. Furthermore, estimating usage frequency will help us verify candidate patterns using the rule of three (rule of X) [6] .  \nWe have identified 769 AI design pattern candidates proposed in the literature. Using word embeddings of those pattern descriptions and clustering, we have grouped them into 78 refined pattern candidates. Then, by manual inspection, we have categorized them into 14 pattern classes.  \nTo verify the prevalence of pattern classes in practice, we selected 100 open-source GitHub repositories that implement  \nreal-world AI applications. From those repositories, we have extracted 2442 code communities. (A code community is a group of tightly coupled methods (procedures) in the call graph.)  \nThen, using an active learning-based approach [7], we built a classifier to detect the most common patterns listed above. Active learning builds a model with the help of an (e.g., human) oracle, aiming to minimize the number of data annotations (i.e., oracle queries) . We proceed by starting with an initial model and iterative labeling of a few data-points that exhibit higher uncertainty in their predictions under the cu","cbCair0I3CjBkFGS","https://ap.wps.com/l/cbCair0I3CjBkFGS","pdf",439607,1,"English","en",105,"# Introduction\n# Related Works\n## AI Patterns\n## Mining Patterns from Code","[{\"question\":\"How does the paper identify AI pattern classes for investigation?\",\"answer\":\"It mines 44 AI pattern-related sources from the literature, then synthesizes 769 pattern candidates into a refined taxonomy and categorizes them into 14 AI pattern classes by manual inspection.\"},{\"question\":\"What data and repositories are used to measure pattern prevalence?\",\"answer\":\"The study analyzes 100 open-source GitHub repositories that implement real-world AI applications, extracting 2442 code communities from their call graphs.\"},{\"question\":\"How are pattern occurrences detected and how is prevalence estimated?\",\"answer\":\"An active learning approach trains a classifier with human-in-the-loop annotations to detect the most common pattern classes, and prevalence estimation techniques provide bounds on the true frequency of pattern occurrences.\"}]",1784181271,20,{"code":4,"msg":29,"data":30},"ok",{"site_id":23,"language":22,"slug":31,"title":13,"keywords":32,"description":14,"schema_data":33,"social_meta":84,"head_meta":86,"extra_data":88,"updated_unix":26},"a-methodology-for-investigating-ai-patterns-prevalence-in-software-repositories","",{"@graph":34,"@context":83},[35,52,66],{"@type":36,"itemListElement":37},"BreadcrumbList",[38,42,46,49],{"item":39,"name":40,"@type":41,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":43,"name":44,"@type":41,"position":45},"https://docshare.wps.com/document/","Document",2,{"item":47,"name":12,"@type":41,"position":48},"https://docshare.wps.com/document/research-report/",3,{"item":50,"name":13,"@type":41,"position":51},"https://docshare.wps.com/document/a-methodology-for-investigating-ai-patterns-prevalence-in-software-repositories/82529/",4,{"url":50,"name":13,"@type":53,"author":54,"headline":13,"publisher":56,"fileFormat":59,"inLanguage":22,"description":14,"dateModified":60,"datePublished":60,"encodingFormat":59,"isAccessibleForFree":61,"interactionStatistic":62},"DigitalDocument",{"name":9,"@type":55},"Person",{"url":39,"name":57,"@type":58},"DocShare","Organization","application/pdf","2026-07-16",true,{"@type":63,"interactionType":64,"userInteractionCount":4},"InteractionCounter",{"@type":65},"ViewAction",{"@type":67,"mainEntity":68},"FAQPage",[69,75,79],{"name":70,"@type":71,"acceptedAnswer":72},"How does the paper identify AI pattern classes for investigation?","Question",{"text":73,"@type":74},"It mines 44 AI pattern-related sources from the literature, then synthesizes 769 pattern candidates into a refined taxonomy and categorizes them into 14 AI pattern classes by manual inspection.","Answer",{"name":76,"@type":71,"acceptedAnswer":77},"What data and repositories are used to measure pattern prevalence?",{"text":78,"@type":74},"The study analyzes 100 open-source GitHub repositories that implement real-world AI applications, extracting 2442 code communities from their call graphs.",{"name":80,"@type":71,"acceptedAnswer":81},"How are pattern occurrences detected and how is prevalence estimated?",{"text":82,"@type":74},"An active learning approach trains a classifier with human-in-the-loop annotations to detect the most common pattern classes, and prevalence estimation techniques provide bounds on the true frequency of pattern occurrences.","https://schema.org",{"og:url":50,"og:type":85,"og:title":13,"og:site_name":57,"og:description":14},"article",{"robots":87,"canonical":50},"index,follow",{"doc_id":7,"site_id":23},{"code":4,"msg":5,"data":90},[91,95,99,103,108,113,118,121,125,128,132],{"id":20,"doc_module":4,"doc_module_name":44,"category_name":92,"show_sort_weight":93,"slug":94},"Story & Novel",90,"story-novel",{"id":45,"doc_module":4,"doc_module_name":44,"category_name":96,"show_sort_weight":97,"slug":98},"Literature",80,"literature",{"id":51,"doc_module":4,"doc_module_name":44,"category_name":100,"show_sort_weight":101,"slug":102},"Exam",70,"exam",{"id":104,"doc_module":4,"doc_module_name":44,"category_name":105,"show_sort_weight":106,"slug":107},5,"Comic",60,"comic",{"id":109,"doc_module":4,"doc_module_name":44,"category_name":110,"show_sort_weight":111,"slug":112},6,"Technology",50,"technology",{"id":114,"doc_module":4,"doc_module_name":44,"category_name":115,"show_sort_weight":116,"slug":117},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":44,"category_name":12,"show_sort_weight":119,"slug":120},30,"research-report",{"id":122,"doc_module":4,"doc_module_name":44,"category_name":123,"show_sort_weight":27,"slug":124},9,"Religion & Spirituality","religion-spirituality",{"id":27,"doc_module":4,"doc_module_name":44,"category_name":126,"show_sort_weight":27,"slug":127},"World Cup","world-cup",{"id":129,"doc_module":4,"doc_module_name":44,"category_name":130,"show_sort_weight":129,"slug":131},10,"Lifestyle","lifestyle",{"id":133,"doc_module":4,"doc_module_name":44,"category_name":134,"show_sort_weight":104,"slug":135},19,"General","general"]