atlas

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

Detecting Bugs with Substantial Monetary Consequences by LLM and Rule-based Reasoning

NeurIPS 2024 · Large language models › Agents, code and math · approach: Execution-based code verification · 4 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 ABAuditor, a hybrid system where GPT-3.5 annotates financial meanings of entry-function parameters and globals, rule-based reasoning propagates meanings and flags accounting bugs, and reasoning-trace self-reflection curbs hallucinations.

Problem

Detecting accounting bugs (incorrect implementations of domain-specific financial models) in Solidity smart contracts, which existing tools and naive LLM prompting handle poorly due to context limits, hallucinations, and lack of generalization.

Approach

Split accounting-bug detection into LLM-based financial-meaning annotation of entry variables and deterministic rule-based propagation through the code (via Slither IR and SSA), with a trace-based LLM self-reflection loop to correct mislabeled annotations and reduce false positives.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use LLM annotations with rule-based reasoning and reasoning-trace hallucination remedy instead of human annotationsABAuditor · 23 smart contract projectsrecall: 90.5% vs 90.5%No clear effect
Use LLM annotations with rule-based reasoning and reasoning-trace hallucination remedy instead of human annotationsABAuditor · 23 smart contract projectsfalse positives: 7 -> 10Mixed
Add reasoning-trace hallucination remedy (ablation)ABAuditor · 23 smart contract projectsfalse positives: 22 -> 10; 54.5% reductionHelped
Remove few-shot examples (ablation)ABAuditor with GPT-3.5 · Human-labeled financial annotationscorrect annotations: 62/82 -> 32/82Hurt
Add fine-tuning without few-shot examples (ablation)ABAuditor with GPT-3.5 · Human-labeled financial annotationscorrect annotations: 62/82 -> 39/82Hurt
Add fine-tuning while retaining few-shot examples (ablation)ABAuditor with GPT-3.5 · Human-labeled financial annotationscorrect annotations: 62/82 -> 64/82; 75.6% to 78%Helped
Replace GPT-3.5 with fine-tuned GPT-4o mini and provide few-shot examples (ablation)ABAuditor · Human-labeled financial annotationscorrect annotations: 64/82 -> 71/82; 78% -> 86.6%Helped
Replace GPT-3.5 with CodeLlama-13B (ablation)ABAuditor · Human-labeled financial annotationsannotation accuracy: 41.9% vs 75.6%Hurt
Rewrite variable names while preserving program semantics (ablation)ABAuditor · Human-labeled financial annotationsannotation accuracy: 75.6% -> 31.7%Hurt
Rewrite variable names while preserving program semantics (ablation)ABAuditor · 23 smart contract projectstrue positives: 19 -> 14Hurt
Rewrite variable names while preserving program semantics (ablation)ABAuditor · 23 smart contract projectsfalse positives: 9 -> 21Hurt
Apply ABAuditor to recent projects with LLM annotationABAuditor · 8 new smart contract projectsin-scope bugs detected: 6 of the 7Helped

Surprising findings

Limitations

Experimental setup

Datasets: Zhang et al. 2023 smart contract bug dataset (513 bugs, 113 projects; 72 accounting bugs) 8 recent Code4rena projects (2024)

Benchmarks: Zhang et al. 2023 accounting bug dataset (23 projects) 8 new Code4rena smart contract projects

Metrics: recall false positives annotation accuracy tokens runtime API requests

Baselines: manual annotation with rule-based reasoning GPTScan ItyFuzz GPT-3.5 no few-shot CodeLlama-13B-instruct

Builds on: Slither GPTScan Zhang 2024 type system for accounting bugs chain-of-thought

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