一句话:提出由贝叶斯程序分析引导 LLM 判断中间事实并剪枝依赖告警的静态分析告警消解框架,兼顾质量与 token 开销。
问题:抽象解释静态分析因过近似产生大量告警;逐告警提示 LLM 判断既不准又昂贵,且重复上下文浪费 token。方法:将 LLM 判断从末端告警转向更易验证的中间事实(如别名/流边),用推导图表示依赖以剪枝下游事实与告警;在 token 预算下定义事实影响优先问题,并用贝叶斯程序分析依据规则概率与事实后验估计剪枝影响,迭代查询高影响事实,将判断反馈为高置信证据。评估:在 Java 数据竞争分析和 C 污点分析上,与未过滤静态分析和逐告警 LLM 判断相比,提升告警消解质量并显著减少 token 消耗。
Abstract-interpretation-based static analyzers often report large numbers of alarms due to over-approximation. Although large language models (LLMs) can help filter alarms, per-alarm prompting is often inaccurate and expensive. LLMs often misjudge such end alarms, and the repeated context across queries wastes many tokens. We shift LLM judgment from end alarms to intermediate facts (e.g., alias or flow edges), which are easier to validate. If a fact is judged false, all dependent facts and alarms can be pruned. We capture these dependencies in a derivation graph, enabling analyzer-agnostic pruning for any tool that exposes derivations. Under a token budget, we define the fact impact prioritization problem, which asks which facts to query first to maximize expected downstream pruning. We solve it with Bayesian program analysis by estimating each fact’s pruning impact from rule probabilities and fact posteriors. Building on these ideas, we present an LLM-based alarm resolution framework guided by Bayesian program analysis. It iteratively queries high-impact facts that LLMs can judge accurately, prunes downstream nodes when a fact is false, and feeds the judgments back to the Bayesian model as high-confidence evidence. We evaluate our approach on a Java datarace analysis and a C taint analysis, showing that it improves alarm-resolution quality while substantially reducing token consumption compared with both unfiltered static analysis and per-alarm LLM judging.
@article{paperbot12073,
title = {LLM-Based Alarm Resolution Guided by Bayesian Program Analysis},
author = {Yifan Zhang and Yuanfeng Shi and Haoran Lin and Yingfei Xiong and Xin Zhang},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {OOPSLA2},
year = {2026},
doi = {10.1145/3839536}
}