SOTAVerified

Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Tasks

2024-03-07Code Available1· sign in to hype

Linyuan Gong, Sida Wang, Mostafa Elhoushi, Alvin Cheung

Code Available — Be the first to reproduce this paper.

Reproduce

Code

Abstract

We introduce Syntax-Aware Fill-In-the-Middle (SAFIM), a new benchmark for evaluating Large Language Models (LLMs) on the code Fill-in-the-Middle (FIM) task. This benchmark focuses on syntax-aware completions of program structures such as code blocks and conditional expressions, and includes 17,720 examples from multiple programming languages, sourced from recent code submissions after April 2022 to minimize data contamination. SAFIM provides a robust framework with various prompt designs and novel syntax-aware post-processing techniques, facilitating accurate and fair comparisons across LLMs. Our comprehensive evaluation of 15 LLMs shows that FIM pretraining not only enhances FIM proficiency but also improves Left-to-Right (L2R) inference using LLMs. Our findings challenge conventional beliefs and suggest that pretraining methods and data quality have more impact than model size. SAFIM thus serves as a foundational platform for future research in effective pretraining strategies for code LLMs. The evaluation toolkit and dataset are available at https://github.com/gonglinyuan/safim, and the leaderboard is available at https://safimbenchmark.com.

Tasks

Benchmark Results

DatasetModelMetricClaimedVerifiedStatus
SAFIMdeepseek-coder-33b-baseAverage69.01Unverified
SAFIMdeepseek-coder-6.7b-baseAverage63.4Unverified
SAFIMstarcoderbaseAverage55.54Unverified
SAFIMgpt-4-1106-previewAverage53.28Unverified
SAFIMCodeLlama-13b-hfAverage52.78Unverified
SAFIMdeepseek-coder-1.3b-baseAverage52.63Unverified
SAFIMCodeLlama-34b-hfAverage49.66Unverified
SAFIMCodeLlama-7b-hfAverage45Unverified
SAFIMgpt-3.5-turbo-0301Average40.86Unverified
SAFIMincoder-6BAverage33.79Unverified
SAFIMcodegen-16B-multiAverage30.99Unverified
SAFIMcodegen-2B-multiAverage29.55Unverified
SAFIMincoder-1BAverage29.27Unverified
SAFIMcodegen-6B-multiAverage28.71Unverified
SAFIMcodegen-350M-multiAverage22.94Unverified

Reproductions