Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Tasks
Linyuan Gong, Sida Wang, Mostafa Elhoushi, Alvin Cheung
摘要
We introduce Syntax-Aware Fill-in-the-Middle (SAFIM), a new benchmark for evaluating Large Language Models (LLMs) on the code Fill-inthe-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 .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Gorilla: Large Language Model Connected with Massive APIs 引用了 Language Models are Few-Shot Learners
- Copilot Arena: A Platform for Code LLM Evaluation in the Wild 引用了 SWE-bench: Can Language Models Resolve Real-world Github Issues?
- Copilot Arena: A Platform for Code LLM Evaluation in the Wild 引用了 Training language models to follow instructions with human feedback
- Locus: Agentic Predicate Synthesis for Directed Fuzzing 引用了 SWE-bench: Can Language Models Resolve Real-world Github Issues?
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper7
- From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction TuningJiajun Zhang, Zeyu Cui, Jiaxi Yang, Lei Zhang 等ACL 2026 · 8 次引用
- Code2Bench: Scaling Source and Rigor for Dynamic Benchmark ConstructionZhe Zhang, Runlin Liu, Aishan Liu, Xingyu Liu 等ICLR 2026 · 4 次引用
- Copilot Arena: A Platform for Code LLM Evaluation in the WildWayne Chi, Valerie Chen, Anastasios Nikolas Angelopoulos, Wei-Lin Chiang 等ICML 2025
- PlotCraft: Pushing the Limits of LLMs for Complex and Interactive Data VisualizationJiajun Zhang, Jianke Zhang, Zeyu Cui, Jiaxi Yang 等ICML 2026
- Locus: Agentic Predicate Synthesis for Directed FuzzingJie Zhu, Chihao Shen, Ziyang Li, Jiahao Yu 等ICSE 2026
它引用的 Paper18
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- SWE-bench: Can Language Models Resolve Real-world Github Issues?Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao 等ICLR 2024 · 2,082 次引用
- Gorilla: Large Language Model Connected with Massive APIsShishir G. Patil, Tianjun Zhang, Xin Wang, Joseph E. GonzalezNeurIPS 2024 · 1,715 次引用
- Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formattingMelanie Sclar, Yejin Choi, Yulia Tsvetkov, Alane SuhrICLR 2024 · 682 次引用
相关 Paper
- XCodeEval: An Execution-based Large Scale Multilingual Multitask Benchmark for Code Understanding, Generation, Translation and RetrievalMohammad Abdullah Matin Khan, M. Saiful Bari, Xuan Do Long, Weishi Wang 等ACL 2024 · 21 次引用
- Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification InferenceThanh Le-Cong, Bach Le, Toby MurrayACL 2025
- Flow2Code: Evaluating Large Language Models for Flowchart-based Code Generation CapabilityMengliang He, Jiayi Zeng, Yankai Jiang, Wei Zhang 等ACL Findings 2025 · 5 次引用
- AST-T5: Structure-Aware Pretraining for Code Generation and UnderstandingLinyuan Gong, Mostafa Elhoushi, Alvin CheungICML 2024 · 42 次引用
- LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for CodeNaman Jain, King Han, Alex Gu, Wen-Ding Li 等ICLR 2025
