← Lab /Software

LLMs achieve up to 0.96 F1 detecting reentrancy, outperforming traditional tools

LLM-based detectors are more effective than existing static analyzers and ML models for reentrancy detection in Solidity 0.8+ contracts

Software arXiv 27 Mar 2026 Measurement Prototype evidence Threat model

Published as “Reentrancy Detection in the Age of LLMs”

Why it matters

LLMs can serve as a more robust, low-maintenance alternative for reentrancy detection in Ethereum smart contracts.

Summary

LLMs outperform traditional static and ML-based reentrancy detectors, achieving high accuracy without version-specific maintenance or handcrafted rules. The authors evaluated 12 static tools, 10 conventional ML models, and 9 LLMs on a manually verified benchmark of 432 contracts and a stress-test suite of 143 scenarios, finding that many static tools fail or disagree on modern Solidity code. LLMs also provide useful explanations that help identify mislabeled edge cases. However, the evaluation is limited to these two curated datasets, and LLMs lack formal guarantees.

What they found 3

  1. Several LLMs achieve strong zero-shot performance and higher accuracy than static analyzers.

    “Several LLMs exhibit strong zero-shot performance across both datasets, achieving high accuracy without versionspecific maintenance or handcrafted rules.”

  2. The existing ecosystem of reentrancy detectors is fragmented and unreliable on modern contracts.

    “Our findings reveal a fractured and unreliable ecosystem, with many tools failing outright on modern contracts, disagreeing sharply with one another, or producing high rates of false positives and false negatives even on relatively simple patterns.”

  3. LLMs, despite lacking formal guarantees, outperform outdated static analyzers on both stress tests and manually verified benchmarks.

    “LLMs (despite lacking formal guarantees) offer surprising robustness and semantic generality, outperforming outdated static analyzers on both stress tests and manually verified benchmarks [24, 29].”

Caveats 2

  • RSD is intentionally not representative of real-world prevalence: its purpose is to stresstest detectors under semantic corner cases, evolving language constructs and new habits within the dev community.
  • LLMs (despite lacking formal guarantees) offer surprising robustness and semantic generality, outperforming outdated static analyzers on both stress tests and manually verified benchmarks [24, 29].

What’s new here 4

  • Unified three-step labeling procedure that enforces a consistent operational definition of reentrancy across datasets.
  • Release of a high-confidence Aggregated Benchmark (432 contracts) manually re-verified from prior sources.
  • Creation of the Reentrancy Scenarios Dataset (RSD) to stress-test detectors on modern Solidity constructs.
  • Comprehensive comparison of LLMs against static analyzers and traditional ML models for reentrancy detection.

Threat model stated by the source

Adversaryexternally owned accounts controlling malicious contracts
Capabilitydeploy arbitrary contracts, invoke any public/external function with chosen calldata and Ether, implement fallback/receive functions to re-enter victims, create contracts that call victims during construction
Assumesthe underlying blockchain provides standard consensus and integrity guarantees; EVM opcodes behave as specified