atlas

Research map / Large language models / Language, safety and interpretability

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

ICML 2024 · Large language models › Language, safety and interpretability · approach: LLM unlearning and benchmarks · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces SAFIM, a syntax-aware fill-in-the-middle benchmark of 17,720 executable/syntactic code completion tasks, and evaluates 15+ LLMs with multiple prompt designs and a syntax-aware truncation method.

Problem

Existing fill-in-the-middle (FIM) code benchmarks such as HumanEval-Infilling are tiny, Python-only, and randomly masked; comparisons across models are also skewed by prompt choice and output truncation, and possible data contamination threatens validity.

Approach

Mask syntactically meaningful AST structures (algorithmic blocks, control-flow conditions, API calls) from post-April-2022 code, evaluate with unit-test execution or syntax matching, and use five prompt designs plus an AST-based syntax-aware truncation so that FIM and non-FIM models are compared fairly.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add syntax-aware truncation (ablation)CodeGen-16B · SAFIM algorithmic block completionPass@1: 0.0 -> 25.9Helped
Add syntax-aware truncation (ablation)CodeLLaMa-13B · SAFIM algorithmic block completionPass@1: 16.4 -> 41.4Helped
Add syntax-aware truncation (ablation)CodeLLaMa-13B · SAFIM control-flow completionPass@1: 27.8 -> 57.2Helped
Add syntax-aware truncation (ablation)GPT-3.5 (175B) · SAFIM control-flow completionPass@1: 37.4 -> 37.5No clear effect
Add syntax-aware truncation (ablation)GPT-3.5 (175B) · SAFIM API function call completionPass@1: 44.2 -> 53.9Helped
Use the SPM prompt instead of IPF (ablation)CodeGen-16B · SAFIM algorithmic block completionPass@1: 15.2 -> 25.9Helped
Use the PSM prompt instead of IPF (ablation)DeepSeekCoder-33B · SAFIM algorithmic block completionPass@1: 33.8 -> 60.8Helped
Use the 1S prompt instead of L2R (ablation)GPT-3.5 (175B) · SAFIM algorithmic block completionPass@1: 23.2 -> 31.2Helped

Surprising findings

Limitations

Experimental setup

Datasets: Codeforces solutions and unit tests GitHub code files via GH Archive

Benchmarks: SAFIM

Metrics: Pass@1 compile error rate (CErr%)

Baselines: GPT-3.5 GPT-4 CodeGen InCoder CodeLLaMa StarCoder DeepSeekCoder

Builds on: HumanEval-Infilling InCoder ExecEval CodeBLEU

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy