arXiv:2609.02789cs.SESep 2026

Manuscript Offprint

arXiv:2609.02789

ShikumiMiner: Mining Recurring Implementation Patterns in AI Codebases

Afsana Tasnim, Sheikh Motahar Naim

Afsana Tasnim

University of Texas at Arlington

Arlington, TX, USA

axt0868@mavs.uta.edu

Sheikh Motahar Naim

Microsoft

Seattle, WA, USA

snaim@microsoft.com

Abstract—Large language models are paving the way towards innovation by understanding, analyzing, summarizing and generating content in the modern world. Currently there are thousands of LLM projects developed by engineers in open-source repositories. However, whether these LLM projects have underlying patterns or not remains a question. Exploring these underlying patterns will give new dimensions to the developers who aim to develop these LLM projects. In this paper, we propose ShikumiMiner, a static-analysis framework that combines Abstract Syntax Tree (AST) and Control Flow Graph (CFG) features to detect and compare recurring implementation patterns in C++ local LLM codebases. We analyze ten GitHub open-source repositories and classify functions into seven study-specific categories using a multi-label Random Forest model. Studying these patterns can provide useful insights for developers aiming to design LLM applications.

Index Terms—Large Language Models, Pattern Detection, Source Code Analysis

I. Introduction

Large Language Models (LLMs) are a widespread phenomenon in today's world. Even though these AI-powered innovations have exceptional capabilities like summarization, content generation, complex query answering, code analysis, etc, there are significant concerns regarding the source code used to develop some of the LLM projects. Whether these LLM projects follow any structural or execution pattern or not remains a question that needs to be solved if we want to understand LLM projects better. Code analysis is an option for detecting such patterns in LLM projects. Although prior work has studied ASTs, CFGs, data-flow graphs, and other program representations for code analysis, [1], [2], [3], [4], [5], [6], limited work has examined how these techniques can be used to characterize recurring implementation patterns in C++ local LLM codebases. This gap motivates our work on ShikumiMiner, which analyzes local LLM implementations by extracting function-level syntactic and control-flow evidence from source code.

Previous studies have shown a systematic empirical analysis of the extent to which large language models can perform fundamental code analysis tasks in a zero-shot setting [1]. While conducting the study, authors have considered three core dimensions of program comprehension namely syntax parsing, static semantic inference, and dynamic reasoning. The authors examine nine representative tasks, including AST generation, expression matching, CFG construction, call graph generation, data dependency analysis, taint analysis, pointer analysis, equivalent mutant detection, and flaky test reasoning in order to evaluate these dimensions.

GraphCodeBERT, a pre-trained model for programming languages, considers the inherent structure of code [7]. By using data flow in the pre-training stage, the authors learn code representation from source code and code structure. Their analysis shows that code structure and newly introduced pre-training tasks can improve GraphCodeBERT [7].

However, the study [1] also identifies several limitations: when tasks require deeper semantic or runtime reasoning, LLM performance degrades substantially. Their outputs depend largely on prompt design and representation format. It is also challenging to evaluate the generated ASTs, CFGs, and semantic graphs because multiple structurally different outputs may still be partially correct. Overall, the paper concludes that LLMs have promising potential for assisting code analysis. However, their reliability limitations require validation mechanisms and hybrid integration with deterministic analyzers. The paper's [7] limitations include its reliance on accurate data-flow extraction, which may be difficult for incomplete, dynamically typed, or complex real-world code; its focus on data flow while excluding richer structures such as control flow or full AST semantics; and evaluation mainly on benchmark datasets, so its robustness in large, noisy, industrial codebases remains less certain.

In this work, we aim to address these limitations by developing an approach named ShikumiMiner. Rather than relying solely on syntactic structure or control-flow information [8], [9], [10], [11], [12], our approach seeks to combine both perspectives in order to capture richer program characteristics, including code organization, execution paths, and structural dependencies.

In this paper, we make the following contributions:

  • We propose ShikumiMiner, an AST-CFG-based static-analysis framework for extracting function-level structural and control-flow features from C++ local LLM codebases.

  • We formalize recurring implementation structures in local LLM codebases as detectable pattern categories using combined syntactic and control-flow evidence.

  • We evaluate ShikumiMiner on ten open-source C++ local LLM repositories and report function-level and project-level pattern distributions.
  • We analyze project-level similarities and feature-pattern relationships to show how local LLM implementations differ in their structural and execution characteristics.

Prior work has extensively studied ASTs, CFGs, data-flow graphs, and program-dependence graphs for code representation, vulnerability detection, clone detection, defect prediction, and pretrained code-model analysis. However, these studies mainly focus on general software-engineering tasks, neural code representation, or the internal capabilities of pretrained code models. In contrast, ShikumiMiner focuses on real C++ local LLM implementations and uses combined AST and CFG analysis to identify recurring structural and execution patterns. Therefore, ShikumiMiner does not claim to invent AST or CFG analysis; rather, its contribution lies in applying and integrating these representations for domain-specific pattern tracing in local LLM systems.

References (53)