Leveraging LLMs for Front-Running Attack Detection in Ethereum
Abstract
Front-running attacks have become a threat to blockchain security. By exploiting transaction ordering, attackers use front-running to gain profits on Ethereum-based blockchains. Existing heuristics and ML approaches fail to capture the complex relational dependencies in these attacks. We propose a novel framework by leveraging instruction-tuned large language models, Llama-3.2-3B and Gemma-2-2B, for multi-class front-running detection on Ethereum. Through parameter-efficient fine-tuning with LoRA and an enriched dataset augmented with blockchain metadata from Alchemy and Chainstack, our models achieve up to 96.4 % macro accuracy, surpassing the baseline approach by 8.7 %. We further identify that 256 tokens is the optimal input length while discussing the trade-offs between runtime efficiency and performance. Our findings demonstrate that LLMs are a powerful tool for learning complex transactional patterns, which is crucial for blockchain security.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.