atlas

Research map / Large language models / Agents, code and math

LLMDFA: Analyzing Dataflow in Code with Large Language Models

NeurIPS 2024 · Large language models › Agents, code and math · approach: Execution-based code verification · 8 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes LLMDFA, a compilation-free, customizable dataflow analysis that uses LLMs to synthesize extractor and Z3 scripts and few-shot CoT summaries to detect bugs in Java programs.

Problem

Dataflow analysis traditionally requires successful compilation and expert customization, which limits applicability to incomplete programs and usability for evolving analysis needs; direct LLM-based analysis suffers hallucinations.

Approach

Decompose dataflow analysis into source/sink extraction, few-shot chain-of-thought dataflow summarization, and path feasibility validation, with LLMs synthesizing scripts that call external tools (tree-sitter parsing, Z3 SMT solver) to offload delicate reasoning.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use LLMDFA instead of CodeFuseQueryJuliet DBZ detection · Juliet DBZF1: +0.23 F1Helped
Use LLMDFA instead of end-to-end few-shot CoT analysisJuliet bug detection · Juliet DBZ, XSS, and OSCIF1: +0.36 F1Helped
Use LLMDFA instead of end-to-end analysisTaintBench · TaintBenchF1: +0.35 F1Helped
Add synthesized source/sink extractors instead of directly prompting the LLM (ablation)LLMDFA · Juliet DBZ, XSS, and OSCIprecisionHelped
Add few-shot CoT prompting for dataflow summarization (ablation)LLMDFA · Juliet DBZF1Helped
Add few-shot CoT prompting for dataflow summarization (ablation)LLMDFA · Juliet DBZprecision: 86.8% -> 73.7%Hurt
Synthesize programs invoking SMT solvers for path validation instead of directly prompting the LLM (ablation)LLMDFA · Juliet XSS and OSCIbug detection performanceNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: Juliet Test Suite TaintBench SecBench.js

Benchmarks: Juliet Test Suite TaintBench SecBench.js Juliet Test Suite C/C++

Metrics: precision recall F1 score

Baselines: CodeFuseQuery Pinpoint LLM-based end-to-end analysis NoSynExt NoCoT NoSynVal

Builds on: LLVM Z3 tree-sitter few-shot chain-of-thought prompting

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy