Smart Contract Intent Detection with Pre-trained Programming Language Model
Paper • 2508.20086 • Published
# Load model directly
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("web3se/SmartBERT")
model = AutoModelForMaskedLM.from_pretrained("web3se/SmartBERT")This smart contract pre-trained model is used to transfer smart contract function-level code to embeddings.
It is trained by Sen Fang in 2022 on over 40,000 smart contracts.
Initialized with RoBERTa
Please update to SmartBERT V2
@article{huang2025smart,
title={Smart Contract Intent Detection with Pre-trained Programming Language Model},
author={Huang, Youwei and Li, Jianwen and Fang, Sen and Li, Yao and Yang, Peng and Hu, Bin and Zhang, Tao},
journal={arXiv preprint arXiv:2508.20086},
year={2025}
}
Base model
FacebookAI/roberta-base
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="web3se/SmartBERT")