Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Tasks
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 24 papers in the map (data through 7 Oct 2026). Builds on 39 of its 48 references that are in the map. First posted on arXiv 7 Mar 2024.
Builds on
39 of 48 references.
References · 39
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,302
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,026
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
27 more
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formattingcited by 778
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 612
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2023Rethinking Benchmark and Contamination for Language Models with Rephrased Samplescited by 192
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
- 2022MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generationcited by 132
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2021Jigsaw: Large Language Models meet Program Synthesiscited by 103
- 2022Execution-Based Evaluation for Open-Domain Code Generationcited by 89
- 2022Natural Language to Code Generation in Interactive Data Science Notebookscited by 86
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 64
- 2019JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code Generationcited by 49
- 2023ToolCoder: Teach Code Generation Models to use API search toolscited by 37
- 2024AST-T5: Structure-Aware Pretraining for Code Generation and Understandingcited by 32
Built on by
Citing papers per year: 2024: 4; 2025: 13; 2026: 7.
24 papers.
Sort:
By area:
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoningcited by 40
- 2025AutoP2C: An LLM-Based Agent Framework for Code Repository Generation from Multimodal Content in Academic Paperscited by 18
- 2025A Comprehensive Survey on Benchmarks and Solutions in Software Engineering of LLM-Empowered Agentic Systemcited by 15
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2024Beyond Correctness: Benchmarking Multi-dimensional Code Generation for Large Language Modelscited by 9
- 2024Watson: A Cognitive Observability Framework for the Reasoning of LLM-Powered Agentscited by 8
- 2025Locus: Agentic Predicate Synthesis for Directed Fuzzingcited by 8
- 2025CopySpec: Accelerating LLMs with Speculative Copy-and-Paste Without Compromising Qualitycited by 6
- 2026From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuningcited by 5
- 2025Comparative Analysis of Large Language Models for Context-Aware Code Completion using SAFIM Frameworkcited by 3
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Qualitycited by 3
12 more
- 2025Structure-Aware Fill-in-the-Middle Pretraining for Codecited by 3
- 2025Code2Bench: Scaling Source and Rigor for Dynamic Benchmark Constructioncited by 3
- 2025VocabTailor: Dynamic Vocabulary Selection for Downstream Tasks in Small Language Modelscited by 2
- 2025Mellum: Production-Grade in-IDE Contextual Code Completion with Multi-File Project Understandingcited by 2
- 2025From Output to Evaluation: Does Raw Instruction-Tuned Code LLMs Output Suffice for Fill-in-the-Middle Code Generation?cited by 1
- 2026Evaluating and Achieving Controllable Code Completion in Code LLMcited by 1
- 2026Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Taskscited by 1
- 2024In-Context Code-Text Learning for Bimodal Software Engineeringcited by 0
- 2026Playing Psychic: Using Thought Trees to Predict Reasoning Models Accuracy on Coding Taskscited by 0
- 2026Hide to Guide: Learning via Semantic Maskingcited by 0
- 2026Lost in the Flow with Code Talkers: Unveiling the Instruction-Tuning Tax of Large Language Models in Code Taskscited by 0
- 2026ER-JEPA: Experience Replay Improves Joint-Embedding Predictive Learning in Language Modelscited by 0
- 2026ER-JEPA: Experience Replay Improves Joint-Embedding Predictive Learning in Language Models29 Sep 2026
- 2026Lost in the Flow with Code Talkers: Unveiling the Instruction-Tuning Tax of Large Language Models in Code Tasks7 Jun 2026
- 2026Hide to Guide: Learning via Semantic Masking24 May 2026
- 2026Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Tasks7 May 2026
- 2026Playing Psychic: Using Thought Trees to Predict Reasoning Models Accuracy on Coding Tasks18 Apr 2026
- 2026Evaluating and Achieving Controllable Code Completion in Code LLM22 Jan 2026
- 2026From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuning19 Jan 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025A Comprehensive Survey on Benchmarks and Solutions in Software Engineering of LLM-Empowered Agentic System10 Oct 2025
- 2025Mellum: Production-Grade in-IDE Contextual Code Completion with Multi-File Project Understanding7 Oct 2025
- 2025Locus: Agentic Predicate Synthesis for Directed Fuzzing29 Aug 2025
- 2025VocabTailor: Dynamic Vocabulary Selection for Downstream Tasks in Small Language Models21 Aug 2025
12 more
- 2025Code2Bench: Scaling Source and Rigor for Dynamic Benchmark Construction10 Aug 2025
- 2025Structure-Aware Fill-in-the-Middle Pretraining for Code30 May 2025
- 2025From Output to Evaluation: Does Raw Instruction-Tuned Code LLMs Output Suffice for Fill-in-the-Middle Code Generation?24 May 2025
- 2025AutoP2C: An LLM-Based Agent Framework for Code Repository Generation from Multimodal Content in Academic Papers28 Apr 2025
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Quality7 Mar 2025
- 2025Comparative Analysis of Large Language Models for Context-Aware Code Completion using SAFIM Framework21 Feb 2025
- 2025CopySpec: Accelerating LLMs with Speculative Copy-and-Paste Without Compromising Quality13 Feb 2025
- 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoning5 Jan 2025
- 2024Watson: A Cognitive Observability Framework for the Reasoning of LLM-Powered Agents5 Nov 2024
- 2024In-Context Code-Text Learning for Bimodal Software Engineering8 Oct 2024
- 2024Qwen2.5-Coder Technical Report18 Sep 2024
- 2024Beyond Correctness: Benchmarking Multi-dimensional Code Generation for Large Language Models16 Jul 2024
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoningcited by 40
- 2024Watson: A Cognitive Observability Framework for the Reasoning of LLM-Powered Agentscited by 8
- 2026Playing Psychic: Using Thought Trees to Predict Reasoning Models Accuracy on Coding Taskscited by 0
- 2026Hide to Guide: Learning via Semantic Maskingcited by 0
- 2026Hide to Guide: Learning via Semantic Masking24 May 2026
- 2026Playing Psychic: Using Thought Trees to Predict Reasoning Models Accuracy on Coding Tasks18 Apr 2026
- 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoning5 Jan 2025
- 2024Watson: A Cognitive Observability Framework for the Reasoning of LLM-Powered Agents5 Nov 2024
- 2024Qwen2.5-Coder Technical Report18 Sep 2024
- 2025AutoP2C: An LLM-Based Agent Framework for Code Repository Generation from Multimodal Content in Academic Paperscited by 18
- 2025A Comprehensive Survey on Benchmarks and Solutions in Software Engineering of LLM-Empowered Agentic Systemcited by 15
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2025Locus: Agentic Predicate Synthesis for Directed Fuzzingcited by 8
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025A Comprehensive Survey on Benchmarks and Solutions in Software Engineering of LLM-Empowered Agentic System10 Oct 2025
- 2025Locus: Agentic Predicate Synthesis for Directed Fuzzing29 Aug 2025
- 2025AutoP2C: An LLM-Based Agent Framework for Code Repository Generation from Multimodal Content in Academic Papers28 Apr 2025
- 2024Beyond Correctness: Benchmarking Multi-dimensional Code Generation for Large Language Modelscited by 9
- 2026From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuningcited by 5
- 2025Comparative Analysis of Large Language Models for Context-Aware Code Completion using SAFIM Frameworkcited by 3
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Qualitycited by 3
- 2025Structure-Aware Fill-in-the-Middle Pretraining for Codecited by 3
- 2025Code2Bench: Scaling Source and Rigor for Dynamic Benchmark Constructioncited by 3
- 2025VocabTailor: Dynamic Vocabulary Selection for Downstream Tasks in Small Language Modelscited by 2
- 2025Mellum: Production-Grade in-IDE Contextual Code Completion with Multi-File Project Understandingcited by 2
- 2025From Output to Evaluation: Does Raw Instruction-Tuned Code LLMs Output Suffice for Fill-in-the-Middle Code Generation?cited by 1
- 2026Evaluating and Achieving Controllable Code Completion in Code LLMcited by 1
- 2026Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Taskscited by 1
- 2024In-Context Code-Text Learning for Bimodal Software Engineeringcited by 0
12 most cited of 14 All 14 (JSON)
- 2026ER-JEPA: Experience Replay Improves Joint-Embedding Predictive Learning in Language Models29 Sep 2026
- 2026Lost in the Flow with Code Talkers: Unveiling the Instruction-Tuning Tax of Large Language Models in Code Tasks7 Jun 2026
- 2026Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Tasks7 May 2026
- 2026Evaluating and Achieving Controllable Code Completion in Code LLM22 Jan 2026
- 2026From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuning19 Jan 2026
- 2025Mellum: Production-Grade in-IDE Contextual Code Completion with Multi-File Project Understanding7 Oct 2025
- 2025VocabTailor: Dynamic Vocabulary Selection for Downstream Tasks in Small Language Models21 Aug 2025
- 2025Code2Bench: Scaling Source and Rigor for Dynamic Benchmark Construction10 Aug 2025
- 2025Structure-Aware Fill-in-the-Middle Pretraining for Code30 May 2025
- 2025From Output to Evaluation: Does Raw Instruction-Tuned Code LLMs Output Suffice for Fill-in-the-Middle Code Generation?24 May 2025
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Quality7 Mar 2025
- 2025Comparative Analysis of Large Language Models for Context-Aware Code Completion using SAFIM Framework21 Feb 2025
12 newest of 14 All 14 (JSON)