PreprintCited by 217Software Engineering ResearchTopic ModelingTeaching and Learning Programming

InCoder: A Generative Model for Code Infilling and Synthesis

Open access
Fried, Daniel, Aghajanyan, Armen, Lin, Jessy, Wang, Sida, Wallace, Eric, Shi, Freda, Zhong, Ruiqi, Yih, Wen-tau +2 more·2022·arXiv

Abstract

Code is seldom written in a single left-to-right pass and is instead repeatedly edited and refined. We introduce InCoder, a unified generative model that can perform program synthesis (via left-to-right generation) as well as editing (via infilling). InCoder is trained to generate code files from a large corpus of permissively licensed code, where regions of code have been randomly masked and moved to the end of each file, allowing code infilling with bidirectional context. Our model is the first generative model that is able to directly perform zero-shot code infilling, which we evaluate on challenging tasks such as type inference, comment generation, and variable re-naming. We find that the ability to condition on bidirectional context substantially improves performance on these tasks, while still performing comparably on standard program synthesis benchmarks in comparison to left-to-right only models pretrained at similar scale. The InCoder models and code are publicly released. https://sites.google.com/view/incoder-code-models

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

DataCite · 10.48550/arxiv.2204.05999

Cites

71 of 72 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • They lack many models capable of generating code.

    “However, we lack many models capable of generating code (Black et al., 2021;Fried et al., 2022;Black et al., 2022;Wang & Komatsuzaki, 2021;Biderman et al., 2023b).”

    From OctoPack: Instruction Tuning Code Large Language Models (2023) · cites this paper as Fried et al., 2022

    The Related Work section (p. 9) describes a “flurry of recent work” on code language models and identifies models that generate programs. InCoder itself is a code-generating model (Abstract, p. 1), but the paper does not support the cited sentence’s claim that such models are scarce. (LLM, conf=0.83)

    Checked by a reasoning model — may be wrong.

    Experimental — accuracy not yet measured
  • The study used Pass@1 as the evaluation metric for all RQs rather than code similarity scores, as it is more appropriate for problem-solving and code generation tasks.

    “Following existing works evaluating LLM code generation [12, 23] and common evaluation practices over LiveCodeBench and DevEval, we use Pass@1 as the evaluation metric for all RQs rather than code similarity scores, as it is more appropriate for problem-solving and code generation tasks.”

    From What Makes In-Context Examples Effective for Code Generation? (2026) · cites this paper as [23]

    Section C.6 (p. 20) confirms that InCoder used pass@1 to evaluate code synthesis on HumanEval and MBPP, supporting the citation as a precedent for that metric. It does not say pass@1 is more appropriate than code-similarity scores: it also reports pass@10 and pass@100 for HumanEval, while Table 1 (p. 5) reports exact match alongside pass rate. The citing authors’ choice to use pass@1 for all their research questions is their own methodology, not a finding attributed to InCoder. (LLM, conf=0.87)

    Experimental — accuracy not yet measured
  • Longer contexts enable moving forward to smart context composition techniques, including fill-in-the-middle and retrieval-augmented generation methods.

    “Longer contexts enable us to move forward to”

    From Context Composing for Full Line Code Completion (2024) · cites this paper as [3]

    Section 2.2 (p. 3) describes code infilling using left and right context, and Section 4.1 (p. 5) reports larger gains as more right-sided context becomes available. Section 7 (p. 9) identifies a similar fill-in-the-middle objective. The paper does not establish that longer context windows enable these techniques, and the passages found do not address retrieval-augmented generation. (LLM, conf=0.85)

    Experimental — accuracy not yet measured
  • Pretrained large language models have demonstrated strong capabilities at solving a wide range of programming tasks.

    “Simultaneously, pretrained large language models (LLMs) have demonstrated strong capabilities at solving a wide range of programming tasks.”

    From Learning Performance-Improving Code Edits (2023) · cites this paper as Fried et al., 2022

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

9 of the 81 references couldn’t be matched to a known paper.

Research works printed but not linked: 4

  1. Uri Alon, Roy Sadaka, Omer Levy, and Eran Yahav. Structural language models of code. In ICML , pp. 245-256. PMLR, 2020.
  2. Aditya Kanade, Petros Maniatis, Gogul Balakrishnan, and Kensen Shi. Learning and evaluating contextual embedding of source code. In ICML , 2020.
  3. Lewis Tunstall, Leandro von Werra, and Thomas Wolf. Natural Language Processing with Transformers . O'Reilly Media, Inc., 2022.
  4. John M Zelle and Raymond J Mooney. Learning to parse database queries using inductive logic programming. In AAAI , 1996.

Cited by

Sorted by citations

Authors
Fried, D., Aghajanyan, A., Lin, J., Wang, S., Wallace, E., Shi, F., Zhong, R., Yih, W.-T., Zettlemoyer, L., & Lewis, M.
Affiliations
  • Meta (United States) (US)
  • Carnegie Mellon University (US)
Venue
arXiv
Publisher
arXiv
Published
2022
ISSN
2331-8422 (ISSN-L)
OpenAlex
W4224060952
Cited by
187
References
81
Citations by year
2026: 4 · 2025: 52 · 2024: 68 · 2023: 59 · 2022: 4
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
Keywords
program synthesis, bidirectional context, code editing, type inference, comment generation, variable renaming

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review