mlsanityData to 14 Oct 2026

Legal Compliance Evaluation of Smart Contracts Generated By Large Language Models

arXiv 2506.00943 ↗First posted 1 Jun 2025cs.SE cs.AIcited by 1

Not on the map. Why?

Abstract (arXiv)

Smart contracts can implement and automate parts of legal contracts, but ensuring their legal compliance remains challenging. Existing approaches such as formal specification, verification, and model-based development require expertise in both legal and software development domains, as well as extensive manual effort. Given the recent advances of Large Language Models (LLMs) in code generation, we investigate their ability to generate legally compliant smart contracts directly from natural language legal contracts, addressing these challenges. We propose a novel suite of metrics to quantify legal compliance based on modeling both legal and smart contracts as processes and comparing their behaviors. We select four LLMs, generate 20 smart contracts based on five legal contracts, and analyze their legal compliance. We find that while all LLMs generate syntactically correct code, there is significant variance in their legal compliance with larger models generally showing higher levels of compliance. We also evaluate the proposed metrics against properties of software metrics, showing they provide fine-grained distinctions, enable nuanced comparisons, and are applicable across domains for code from any source, LLM or developer. Our results suggest that LLMs can assist in generating starter code for legally compliant smart contracts with strict reviews, and the proposed metrics provide a foundation for automated and self-improving development workflows.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 13 of its 40 references that are in the map. First posted on arXiv 1 Jun 2025.

Builds on

13 of 40 references.

References · 13

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  4. 2024GPT-4o System Cardcited by 4,588
  5. 2021Program Synthesis with Large Language Modelscited by 3,637
  6. 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,224
  7. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  8. 2023Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Modelscited by 560
  9. 2023LegalBench: A Collaboratively Built Benchmark for Measuring Legal Reasoning in Large Language Modelscited by 336
  10. 2019Manticore: A User-Friendly Symbolic Execution Framework for Binaries and Smart Contractscited by 37
  11. 2017Blockchains for Business Process Management - Challenges and Opportunitiescited by 5
  12. 2024Using Large Language Models for Generating Smart Contracts for Health Insurance from Textual Policiescited by 5
1 more
  1. 2019VeriSolid: Correct-by-Design Smart Contracts for Ethereumcited by 3

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.