paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Adaptive Static Analysis via Learning with Bayesian Optimization

通过贝叶斯优化学习实现自适应静态分析
TOPLAS 40(4)2018匹配度 6/10 · 论文属于 AI→PL 方向,用贝叶斯优化学习自适应静态分析策略,与“贝叶斯/机器学习改进静态分析”相关,且兼具工程实现;但不涉及 LLM/Agent、浮点程序分析或 Agentic 程序,与当前画像中 LLM 交叉的核心兴趣有距离。引用 8 inbox
Kihong Heo, Hakjoo Oh, Hongseok Yang, Kwangkeun Yi
crossref: 2026-09-10

AI 速览

一句话:提出用贝叶斯优化从代码库学习参数化分析策略,实现按需流/上下文敏感的自适应静态分析。

构建高性价比的静态分析器仍需在精度与开销之间权衡。本文提出一种基于学习的自适应静态分析方法:分析器内含参数化策略,对程序各部分决定是否启用提升精度的技术;通过贝叶斯优化从已有代码库中学习该策略的参数,并用于未见程序。作者据此实现了部分流敏感与部分上下文敏感的 C 静态分析器。实验表明,贝叶斯优化对从代码库学习至关重要;在所有需要流/上下文敏感的查询中,该分析能回答 75%,而分析开销仅为基线不敏感分析的 3.3 倍,远低于完全敏感版本的 40 倍以上。

问题
静态分析难以平衡精度与分析成本,理想分析器应根据具体任务自适应地按程序部分选择是否启用精度提升技术,但实现此类自适应分析非常困难。
方法
将分析设计为带参数的策略,对程序各部分决定是否应用流敏感、上下文敏感等精度提升技术,并用贝叶斯优化从已有代码库中学习策略参数,再应用于新程序。
评估
在真实 C 静态分析器上实现部分流敏感与部分上下文敏感变体,通过实验评估学习效果、查询回答率与分析开销,并验证贝叶斯优化的关键作用。
原文摘要(Abstract)

Building a cost-effective static analyzer for real-world programs is still regarded an art. One key contributor to this grim reputation is the difficulty in balancing the cost and the precision of an analyzer. An ideal analyzer should be adaptive to a given analysis task and avoid using techniques that unnecessarily improve precision and increase analysis cost. However, achieving this ideal is highly nontrivial, and it requires a large amount of engineering efforts. In this article, we present a new learning-based approach for adaptive static analysis. In our approach, the analysis includes a sophisticated parameterized strategy that decides, for each part of a given program, whether to apply a precision-improving technique to that part or not. We present a method for learning a good parameter for such a strategy from an existing codebase via Bayesian optimization. The learnt strategy is then used for new, unseen programs. Using our approach, we developed partially flow- and context-sensitive variants of a realistic C static analyzer. The experimental results demonstrate that using Bayesian optimization is crucial for learning from an existing codebase. Also, they show that among all program queries that require flow- or context-sensitivity, our partially flow- and context-sensitive analysis answers 75% of them, while increasing the analysis cost only by 3.3× of the baseline flow- and context-insensitive analysis, rather than 40× or more of the fully sensitive version.

链接与引用

DOI 原文 ·

BibTeX
@article{paperbot313,
  title = {Adaptive Static Analysis via Learning with Bayesian Optimization},
  author = {Kihong Heo and Hakjoo Oh and Hongseok Yang and Kwangkeun Yi},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {40},
  number = {4},
  year = {2018},
  doi = {10.1145/3121135}
}