atlas

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

Self-Infilling Code Generation

ICML 2024 · Large language models › Language, safety and interpretability · approach: Parallel and early-exit decoding · 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.

Proposes self-infilling code generation, which uses the self-infilling ability of FIM-trained code LMs to add interruption and looping mechanisms to left-to-right decoding, improving code generation quality on HumanEval, MBPP, DS-1000, MultiPL-E and GSM8K without training.

Problem

Code language models trained with fill-in-the-middle are used almost exclusively left-to-right at inference, leaving their infilling ability unused for complete code generation, and left-to-right decoding is prone to error propagation and degenerate outputs.

Approach

FIM-trained models can generate a suffix from the prefix alone (self-infilling). The method interrupts left-to-right decoding when token confidence is low, generates a suffix anchored by a suffix prompt, then infills the middle; a looping mechanism alternates self-infilling and left-to-right passes to recurrently refine snippets.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add self-infilling with 2 looping iterations instead of left-to-right decodingCode Llama 7B · HumanEval zero-shotpass@1: 34.1 -> 39.0Helped
Add self-infilling with 2 looping iterations instead of left-to-right decodingCode Llama 7B · MBPP three-shotpass@1: 42.8 -> 44.8Helped
Add self-infilling with 2 looping iterations instead of left-to-right decodingCode Llama 13B · HumanEval zero-shotpass@1: 35.4 -> 40.8Helped
Add self-infilling with 2 looping iterations instead of left-to-right decodingCode Llama 13B · MBPP three-shotpass@1: 47.2 -> 49.0Helped
Disable looping while retaining self-infilling interruption (ablation)Code Llama 7B self-infilling · HumanEval zero-shotpass@1: 34.1 -> 29.9Hurt
Use 1 looping iteration instead of 2 (ablation)Code Llama 7B self-infilling · HumanEval zero-shotpass@1: 39.0 -> 34.1Hurt
Use Vanilla instead of Extended suffix splitting (ablation)Code Llama 7B looping · HumanEvalpass@1: 32.3 -> 37.2Helped
Use Half instead of Extended suffix splitting (ablation)Code Llama 7B looping · HumanEvalpass@1: 32.3 -> 31.7Hurt
Use Vanilla instead of Extended suffix splitting (ablation)Code Llama 7B looping · MBPPpass@1: 43.8 -> 44.6Helped
Use Half instead of Extended suffix splitting (ablation)Code Llama 7B looping · MBPPpass@1: 43.8 -> 43.8No clear effect
Increase the interruption threshold from 0.1 to 0.25 (ablation)Code Llama 7B self-infilling · HumanEvaldegenerate output rate: nearly 13% -> 2.4%Helped
Apply self-infilling to instruction-tuned modelsCode Llama Instruct and DeepSeek-Coder Instruct · HumanEval and HumanEval+pass@1Mixed

Surprising findings

Limitations

Experimental setup

Datasets: HumanEval MBPP DS-1000 MultiPL-E GSM8K HumanEval+

Benchmarks: HumanEval MBPP DS-1000 MultiPL-E GSM8K HumanEval+

Metrics: pass@1 pass@10 pass@100 degeneracy rate

Baselines: Left-to-right decoding Insertion (DS-1000 infilling format) Code Llama - Instruct Code Llama - Python GPT-3.5 Turbo GPT-4 Turbo

Builds on: fill-in-the-middle nucleus sampling Gibbs sampling

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