mlsanityData to 7 Oct 2026

RAGas: Retrieval-Augmented Gas Optimization for Smart Contracts with Continuous Knowledge Integration

arXiv 2608.15857 ↗First posted 16 Aug 2026cs.AIcited by 0

On the map: Retrieval-augmented generation → Privacy and security of RAG

Abstract (arXiv)

Ethereum is now integral to mission-critical sectors, including finance, healthcare, and supply chain management. Execution fees, commonly referred to as Gas, scale with the computational complexity of their functions. Smart contracts on Ethereum incur execution fees, known as Gas, which increase with computational complexity. Thus, optimizing Gas-intensive code while preserving functional equivalence significantly lowers deployment costs. No existing system continuously exploits evolving Gas usage patterns. We systematically analyze syntactic and semantic constructs that drive excessive Gas use. This yields six high-level categories covering twelve fine-grained antipatterns underpinning a curated knowledge base. We operationalize these insights with RAGas, a three-stage retrieval-augmented generation framework that uses a large language model to pinpoint and automatically fix Gas inefficiencies. Experiments on deployed contracts demonstrate that RAGas reduces Gas usage by up to 11% and achieves high precision and recall in detecting code snippets exhibiting Gas wastage.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Privacy and security of RAG, one of 15 directions in Retrieval-augmented generation. Builds on 37 of its 69 references that are in the map. First posted on arXiv 16 Aug 2026.

Builds on

37 of 69 references.

References · 37

  1. 2017Attention Is All You Needcited by 59,932
  2. 2024The Llama 3 Herd of Modelscited by 14,192
  3. 2024A Survey on LLM-as-a-Judgecited by 1,384
  4. 2023Siren's Song in the AI Ocean: A Survey on Hallucination in Large Language Modelscited by 695
  5. 2022Automatic Chain of Thought Prompting in Large Language Modelscited by 684
  6. 2022Large Language Models Struggle to Learn Long-Tail Knowledgecited by 452
  7. 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 450
  8. 2024Chain of Thoughtlessness? An Analysis of CoT in Planningcited by 100
  9. 2024A Comprehensive Survey of Hallucination in Large Language, Image, Video and Audio Foundation Modelscited by 98
  10. 2019Slither: A Static Analysis Framework For Smart Contractscited by 88
  11. 2024Large Language Model (LLM) for Telecommunications: A Comprehensive Survey on Principles, Key Techniques, and Opportunitiescited by 83
  12. 2023GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysiscited by 65
25 more
  1. 2024LLMs are Also Effective Embedding Models: An In-depth Overviewcited by 32
  2. 2023In Search of the Long-Tail: Systematic Generation of Long-Tail Inferential Knowledge via Logical Rule Guided Searchcited by 9
  3. 2024Unveiling Decentralization: A Comprehensive Review of Technologies, Comparison, Challenges in Bitcoin, Ethereum, and Solana Blockchaincited by 6
  4. 2024Interaction-Aware Vulnerability Detection in Smart Contract Bytecodescited by 6
  5. 2024Static Application Security Testing (SAST) Tools for Smart Contracts: How Far Are We?cited by 5
  6. 2025Exploring Vulnerabilities and Concerns in Solana Smart Contractscited by 4
  7. 2026Defensible Design for OpenClaw: Securing Autonomous Tool-Invoking Agentscited by 4
  8. 2020STAN: Towards Describing Bytecodes of Smart Contractcited by 3
  9. 2024How to Save My Gas Fees: Understanding and Detecting Real-world Gas Issues in Solidity Programscited by 3
  10. 2025Bridging External and Parametric Knowledge: Mitigating Hallucination of LLMs with Shared-Private Semantic Synergy in Dual-Stream Knowledgecited by 3
  11. 2026Knowledge is Not Enough: Injecting RL Skills for Continual Adaptationcited by 3
  12. 2025DoS Attacks and Defense Technologies in Blockchain Systems: A Hierarchical Analysiscited by 2
  13. 2025Blockchain security based on cryptography: a reviewcited by 2
  14. 2025Penetrating the Hostile: Detecting DeFi Protocol Exploits through Cross-Contract Analysiscited by 2
  15. 2025CKG-LLM: LLM-Assisted Detection of Smart Contract Access Control Vulnerabilities Based on Knowledge Graphscited by 2
  16. 2024DApps Ecosystems: Mapping the Network Structure of Smart Contract Interactionscited by 1
  17. 2025Implementation and Security Analysis of Cryptocurrencies Based on Ethereumcited by 1
  18. 2025A Comprehensive Study of Exploitable Patterns in Smart Contracts: From Vulnerability to Defensecited by 1
  19. 2025From Fomo3D to Lottery DAPP: Analysis of Ethereum-Based Gambling Applicationscited by 1
  20. 2025AtomGraph: Tackling Atomicity Violation in Smart Contracts using Multimodal GCNscited by 1
  21. 2025USCSA: Evolution-Aware Security Analysis for Proxy-Based Upgradeable Smart Contractscited by 1
  22. 2025ScamSweeper: Detecting Illegal Accounts in Web3 Scams via Transactions Analysiscited by 1
  23. 2026LibScan: Smart Contract Library Misuse Detection with Iterative Feedback and Static Verificationcited by 1
  24. 2026SCPatcher: Automated Smart Contract Code Repair via Retrieval-Augmented Generation and Knowledge Graphcited by 1
  25. 2026PSR2: A Phase-based Semantic Reasoning Framework for Atomicity Violation Detection via Contract Refinementcited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025GasAgent: A Multi-Agent Framework for Automated Gas Optimization in Smart Contracts
  2. 2025Beyond Code Similarity: Benchmarking the Plausibility, Efficiency, and Complexity of LLM-Generated Smart Contracts
  3. 2024Retrieval Augmented Generation Integrated Large Language Models in Smart Contract Vulnerability Detection
  4. 2025Towards Automated Smart Contract Generation: Evaluation, Benchmarking, and Retrieval-Augmented Repair
  5. 2026Repository-Level Solidity Code Generation with Large Language Models: From Prompting to Fine-Tuning
  6. 2025SCALM: Detecting Bad Practices in Smart Contracts Through LLMs
  7. 2025ParaVul: A Parallel Large Language Model and Retrieval-Augmented Framework for Smart Contract Vulnerability Detection
  8. 2025Towards Secure and Explainable Smart Contract Generation with Security-Aware Group Relative Policy Optimization