mlsanityData to 14 Oct 2026

Towards Compositional Generalization in LLMs for Smart Contract Security: A Case Study on Reentrancy Vulnerabilities

arXiv 2601.06914 ↗First posted 11 Jan 2026cs.CR cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) demonstrate remarkable capabilities in natural language understanding and generation. Despite being trained on large-scale, high-quality data, LLMs still fail to outperform traditional static analysis tools in specialized domains like smart contract vulnerability detection. To address this issue, this paper proposes a post-training algorithm based on atomic task decomposition and fusion. This algorithm aims to achieve combinatorial generalization under limited data by decomposing complex reasoning tasks. Specifically, we decompose the reentrancy vulnerability detection task into four linearly independent atomic tasks: identifying external calls, identifying state updates, identifying data dependencies between external calls and state updates, and determining their data flow order. These tasks form the core components of our approach. By training on synthetic datasets, we generate three compiler-verified datasets. We then employ the Slither tool to extract structural information from the control flow graph and data flow graph, which is used to fine-tune the LLM's adapter. Experimental results demonstrate that low-rank normalization fusion with the LoRA adapter improves the LLM's reentrancy vulnerability detection accuracy to 98.2%, surpassing state-of-the-art methods. On 31 real-world contracts, the algorithm achieves a 20% higher recall than traditional analysis tools.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 21 of its 40 references that are in the map. First posted on arXiv 11 Jan 2026.

Builds on

21 of 40 references.

References · 21

  1. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  2. 2017The Implicit Bias of Gradient Descent on Separable Datacited by 655
  3. 2018Stronger generalization bounds for deep nets via a compression approachcited by 307
  4. 2023Unifying Molecular and Textual Representations via Multi-task Language Modellingcited by 93
  5. 2019Slither: A Static Analysis Framework For Smart Contractscited by 89
  6. 2021Making Transformers Solve Compositional Taskscited by 72
  7. 2018Securify: Practical Security Analysis of Smart Contractscited by 61
  8. 2025Atom of Thoughts for Markov LLM Test-Time Scalingcited by 54
  9. 2019Compositional Generalization for Primitive Substitutionscited by 48
  10. 2018Jump to better conclusions: SCAN both left and rightcited by 29
  11. 2025HeurAgenix: Leveraging LLMs for Solving Complex Combinatorial Optimization Challengescited by 21
  12. 2025Complexity Control Facilitates Reasoning-Based Compositional Generalization in Transformerscited by 20
9 more
  1. 2020SmartBugs: A Framework to Analyze Solidity Smart Contractscited by 18
  2. 2018Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attackscited by 17
  3. 2025Reasoning-as-Logic-Units: Scaling Test-Time Reasoning in Large Language Models Through Logic Unit Alignmentcited by 12
  4. 2024AtomR: Atomic Operator-Empowered Large Language Models for Heterogeneous Knowledge Reasoningcited by 10
  5. 2025From Chaos to Order: The Atomic Reasoner Framework for Fine-grained Reasoning in Large Language Modelscited by 5
  6. 2023Robust Subtask Learning for Compositional Generalizationcited by 4
  7. 2024Exploring Continual Learning of Compositional Generalization in NLIcited by 4
  8. 2021Compositional Security for Reentrant Applicationscited by 3
  9. 2025Generative Large Language Model usage in Smart Contract Vulnerability Detectioncited by 3

Built on by

Not cited yet.