WorksComputer Science
How Far Can LLMs Go in Generating Android Lint Checks from Natural Language?
Abstract
Static analysis tools such as Android Lint, PMD, and CodeQL let developers add custom checks for project-specific rules. However, authoring a check is a demanding programming task: a rule can be stated in a few sentences, yet turning it into a working, tested check requires detailed knowledge of the analysis framework and its issue-detection logic. Recent work generates such checks with large language models (LLMs), but each system needs more than the natural language description a developer always has: a bug-fix patch, a CVE record, or a developer-written test suite to repair against. No prior work measures whether an LLM can turn a description into a working check, or what external knowledge it needs to do so. We introduce LintBench, a human-validated benchmark of 113 real-world Android Lint checks, each paired with a natural language description and its original test suite as a held-out oracle. We evaluate four LLMs, including proprietary and open-weight models. We compare prompting strategies, then evaluate execution-guided repair with and without retrieved API knowledge. Prompting alone reaches 30%-65% (pass@5) across models. Execution-guided repair and retrieval reach 57%-85% test-passing rates within five calls. Our results show that execution feedback raises the pass rate, while retrieved framework knowledge raises the compile rate, which reaches up to 99%. The framework knowledge helps the low-performing models the most, providing the knowledge they need to fix compilation errors. Of the generated checks that compile but fail their tests, 87% have false negatives, missing an issue the generated check should report. Based on our findings, getting the issue-detection logic right remains an open challenge. We release LintBench and the evaluation harness to support future work on generating Android Lint checks.
Introduction
Static analysis tools are widely used to ensure code quality, flagging bugs and security vulnerabilities by checking code against predefined rules. Built-in rules do not always capture a team’s coding conventions, so analyzers such as Android Lint, PMD, and CodeQL let developers add custom checks for the rules they care about [1, 2, 3]. Studies of developer needs report a broad demand for such project-specific rules [4, 5]. Yet, each custom check is a small program written against the analyzer’s framework, and authoring a check is known to be difficult [6]. As a result, teams encode far fewer rules than they would like. Given the success of large language models (LLMs) for generating code, a natural question is whether they can generate these checks too.
Recent work pursues this goal with LLMs. KNighter synthesizes Clang Static Analyzer checkers from historical bug-fix patches [7]. QLCoder synthesizes CodeQL queries from CVE metadata [8], which typically pairs a textual description with the weakness type (CWE), the affected versions, and references such as the fixing commit. Neither of these works builds a check from the description alone, the one artifact a developer is sure to have (Table I). Closest to a description-driven setting, AutoChecker generates PMD checkers, but it is test-driven: it provides a natural language description and developer-written tests to the model as input, where the model is tasked to repair the checker until those tests pass [9]. Exposing the tests during generation is not just an added burden, it also undermines validity. With the tests exposed to an LLM, it can reward-hack the oracle, hard-coding or special-casing the shown cases instead of implementing the rule [10, 11]. Thus, we argue that the tests must be kept as a held-out oracle that the model never sees.
Table I. Prior LLM check synthesizers vs. LINTBENCH. LINTBENCH evaluates check generation from a natural-language description alone. The tests are held-out oracle, and the repair conditions receive only test outcomes.
We study how far LLMs can go in this description-only setting for Android Lint, the analyzer shipped with the Android build toolchain and run by default on nearly every Android project [1]. Besides its hundreds of built-in checks, Android Lint runs custom checks that libraries distribute to their users. To measure the adoption of custom checks, we searched Gradle build files on GitHub (extension:gradle and extension:kts) for lintPublish, the configuration that packages a library’s custom checks with the library. We confirmed a lintPublish invocation in 471 of the 537 matching files (88%), which span 245 distinct non-fork repositories owned by 67 organizations. It includes teams at Uber and Slack that maintain their own checks [12, 13, 14]. Android Lint requires choosing scanner interfaces and callbacks for Java and Kotlin source, XML resources, manifests, or Gradle files, then expressing detection logic through the corresponding framework APIs.
Generating a check this way demands two capabilities: lint framework understanding, i.e., which scanner to implement and which Lint APIs to call, and the issue detection logic, which decides when to report. Which of these two capabilities is more critical is unknown and consequential. If checks fail for lack of framework knowledge, retrieving that knowledge should close the gap. If they fail on the detection logic, no amount of framework documentation would help, and the bottleneck is the model’s own reasoning. We resolve this question with a benchmark of real Lint checks paired with their tests (as held-out oracle) and a controlled study across four LLMs, isolating what retrieval sources and execution-guided repair each contributes.
Problem setting. The model is given a rule’s natural language description and must synthesize a check that compiles and passes a test suite encoding the rule’s intended behavior. We keep the tests as a held-out oracle. The model cannot access the test source or reference implementation. The description-only task specification mirrors a realistic authoring setting where a developer can describe a rule but has not yet written its tests. Depending on the condition, the model also receives examples, scaffolding, retrieved documentation, or compiler and test diagnostics. We use the held-out tests to evaluate candidates and provide diagnostic feedback during repair.
Benchmark. We build LINTBENCH, 113 human-validated real checks from the production Android Open Source Project (AOSP) [15] Lint suite, each paired with a natural language description from the check’s developer documentation and its test suite as an executable oracle. The instances cover Java/Kotlin source, XML resources, and manifests, and 23% of them require more than one scanner interface. We keep only checks that pass mutation-based filtering and manual validation, so a passing check requires non-trivial issue-detection logic and every description admits a correct implementation. A harness scores each generated check by compiling it and running the tests, providing an objective pass/fail signal.
Using LINTBENCH, we evaluate the information sources that current check-generation approaches rely on. We start from prompting on the description alone and add two richer prompts: in-context examples of well-formed checks, as KNighter uses [7], and structural scaffolding that hands the model a solution skeleton to complete. We then add execution-guided repair, feeding compiler and test diagnostics back to the model as in self-debugging [16], [17]. This generate–run–repair loop mirrors an agentic coding workflow, where the model acts, observes execution feedback, and revises, but in a controlled, fixed-budget, fixed-tool setting that isolates each component’s contribution. Finally, we add retrieval, which augments the prompt with external knowledge in the style of retrieval-augmented generation [18], [19], drawing on two sources, the Android Lint API reference [20] and the Lint developer guide [21].
Research questions. We organize the study around four questions. The first examines what prompting alone achieves, and the rest analyze the retrieval-and-repair setting:
RQ1: From a natural language description alone, how far does LLM prompting reach, and at which stage (compilation or issue-detection logic) do its failures concentrate?
RQ2: How far does check generation reach once execution-guided repair and retrieved framework knowledge are added, and how much does each contribute to the gain?
RQ3: When generated checks fail, is it because of a knowledge gap (missing framework APIs) or incorrect issue-detection logic?
RQ4: What does each component (the repair loop and each retrieval source) cost per successfully generated check?
We study these questions by evaluating each of the conditions across four LLMs, two open-weight (Qwen3.6-Max-Preview [22] and Kimi K2.7 Code [23]) and two proprietary (Claude Sonnet 4.6 [24] and Gemini 3.5 Flash [25]).
Findings. Prompting from the description alone plateaus at 64.6%, with most failures concentrated at compilation (RQ1). Adding execution-guided repair and retrieval raises the best result to 85.0% at a matched five-call budget, and a repair-only control shows the repair loop accounts for most of this gain. The top-performing models nearly saturate compilation on their own by self-correcting APIs from compiler feedback, so API-reference retrieval adds little for them. It helps more for the low-performing models, which correct fewer of these errors (RQ2). Once a check compiles but fails tests, none of the retrieved sources improves it. Compiling but failing checks are unsound (under-detection): checks that fail to flag the issue. This gap in the issue-detection logic closes only with the model’s coding capability (RQ3). On cost, the cheapest model is not the top-performing one. Retrieval is roughly cost-neutral per solved check. The expanded context raises the per-run cost, but the higher pass count offsets it (RQ4).
Contributions. To the best of our knowledge, LINTBENCH is the first benchmark and controlled study of generating static analysis checks from natural-language task descriptions with hidden test source (Table 1). This work makes the following contributions:
LINTBENCH, a human-validated benchmark of 113 real Android Lint checks, each paired with a natural language description and its original test suite, with an execution harness (Section III).
A controlled study across four LLMs that isolates prompting, retrieval, and execution-guided repair, attributes each gain to its source (execution feedback raises the pass rate, retrieval the compile rate), and quantifies the cost each component adds (Sections IV–VI).
An instance-level failure analysis separating under-detection, runtime errors, and message or location failures (Sections VI and VII).
Anatomy of a Lint Check
Android Lint is the standard static analyzer for Android, extensible with developer-written checks.
class SecureRandomDetector :
Detector(), SourceCodeScanner {
override fun getApplicableMethodNames() =
listOf("setSeed")
override fun visitMethodCall(context: JavaContext,
node: UCallExpression, method: PsiMethod) {
val args = node.valueArguments
if (args.isEmpty()) return
if (!context.evaluator.isMemberInClass(method,
"java.security.SecureRandom")) return
if (ConstantEvaluator.evaluate(context, args[0])
!= null)
context.report(ISSUE, node,
context.getLocation(node), MSG)
}
// companion: ISSUE = Issue.create("SecureRandom", ...)
}
Listing 1: Condensed SecureRandom check (Kotlin). Everything in green is Lint framework code: the scanner interface, callbacks, and API utilities the model must implement. The rule itself touches only an ordinary JDK target (black, setSeed on java.security.SecureRandom).
Terminology. Four framework terms recur throughout this paper. A check is a single rule Lint enforces. It is implemented as a Detector, the Java or Kotlin class that runs the analysis, which declares one or more Issues, the metadata (id, message, severity, category) for each problem it reports, and implements a scanner interface (e.g., SourceCodeScanner or XmlScanner) that fixes the program representation it inspects. One detector may declare several issues, so we identify a check by its Issue, not its detector. Generating a check means writing a detector that registers the right issue and implements the right scanner.
Because the targeted representation varies, the same intent, “flag ,” yields very different code depending on whether lives in source, a layout, the manifest, or the build script. Consider Lint’s own SecureRandom check, whose developer-facing description reads: “Using a fixed seed with SecureRandom . . . will cause the instance to return a predictable sequence of numbers . . . not appropriate for secure use.” The description states the rule’s intent and the JDK class it concerns, but nothing about how to express it as a Lint check (Listing 1; LINTBENCH, Section III-B).
What a working check demands. The rule takes only a sentence or two to state. A working check must still supply four elements the description leaves implicit. (i) Choosing the scanner and scope: which representation to scan and which callbacks to implement, here a SourceCodeScanner intercepting the setSeed call. (ii) Grounding the framework API: precise utilities such as JavaEvaluator.isMemberInClass and ConstantEvaluator, called with their exact signatures. (iii) Assembling and registering the check: declaring an Issue and wiring its implementation and registry entry by framework convention. (iv) Getting the issue-detection logic right: confirming the receiver is a SecureRandom and deciding whether the seed is a compile-time constant. Our study measures how far current LLMs reach on these demands, and where they fall short (Section VI).
LintBench
LintBench is, to the best of our knowledge, the first public benchmark for generating Android Lint checks from a natural-language description. Its 113 instances are human-validated real checks from the production AOSP detector suite, each paired with the developer’s description and the check’s own test suite as an executable oracle. Together, the instances cover source, XML resource, and manifest checks. Three properties make it a realistic and discriminating benchmark. (i) Realistic: every check ships in Android’s official tooling. (ii) A behavior-validated oracle: we keep an instance only after confirming that its tests fail on an empty stub detector. (iii) Human-validated: every description is reviewed for clear specification.
Dataset Construction
We construct LINTBENCH in the steps of Figure 1.
Figure 1. LINTBENCH construction. Four filters reduce 478 candidate issues to 152; human validation flags 35 and four are held out as few-shot examples, yielding the 113-check LINTBENCH. Badges show the count after each step.
1. Checks collection. We clone the AOSP lint-checks module [15], the canonical set of production Android Lint detectors, and pair each lint issue with the JUnit tests that exercise it (a detector may define several issues), yielding 478 candidate issues whose own tests serve as an executable correctness oracle.
2. Tests-oracle filtering. We keep the 439 issues backed by a discriminating oracle: per detector, at least two test methods, ideally checking both flagged and clean code (dropping 32 issues with absent or too-thin tests); per issue, the issue’s own ID asserted in some test, so the signal is specific to that check and not a sibling (dropping 7 more).
3. Execution-based filtering. We run each issue’s tests against its reference implementation in an isolated, version-pinned Docker harness, keeping the 160 that pass; the rest depend on AOSP-internal utilities, shared fixtures, or cross-module helpers unavailable in the harness.
4. Mutation-based filtering. We replace each reference detector with an empty stub and rerun its tests, keeping only checks whose tests catch this mutant. Four still pass and cannot tell a working detector from one that does nothing, leaving 156.
5. API-based filtering. We drop four checks built on the deprecated ASM bytecode-visitor API, restricting LINTBENCH to the current UAST source-analysis API (the unified syntax tree Lint exposes for Java and Kotlin) [26], leaving 152 valid checks.
6. Human validation. We manually reviewed the description and targeted tests of all 152 checks against two criteria and rejected 35, which leaves 117. We flagged 22 as under-specified: the description omitted behavior or contracts required by the tests. For example, InvalidAnalyticsName refers to external Firebase documentation without stating the tested naming rules. We flagged 24 for sibling-test burden, where passing requires implementing other issues in the same detector. Eleven checks met both criteria. For example, IconDuplicatesConfig’s testNoDpi also requires reports for IconNoDpi and IconMissingDensityFolder.
| LINTBENCH-unverified (148) | LINTBENCH (113) | |
| Analysis representation | ||
| XML / manifest (XmlScanner) | 67 (45%) | 54 (48%) |
| Source (SourceCodeScanner) | 41 (28%) | 33 (29%) |
| Mixed (source + XML) | 38 (26%) | 26 (23%) |
| Other (Gradle, binary, . . .) | 2 (1%) | 0 (0%) |
| Implementation language | ||
| Java | 91 (61%) | 63 (56%) |
| Kotlin | 57 (39%) | 50 (44%) |
| Difficulty | ||
| Easy | 41 (28%) | 38 (34%) |
| Medium | 82 (55%) | 61 (54%) |
| Hard | 25 (17%) | 14 (12%) |
| Issue category | ||
| Correctness | 87 (59%) | 71 (63%) |
| Performance | 18 (12%) | 11 (10%) |
| Icons | 15 (10%) | 8 (7%) |
| Security | 9 (6%) | 9 (8%) |
| Other (8 categories) | 19 (13%) | 14 (12%) |
Table II. Composition of LINTBENCH and the unverified 148 set. Each group partitions the benchmark independently.
Held-out examples. We reserve four of the 117 as few-shot examples, leaving 113 as LINTBENCH. LINTBENCH plus the 35 filtered checks in human validation form the 148-check unverified set that tbl:II contrasts with LINTBENCH. The four examples, 113 benchmark checks, and 35 rejected checks are mutually disjoint.
Instance Structure and Task Descriptions
Each LINTBENCH instance pairs a natural-language specification with the scanner interface(s) the check must implement and links to the relevant Lint API reference. The specification is derived from the check’s developer-facing briefDescription and explanation in the AOSP source. It conveys the rule’s intent and, like that documentation, may name the type or API the rule concerns (for example, SecureRandom), but it never includes the check’s implementation: the scanner to extend, the callbacks to override, or the Issue registration. This keeps the task (“what to detect”) separate from the solution (“how to implement it as a Lint check”), so the base condition measures generation from intent, not from a leaked implementation. Full schema and field definitions are included in the released artifact.
Dataset Characteristics
LINTBENCH comprises 113 checks with 296 targeted test methods (mean 2.6 per check); their 81 reference detectors span 50–1,732 source lines of code (SLoC) (median 120) and 11 issue categories, dominated by CORRECTNESS (62.8%). tbl:II contrasts LINTBENCH with the larger 148-check unverified set, which tracks it closely. The mix is heterogeneous: 26 checks (23%) implement more than one scanner interface, most often source and XML together, forcing a model to coordinate two scanners at once.
Difficulty. For reference detector , let be SLoC, its scanner-interface count, and its test-method count across distinct test files. We compute per-detector medians on the 148-check unverified set: logical source lines, scanner interface, and test methods per detector, counting distinct test files. We retain these medians after human filtering. The equally weighted score is
All checks from a detector inherit its score. The tiers are EASY (), MEDIUM (), and HARD (), yielding the reported 0.33/0.67 cutpoints directly from the three indicators. We fixed these tiers before the repair experiments. Test count is a proxy for tested behavioral breadth. The tiers describe reference-code complexity, and we evaluate their association with generation outcomes in Section VI-B.
Evaluation Harness
The harness takes a generated check, compiles it against the Lint API, and runs the original tests that assert its issue, recording: (i) compile success; (ii) test outcome (all targeted tests pass / some fail); (iii) compiler and test logs for failure analysis. Before execution, two pre-processing steps are applied. Stub injection aligns the generated Issue field names with the pre-compiled BuiltinIssueRegistry, preserving issue-detection logic while allowing the JVM to initialize. Loose-mode patching replaces supported exact-output assertions with expectContains("[IssueId]") for the expected issue IDs and removes expectFixDiffs calls, so evaluation targets issue-detection logic, not message wording. These assertions require a report for each expected ID but do not enforce its location, multiplicity, wording, or the absence of extra reports. Existing expectClean() assertions remain unchanged and reject reports on the clean inputs they cover. This coverage varies across checks. We consider a generated check test-passing if it compiles and passes all targeted tests under these rules.
Producing framework-correct, compilable code is a key part of authoring a Lint check: the check must call the scanner APIs with the right signatures and assemble a registrable Issue. We therefore record compilation and test-passing as separate outcomes (compile@k and pass@k; Section IV), which lets us locate whether a generation fails at framework grounding or at issue-detection logic.
Docker-isolated execution. The pre-processed detector and test files are mounted into a Docker container built from a Gradle environment containing lint-api, `lint-tests, and android.jar at pinned versions (Android Gradle Plugin 31.7.0). Gradle compiles the detector and test class, then runs the targeted test class with -tests. Compilation errors are extracted from the build log; JUnit XML output is parsed to determine per-method pass/fail status. The container enforces a 120-second timeout and 3 GB memory limit.
How Far Prompting Alone Reaches
We measure how far current LLM prompting reaches on LintBench from the description alone, establishing the gap a method must close. This section first defines the apparatus for the baseline study (RQ1), the models, metrics, and prompting strategies we compare, then reports the results.
Models and metrics
We evaluate four recent LLMs spanning a range of coding performance: Claude Sonnet 4.6 [24], Gemini 3.5 Flash [25], Qwen3.6-Max-Preview [22], and Kimi K2.7 Code [23]. We selected a leading model from each of Anthropic, Google, Qwen, and Moonshot using Android Bench rankings during May–June 2026 [27], prioritizing provider diversity. We also considered OpenRouter pricing [28]: Opus 4.6 offered little ranking improvement over Sonnet 4.6 at several times its price.
We report two @k metrics, each the probability that at least one of independently sampled generations meets a criterion, using the standard unbiased estimator [29], [30], with samples per instance and meeting it. The criterion is compile (the check compiles) or pass (it compiles and all targeted tests succeed), so ; compile isolates framework-grounding from logic failures. We report each at and , and #Pass, the number of checks solved by at least one of the samples.
Prompting conditions
We compare three prompt configurations that vary the knowledge provided to the model, each instance sampled times at temperature :
Zero-shot (C0): the natural-language description only, with no additional context. This measures raw LLM performance on the task.
Few-shot (C0 + C1): the description plus worked Detector examples matched to the target’s scanner interfaces and language. The reported experiments use only four held-out source/XML examples: one Java and one Kotlin example for each of
SourceCodeScannerandXmlScanner. These are the only interfaces used by 111 of the 113 checks. Each example compiles, passes its original tests, has fewer than 300 LOC with no hidden dependencies, and represents a distinct implementation pattern. Multi-interface targets receive matching examples.Structural scaffolding (C0 + C2): the description plus scaffolding derived from the target check’s metadata: the
Detectorbase class, scanner interface(s), andIssue/Implementationregistration boilerplate. The system prompt casts the model as an expert Android Lint developer (Listing 2): it is handed the framework basics and asked only for the check-specific issue-detection logic, which it must still produce in full.
System prompt:
You are an expert Android developer specialising in Android Lint custom checks. You write Detector implementations in Kotlin that are correct, idiomatic, and compile cleanly against the Lint API.
// Rules are provided here (omitted)
User prompt:
Complete the following Android Lint Detector skeleton in Kotlin.
Issue ID: SecureRandom Class: SecureRandomDetector
Category: SECURITY Severity: WARNING
Base class: Detector
Specification: Using a fixed seed with `SecureRandom`
Specifying a fixed seed will cause the instance to
return a predictable sequence of numbers. This may be
useful for testing but it is not appropriate for
secure use.
Starter skeleton -- fill in all TODO() stubs,
add helpers as needed:
class SecureRandomDetector : Detector(),
SourceCodeScanner {
companion object {
<IMPLEMENTATION; ISSUE =
Issue.create("SecureRandom", ...)>
}
override fun getApplicableMethodNames():
List<String>? = TODO()
override fun visitMethodCall(context: JavaContext,
node: UCallExpression, method: PsiMethod) {
TODO() }
}
Output the complete SecureRandomDetector.kt with all
methods implemented.
Listing 2: Structural scaffolding prompt (C0 + C2) for the SecureRandom check. Given the spec and a metadata-derived skeleton (green), the model fills the TODO() stubs with issue-detection logic (red).
Baseline results
Zero-shot ranges from 13.3% (Kimi) to 34.3% (Gemini), and even at five samples the best prompt setting solves only 64.6% of checks (Table III). Implementing the rule as compilable code is the challenge: most first attempts never compile, especially for the open-weight models (compile@1 24.6% for Kimi and 26.5% for Qwen, against 55–63% for the proprietary Claude and Gemini). Compile-stage errors account for roughly three-quarters of the open-weight models’ samples (74% Qwen, 75% Kimi). The dominant compile failure is API hallucination, which we flag when a sample’s compiler diagnostic reports an unresolved symbol or an invalid override against the Lint or UAST API. It accounts for 53% of zero-shot compile failures (31% of all generations) and falls monotonically with model performance, from 41% of Kimi’s generations to 17% for Claude, but never vanishes. Structural scaffolding, which hands the model the scanner and Issue skeleton, lowers hallucination for three of the four models (Qwen 40→22%, Kimi 41→28%, Gemini 25→14%) but not for Claude (17→23%), indicating that this hallucination pattern drives its uneven effect on pass@1.
| Setting + LLM | compile@1 | pass@1 | compile@k | pass@k | #Pass |
| Zero-shot | |||||
| + Qwen3.6-Max-Preview | 26.5 | 14.3 | 54.9 | 31.9 | 36 |
| + Kimi K2.7 Code | 24.6 | 13.3 | 61.1 | 38.1 | 43 |
| + Claude Sonnet 4.6 | 62.5 | 33.1 | 85.0 | 47.8 | 54 |
| + Gemini 3.5 Flash | 55.2 | 34.3 | 89.4 | 61.1 | 69 |
| Few-shot | |||||
| + Qwen3.6-Max-Preview | 33.1 | 15.8 | 55.8 ↑0.9 | 30.1 ↓1.8 | 34 |
| + Kimi K2.7 Code | 34.2 | 18.8 | 57.5 ↓3.6 | 36.3 ↓1.8 | 41 |
| + Claude Sonnet 4.6 | 54.0 | 31.3 | 67.3 ↓17.7 | 42.5 ↓5.3 | 48 |
| + Gemini 3.5 Flash | 38.1 | 24.6 | 61.9 ↓27.5 | 38.9 ↓22.2 | 44 |
| Structural scaffolding | |||||
| + Qwen3.6-Max-Preview | 48.0 | 23.0 | 69.9 ↑15.0 | 37.2 ↑5.3 | 42 |
| + Kimi K2.7 Code | 42.8 | 22.1 | 74.3 ↑13.2 | 48.7 ↑10.6 | 55 |
| + Claude Sonnet 4.6 | 47.8 | 26.4 | 67.3 ↓17.7 | 40.7 ↓7.1 | 46 |
| + Gemini 3.5 Flash | 66.7 | 42.3 | 84.1 ↓5.3 | 64.6 ↑3.5 | 73 |
Table III. Prompting baselines on LINTBENCH ( samples). Arrows indicate the change vs. the zero-shot.
Richer prompts move this ceiling little. Structural scaffolding raises pass@1 for three of the four models (for example, Qwen 14.3%→23.0% and Gemini 34.3%→42.3%) but lowers it for Claude (33.1%→26.4%), and few-shot examples raise pass@1 only for Qwen and Kimi. The best pass@5 rises from 61.1% (zero-shot) to 64.6% (Gemini with scaffolding). These swings share one cause: added context helps a model that lacks structure and constrains one that does not. The open-weight models start far lower (zero-shot compile@1 24.6% Kimi, 26.5% Qwen), so the skeleton supplies the boilerplate they cannot write and raises their compile and pass rates. The proprietary models gain little structurally and regress at the compile stage, as the worked example pulls in API patterns from a mismatched detector; few-shot also makes the five samples alike, lowering pass@5 even where pass@1 rises. Claude, which already writes compilable detectors in the zero-shot setting, only loses from the added constraints. The deeper barrier underneath these swings is API hallucination. A hallucinated symbol is a missing piece of Android Lint framework knowledge that the compiler error pinpoints exactly, so it can be fixed two ways: by supplying that knowledge (retrieval) or by letting the model read its own diagnostic and self-correct (execution-guided repair). We pursue both in § 5.
Finding 1: Prompting from the description alone plateaus at 64.6% (pass@5). Richer prompts do not break the ceiling. The barrier is compilation, dominated by API hallucination that falls with model performance but never vanishes.
Execution-Guided Repair and Retrieval
Overview
Prompting alone plateaus, with most failures never compiling (Section IV). We therefore evaluate execution-guided repair, with and without retrieval of Lint API-reference entries and developer-guide passages. The augmented description is given to the LLM, which emits a complete check (a Detector with its Issue registration). The harness compiles and runs its tests (Section III), and on failure feeds back the compiler errors and the failing-test assertions (the JUnit failure messages, not the test source) for repair until the check passes or the budget is exhausted. The model never sees the test code or a reference implementation, working only from the description and these diagnostics (Figure 2). This generate–run–repair loop mirrors an agentic coding workflow, in which the model acts, observes execution feedback, and revises, but it runs with a fixed call budget and fixed decoding settings, so the retrieval sources can be compared under identical repair conditions.
Figure 2. Execution-guided repair and retrieval. The description (plus retrieved knowledge) goes to the LLM; the harness compiles and tests the candidate, feeding diagnostics back.
Conditions and prompts
All repair conditions use the description (C0). We vary retrieval of the API reference (C3) and developer guide (C4), including a Repair-only control with neither source. The few-shot examples (C1) and scaffolding (C2) are evaluated separately in Section IV. To prevent leakage, each target’s own source, tests, and Issue metadata are excluded from every pool and index.
C3: API-reference retrieval. We index the public Lint analysis API and the UAST/PSI source-syntax APIs it uses (≈ 153 entries), a scanner-interface method index (≈ 43), and SdkConstants mined from existing detectors. Each entry pairs an API element with its signature, doc comment, and a usage snippet (target excluded), embedded with BAAI/bge-large-en-v1.5 [31] and indexed with FAISS. We query with the description and insert the top-5 entries above a 0.6 cosine threshold.
C4: Developer-guide retrieval. We chunk the official Lint developer guide by section (223 chunks), embed it with the same model, and insert the top-20 chunks above the same 0.6 threshold.
Prompt construction. The template includes the description and an instruction to emit the check in a fixed output format the harness can extract. Decoding is held fixed across the four repair conditions (§ 5-C). We release the full template and one filled instance per condition with the artifact.
Scanner-conditioned, error-augmented retrieval. A detector’s structure follows the scanner interface it implements, which the model has not chosen at the first iteration. The initial prompt therefore opens with a fixed overview of the available scanner interfaces and project-level callbacks and asks the model to select those it needs. We parse the interface(s) the generated detector actually implements and condition later retrieval on them, so the signatures supplied follow the model’s own design. Before each repair we re-retrieve with a query augmented by the failure’s compiler errors or failing-test output, biasing results toward the symbols relevant to the fault.
Experimental setup
We evaluate a Repair-only control (execution-guided repair with no retrieval) and three retrieval configurations that pair the base description and repair with a source: Repair + API reference (C0 + C3), Repair + Developer guide (C0 + C4), and Repair + Both sources (C0 + C3 + C4, the full configuration). We run all four on the same four models as the baseline study (Section IV), each as one initial generation plus up to four execution-guided repair attempts (five model calls total) at temperature , a 32,768-token output cap, and a 180-second per-iteration build timeout. We chose the five-call budget after an initial ten-call pilot in which performance plateaued at five calls. Section VI reports a further ten-call check on Gemini’s remaining failures.
Pass rate and compile rate. Pass rate is the fraction of instances whose single run yields a passing check (the pass criterion of Section IV); compile rate, the fraction whose run yields a check that compiles on at least one iteration. The prompting baseline draws five independent samples at . Execution-guided repair uses one run of up to five calls at . Matching call budgets therefore compares two generation settings, with both sampling and temperature changed. It does not isolate the effect of repair. Retrieval comparisons within the repair study hold these settings fixed. Solved@iter and convergence. solved@iter is the cumulative fraction of instances passing by iteration (; iteration 1 is the initial generation, 2–5 are repairs), showing how much of the final pass rate repair contributes; we also report the mean iteration at which passing checks first pass.
Cost per solved check. We report dollar cost and total token usage (input + output) per successfully generated check, for each model and configuration. Statistical tests (cluster-robust GEE and Chi-Square test ()) are reported with each result where they are used (Section VI).
How Far Repair and Retrieval Reach
We now evaluate the retrieval-and-repair pipeline, which augments the base description with retrieval and execution-guided repair (§ 5).
RQ2: How far the retrieval and repair feedback loop reaches
With execution-guided repair and retrieval (Table IV), the full configuration on LINTBENCH compiles 92.0–99.1% of checks and passes 56.6% (Qwen) to 85.0% (Gemini), against a best prompting pass@5 of 64.6%. The Repair-only control estimates retrieval’s contribution with the repair budget and decoding held fixed.
| Setting + LLM | Compile (%)↑ | Pass (%)↑ | #Pass (/113)↑ | Iters↓ | $/solved↓ | kTok/solved↓ | |
| Repair-only | (Δ vs. best prompting) | |||||
| + Qwen3.6-Max-Preview | 74.3 ⇑4.4 | 50.4 ⇑13.2 | 57 | 3.6 | 0.308 | 55.6 |
| + Kimi K2.7 Code | 77.0 ⇑2.7 | 49.6 ⇑0.9 | 56 | 3.8 | 0.327 | 104.3 |
| + Claude Sonnet 4.6 | 93.8 ⇑8.8 | 66.4 ⇑18.6 | 75 | 2.9 | 0.152 | 16.4 |
| + Gemini 3.5 Flash | 95.6 ⇑6.2 | 80.5 ⇑15.9 | 91 | 2.5 | 0.227 | 28.1 |
| Repair + API reference | (Δ vs. Repair-only) | |||||
| + Qwen3.6-Max-Preview | 92.0 ↑17.7 | 56.6 ↑6.2 | 64 | 3.4 | 0.265 | 50.1 |
| + Kimi K2.7 Code | 91.2 ↑14.2 | 63.7 ↑14.1 | 72 | 3.2 | 0.202 | 64.9 |
| + Claude Sonnet 4.6 | 97.3 ↑3.5 | 73.5 ↑7.1 | 83 | 2.6 | 0.129 | 15.2 |
| + Gemini 3.5 Flash | 98.2 ↑2.6 | 82.3 ↑1.8 | 93 | 2.4 | 0.219 | 28.3 |
| Repair + Developer guide | (Δ vs. Repair-only) | |||||
| + Qwen3.6-Max-Preview | 76.1 ↑1.8 | 45.1 ↓5.3 | 51 | 3.7 | 0.348 | 63.5 |
| + Kimi K2.7 Code | 82.3 ↑5.3 | 61.1 ↑11.5 | 69 | 3.5 | 0.228 | 71.6 |
| + Claude Sonnet 4.6 | 94.7 ↑0.9 | 69.0 ↑2.6 | 78 | 2.9 | 0.138 | 15.6 |
| + Gemini 3.5 Flash | 99.1 ↑3.5 | 81.4 ↑0.9 | 92 | 2.4 | 0.215 | 27.2 |
| Repair + API reference + Developer guide | (full; Δ vs. Repair-only) | |||||
| + Qwen3.6-Max-Preview | 94.7 ↑20.4 | 56.6 ↑6.2 | 64 | 3.5 | 0.260 | 49.5 |
| + Kimi K2.7 Code | 92.0 ↑15.0 | 69.0 ↑19.4 | 78 | 3.3 | 0.172 | 56.0 |
| + Claude Sonnet 4.6 | 99.1 ↑5.3 | 75.2 ↑8.8 | 85 | 2.7 | 0.120 | 14.6 |
| + Gemini 3.5 Flash | 99.1 ↑3.5 | 85.0 ↑4.5 | 96 | 2.4 | 0.205 | 26.7 |
Table IV. Retrieval-and-repair results on LINTBENCH. Best per column bold. Arrows (matched five-call budget): Repair-only vs. best prompting (⇑); retrieval vs. Repair-only (↑/↓).
Repair-only improves on prompting. Retrieval adds smaller gains. Comparing the Repair-only control against the retrieval configurations isolates what retrieval adds over Repair-only (Table IV). Relative to matched-budget prompting, the Repair-only setting is associated with higher odds of compilation (odds ratio, OR 2.34) and passing given compilation (OR 1.82, Table V). These associations include the change in decoding and sampling. Repair-only already reaches near-ceiling compilation for the top-performing models (Claude 93.8%, Gemini 95.6%) and a high pass rate (66.4%, 80.5%), because the compiler diagnostic lets the model self-correct its invented API symbols. Adding the API reference then increases pass by only 7.1 points for Claude and 1.8 for Gemini, but 14.1 for Kimi and 6.2 for Qwen, whose repair-only compilation is lowest (77.0%, 74.3%). Retrieval thus substitutes for self-correction, large where the model cannot self-correct and small where it can.
| Predictor | Compile OR | Pass|compile OR |
| Repair loop (vs. matched-budget prompting) | ||
| Repair loop | 2.34 [1.71, 3.21] | 1.82 [1.37, 2.42] |
| Retrieval and performance (vs. Repair-only) | ||
| API reference | 2.88 [1.93, 4.30] | 1.09 [0.94, 1.27] |
| Developer guide | 1.52 [1.05, 2.22] | 1.06 [0.90, 1.25] |
| Performance (+1 SD) | 2.31 [1.83, 2.91] | 1.41 [1.23, 1.63] |
| API × performance | 0.76 [0.55, 1.06] | 1.10 [0.96, 1.25] |
Table V. Two-stage GEE odds ratios on LINTBENCH with 95% CIs. Repair loop vs. matched-budget prompting; retrieval and performance vs. Repair-only. Bold: .
Modeling approach. We model success as two conditional stages, the compile stage (whether a check compiles) and the logic stage (whether it passes given it compiles), each fit with a cluster-robust logistic regression (generalized estimating equations, GEE) clustered by check, since each of the 113 checks recurs across the model and configuration cells [32], [33]. Each model contributes a standardized performance covariate, and an API × performance term tests whether retrieval’s value depends on it (Table V).
Retrieval helps only at the compile stage, dominated by the API reference. The API reference more than doubles the odds a check compiles (OR 2.88, 95% CI [1.93, 4.30], ), the largest retrieval effect in the study. The descriptive gains are largest for the models with the lowest compile rates, but the API × performance interaction is not significant (OR 0.76, 95% CI [0.55, 1.06]). The mechanism is concrete: the reference supplies the scanner-callback signatures the description omits, removing the symbol-hallucination and wrong-override errors that dominate compile failures. The developer guide has a smaller compile-stage effect (OR 1.52, 95% CI [1.05, 2.22]) and none at the logic stage (pass|compile OR 1.06); it is rarely retrieved, clearing the 0.6 similarity threshold for only 9% of prompts against 100% for the API index.
Stacking the two sources does not compose. Combining both sources does not significantly go beyond the API reference alone; the differences among the retrieval configurations sit within sampling noise on pass rate, consistent with the null logic-stage effects in Table V.
Retrieval helps checks compile. The API reference’s effect on passing is almost fully mediated by the compile stage: it raises the compile rate but leaves the pass rate among checks that compile unchanged. What governs the conditional pass rate is model performance (OR 1.41).
Finding 2: The repair loop drives most of the gain (compile OR 2.34, pass OR 1.82). Retrieval helps only at compile time, driven by the API reference (OR 2.88), and its benefit is largest for weaker models. The remaining logic gap scales with the model’s coding capabilities.
Why do checks fail?
Adding repair iterations yields diminishing returns. We fit
the cumulative pass rate across all 452 full-configuration runs (four models × 113 checks), pooling the per-model outcomes in Figure 3. It rises from 25.0% (113/452) on the first call to 50.2% (227/452) on the second and 71.5% (323/452) by the fifth. The fifth call adds about four percentage points. The top-performing models solve most checks at the initial generation, while the low-performing models depend on the repair calls and leave a larger share unresolved (15% to 43%). The fitted 82% asymptote is an extrapolation beyond this observed budget. In a follow-up, we extended Gemini’s 16 compiled-but-failing checks to ten calls. None passed on calls six through ten. This supports the five-call budget for that subset, but leaves the effect of longer runs on other models and failures unmeasured.

Figure 3. Outcome composition by model, full configuration on LINTBENCH (113 checks). Bars split each model’s checks by the iteration that first passed (1 = initial, 2–5 = repairs); the gray tail is unresolved within the five-call budget.
The API reference clears the compile failures. Repair fixes 43.6% of the compiled-but-failing checks. Adding the API reference moves the residual from compilation to logic. Without it, 54 of 452 runs never compile; the API reference cuts that to 17, while logic-stage failures stay flat across settings (108–116 compiled checks), consistent with the null Stage-2 effects in Table V. Repair then fixes part of that residual: among the 1,261 checks that compile, test feedback increases the pass rate from 52.7% to 73.4%, repairing 260 of 596 compiled-but-failing checks (43.6%). The repair rate rises with performance (Qwen 29.8% to Gemini 55.0%; ). The remaining gap is therefore semantic, not a matter of API grounding.
The failures are mostly due to under-detection. After both repair phases, 27% of compiled checks still never pass on LINTBENCH (441 of 1,646). We observe that (Table VI), 87% are due to unsoundness: they compile and run but miss the issue they should report (false negatives), split between predicates that never flag (48.1%) and ones that flag too narrowly (38.5%). The pattern holds across all four models (85–89%) and is the dominant residual for the top models in the best configuration: Gemini’s 16 remaining failures are 100% under-detection and Claude’s 26 are 85%, with no compile or over-detection errors. Reaching near-complete pass thus needs the logic to capture the targeted issue on checks that already run. Compile failures are also somewhat more recoverable than logic ones (58.4% vs. 53.5% eventually repaired): a compile error names the missing symbol and repair supplies it, whereas a logic failure only signals that some inputs are mishandled, leaving the model to infer the fix from the rule itself, with no external artifact to retrieve.
| Failure mode | All | Claude | Gemini |
| False negative (under-detection) | 383 (86.8%) | 22 (84.6%) | 16 (100%) |
| reports nothing | 212 (48.1%) | 11 (42.3%) | 7 (43.8%) |
| catches some, misses some | 170 (38.5%) | 11 (42.3%) | 9 (56.2%) |
| flags wrong target | 1 (0.2%) | 0 | 0 |
| Wrong message / location | 16 (3.6%) | 1 (3.8%) | 0 |
| Runtime error | 25 (5.7%) | 3 (11.5%) | 0 |
| Other | 17 (3.9%) | 0 | 0 |
| Compiled-but-failing () | 441 | 26 | 16 |
Table VI. Failure modes of compiled-but-failing checks on LINTBENCH. All: pooled over four models and conditions. Claude/Gemini: the two models at compile in the full configuration, isolating residual issue-detection logic. Percentages within column; is the compiled-but-failing count.
Failure overlap across models. In the full configuration, the failure analysis includes 26/16/43/26 compiled-but-failing checks for Claude/Gemini/Qwen/Kimi, respectively. They cover 62 distinct checks: 34 fail in one model, 14 in two, seven in three, and seven in all four. Thus, 55/62 (89%) are not shared compiled-but-failing cases across all models. These counts describe which checks fail, not whether the models make the same detection error. The seven shared failures warrant further inspection of both the descriptions and generated logic.
What makes a check hard: spanning multiple scanner interfaces. Difficulty concentrates unevenly, and where tells us about the task (Table VII). Counter to the intuition that Java/Kotlin UAST checks are the hardest, source-code checks pass at 66.3%, indistinguishable from the XML checks that dominate the benchmark (72.2%; OR 0.76, ); difficulty instead concentrates in checks that span multiple scanner interfaces (55.3%; OR 0.48, ). Across tiers, pass rate falls from EASY (68.6%) to HARD (50.0%; Figure 4), with only the HARD tier significant (OR 0.46, ; MEDIUM
| Subset | Pass rate | Pass odds vs. ref. |
| By analysis surface (scanner interface) | ||
| XML resource | 72.2% | – |
| Source code (UAST) | 66.3% | 0.76 |
| Multiple scanners | 55.3% | 0.48* |
| By benchmark difficulty tier (vs. Easy) | ||
| Easy | 68.6% | – |
| Medium | 69.2% | 1.03 |
| Hard | 50.0% | 0.46* |
Table VII. Pass rate by analysis surface and difficulty tier on LINTBENCH, pooled over conditions and models. “Multiple” = >1 scanner interface. ORs vs. the reference category (cluster-robust); *.

Figure 4. Pass rate by difficulty tier under full configuration.
indistinguishable from EASY, OR 1.03), so difficulty concentrates in the HARD tier instead of rising evenly. By category, pass rates are lowest on directional or visual checks (RTL 53.1%, ICONS 65.6%) and highest on pattern-matching ones (SECURITY 79.9%), though per-category counts are small.
Finding 3: The generated checks that compile but fail are unsound: 87% of compiled-but-failing checks are false negatives that miss the issue. Retrieval cannot close this gap. It needs issue-detection logic the model must reason out.
RQ4: Cost
On LINTBENCH, cost per solved check spans $0.12–0.35 and 15–104k tokens (Table IV). Claude is the cheapest model in every configuration ($0.12–0.15, 15–16k tokens), while the top-performing Gemini costs more ($0.21–0.23, 27–28k) and Kimi’s verbose generations make it the most token-heavy (56–104k). Turning to configurations, retrieval does not raise cost per solved check despite its longer context, because a higher solve count offsets the extra input. For Claude, the full configuration is even the cheapest per success ($0.120, 14.6k). Holding the model fixed, the API reference is at least as cost-effective as the developer guide, and cheaper for the lowest-performing model (Qwen $0.27 vs. $0.35, 50k vs. 64k tokens), because guide-only generation needs more repair to pass. Even Repair-only is no cheaper, since its compiler feedback can itself expand the context.
Finding 4: Cost per solved check is driven by token count. Claude uses the fewest tokens (15k) and is the cheapest at $0.12 per solved check, yet it is not the top performer. Gemini performs best but costs more. Retrieval is roughly cost-neutral: its expanded context length is offset by a higher solve count.
Discussion
What drives generation, and what knowledge adds
Most of the improvement over prompting appears with execution-guided repair, and retrieval adds less (RQ2). Hallucinated API calls are the dominant baseline failure, and a top-performing model self-corrects them from the compiler’s diagnostics, so the loop alone reaches near-ceiling compilation with no retrieved knowledge. Retrieval helps in proportion to need: the API reference substitutes for self-correction at the compile stage, much for weak models and little for strong ones, while the developer guide adds little and the two do not compose. What matters is execution feedback plus, where needed, retrieved API grounding, not static scaffolding or prose documentation [19].
Where LLMs still fail
Once a check compiles, the residual is issue-detection logic: the check runs but its predicate misses the issue (RQ3). For the top models, which all but saturate compilation, it is nearly the entire remaining gap. Repair fixes some of these failures from the test diagnostics, but the rest need analysis reasoning that neither retrieved source supplies. The bottleneck thus shifts from knowing the API to reasoning about the analysis, so we expect further gains from tooling aimed there, such as program-analysis-aware decoding or counterexample-guided repair.
An ablation on description quality
Human validation doubles as an ablation on description quality. The 35 checks it removes are effectively unsolvable, passing at only 12.1% under the full configuration, and 19 of the 35 are never solved by any model in any configuration. Adding them back, the LINTBENCH-unverified 148-check set, drops the full-configuration pass rate from 71.5% on LINTBENCH to 57.4%, a 14-point gap that comes entirely from these low-yield checks. LINTBENCH thus measures capability without these benchmark artifacts. Exclusions include under-specification and sibling-test dependencies; low pass rates do not rule out solutions from other models or prompts.
Implications
The description-only setting is a realistic entry point for check authoring: from a one-sentence rule, with no tests written first, the pipeline produces a working, test-passing check for up to 85.0% of LINTBENCH checks at $0.12 to $0.35 each (RQ4), so a developer can describe a rule and review a working candidate instead of implementing it from scratch. For framework designers, the failure modes point to the API and documentation gaps that most mislead generation; for researchers, LINTBENCH is an objective benchmark scored by a held-out test oracle. Repair used the held-out test oracle; reduced authoring or review effort was not measured against a human baseline.
Threats to Validity
Construct validity. We equate a correct check with passing the developers’ original test suite, which encodes the intended behavior; a check could still misbehave on unseen code, so the absence of false positives we report is relative to these tests, and broader validation is future work. Relaxed assertions omit message and quick-fix requirements; preserved expectClean() cases cover only some clean inputs. Empty-detector mutation filtering rejects a trivial implementation without establishing test completeness (Section III-D). To confirm that passing reflects real issue-detection logic and not gaming of the held-out oracle, we compared the 1,355 detectors generated on LINTBENCH against the original implementation. Passing detectors match the original’s analysis scope () and use more of its API vocabulary () than failing ones (Mann–Whitney). We find no passing detector that hardcodes test outputs, so this form of oracle-gaming is effectively absent. Other overfitting to the fixed tests through repeated diagnostic feedback remains possible.
Internal validity. Retrieval and the repair loop could be confounded, since both sit on top of the prompting baselines; the Repair-only condition separates them (Table IV), and our marginal comparisons (API reference vs. developer guide, the performance interaction) are within-design. In the execution-guided repair study, each model runs each check once per configuration (a single execution-guided repair run, not samples), so we base claims on aggregate rates and the GEE model, not individual check flips, with fixed throughput decoding. Prompting uses five independent samples at ; repair uses up to five calls at , so matching call budgets leaves sampling and temperature differences. Screening used one author; annotator agreement and sensitivity to few-shot selection were not measured.
External validity. We study a single framework (Android Lint) and a finite model set, so findings may not transfer to other analyzers or models. We mitigate by spanning Lint’s full range of analysis representations and four model families.
Data contamination. The AOSP detectors and their tests are public, so they may have been included in the models’ pretraining data, and memorization could inflate compile/pass rates. Two observations bound this concern. First, if a model were reproducing an exact, complete copy of a memorized detector matching our evaluated reference, it would compile and pass perfectly under zero-shot prompting. Instead, checks fail by hallucinating APIs at compile time and by under-detecting at the logic stage. Partial memorization can still contribute to these imperfect outputs [34]. Second, our component comparisons hold the model fixed, so memorization that does not depend on prompt context would shift all conditions equally and leave the differences between Repair-only and the retrieval configurations unchanged. Context can affect memorized output [35], however, so contamination may still contribute differently across the prompting, repair, and retrieval conditions.
At our May 22, 2026 checkout, the 81 reference files’ last-modified dates span March 9, 2018–March 11, 2026 (median: January 29, 2026). Of these, 41/81 (50.6%) postdate Claude’s January 2026 cutoff, and 49/81 (60.5%) Gemini’s January 2025 cutoff (Qwen and Kimi do not disclose cutoff dates). All files were created before both cutoffs, so updates do not establish unseen code.
Of 451 available candidates from 452 full-configuration runs (one Qwen run produced none), none matched the reference after comment/whitespace normalization or reached 0.95 token-sequence similarity (SequenceMatcher); model means were 0.30–0.32. This weighs against verbatim reproduction; partial memorization remains possible. Evaluation on new, non-public checks remains future work.
Reliability. We release LINTBENCH, the descriptions, the harness, and all prompts and generated outputs so that our results can be reproduced and future check-generation methods scored against the same objective oracle.
Related Work
Traditional static analysis and custom checks
Hand-written analyzers such as FindBugs [36], PMD [2], and Infer [37] rely on manually authored bug patterns [38], and frameworks such as Soot [39] and FlowDroid [40] provide the program-analysis machinery for Android taint tracking; such analysis has been deployed at industrial scale [41]. Authoring custom rules is difficult even for experienced developers [5], [6], and developers frequently avoid these tools because of API complexity and friction [4], [42], which motivates automated check generation. AutoComply [43] hand-constructs checkers for Android Auto compliance that Android Lint does not cover, indicating how often Lint lags emerging platform features. LINTBENCH evaluates whether LLMs can generate such detectors from a natural-language description alone.
LLMs for code and static analysis
Pre-trained code models such as CodeBERT [44], CodeT5+ [45], StarCoder [46], Code Llama [47], and DeepSeek-Coder [48] underpin their use across software engineering [49], [50], but most work applies LLMs to analysis, not to building analyzers: interleaving analyzer calls with LLM queries where the analyzer cannot proceed [51], integrating LLMs into bug-detection pipelines [52], inferring source–sink specifications for vulnerability detection [53], auditing privacy compliance over a curated Android-API knowledge base [54], and benchmarking LLMs against traditional tools for vulnerability detection [55]–[57], code-smell detection [58], and specification mining [59]. Related studies ask whether code LLMs perform static-analysis reasoning [60] and contextualize them with program-analysis insights [61]. These works use LLMs as analyzers; we instead study LLMs as builders of the analyzer itself.
LLM-based synthesis of static-analysis artifacts
A few systems synthesize analysis artifacts with LLMs. KNighter generates Clang Static Analyzer checkers from historical bug-fix patches [7], and QLCoder synthesizes CodeQL queries from CVE metadata with retrieval and execution feedback [8]. Closest to us, AutoChecker generates PMD checkers from a rule description and a test suite, repairing against the supplied tests [9]. Our task specification is a description, with test source hidden from the model. Lint adds a representation-selection problem: Clang checkers inspect C/C++ syntax trees and CodeQL queries operate on a source-derived relational database, while Lint exposes scanners for source, resources, manifests, and build scripts. Lint authors also need Android framework classes, resource conventions, manifest schemas, and Gradle DSL knowledge [20], [21]. We also contribute LINTBENCH, which scores check generation by compiling each candidate and running the check’s own held-out tests. It thus differs from benchmarks that evaluate analysis or repair of existing code, such as the vulnerability-detection benchmark CWE-Bench-Java [53] and the mobile issue-resolution benchmark MobileDev-Bench [62], and from work that automates linter configuration of existing rules [63], not synthesis of new ones.
Execution-guided self-repair and retrieval
LINTBENCH combines two techniques. The first is execution-guided self-repair, in which a model revises its code from compiler or test feedback [16], [64], although self-repair does not always improve results [17]. The second is retrieval: retrieval-augmented generation grounds models in knowledge beyond their parameters [18], and for code it can supply the specific APIs a task requires, including through compositional API recommendation [65]. For unfamiliar APIs, retrieving relevant documentation, especially usage examples, can substantially raise pass rates [19], though the benefit is not guaranteed: in checker synthesis, KNighter reports that retrieval over checker examples matched fixed few-shot examples while roughly doubling token cost, and so retained the fixed examples [7]. Whether, and at what cost, retrieval helps check generation thus remains open. LINTBENCH applies both in a fixed generate-validate-repair loop specialized for detector synthesis, repairing from harness diagnostics and retrieving over Lint’s API reference and developer guide.
Conclusion
We studied whether LLMs can generate Android Lint checks from natural language descriptions alone and what external knowledge they need to do so. We introduced LINTBENCH, a human-validated benchmark of 113 real-world checks with their original test suites and an automated compile-and-test harness. We evaluated four LLMs across prompting, retrieval of the Lint API reference and developer guide, and execution-guided repair. Prompting alone reaches 64.6% (pass@5); adding retrieval and execution-guided repair raises this to 85.0% at a matched five-call budget. Our results show that execution feedback raises the pass rate, while retrieved API knowledge raises the compile rate, which reaches up to 99% and helps the low-performing models most. The residual failures are mostly false negatives. Of the generated checks that compile but fail their tests, 87% miss the issue they should report, so getting the issue-detection logic right remains an open challenge. We release LINTBENCH, the harness, and prompts [66] to support future work.
Acknowledgment
This material is based upon the work supported in part by the U.S. National Science Foundation (NSF) under Grant numbers 2223826, 2616791, 2616792, and 2616793. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the NSF.
References
References
- [1]Android Open Source Project, “Android lint,” https://developer.android.com/studio/write/lint, 2011.
- [2]“Pmd: An extensible cross-language static code analyzer,” https://pmd.github.io/, 2015.
- [3]GitHub, “CodeQL,” https://codeql.github.com/, 2019.
- [4]Y. Tymchuk, M. Ghafari, and O. Nierstrasz, “Jit feedback: what experienced developers like about static analysis,” in Proceedings of the 26th Conference on Program Comprehension, ser. ICPC ’18. New York, NY, USA: Association for Computing Machinery, 2018, pp. 64–73. [Online]. Available: https://doi.org/10.1145/3196321.3196327
- [5]M. Christakis and C. Bird, “What developers want and need from program analysis: An empirical study,” in Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, ser. ASE ’16. New York, NY, USA: Association for Computing Machinery, 2016, pp. 332–343. [Online]. Available: https://doi.org/10.1145/2970276.2970347
- [6]D. S. Mendonça and M. Kalinowski, “An empirical investigation on the challenges of creating custom static analysis rules for defect localization,” Software Quality Journal, vol. 30, no. 3, pp. 781–808, 2022. [Online]. Available: https://doi.org/10.1007/s11219-021-09580-z
- [7]C. Yang, Z. Zhao, Z. Xie, H. Li, and L. Zhang, “KNighter: Transforming static analysis with llm-synthesized checkers,” in Proceedings of the ACM SIGOPS 31st Symposium on Operating Systems Principles, ser. SOSP ’25. New York, NY, USA: Association for Computing Machinery, 2025, pp. 655–669. [Online]. Available: https://doi.org/10.1145/3731569.3764827
- [8]C. Wang, Z. Li, S. Dutta, and M. Naik, “QCoder: A query synthesizer for static analysis of security vulnerabilities,” 2026. [Online]. Available: https://arxiv.org/abs/2511.08462
- [9]J. Liu, Y. Xie, J. Yan, H. Huang, J. Yan, and J. Zhang, “Write your own codechecker: An automated test-driven checker development approach with llms,” 2025. [Online]. Available: https://arxiv.org/abs/2411.06796
- [10]B. Baker, J. Huizinga, L. Gao, Z. Dou, M. Y. Guan, A. Madry, W. Zaremba, J. Pachocki, and D. Farhi, “Monitoring reasoning models for misbehavior and the risks of promoting obfuscation,” 2025. [Online]. Available: https://arxiv.org/abs/2503.11926
- [11]C. Denison, M. MacDiarmid, F. Bare, D. Duvenaud, S. Kravec, S. Marks, N. Schiefer, R. Soklaski, A. Tamkin, J. Kaplan, B. Shlegeris, S. R. Bowman, E. Perez, and E. Hubinger, “Sycophancy to subterfuge: Investigating reward-tampering in large language models,” 2024. [Online]. Available: https://arxiv.org/abs/2406.10162
- [12]Uber Developers Team, “lint-checks: A collection of android lint checks,” https://github.com/uber/lint-checks, 2019, accessed 2026-06-03.
- [13]Slack Developers Team, “slack-lints: Custom android/kotlin lint checks used at slack,” https://github.com/slackhq/slack-lints, 2022, accessed 2026-06-03.
- [14]Slack Team, “compose-lints: Lint checks for jetpack compose,” https://github.com/slackhq/compose-lints, 2023, accessed 2026-06-03.
- [15]Google, “Android open source project,” https://source.android.com, 2008, accessed: May 2026.
- [16]X. Chen, M. Lin, N. Schärli, and D. Zhou, “Teaching large language models to self-debug,” 2023. [Online]. Available: https://arxiv.org/abs/2304.05128
- [17]T. X. Olausson, J. P. Inala, C. Wang, J. Gao, and A. Solar-Lezama, “Is self-repair a silver bullet for code generation?” 2024. [Online]. Available: https://arxiv.org/abs/2306.09896
- [18]P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Küttler, M. Lewis, W.-t. Yih, T. Rocktäschel, S. Riedel, and D. Kiela, “Retrieval-augmented generation for knowledge-intensive NLP tasks,” in Proceedings of the 34th International Conference on Neural Information Processing Systems, ser. NIPS ’20. Red Hook, NY, USA: Curran Associates Inc., 2020. [Online]. Available: https://dl.acm.org/doi/abs/10.5555/3459724.3496517arxiv.org/abs/2005.11401
- [19]J. Chen, S. Chen, J. Cao, J. Shen, and S.-C. Cheung, “When LLMs meet API documentation: Can retrieval augmentation aid code generation just as it helps developers?” 2025. [Online]. Available: https://arxiv.org/abs/2503.15231
- [20]Google, “Android lint API guide,” https://googlesamples.github.io/android-custom-lint-rules/api-guide.md.html, 2011, accessed: May 2026.
- [21]Google, “Android lint user guide,” https://googlesamples.github.io/android-custom-lint-rules/user-guide.md.html, 2011, accessed: May 2026.
- [22]Qwen Team, Alibaba, “Qwen3.6-Max-Preview,” https://qwen.ai/blog?id=qwen3.6-max-preview, 2026, accessed: June 2026.
- [23]Moonshot AI, “Kimi K2.7 Code: Technical report,” https://huggingface.co/moonshotai/Kimi-K2.7-Code, 2026, accessed: June 2026.
- [24]Anthropic, “Claude sonnet 4.6,” https://www.anthropic.com/news/claude-sonnet-4-6, 2026, accessed: May 2026.
- [25]Google DeepMind, “Gemini 3.5 flash,” https://blog.google/technology/ai-models-and-research/gemini-models/gemini-3-5/#gemini-3-5-flash, 2026, accessed: May 2026.
- [26]JetBrains, “UAST: Unified abstract syntax tree,” https://plugins.jetbrains.com/docs/intellij/uast.html, 2017.
- [27]Google, “Android Bench: Benchmarking LLMs for Android development,” https://developer.android.com/bench, 2026.
- [28]OpenRouter, “OpenRouter: A unified interface for LLMs,” https://openrouter.ai, 2026.
- [29]M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. de Oliveira Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman, A. Ray, R. Puri, G. Krueger, M. Petrov, H. Khlaaf, G. Sastry, P. Mishkin, B. Chan, S. Gray, N. Ryder, M. Pavlov, A. Power, L. Kaiser, M. Bavarian, C. Winter, P. Tillet, F. P. S. Such, D. Cummings, M. Plappert, F. Chantzis, E. Barnes, A. Herbert-Voss, W. H. Guss, A. Nichol, A. Paino, N. Tezak, J. Tang, I. Babuschkin, S. Balaji, S. Jain, W. Saunders, C. Hesse, A. N. Carr, J. Leike, J. Achiam, V. Misra, E. Morikawa, A. Radford, M. Knight, M. Brundage, M. Murati, K. Mayer, P. Welinder, B. McGrew, D. Amodei, S. McCandlish, I. Sutskever, and W. Zaremba, “Evaluating large language models trained on code,” 2021. [Online]. Available: https://arxiv.org/abs/2107.03374
- [30]Z. Peng, X. Yin, R. Qian, P. Lin, Y. Liu, H. Zhang, C. Ying, and Y. Luo, “SolEval: Benchmarking large language models for repository-level solidity code generation,” 2025. [Online]. Available: https://arxiv.org/abs/2502.18793
- [31]Beijing Academy of Artificial Intelligence, “BGE: BAAI general embedding (bge-large-en-v1.5),” https://huggingface.co/BAAI/bge-large-en-v1.5, 2023.
- [32]K.-Y. Liang and S. L. Zeger, “Longitudinal data analysis using generalized linear models,” Biometrika, vol. 73, no. 1, pp. 13–22, 04 1986. [Online]. Available: https://doi.org/10.1093/biomet/73.1.13
- [33]A. Arcuri and L. Briand, “A practical guide for using statistical tests to assess randomized algorithms in software engineering,” in Proceedings of the 33rd International Conference on Software Engineering, ser. ICSE ’11. New York, NY, USA: Association for Computing Machinery, 2011, pp. 1–10. [Online]. Available: https://doi.org/10.1145/1985793.1985795
- [34]M. Riddell, A. Ni, and A. Cohan, “Quantifying contamination in evaluating code generation capabilities of language models,” 2024. [Online]. Available: https://arxiv.org/abs/2403.04811
- [35]N. Carlini, D. Ippolito, M. Jagielski, K. Lee, F. Tramer, and C. Zhang, “Quantifying memorization across neural language models,” 2023. [Online]. Available: https://arxiv.org/abs/2202.07646
- [36]D. Homeyerer and W. Pugh, “Finding bugs is easy,” SIGPLAN Not., vol. 39, no. 12, pp. 92–106, Dec. 2004. [Online]. Available: https://doi.org/10.1145/1052883.1052895
- [37]C. Calcagno, D. Distefano, J. Dubreil, D. Gabi, P. Homeijier, M. Luca, P. O’Hearn, I. Papakonstantinou, J. Purbrick, and D. Rodriguez, “Moving fast with software verification,” in NASA Formal Methods, K. Havelund, G. Holzmann, and R. Joshi, Eds. Cham: Springer International Publishing, 2015, pp. 3–11. [Online]. Available: https://doi.org/10.1007/978-3-319-17524-9_1
- [38]N. Ayewah, W. Pugh, D. Hovemeyer, J. D. Morgenthaler, and J. Penix, “Using static analysis to find bugs,” IEEE Software, vol. 25, no. 5, pp. 22–29, 2008. [Online]. Available: https://doi.org/10.1109/MS.2008.130
- [39]R. Vallée-Rai, P. Co, E. Gagnon, L. Hendren, P. Lam, and V. Sundaresan, “Soot: a Java bytecode optimization framework,” in CASCON First Decade High Impact Papers, ser. CASCON ’10. USA: IBM Corp., 2010, pp. 214–224. [Online]. Available: https://doi.org/10.1145/1925805.1925818
- [40]S. Arzt, S. Rasthofer, C. Fritz, E. Bodden, A. Bartel, J. Klein, Y. Le Traon, D. Octeau, and P. McDaniel, “FlowDroid: precise context, flow, field, object-sensitive and lifecycle-aware taint analysis for Android apps,” in Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, ser. PLDI ’14. New York, NY, USA: Association for Computing Machinery, 2014, pp. 259–269. [Online]. Available: https://doi.org/10.1145/2594291.2594299
- [41]D. Distefano, M. Fähndrich, F. Logozzo, and P. W. O’Hearn, “Scaling static analyses at Facebook,” Commun. ACM, vol. 62, no. 8, pp. 62–70, Jul. 2019. [Online]. Available: https://doi.org/10.1145/3338112
- [42]B. Johnson, Y. Song, E. Murphy-Hill, and R. Bowdidge, “Why don’t software developers use static analysis tools to find bugs?” in 2013 35th International Conference on Software Engineering (ICSE), 2013, pp. 672–681. [Online]. Available: https://doi.ieeecomputersociety.org/10.1109/ICSE.2013.6606613
- [43]M. A. Fakorede and U. Farooq, “Understanding and detecting platform-specific violations in Android Auto apps,” in Proceedings of the 7th ACM/IEEE International Conference on Automation of Software Test, ser. AST ’26. ACM, Apr. 2026, pp. 123–133. [Online]. Available: https://doi.org/10.1145/3793654.3793745
- [44]Z. Feng, D. Guo, D. Tang, N. Duan, X. Feng, M. Gong, L. Shou, B. Qin, T. Liu, D. Jiang, and M. Zhou, “CodeBERT: A pre-trained model for programming and natural languages,” 2020. [Online]. Available: https://arxiv.org/abs/2002.08155
- [45]Y. Wang, H. Le, A. D. Gotmare, N. D. Q. Bui, J. Li, and S. C. H. Hoi, “CodeT5+: Open code large language models for code understanding and generation,” 2023. [Online]. Available: https://arxiv.org/abs/2305.07922
- [46]R. Li, L. B. Allal, Y. Zi, N. Muennighoff, D. Kocetkov, C. Mou, M. Marone, C. Akiki, J. Li, J. Chim, Q. Liu, E. Zheltonozhskii, T. Y. Zhuo, T. Wang, O. Dehaene, M. Davaadorj, J. Lamy-Poirier, J. ao Monteiro, O. Shliazhko, N. Gontier, N. Meade, A. Zebaze, M.-H. Yee, L. K. Umapathi, J. Zhu, B. Lipkin, M. Oblokulov, Z. Wang, R. Murthy, J. Stillerman, S. S. Patel, D. Abulkhanov, M. Zocca, M. Dey, Z. Zhang, N. Fahmy, U. Bhattacharyya, W. Yu, S. Singh, S. Luccioni, P. Villegas, M. Kunakov, F. Zhdanov, M. Romero, T. Lee, N. Timor, J. Ding, C. Schlesinger, H. Schoelkopf, J. Ebert, T. Dao, M. Mishra, A. Gu, J. Robinson, C. J. Anderson, B. Dolan-Gavitt, D. Contractor, S. Reddy, D. Fried, D. Bahdanau, Y. Jernite, C. M. noz Ferrandis, S. Hughes, T. Wolf, A. Guha, L. von Werra, and H. de Vries, “StarCoder: may the source be with you!” 2023. [Online]. Available: https://arxiv.org/abs/2305.06161
- [47]B. Rozière, J. Gehring, F. Gloeckle, S. Sootla, I. Gat, X. E. Tan, Y. Adi, J. Liu, R. Sauvestre, T. Remez, J. Rapin, A. Kozhevnikov, I. Evtimov, J. Bitton, M. Bhatt, C. C. Ferrer, A. Grattafiori, W. Xiong, A. Défosséz, J. Copet, F. Azhar, H. Touvron, L. Martin, N. Usunier, T. Scialom, and G. Synnæve, “Code Llama: Open foundation models for code,” 2024. [Online]. Available: https://arxiv.org/abs/2308.12950
- [48]D. Guo, Q. Zhu, D. Yang, Z. Xie, K. Dong, W. Zhang, G. Chen, X. Bi, Y. Wu, Y. K. Li, F. Luo, Y. Xiong, and W. Liang, “DeepSeek-Coder: When the large language model meets programming – the rise of code intelligence,” 2024. [Online]. Available: https://arxiv.org/abs/2401.14196
- [49]X. Hou, Y. Zhao, Y. Liu, Z. Yang, K. Wang, L. Li, X. Luo, D. Lo, J. Grundy, and H. Wang, “Large language models for software engineering: A systematic literature review,” ACM Trans. Softw. Eng. Methodol., vol. 33, no. 8, Dec. 2024. [Online]. Available: https://doi.org/10.1145/3695988
- [50]A. Fan, B. Gokkaya, M. Harman, M. Lyubarskiy, S. Sengupta, S. Yoo, and J. M. Zhang, “Large language models for software engineering: Survey and open problems,” in 2023 IEEE/ACM International Conference on Software Engineering: Future of Software Engineering (ICSE-FoSE), 2023, pp. 31–53. [Online]. Available: https://ieeexplore.ieee.org/document/10449667arxiv.org/abs/2310.03533
- [51]P. J. Chapman, C. Rubio-González, and A. V. Thakur, “Interleaving static analysis and llm prompting,” in Proceedings of the 13th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis, ser. SOAP 2024. New York, NY, USA: Association for Computing Machinery, 2024, pp. 9–17. [Online]. Available: https://doi.org/10.1145/3652588.3663317
- [52]H. Li, Y. Hao, Y. Zhai, and Z. Qian, “Enhancing static analysis for practical bug detection: An LLM-integrated approach,” Progam. Lang., vol. 8, no. OOPSLA1, Apr. 2024. [Online]. Available: https://doi.org/10.1145/3649828
- [53]Z. Li, S. Dutta, and M. Naik, “IRIS: Llm-assisted static analysis for detecting security vulnerabilities,” 2025. [Online]. Available: https://arxiv.org/abs/2405.17238
- [54]Z. Zhang, Z. Li, Z. Jiang, J. Yin, X. Wang, J. Chen, and Q. Liu, “PriAgent: A collaborative multi-agent framework for auditing android privacy compliance,” in Proceedings of the Fortieth AAAI Conference on Artificial Intelligence and Thirty-Eighth Conference on Innovative Applications of Artificial Intelligence and Sixteenth Symposium on Educational Advances in Artificial Intelligence, ser. AAAI ’26/IAAI ’26/EAAI ’26. AAAI Press, 2026. [Online]. Available: https://doi.org/10.1609/aaai.v40i2.37135
- [55]D. Gnieciak and T. Szandala, “Large language models versus static code analysis tools: A systematic benchmark for vulnerability detection,” 2025. [Online]. Available: https://arxiv.org/abs/2508.04448
- [57]X. Zhou, T. Zhang, and D. Lo, “Large language model for vulnerability detection: Emerging results and future directions,” in Proceedings of the 2024 ACM/IEEE 44th International Conference on Software Engineering: New Ideas and Emerging Results, ser. ICSE-NIER’24. New York, NY, USA: Association for Computing Machinery, 2024, pp. 47–51. [Online]. Available: https://doi.org/10.1145/3639476.3639762
- [58]S. Souza, A. Santana, E. Figueiredo, I. Muzetti, J. E. Montandon, and L. Briand, “Beyond strict rules: Assessing the effectiveness of large language models for code smell detection,” 2026. [Online]. Available: https://arxiv.org/abs/2601.09873
- [59]Z. Chen, L. Zhang, Z. Zhang, J. Zhang, R. Zhou, Y. Shen, J. Ma, and L. Yang, “Enhancing llm-based specification generation via program slicing and logical deletion,” 2026. [Online]. Available: https://arxiv.org/abs/2509.09917
- [60]C.-Y. Su and C. McMillan, “Do code LLMs do static analysis?” Empirical Software Engineering, vol. 31, no. 5, p. 116, 2026. [Online]. Available: https://doi.org/10.1007/s10664-026-10853-z
- [61]R. Krishna, R. Pan, S. Sinha, S. Tamiselvam, R. Pavuluri, and M. Vukovic, “CodeLlm-Devkit: A framework for contextualizing code LLMs with program analysis insights,” in Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering, ser. FSE Companion ’25. New York, NY, USA: Association for Computing Machinery, 2025, pp. 308–318. [Online]. Available: https://doi.org/10.1145/3696630.3728555
- [62]M. A. Fakorede, K. Upadhyay, A. B. Siddique, and U. Farooq, “MobileDev-Bench: A benchmark for issue resolution in mobile application development,” 2026. [Online]. Available: https://arxiv.org/abs/2603.24946
- [63]Z. Zhang, Y. Gan, Z. Xing, T. Zhang, Y. Li, X. Xu, Q. Lu, and L. Zhu, “Still manual? automated linter configuration via dsl-based llm compilation of coding standards,” 2026. [Online]. Available: https://arxiv.org/abs/2602.07783
- [64]N. Shinn, F. Cassano, E. Berman, A. Gopinath, K. Narasimhan, and S. Yao, “Reflexion: Language agents with verbal reinforcement learning,” 2023. [Online]. Available: https://arxiv.org/abs/2303.11366
- [65]Z. Ma, S. An, B. Xie, and Z. Lin, “Compositional API recommendation for library-oriented code generation,” in Proceedings of the 32nd IEEE/ACM International Conference on Program Comprehension, ser. ICPC ’24. New York, NY, USA: Association for Computing Machinery, 2024, pp. 87–98. [Online]. Available: https://doi.org/10.1145/3643916.3644403
- [66]M. A. Fakorede, A. B. Siddique, M. Sridharan, and U. Farooq, “Replication package for lintbench,” Computer software, version v1.0.0, 2026. [Online]. Available: https://doi.org/10.5281/zenodo.24094632

