Manuscript Offprint

arXiv:2610.38621

When LLM Architectures Meet Smart Contract Vulnerability Detection: a Replication Study

Gerardo Iuliano, Gabriele De Vito, Dario Di Nucci

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Gerardo Juliano

University of Salerno, Italy

geiuliano@unisa.it

Gabriele De Vito

University of Salerno, Italy

gadevito@unisa.it

Dario Di Nucci

University of Salerno, Italy

ddinucci@unisa.it

Abstract—Smart contracts are immutable programs deployed on blockchain platforms, where vulnerabilities can translate directly into financial loss. Among the techniques proposed for their detection, recent work has relied increasingly on Large Language Models (LLMs) guided by carefully crafted prompts. However, the evidence accumulated so far rests almost entirely on the dense Transformer architecture behind the GPT line and on model snapshots already scheduled for deprecation, leaving open the question of whether the reported behaviors reflect a general property of LLMs or an artifact of that specific design.

This paper presents an extended replication of the empirical study by Chen et al. on LLM-based smart contract vulnerability detection. We replicate the original protocol on GPT-4 as a baseline, followed by a differentiated replication, executing the protocol on representative models based on Mixture-of-Experts and RNN-like designs, together with an attempted preliminary evaluation of State Space Models. The exact replication confirms the findings of Chen et al., including the high-recall, low-precision detection pattern they report on GPT-4. Nevertheless, the differentiated replication shows that this pattern does not transfer uniformly across the evaluated models. Those from the same architectural family may also exhibit different behaviors, indicating that architectural family alone is insufficient to predict the resulting detection profile. We observe the same qualitative dense-Transformer profile in both GPT-4 and Gemma-3, despite a gap of roughly two orders of magnitude in parameter counts, whereas two Mixture-of-Experts models from different lineages exhibit qualitatively divergent behaviors, indicating that architectural family alone is insufficient to predict the detection profile.

Index Terms—Replication Study, Vulnerability Detection, LLM Architecture

I. INTRODUCTION

A smart contract is a self-executing program that runs on a blockchain platform, such as Ethereum [1]. It automatically enforces and executes the terms of an agreement when predefined conditions are met, without the need for intermediaries. Unlike traditional software, once deployed, smart contracts cannot be modified or patched, so even minor flaws can lead to severe repercussions [2].

Ensuring the security of smart contracts is critical. Well-known vulnerabilities, including Reentrancy, Timestamp Dependence, Transaction Order Dependence, Authorization via tx.origin, and Unchecked External Calls, have already led to major financial losses, most notably in the DAO hack [3]. To address these issues, static and dynamic analysis techniques have long been used by researchers, as extensively surveyed by Rameder et al. [4] and Iuliano et al. [5]. Recently, the focus has shifted to methods based on Large Language Models (LLMs), including VulnHunt [6], GPTScan [7], AdvSCanner [8], LLMSmartSec [9], GPTLens [10], FELLMVP [11], and SolGPT [12], demonstrating the ability of LLMs to discover vulnerabilities by leveraging carefully designed prompts.

Within this line of work, the empirical study by Chen et al. [13] stands out as a reference point. They systematically evaluated three GPT model snapshots on the SmartBugs curated benchmark [14], reporting high recall coupled with low and unstable precision. However, two aspects of their setup leave open questions worth investigating. First, their investigation focuses on a single architectural family, i.e., the dense Transformer used in the GPT line, leaving it unknown whether the observed behavior is a property of LLMs in general or an artifact of that design. Second, the study relies on model snapshots scheduled for deprecation by OpenAI [15], which threatens the long-term reproducibility and practical relevance of their conclusions. Meanwhile, the architectural landscape of LLMs has diversified considerably, with Mixture-of-Experts, RNN-like, and State Space Model designs now competing with the dense Transformer at comparable scales.

This paper presents an extended replication of Chen et al. [13] to verify whether their findings hold under a change in the underlying architecture. We organize the work around two research questions. The first asks whether the original results can be reproduced under controlled conditions on GPT-4 itself (exact replication). The second question asks whether the same protocol, prompt, dataset, and evaluation procedure yield the same behavior when the model is drawn from a different architectural family (differentiated replication). Therefore, we re-execute the experiment on representative models from three further families: Mixture-of-Experts, RNN-like, and, in a preliminary capacity, State Space Models. By keeping the prompt, dataset, evaluation procedure, and temperature fixed, we examine whether the behavior observed for GPT-4 transfers to a set of models with heterogeneous architectural designs. However, because the selected models also differ in scale, training data, tokenization, tuning, and cut-off, our design does not isolate architecture as the only causal factor.

The results confirm Chen et al.'s findings [13] in the exact replication, including the high-recall, low-precision pattern observed for GPT-4. However, the differentiated replication shows that this pattern does not generalize uniformly across architectures. In particular, the same qualitative dense-

Transformer profile is observed in both GPT-4 and Gemma-3 despite a substantial scale gap, whereas DeepSeek-V2-Lite and RWKV-7 exhibit much more conservative behavior, achieving higher specificity at the cost of substantially lower recall. At the same time, the contrast between Qwen-3.5 and DeepSeek-V2-Lite shows that shared membership in the same architectural family is not, by itself, sufficient to predict detection behavior.

Paper Structure. Section II reviews related work and key concepts to understand the paper, whereas Section III describes the reference work by Chen et al. [13]. Section IV details the methods used to conduct the study, with its execution plan and procedures to ensure transparency and reproducibility, and whose results are reported in Sections V and VI, and discussed in Section VII. Section VIII lists the threats to the validity of the study, addressing potential limitations and biases in the study and the measures taken to mitigate them. Finally, Section IX concludes the paper.

References (63)

  • Ethereum white paper: a next generation smart contract & decentralized application platform
  • A survey of attacks on ethereum smart contracts (sok)
  • Understanding a revolutionary and flawed grand experiment in blockchain: the dao attack
  • Review of automated vulnerability analysis of smart contracts on ethereum
  • Smart contract vulnerabilities, tools, and benchmarks: An updated systematic literature review (opens arXiv in a new tab)
  • Vulnhunt-gpt: a smart contract vulnerabilities detector based on openai chatgpt
  • Gptscan: Detecting logic vulnerabilities in smart contracts by combining gpt with program analysis
  • Advscanner: Generating adversarial smart contracts to exploit reentrancy vulnerabilities using llm and static analysis
  • Llmsmartsec: Smart contract security auditing with llm and annotated control flow graph
  • Large language model-powered smart contract vulnerability detection: New perspectives
  • Fellmvp: An ensemble llm framework for classifying smart contract vulnerabilities
  • Solgpt: A gpt-based static vulnerability detection model for enhancing smart contract security
  • When chatgpt meets smart contract vulnerability detection: How far are we?
  • Smartbugs: A framework to analyze solidity smart contracts
  • Deprecations - OpenAI API
  • building smart contracts and dapps
  • Systematic review of security vulnerabilities in ethereum blockchain smart contract
  • Smart contract development: Challenges and opportunities
  • Springer, 2017, vol. 1
  • Vyper: A security comparison with solidity based on common vulnerabilities
  • Immutable smart contracts on blockchain technology: Its benefits and barriers
  • Blockchain mutability: Challenges and proposed solutions
  • Openscv: An open hierarchical taxonomy for smart contract vulnerabilities
  • Static application security testing (sast) tools for smart contracts: How far are we?
  • Smart contract vulnerabilities, tools, and benchmarks: An updated systematic literature review
  • Reguard: finding reentrancy bugs in smart contracts
  • Security vulnerabilities in ethereum smart contracts
  • Contractfuzzer: Fuzzing smart contracts for vulnerability detection
  • Smart contract: Attacks and protections
  • Etherfuzz: mutation fuzzing smart contracts for tod vulnerability detection
  • Smartscan: an approach to detect denial of service vulnerability in ethereum smart contracts
  • Do large language models understand us?
  • Language models are unsupervised multitask learners
  • Language models are few-shot learners
  • Llm-based generation of solidity smart contracts from system requirements in natural language: the astrakode case
  • GPT-4 Technical Report
  • Gemini: A Family of Highly Capable Multimodal Models
  • LLaMA: Open and Efficient Foundation Language Models
  • Introducing claude
  • Mixtral of Experts
  • Rwkv: Reinventing rnns for the transformer era
  • Transformers are ssm: generalized models and efficient algorithms through structured state space duality
  • On pruning state-space llms
  • Routing mamba: Scaling state space models with mixture-of-experts projection
  • Mamba-360: Survey of state space models as transformer alternative for long sequence modelling: Methods, applications, and challenges
  • Bert: Pre-training of deep bidirectional transformers for language understanding
  • Large language diffusion models
  • Efficient transformers: A survey
  • OpenAI o1 System Card
  • DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning
  • Smart contract vulnerability detection: The role of large language model (llm) (opens the publisher in a new tab)
  • Smartguard: An Ilm-enhanced framework for smart contract vulnerability detection
  • Llm-smartaudit: Advanced smart contract vulnerability detection (opens arXiv in a new tab)
  • GPT - OpenAI API
  • GPT-3.5 - OpenAI API
  • GPT-4o System Card
  • Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing
  • Large language models for software engineering: A systematic literature review
  • Decentralized application security project: Top 10 of 2018
  • Youden index and optimal cut-point estimated from observations affected by a lower limit of detection
  • Understanding and mitigating bottlenecks of state space models through the lens of recency and over-smoothing
  • Springer, 2012, vol. 236
  • Automated vulnerability injection in solidity smart contracts: A mutation-based approach for benchmark development