Merlin: Using an LLM and CodeQL to Answer Questions About Codebases
This arXiv paper, submitted on 10 May 2026, presents Merlin, a system that answers free-form questions about code that require analytical reasoning. Merlin combines a large language model (LLM) with CodeQL[1].
The authors name two main challenges. Program analysis queries are diverse and semantically complex, so even well-formed queries often return degenerate or empty results. Also, relatively few CodeQL queries are available online. To address this, they developed a RAG-based[2] iterative query-generation approach and a self-test technique that uses assistive queries to produce concrete witnesses exposing semantic flaws in candidate queries.
On natural language questions derived from common bug-finding tasks, Merlin found most of the software issues reported by other approaches, along with issues that would otherwise have remained undetected. In a within-subject user study, access to Merlin increased task accuracy by an average of 3.8* and reduced the time programmers needed to complete all tasks by 31%.
Read the original arxiv.orgDiscussion
Sources
-
arXiv
Helping Developers Writing Code Analyzer Queries


