ArXiv: 2305.06161
🎯 Pitch
StarCoder’s 15B-parameter open-access code model rivals closed-source systems like OpenAI’s code-cushman-001 while pioneering built-in privacy safeguards—a PII redaction pipeline and an attribution tool that detects training-set copying. This means you finally get competitive, safe code generation without surrendering transparency or control.
1. Executive Summary
This paper introduces StarCoder and StarCoderBase, 15.5B-parameter open-access Code LLMs developed by the BigCode consortium that uniquely combine Fill-in-the-Middle infilling capabilities, an 8K-token context length, and fast large-batch inference via Multi-Query Attention — architectural features previously unavailable together in any open code model. Trained on 1 trillion tokens of permissively licensed source code from The Stack v1.2 spanning 86 programming languages, StarCoderBase matches or outperforms OpenAI's closed-access code-cushman-001 across multi-language benchmarks while StarCoder — fine-tuned on an additional 35B Python tokens — achieves a pass@1 of 33.6% on HumanEval and 52.7% on MBPP, substantially exceeding every prior open-access Code LLM including CodeGen-16B-Mono and CodeGeeX-13B. The paper further contributes a robust PII redaction pipeline trained on 22,950 annotated entities and a novel two-stage attribution tool combining Bloom-filter membership checking with BM25 search to help users detect generations copied from the training set, establishing that open-access models can achieve closed-model-competitive performance only when rigorous data governance — permissive licensing, PII scrubbing, and attribution infrastructure — is integrated into the development process.
2. Context and Motivation
The Core Problem: Openness, Transparency, and Performance Gaps in Code LLMs
The fundamental tension this paper addresses is that the strongest code-generating language models are closed-access, while open-access models lag significantly behind in both capabilities and responsible development practices. By late 2022 and early 2023, Code LLMs had demonstrated remarkable utility — GitHub Copilot reported that users relied on it to produce 35% of code for some languages, and Microsoft's Copilot attracted over one million professional developers — but the models powering these tools remained inaccessible for inspection, adaptation, or safety research.
This creates a multi-dimensional problem that the paper unpacks across legal, privacy, scientific, and practical axes:
Legal concerns around training data. The paper opens with a detailed discussion of copyright uncertainty. In both the U.S. and E.U., it remains unsettled whether training machine learning models on publicly available code constitutes fair use. The U.S. fair use doctrine is "most likely when the model generates novel content dissimilar to any copyrighted training data" (Section 1, citing Lemley & Casey, 2020; Levendowski, 2018), but this condition is not guaranteed — and lawsuits had already been filed against GitHub Copilot and Stable Diffusion at the time of writing. Henderson et al. (2023) specifically argued that LLM developers should provide tools to help users ensure outputs comply with copyright law, implying that mere model release is insufficient; the broader ecosystem needs attribution and traceability infrastructure. The paper positions itself as a direct response to this call.
Privacy and data protection obligations. The paper grounds its privacy concerns in concrete regulatory events: Italy temporarily banned ChatGPT and launched a GDPR investigation into OpenAI (Section 1, citing BBC, 2023). Under GDPR, organizations processing personal information must have a valid legal basis, but obtaining explicit consent from every data creator whose code appears in a web-scale training corpus is "difficult at this scale, and it is uncertain whether other legal grounds exist" (Section 1). Moreover, GDPR mandates that individuals be informed about how their data is processed and provided with access controls — rights to inspect, delete, or correct personal data. The paper argues that these obligations require LLM providers to be transparent about their data collection and to build tooling for data inspection, neither of which closed-access providers typically offer.
Scientific opacity and the limits of API access. The paper draws a sharp distinction between open-access models (weights publicly available) and the spectrum of partially-open alternatives. It situates itself within a broader movement in the field:
"Many models are closed-access to varying degrees: from being available only within the organization that developed them to being accessible publicly through a paid API but with many details on their development process hidden." (Section 1)
Even models with released weights vary substantially in openness. LLaMA (Touvron et al., 2023) was released under a non-commercial license restricting distribution. CodeGen-Mono (Nijkamp et al., 2023) did not disclose its proprietary Python fine-tuning dataset. CodeGeeX (Zheng et al., 2023) released model weights but not training data. InCoder (Fried et al., 2022) disclosed only "high-level details about the data collection and filtering process" (Section 2). The paper argues that these partial disclosures, while better than fully closed models, still impede safety research, model inspection, and community-driven improvement.
The paper explicitly connects these concerns to a lineage of open-science efforts: BigScience's BLOOM (Scao et al., 2022), which engaged hundreds of researchers in collaborative development, and EleutherAI's releases of GPT-NeoX, GPT-J, and Pythia alongside their training data. StarCoder positions itself as extending this tradition specifically into the code domain, where no comparably-sized open-access model existed.
The Performance Gap: Prior Open Code LLMs Are Too Small and Too Narrow
Beyond the openness concerns, the paper is motivated by a concrete performance gap that it quantifies through systematic evaluation. The largest fully open Code LLMs prior to StarCoder — SantaCoder (1.1B parameters, trained on <300 GB of code) and PolyCoder (2.7B parameters) — were substantially smaller than closed-access alternatives like OpenAI's code-cushman-001 (12B parameters) and code-davinci-002 (175B parameters). The paper identifies specific shortcomings of these prior models:
SantaCoder (Ben Allal et al., 2023) was the community's prior effort and the immediate predecessor to StarCoder. At 1.1B parameters, it demonstrated that FIM-capable code models could be trained on permissively licensed data, but its small scale fundamentally limited its capabilities — it achieved only 18.0% pass@1 on HumanEval (Table 12). Its context window of 2,048 tokens, while standard at the time, was insufficient for the long code files common in real-world repositories.
CodeGen-16B-Multi and CodeGen-16B-Mono (Nijkamp et al., 2023) were the closest open-access competitors in size, but the paper demonstrates their limitations: CodeGen-Mono achieved 29.3% on HumanEval but relied on a proprietary Python dataset that could not be inspected or reproduced. CodeGen-Multi, trained on disclosed data, reached only 18.3% on HumanEval and showed highly variable multi-language performance — scoring 0% on Ruby and Julia (Table 15). Moreover, neither CodeGen variant supported Fill-in-the-Middle infilling, a capability that the paper argues is essential for practical code completion tools.
CodeGeeX-13B (Zheng et al., 2023) showed stronger multi-language performance (22.9% on HumanEval Python) but, like CodeGen-Mono, lacked transparent training data. It also did not support FIM or an 8K context length.
InCoder (Fried et al., 2022) pioneered the FIM training approach that StarCoder adopts, but at 6B parameters with a non-commercial license and limited disclosure of training data curation, it represented a partial step rather than a complete solution to the openness problem. Its multi-language performance was not competitive with closed models — on the DS-1000 benchmark, InCoder-6B achieved only 7.4% overall compared to code-cushman-001's 18.1% (Table 13).
The paper's assessment of this landscape is implicit but clear: no existing open-access model simultaneously offered (1) competitive performance against closed models, (2) transparent training data with permissive licensing, (3) FIM infilling capabilities, and (4) sufficient context length for real-world code. Each prior model was deficient on at least two of these dimensions.
The Capability Gap in Architectural Features
Beyond raw benchmark scores, the paper is motivated by a specific set of architectural capabilities that were available in closed models but fragmented across open ones:
Fill-in-the-Middle (FIM) was demonstrated by Bavarian et al. (2022) at OpenAI and implemented in InCoder and SantaCoder, but neither of those open models was large enough to serve as a practical code assistant. The paper notes that FIM "opens up the possibility of a variety of tasks that go beyond left-to-right code completion" (Section 6.2.3), including type prediction, docstring generation, and security-relevant code repair — all of which are evaluated in the paper.
Multi-Query Attention (MQA; Shazeer, 2019) enables faster large-batch inference by sharing key and value heads across attention queries, reducing the memory bandwidth bottleneck during autoregressive decoding. Prior open code models used standard multi-head attention, making them slower at serving. The paper's combination of MQA with FlashAttention (Dao et al., 2022) — where they "simply expand the key and value before calling the attention kernel" to make the two techniques compatible (Section 5.4) — was a practical engineering contribution motivated by the need for deployable models, not just benchmark-saturating ones.
8K context length was enabled by FlashAttention's memory efficiency but was unprecedented in open code models (SantaCoder used 2K tokens, InCoder used 2K tokens, CodeGen used 2K tokens). The paper demonstrates through perplexity measurements (Table 21) that the longer context provides substantial benefits — perplexity drops from 2.01 to 1.79 on C++ code and from 2.16 to 2.02 on Ruby when expanding the window from 2K to 8K tokens. This is not merely a benchmark curiosity; real code files, repositories, and issue threads routinely exceed 2K tokens, and a model that cannot attend to full context will make errors that are invisible on curated benchmarks.
The Data Governance Gap: PII and Attribution
A distinct but equally important motivation is the paper's observation that prior open-access code models had not adequately addressed personal data redaction or output attribution. The paper's discussion of PII is not perfunctory — it describes a concrete failure mode: SantaCoder (Ben Allal et al., 2023) used regex-based PII detection that the paper's own evaluation shows had only 3.62% precision on API key detection (Table 8), meaning that the vast majority of detected "keys" were false positives, while genuine secrets likely passed through undetected. This is not a minor implementation detail; it means prior models trained on unredacted GitHub code could potentially memorize and regurgitate API keys, passwords, and personal email addresses.
Similarly, the paper argues that attribution — the ability to trace model outputs back to training data — is an underexplored requirement for responsible deployment. The legal analysis in Section 1, citing Henderson et al. (2023), establishes that fair use protection is strongest when models generate novel content dissimilar to training data. But without attribution tools, neither developers nor users can determine whether a given code generation is novel or memorized. The paper frames this as a gap that the community must address, not just for legal compliance but for scientific understanding — as Mitchell et al. (2022) argued, understanding data is becoming "increasingly recognized and operationalized" as a core LLM development responsibility (Section 9).
How This Paper Positions Itself
The paper's positioning can be understood through the specific choices it makes in contrast to prior work:
On the openness spectrum: StarCoder aims to be more open than any prior large Code LLM. The paper emphasizes that the training data (The Stack v1.2) is publicly available and permissively licensed, the PII redaction pipeline and its training data are released under gated access, the training code is open-sourced, and the model weights are released under an OpenRAIL-M license — a "more commercially viable version" than prior RAIL licenses (Section 1). The paper's extensive appendices (data filtering regular expressions, IP address replacement lists, annotator country lists, the full technical assistant prompt) are themselves a form of transparency claim: the development process is documented at a level of detail that enables reproduction and audit.
On the performance frontier: The paper does not claim to surpass the largest closed models — code-davinci-002 at 175B parameters remains substantially stronger, as Table D.1 shows (e.g., 46.68% vs. 30.35% on Python HumanEval). Instead, it targets a specific competitive threshold: matching or exceeding code-cushman-001, the 12B-parameter model that initially powered GitHub Copilot. This is a strategic choice. code-cushman-001 represents the frontier of practically deployable, cost-effective code models, and matching it with an open-access model demonstrates that the open-source community can build tools competitive with commercial offerings — if it commits to the data curation, infrastructure, and evaluation rigor that the paper exemplifies.
On responsible development: The paper frames its PII redaction and attribution tools not as afterthoughts but as integral components of the model's value proposition. The community governance structure — "priority in decision-making has always yielded to the more responsible option even if this meant introducing limitations that might impact adoption or future research" (Section 10.1), exemplified by the decision to remove and not release a dataset of identified malicious code — is presented as a deliberate tradeoff in favor of safety over capability maximization.
The paper's central thesis, therefore, is that competitive performance, genuine openness, and responsible data practices are not in tension — they can and should be pursued simultaneously in Code LLM development. StarCoder is the evidence for this claim. The alternative — accepting that top-performing models must be closed and opaque — is presented as both scientifically limiting and legally precarious, a position that the paper substantiates through its extensive legal analysis, evaluation rigor, and governance documentation.
3. Technical Approach
This is primarily a systems and data engineering paper whose core idea is that building a state-of-the-art open-access Code LLM requires integrating careful data curation, PII redaction, architectural innovations, and attribution tooling into a unified development pipeline — and that doing so enables open models to match closed-source performance without sacrificing transparency or responsible development practices.
3.1 Reader Orientation
The paper describes the construction of StarCoder and StarCoderBase, two 15.5B-parameter decoder-only Transformer language models that generate code across 86 programming languages, support fill-in-the-middle infilling, and operate on up to 8,192 tokens of context. The system solves the problem of how to build a code-generation model that is simultaneously performant, open, and responsible — achieving closed-model-competitive benchmark scores while releasing all training data, model weights, data curation code, PII redaction pipelines, and attribution infrastructure under permissive or open licenses.
3.2 Big-Picture Architecture (Diagram in Words)
The StarCoder system comprises six major components connected in a linear pipeline with two feedback loops for quality assurance:
-
Data Source Filtering — selects 86 programming languages from The Stack v1.2, plus GitHub issues, Git commits, and Jupyter notebooks, based on volume thresholds and popularity rankings. Applies language-specific heuristic filters (XML detection, alphabetic character ratio, HTML visible-text ratio, JSON/YAML size limits) informed by community visual inspection of 30,000 files.
-
Data Formatting and Transformation — wraps each data source in a standardized template with sentinel tokens (e.g.,
<reponame>,<issue_start>,<commit_before>), applies Fill-in-the-Middle transformations to 50% of code files, and assigns metadata (repository name, filename, star count bucket) that is randomly dropped during training to prevent overfitting. -
PII Redaction Pipeline — detects personally identifiable information using a fine-tuned StarEncoder model trained on 22,950 crowd-sourced annotations across 12,000 files, then replaces detected entities with placeholder tokens (
<NAME>,<EMAIL>,<KEY>,<PASSWORD>) or synthetic private IP addresses. This model runs inference across the entire 815 GB training corpus. -
Deduplication and Weighting — applies MinHash-based near-deduplication with 5-gram shingling and a Jaccard similarity threshold of 0.7 across all programming languages and Jupyter notebooks, then weights data sources proportionally to their post-filtering volume (with JSON, YAML, and CSS capped to 1 GB, 1 GB, and 3 GB respectively to prevent memorization of data-heavy formats).
-
Model Training — trains a 15.5B-parameter decoder-only Transformer with Multi-Query Attention and FlashAttention on 1 trillion tokens (StarCoderBase), then fine-tunes on 35B additional Python tokens (StarCoder), using 3D parallelism across 512 A100 GPUs.
-
Attribution Tools — builds a Bloom-filter-based membership checker (26 GB, ~3% of data size) on 50-character strings and a BM25 search index over the entire training corpus, integrated into a VSCode extension to enable users to trace model outputs back to training data.
Information flows as follows: raw GitHub repositories enter The Stack v1.2 → license filtering retains only permissively licensed code → language selection and heuristic filtering remove low-quality files → PII redaction replaces sensitive entities → near-deduplication removes redundant files → formatted data enters the training loop → trained model weights are released alongside the attribution index and search tools.
3.3 Roadmap for the Deep Dive
-
First, the data selection and filtering pipeline (Section 3, main paper), because the composition and quality of training data is the single largest determinant of model behavior, and the paper's filtering decisions — which languages to include, which heuristics to apply, how to handle Jupyter notebooks and GitHub issues — represent hundreds of person-hours of community inspection and iterative refinement.
-
Second, the data formatting templates and Fill-in-the-Middle procedure (Section 5.1), because these determine what the model learns about the structure of code, commits, issues, and notebooks, and because the sentinel token vocabulary (Table 10) is the interface between data and model.
-
Third, the PII redaction pipeline (Section 4), including the annotation dataset collection, StarEncoder pre-training, Named Entity Recognition fine-tuning, pseudo-labeling, and post-processing, because this is the most novel contribution to responsible AI practice and the component with the greatest potential for false positives and negatives.
-
Fourth, the tokenizer and model architecture (Sections 5.3–5.4), because the combination of Multi-Query Attention with FlashAttention and learned absolute positional embeddings is what enables the 8K context length and fast inference that distinguish StarCoder from prior open models.
-
Fifth, the training configuration and distributed setup (Sections 5.2, 5.5–5.6), because the 3D parallelism strategy, BF16 training, and decontamination procedure represent practical engineering decisions that directly affect reproducibility and stability.
-
Sixth, the attribution tools (Section 9), because the Bloom filter membership checker and BM25 search index operationalize the paper's commitment to data transparency and provide a model for future responsible releases.
3.4 Detailed, Sentence-Based Technical Breakdown
Data Source Selection and Language Filtering
The paper constructs the training corpus exclusively from The Stack v1.2 (Kocetkov et al., 2022), a dataset containing 6.4 TB of permissively licensed source code in 384 programming languages, plus 54 GB of GitHub issues and repository-level metadata. The restriction to permissively licensed code (MIT, Apache, BSD, and similar licenses that permit reuse) is the foundational data governance decision — it means that every file used for training has a license that explicitly allows copying and modification, reducing (though not eliminating) copyright concerns.
From the 358 programming languages available in The Stack, the paper selects 86 languages using a three-pronged criterion (Section 3.1):
-
Volume threshold: any language with more than 500 MB of data is included, ensuring that the model has sufficient examples to learn syntax and idioms.
-
Popularity rankings: languages ranked in the top 50 on either Githut 2.0 or the December 2022 TIOBE Index are included, capturing languages that developers actually use regardless of their representation in The Stack.
-
Dialect inclusion: dialects of already-selected languages are included — for example, Racket and Scheme are included because Lisp (their parent language family) is selected. This ensures coverage of language ecosystems rather than isolated points.
The paper explicitly excludes configuration languages (Nix, Puppet), languages no longer actively supported (ActionScript), and — due to data quality issues — D (fewer than 2 MB of data after language misclassification) and Swift (excluded "due to human error," Section 3.1). The exclusion of Swift is acknowledged as an oversight, and the paper later demonstrates that StarCoder nonetheless performs well on Swift benchmarks (22.74% on HumanEval Swift, Table 15), indicating transfer learning from related languages.
Community visual inspection: this is a distinctive element of the paper's methodology that merits careful attention. Rather than relying solely on automated filters, the paper describes a community-driven quality assessment: 18 annotators from the BigCode community visually inspected 300 programming language extensions, examining 50–100 files per extension, to answer two questions for each extension: (1) does the data appear to be "normal code written by humans, as opposed to text, data, or a single long line of autogenerated code"? (2) should the default alpha-numeric filter (requiring >25% alphabetic characters) and long-line filter (requiring lines <1,000 characters) be applied?
The outcome of this inspection (documented in a publicly accessible Google Sheet) was the exclusion of 36 file extensions and the removal of the long-line filter for 27 extensions where legitimate code routinely exceeded 1,000 characters per line. This manual step is expensive and time-consuming but addresses a fundamental challenge in code dataset curation: automated heuristics inevitably have false positives, and only human judgment can determine whether a file of seemingly-structured text in a .sld extension is actually XML (leading to the XML filter described below) or legitimate source code.
Heuristic Filters Applied to Code Files
The paper describes five categories of automated filters applied after the community inspection:
XML filter: during the visual inspection, annotators observed that certain extensions — notably .sld — contained more than 50% XML files rather than source code in the expected language. The paper implements a simple but effective heuristic: "checking for the presence of <?xml version= within the first 100 characters of the file" (Section 3.1). Files matching this pattern are removed. The filter is applied to all programming languages except XSLT, which legitimately uses XML syntax. The key design choice is the 100-character window — XML declarations must appear at the very start of valid XML files, so checking only the first 100 characters minimizes false positives while catching virtually all XML files. The paper reports that this filter "proved to be effective and produced few false positives."
Alpha filter: this filter removes files where fewer than 25% of characters are alphabetic (A-Z, a-z), targeting data files that store large tensors, binary dumps, or numerical tables rather than source code. The paper explicitly notes that the threshold was not applied uniformly — 25 extensions with the highest number of detections were manually verified to determine whether the filter was appropriate. This is important because languages like Assembly have legitimately low alphabetic character ratios (dominated by mnemonics and hex addresses), and blindly applying the alpha filter would remove valid code. The manual verification step ensures that the filter targets only languages where low alphabetic ratios genuinely indicate non-code data.
HTML filter: a custom filter for HTML files addresses the problem of "excessive HTML boilerplate and links" (Section 3.1). The filter computes the ratio of visible text to total HTML code and retains only files where visible text constitutes at least 20% of the code and has a minimum length of 100 characters. This removes pages that are mostly navigation, advertisements, or auto-generated wrappers while preserving documentation, tutorials, and content-rich pages. The 20% threshold and 100-character minimum are empirical choices that the paper does not ablate, but they represent a balance between removing boilerplate (which would waste training compute on non-semantic content) and preserving legitimate HTML documentation.
JSON and YAML filters: these are the most aggressive volume-reduction filters because JSON and YAML files "are naturally more data-heavy than other languages" (Section 3.1). For YAML, the paper retains only files with: 50–5,000 characters total, average line length <100 characters, maximum line length <1,000 characters, and >50% alphabetic characters. These constraints remove "around 20% of the files and 90% of the volume." For JSON, the constraints are 50–5,000 characters and >50% alphabetic characters, removing "around 70% of the files and 98% of the volume."
The dramatic volume reduction (90% for YAML, 98% for JSON) reveals the paper's underlying philosophy: the model should learn the structure and syntax of these data formats, not memorize the specific data they contain. JSON configuration files, package manifests, and API responses are structurally repetitive — the model can learn JSON syntax from a small, curated subset without needing the full 338 GB of JSON data present after deduplication. The 1 GB cap applied during weighting (Section 3.6) further reinforces this principle.
Jupyter Notebook Processing
The paper transforms Jupyter notebooks into two distinct datasets with different structures and intended uses (Section 3.2):
Jupyter – scripts: using Jupytext (an actively maintained open-source library supporting 31 programming languages), notebooks are converted to executable scripts by extracting code cells in order and discarding Markdown text and outputs. The conversion requires knowing each notebook's programming language, which is extracted from notebook metadata. For the approximately 30,000 notebooks lacking language metadata, the paper applies Guesslang, a machine-learning-based language identification library, with a probability threshold ≥0.5. This threshold is relatively permissive — it accepts predictions where the classifier is at least 50% confident — and reduces the number of unidentified notebooks to 6,400 (from 30,000), meaning approximately 23,600 notebooks are successfully classified.
The resulting dataset contains 1,432,992 scripts, with Python dominating at 97.17% (Table 3). The paper evaluates language coverage by manually inspecting 100 randomly selected files, confirming that all programming languages in the dataset are represented — a lightweight quality check that validates the conversion pipeline.
Jupyter – structured: this is a more sophisticated transformation that preserves the pedagogical structure of notebooks. The paper first filters out non-Python notebooks using metadata language tags, then merges consecutive Markdown blocks and consecutive code blocks into larger blocks. The result is a sequence of "code-text pairs in temporal order grouped by each notebook" (Section 3.2). Each pair consists of the Markdown text immediately preceding a code block and the Python code itself, forming "a natural instruction pair." Output cells are included if non-empty (otherwise marked with a special <empty_output> token), and when consecutive code blocks have multiple output cells, only the output of the last block is retained.
The structured format produces 1,045,605 notebooks, each containing chains of instruction-code-output triples. This dataset serves a dual purpose: during training, it teaches the model to generate code from natural language descriptions (because the Markdown often describes what the subsequent code does), and during inference, it enables the model to act as a basic interpreter by predicting code outputs (Section E.1 demonstrates this capability with examples like predicting the result of print(is_prime(3))).
GitHub Issues Processing
The paper processes GitHub issues through a four-stage filtering pipeline (Section 3.3), motivated by the observation that raw issue data contains substantial automated content, bot-generated noise, and non-English text that would degrade training quality:
Stage 1 — Automated text removal: a set of regular expressions (listed in Appendix A) removes auto-generated text produced when users reply to issues via email. The regexes target patterns like "On [date] notifications@github.com wrote:" and "Reply to this email directly, view it on GitHub", which are appended by GitHub's email interface and contain no useful signal. The paper also deletes issues with messages shorter than 200 characters and truncates long comments to a maximum of 100 lines while retaining the last 20 lines. The truncation strategy — keeping the end of long comments — is deliberate: issue discussions often build toward conclusions, and the most recent 20 lines are most likely to contain resolutions, decisions, or final code snippets. This step removes 18% of the total volume.
Stage 2 — Bot removal: the paper identifies bot-authored comments using three methods applied to the author's username: (a) an explicit blocklist of known bot usernames ("Apache-HBase", "CLAassistant", "codecov-io", "coveralls", "danger-public", and others listed in Appendix A); (b) substring matching against bot keywords ("[bot]", "botmanager", "jenkins", "travis", etc.); and (c) suffix matching against bot-like patterns ("-automaton", "-automation", "-benchmark", "-build", "-ci", "bot", etc.). This multi-pronged approach recognizes that bot accounts follow naming conventions that are predictable but not perfectly uniform. The step eliminates 17% of total events and empties 14.7% of issues entirely.
Stage 3 — Quality filtering by engagement: the paper uses conversation participant count as a quality signal. Issues with two or more distinct users are always retained, under the assumption that multi-party discussions contain richer technical content than monologues. Single-user issues are retained only if the total comment text is less than 7,000 characters (the 96th percentile of single-user issue length) AND the issue contains ten or fewer events. Issues exceeding either threshold are removed, as they "tended to be of poor quality or originate from overlooked bots" (Section 3.3). This step removes an additional 14% of issues.
Stage 4 — Language filtering: a fasttext language identification model removes non-English issues. The paper states this "was necessary to enable accurate redaction of names using a PII detection model" (Section 3.3), because the PII model (described in Section 4) was trained primarily on English text and would produce unreliable results on other languages. This is a pragmatic tradeoff: the model sacrifices multilingual issue data to ensure PII redaction quality.
Finally, the paper anonymizes usernames in issue conversations by replacing them with participant counters (e.g., the third participant becomes username_2). This anonymization serves both privacy (removing GitHub usernames that could be considered personal data) and generalization (preventing the model from associating specific usernames with specific behaviors).
Git Commits Processing
The Git commit dataset is sourced from BigQuery and "includes only single-file commits of repositories with the same licenses and file extension as used in The Stack" (Section 3.4). The raw dataset is approximately 4 TB, and the paper samples 50% of files before applying heuristic filters listed in Table 4:
- Maximum characters: files exceeding 100K characters are removed (excessively large files are typically auto-generated or data files, not human-authored code).
- Small changes: commits with ≤2 changed lines are subsampled with 50% probability, reducing the prevalence of trivial typo fixes and single-line edits that provide limited learning signal.
- Long-range refactorings: commits spanning ≥200 changed lines are subsampled with 10% probability, reducing the dominance of large mechanical refactorings (variable renames, formatting changes) that are less informative about semantic code transformations.
- Empty commit message: commits with empty subjects are removed, as the commit message is the primary signal connecting the code change to its intent.
- Automatic commits: commits whose messages contain or equal stop words associated with automated processes (e.g., "auto-merge", "version bump") are removed.
- Hash messages: commits with a whitespace-separated words-to-characters ratio >20 are removed, targeting commits where the message is dominated by hashes or machine-generated tokens rather than human-readable text.
- Data files: data formats (JSON, YAML, XML, HTML) are subsampled with 50% probability, consistent with the principle that the model should learn code changes, not data mutations.
A particularly important design choice is the windowed context strategy: to "avoid spending too much compute budget on learning to copy the file content" (Section 3.4), the paper uses the full file only 20% of the time. For the remaining 80%, it samples a window between 0 and 32 lines around the first and last changed line. This forces the model to learn the relationship between commit messages and localized code changes, rather than memorizing large surrounding context that is unchanged. The resulting dataset is 64 GB.
This windowing strategy has a subtle but powerful implication for what the model learns: by showing the model a focused view of the changed region plus a small surrounding context, the training signal emphasizes what changed and why, rather than what the entire file looks like. During inference, this enables the commit template use case demonstrated in Appendix E.1, where the model can modify a function signature given a natural language instruction like "add type hints to function."
Data Deduplication
The paper applies near-deduplication to "all programming languages and the Jupyter notebooks" using the pipeline from Ben Allal et al. (2023) (Section 3.5). The procedure operates in two stages:
-
MinHash computation (Broder, 2000): each source code file is decomposed into its constituent 5-grams (consecutive sequences of 5 tokens), and a set of MinHash signatures is computed that compactly represents the file's content. MinHash has the property that the probability of two files sharing a hash value equals their Jaccard similarity — the size of the intersection of their 5-gram sets divided by the size of the union.
-
Locality-Sensitive Hashing (LSH): files with similar MinHash signatures are mapped to the same bucket using LSH, which partitions the signature space so that similar files collide with high probability. Files within the same bucket are compared, and near-duplicates (those with Jaccard similarity ≥ 0.7) are identified and removed, keeping one representative copy.
The Jaccard threshold of 0.7 means that two files sharing 70% of their 5-grams are considered duplicates. This threshold is high enough to avoid removing files that share common boilerplate (license headers, import statements) but low enough to catch copy-pasted code with minor modifications. The choice of 5-grams is standard in code deduplication — shorter n-grams (3-grams) would produce too many false positives from shared language keywords, while longer n-grams (7-grams) would miss near-duplicates with small edits.
The paper explicitly notes that Git commits and GitHub issues were not deduplicated — commits "due to time constraints" and issues because duplicates were "deemed... unlikely" (Section 3.5). This is a pragmatic concession to computational budget; running MinHash+LDA on the full 4 TB of commit data would have been expensive, and the paper judged the expected benefit to be low.
Data Weighting and Distribution
The paper makes a deliberate decision to "follow the natural distribution of data during training and sample data sources proportionally to their volume" (Section 3.6), with three exceptions:
- JSON: capped at 1 GB (from 5.62 GB after filtering, Table 1)
- YAML: capped at 1 GB (from 3.76 GB after filtering, Table 1)
- CSS: capped at 3 GB (from 11.93 GB after filtering, Table 1)
The rationale for these caps is explicit: "we only want the LLM to learn the data format without wasting compute resources on memorizing the data in such files" (Section 3.6). For JSON and YAML, the caps reduce their effective volume by 82% and 73% respectively; for CSS, by 75%.
The paper provides a principled justification for not up-sampling or down-sampling other programming languages: "the largest amount of available data comes from popular programming languages and would, therefore, benefit a larger group of end-users" and "several high-resource programming languages, such as C, C++, C#, Java, Javascript, Python, and PHP, had a similar amount of data ranging from 44–87 GB" (Section 3.6). This is a utilitarian argument: the natural distribution already favors the languages that most developers use, and artificially boosting low-resource languages would come at the expense of performance on the languages that matter most to the user base.
Tables 1 and 2 provide the complete per-language breakdown after deduplication and after filtering. The largest languages by volume are Java (86.94 GB, 11.34% of total), JavaScript (64.71 GB, 8.44%), PHP (60.89 GB, 7.94%), Python (60.40 GB, 7.88%), Markdown (74.93 GB, 9.77%), and C (53.89 GB, 7.03%). GitHub issues contribute 54.40 GB (7.09%) and Git commits contribute 32.00 GB (4.17%), while Jupyter notebooks contribute 13.12 GB (1.71%). The total training corpus after all filtering is 799.37 GB (815.68 GB before weighting adjustments).
Data Formatting and Fill-in-the-Middle
The paper wraps each data source in a standardized template using sentinel tokens (Section 5.1, Table 10). These tokens serve as structured metadata that the model can learn to interpret and generate, enabling the controlled prompting demonstrated in Appendix E. The templates are:
Code files:
<reponame>reponame<filename>filename<gh_stars>stars\ncode<|endoftext|>
The repository name, filename, and star count are each independently dropped with probability 0.2 during training, meaning that in expectation, 48.8% of training examples have all three metadata fields, 38.4% have two, 11.2% have one, and 1.6% have none. This random dropout ensures the model can operate both with and without metadata at inference time — critical for practical use, since an IDE might provide filename context but not repository stars.
GitHub stars are not provided as exact integers but are bucketed into five categories: 0, 1–10, 10–100, 100–1000, and 1000+. This bucketing prevents the model from overfitting on exact star counts (which are a noisy signal of code quality) while preserving the broad popularity signal.
Fill-in-the-Middle transformation: the paper applies FIM at the character level (not the token level) to source code files with a FIM rate of 0.5, meaning that half of all code training examples are presented in FIM format and half in standard left-to-right format. The FIM procedure splits a code file into three parts — a prefix, a middle (the part to be predicted), and a suffix — and rearranges them using sentinel tokens so the model learns to generate the middle given the prefix and suffix.
The paper uses two FIM modes with equal probability (PSM with probability 0.5, SPMv2 with probability 0.5), following the recommendations from Bavarian et al. (2022). In PSM mode, the input is structured as <fim_prefix>prefix<fim_suffix>suffix<fim_middle> and the model generates the middle. In SPMv2 mode, the input is <fim_prefix>prefix<fim_suffix>suffix<fim_middle> with the suffix preceding the middle. Training on both modes ensures the model can handle different FIM input formats that downstream applications might use.
The FIM rate of 0.5 is a crucial hyperparameter: if FIM were applied to 100% of examples, the model would lose the ability to do standard left-to-right generation; if applied to 0%, it would lose infilling capability. The 50% split ensures both capabilities are preserved.
GitHub issues:
<issue_start>Title: title\nusername_0:comment0<issue_comment>username_1:comment1... <issue_closed (optional)><|endoftext|>
Issues are structured as a title followed by a sequence of comments, each prefixed by an anonymized speaker identifier (e.g., username_0 for the first participant). The speaker IDs use a counter within the conversation, so the model can learn turn-taking dynamics without memorizing specific usernames. The optional <issue_closed> token indicates whether the issue was resolved.
Jupyter – structured:
<jupyter_start><jupyter_text>text0<jupyter_code>code0<jupyter_output>output0<jupyter_text>... <|endoftext|>
The structured format preserves the alternating sequence of text cells, code cells, and outputs that characterizes Jupyter notebooks. The <empty_output> token is used when a code cell produces no output, distinguishing "this cell ran and produced nothing" from "this cell was not executed." This distinction matters because in real notebooks, code cells without output are common (e.g., import statements, function definitions), and the model should learn that this is normal rather than anomalous.
Git commits:
<commit_before>code_before<commit_msg>message<commit_after>code_after<|endoftext|>
Commits are structured as the code before the change, the commit message describing the change, and the code after the change. As discussed above, only 20% of training examples use the full file; 80% use a windowed view around the changed lines.
This template system is the paper's principal answer to the question "how do you teach a single model to handle code completion, issue discussion, notebook execution, and commit generation?" Rather than training separate models or using multi-task objectives, the paper embeds the task structure directly in the training data through sentinel tokens, allowing a single autoregressive language modeling objective to learn all tasks simultaneously. During inference, users can elicit specific behaviors by providing the appropriate template prefix (e.g., starting with <commit_before> to trigger commit message generation).
PII Data Collection and Annotation
The PII redaction pipeline is the most extensively documented component of the paper's technical approach, reflecting its importance to the responsible release claim. The pipeline begins with a data collection effort of unusual scale and transparency (Section 4.1):
Annotation workforce: 1,399 crowd-workers from 35 countries (listed in Appendix B, Table B.1) were engaged through the Toloka platform. On average, participants completed 206 tasks, earned approximately $27, and worked 3.1 hours.
Compensation methodology: the paper established an hourly pay rate of 16.50) and adjusting for purchasing power parity (PPP) in each country. This means workers in countries with lower costs of living received an effective wage equivalent to $16.50/hour in U.S. purchasing power. The paper explicitly limits annotation eligibility to countries where this PPP-adjusted rate meets or exceeds the equivalent of the U.S. minimum wage — a practice designed to ensure fair compensation without exploiting international wage differentials. Out of 1,399 workers, 695 filled a quality survey, and 519 completed it; the average score for "would you like to contribute to another project like this?" was 4.92 out of 5.
Dataset composition: the annotated dataset comprises 12,000 files, each containing approximately 50 lines of code written in 31 programming languages (Figure 1 shows the distribution, with Python, JavaScript, Java, and C++ dominating). To increase representation of rare PII types like API keys and IP addresses, 7,100 files were pre-filtered using the detect-secrets tool with all default plugins activated, plus regular expressions from Ben Allal et al. (2023) for detecting emails, IPv4, and IPv6 addresses. The remaining 5,100 files were randomly selected without pre-filtering to avoid biasing the annotation toward the detection tools' strengths.
This split-sampling strategy is a deliberate methodological choice: pre-filtering ensures the dataset contains enough examples of rare but important PII types (API keys are orders of magnitude less common than email addresses in source code), while random sampling ensures the model is not trained exclusively on examples that are easy for regexes to detect.
PII categorization: annotators distinguished between PII based on context:
| Category | Description | Examples |
|---|---|---|
| PII in license headers | Names and emails voluntarily provided by authors for attribution | NAME_LICENSE, EMAIL_LICENSE |
| PII as placeholders | Example values that are not real secrets | EMAIL_EXAMPLE, NAME_EXAMPLE |
| Confidential PII | Actual sensitive data requiring redaction | EMAIL, NAME, KEY, PASSWORD, IP_ADDRESS, USERNAME |
The paper initially planned to use these categories to selectively redact only confidential PII while preserving license headers and placeholders, but found that the model's "performance in distinguishing them" was poor (Section 4.3), so all categories were merged into their parent types for the final detection model.
Annotation quality: the paper manually inspected 300 files to compute precision and recall for each PII type (Table 5). The results reveal both strengths and weaknesses:
- Emails: 99% recall, 97% precision — near-perfect, as expected for a highly regular pattern
- IP addresses: 85% recall, 97% precision — good but with some missed edge cases
- Names: 89% recall, 94% precision — strong for an inherently ambiguous category
- Keys: 91% recall, 78% precision — high recall but significant false positives (one in five detected "keys" is not actually a key)
- Passwords: 91% recall, 86% precision — similar pattern to keys
- IDs: 53% recall, 51% precision — essentially random, leading to the decision to "exclude this category from the PII detection model training"
- Usernames: 74% recall, 86% precision — moderate performance
The ID category's failure is instructive: secret IDs (API tokens, database identifiers, session keys) are structurally diverse and lack the regular patterns that make emails and IP addresses easy to detect. The annotators could not consistently distinguish secret IDs from non-secret identifiers (variable names, class IDs, database primary keys), producing both many false positives (flagging non-secrets as secrets) and false negatives (missing actual secrets). The paper's decision to exclude this category is pragmatic but acknowledges a genuine limitation: the redaction pipeline cannot detect certain types of sensitive identifiers.
The dataset contained 22,950 total PII entity annotations across all categories.
StarEncoder Pre-training
Before training the PII detection model, the paper pre-trains a 125M-parameter encoder-only Transformer called StarEncoder (Section 4.2). The motivation is that a randomly initialized encoder fine-tuned on only 7,878 training examples would not have sufficient linguistic and code knowledge to generalize well; pre-training on a large corpus provides the foundational understanding of code syntax and semantics that enables accurate PII detection.
Architecture: StarEncoder uses the standard BERT architecture (Devlin et al., 2019) with the hyperparameters in Table 6: 12 hidden layers, 768-dimensional hidden states, 3,072-dimensional intermediate FFN layers, 12 attention heads (multi-head, not multi-query), and a maximum sequence length of 1,024 tokens.
Pre-training objectives: the paper uses the two standard BERT objectives:
- Masked Language Modeling (MLM): 15% of tokens in the input are independently masked, and the model must predict the original tokens from context. This teaches bidirectional representations of code.
- Next Sentence Prediction (NSP): pairs of code snippets are sampled either from the same source file or different documents, and the model must predict whether they are adjacent. The snippets are formatted as
[CLS] Snippet-1 [SEP] Snippet-2, and a linear classifier on the[CLS]token representation produces the binary prediction.
Training configuration: the model is trained for 100,000 steps with a global batch size of 4,096 sequences of maximum length 1,024, observing approximately 400B tokens. Training takes "roughly two days using 64 NVIDIA A100 GPUs." This is a modest compute investment relative to the main model training (512 GPUs for weeks), reflecting StarEncoder's role as a specialized tool rather than a general-purpose model.
PII Detection Model Training
The PII detection model is StarEncoder fine-tuned for token-level Named Entity Recognition (Section 4.3). A linear classification head is added on top of the encoder, mapping each token's hidden representation to 6 output classes: NAME, EMAIL, KEY, PASSWORD, IP_ADDRESS, and USERNAME. The ID category is excluded due to low annotation quality, and the sub-categories (LICENSE, EXAMPLE) are merged into their parent types.
Training data split: the annotated dataset is split into 7,878 training examples and 4,000 test examples, "ensuring that both splits have a balanced representation of the different PII types" (Table 7). The label distribution is highly imbalanced — EMAIL has 4,721 training instances while KEY has only 171 — reflecting the natural distribution of PII in code. This imbalance explains why the baseline model's performance on keys (F1: 56.66%) and usernames (F1: 59.39%) is substantially lower than on emails (F1: 96.01%) and IP addresses (F1: 91.61%).
Pseudo-labeling: to improve performance on the underrepresented KEY and PASSWORD categories, the paper applies pseudo-labeling (Lee, 2013). The procedure is:
- Train an ensemble of two encoder models on the existing labeled data.
- Use the ensemble to predict PII labels on 18,000 unlabeled files.
- Compute the average probability logits across the ensemble for each predicted entity.
- Filter predictions using a confidence threshold: minimum 0.5 for all entities except names and usernames (threshold 0.6).
- Apply an additional filter for keys and passwords: retain only entities where a trigger word (key, auth, pwd, or similar) appears within the preceding 100 characters.
- Train the model on this pseudo-labeled dataset before fine-tuning on the original annotated data.
The trigger-word filter for keys and passwords is a form of domain knowledge injection: API keys and passwords in source code are almost always assigned to variables whose names contain indicative substrings (e.g., API_KEY = "sk-...", DB_PASSWORD = "...", auth_token = "..."). By requiring a trigger word within 100 characters, the filter dramatically reduces false positives — strings that look like keys but appear in contexts where keys don't belong — at the cost of potentially missing keys stored in generically-named variables.
The results (Tables 8 and 9) show that pseudo-labeling improves performance on all categories except usernames:
- Email: 96.01% → 98.15% F1
- IP Address: 91.61% → 91.94% F1 (marginal improvement)
- Key: 56.66% → 70.41% F1 (substantial improvement, primarily from recall: 53.38% → 80.81%)
- Name: 89.19% → 91.59% F1
- Password: 73.39% → 81.57% F1
- Username: 59.39% → 61.49% F1 (negligible improvement)
The dramatic improvement on keys (recall nearly doubling) is particularly important: API keys are among the most sensitive PII types, and missing 47% of them (baseline recall of 53.38%) would leave substantial sensitive data in the training corpus. The pseudo-labeled model catches 81% of keys, substantially reducing this risk.
Comparison against regex baseline: the paper compares the NER model against the regular expressions from Ben Allal et al. (2023), which support email, IP address, and key detection (Table 8). The results reveal a critical finding:
- For keys, the regex approach has precision of only 3.62% — meaning 96 out of every 100 detected "keys" are false positives — while achieving recall of 49.15%. This implies the detect-secrets tool generates an enormous number of false positives, "especially in specific programming languages like Go and C-sharp that weren't well represented in the regex evaluation." The NER model with pseudo-labels achieves 62.38% precision and 80.81% recall — still imperfect, but dramatically better.
- For emails and IP addresses, the regex approach is competitive (96.83% F1 for emails, 78.65% F1 for IP addresses), but the NER model still outperforms it.
This comparison justifies the substantial investment in the PII annotation and model training pipeline: regex-based approaches are fundamentally limited for PII types without regular structure (names, usernames, keys) and have unacceptably high false positive rates for keys, which would lead to either excessive redaction (destroying legitimate code) or insufficient redaction (leaving secrets exposed).
Post-processing: after applying the PII detection model, the paper adds several heuristic post-processing steps to reduce false positives:
- Minimum length filtering: secrets with fewer than 4 characters are ignored, under the assumption that genuine API keys, passwords, and names are almost always longer.
- Full name detection: names must contain at least one space, filtering out single-word detections that are more likely to be variable names or identifiers than personal names. This is a deliberate tradeoff — some genuine single-word names will be missed, but the false positive reduction is judged more important.
- Key validation: detected keys with fewer than 9 characters are ignored, and a "gibberish-detector" is used to filter out keys that are not sufficiently random-looking. The gibberish detector likely uses character-level entropy or n-gram statistics to distinguish structured strings from random tokens.
- IP address validation: the Python
ipaddressmodule validates that detected IPs are syntactically valid; private (non-Internet-facing) IPs and addresses from popular DNS servers are ignored, using the same list as Ben Allal et al. (2023).
PII replacement: detected entities are replaced with sentinel tokens:
<NAME>,<EMAIL>,<KEY>,<PASSWORD>for the respective types- For IP addresses: randomly selected from 5 synthetic private IP addresses of the same type (IPv4 or IPv6), listed in Appendix B. The replacement IPs are all from private address ranges (e.g.,
172.16.31.10,fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b), ensuring they cannot route to real hosts even if the model memorizes and regenerates them.
GitHub issues-specific handling: for issues, the PII model is used only for name redaction (keys, IPs, and emails were already handled by regex). Usernames are anonymized by replacing them with participant counters (e.g., username_0, username_1), and these pseudonyms are prepended to each comment to preserve speaker identity. The paper explicitly notes that mentions of non-participating users "are not anonymized" — a privacy-utility tradeoff that preserves conversational context at the cost of potentially leaking usernames of people mentioned but not participating in the discussion.
Computational cost: running PII inference on the full 815 GB training dataset required 800 GPU-hours on NVIDIA A100 80GB GPUs.
Tokenizer Design
The tokenizer follows the same design as SantaCoder (Ben Allal et al., 2023) (Section 5.3). It is a byte-level Byte-Pair Encoding (BPE) tokenizer with a vocabulary size of 49,152 tokens, trained using the Hugging Face Tokenizers library.
The key design choices are:
-
Byte-level BPE: operating at the byte level rather than the Unicode character level means the tokenizer can encode any sequence of bytes, including malformed UTF-8, binary data, and control characters that sometimes appear in source code. This is important for a code model because repositories may contain files in arbitrary encodings, and a tokenizer that fails on unexpected bytes would create training gaps.
-
Digit splitting: the pre-tokenization step includes a digit splitter, meaning that sequences of digits are split into individual tokens. This prevents the vocabulary from being dominated by numeric literals (which would be essentially infinite in variety) and encourages the model to understand numbers as compositional rather than memorized. For example,
12345is tokenized as1 2 3 4 5rather than as a single token. -
GPT-2 regex splitter: the pre-tokenizer uses the same regex pattern as GPT-2, which splits on whitespace and punctuation in a standardized way. This ensures compatibility with existing codebases and established tokenization conventions.
-
Sentinel tokens: the 49,152-token vocabulary includes all sentinel tokens listed in Table 10 (e.g.,
<|endoftext|>,<fim_prefix>,<reponame>, etc.), ensuring they have dedicated token IDs and do not compete with natural text tokens for vocabulary space.
The vocabulary size of 49,152 is a power-of-2 multiple (3 × 2^14), chosen for efficient GPU memory alignment and because it provides sufficient capacity for code-specific tokens (operators, keywords, common identifiers) while maintaining reasonable model embedding size.
Model Architecture
StarCoder uses a decoder-only Transformer with 15.5B parameters (Section 5.4, Table 11). The architecture is identical to SantaCoder but scaled up:
| Hyperparameter | SantaCoder (1.1B) | StarCoder (15.5B) |
|---|---|---|
| Hidden size | 2,048 | 6,144 |
| Intermediate size | 8,192 | 24,576 |
| Max position embeddings | 2,048 | 8,192 |
| Attention heads | 16 | 48 |
| Hidden layers | 24 | 40 |
| Attention type | Multi-Query | Multi-Query |
The scaling from SantaCoder to StarCoder follows a pattern: the hidden size triples (2,048→6,144), the number of layers increases by 67% (24→40), and the context length quadruples (2,048→8,192). The total parameter count scales roughly as O(hidden_size² × layers), so 3² × (40/24) ≈ 15, which matches the 1.1B → 15.5B scaling factor.
Multi-Query Attention (MQA; Shazeer, 2019): in standard multi-head attention, each attention head has its own query (Q), key (K), and value (V) projections, which means that during autoregressive decoding, the KV cache must store separate K and V tensors for every head. MQA shares a single K and V projection across all heads while keeping separate Q projections per head. This reduces the KV cache size by a factor equal to the number of heads (48× in StarCoder), dramatically decreasing memory bandwidth requirements during inference and enabling faster large-batch generation. The tradeoff is that MQA has slightly less expressive power than multi-head attention, but prior work has shown the performance difference is minimal for large models.
FlashAttention (Dao et al., 2022): this is an IO-aware attention algorithm that fuses the attention computation into a single CUDA kernel, avoiding the need to materialize the full N×N attention matrix in GPU high-bandwidth memory. To make FlashAttention work with MQA during training, the paper "simply expand the key and value before calling the attention kernel" (Section 5.4). This means the single K and V from MQA are replicated across all heads in the FlashAttention kernel, maintaining the memory savings of MQA for the KV cache while still benefiting from FlashAttention's computational efficiency.
Learned absolute positional embeddings: unlike some contemporary models that use rotary position embeddings (RoPE) or ALiBi, StarCoder uses traditional learned absolute positional embeddings, with a maximum context length of 8,192 positions. This means the model learns a unique embedding vector for each position 0 through 8191. The advantage is simplicity and compatibility with standard Transformer implementations; the disadvantage is that the model cannot generalize to sequence lengths beyond 8,192 without interpolation or fine-tuning.
Fill-in-the-Middle: FIM is implemented as a data transformation (described in Section 5.1) rather than an architectural modification. The model sees FIM-formatted sequences during training and learns to generate the middle segment when given prefix and suffix context. At inference time, FIM is triggered by providing the appropriate sentinel tokens. This approach requires no architectural changes — the same decoder-only Transformer handles both left-to-right and fill-in-the-middle generation.
Training Data Decontamination
Before training, the code training data was decontaminated against evaluation benchmarks to prevent data leakage (Section 5.2). The paper searched for and removed files containing:
- Docstrings or solutions from HumanEval and MBPP
- Docstrings from APPS
- Questions from GSM8K
- Prompts from DS-1000
The paper reports that "Python is the language with the highest number of matches, with 558 files removed" — a tiny fraction of the 12.9 million Python files in the training set, suggesting that benchmark contamination is not a widespread issue in The Stack, but the decontamination step is included as a precaution.
This decontamination is particularly important for a paper that makes strong performance claims. Without it, the model might achieve inflated benchmark scores by memorizing solutions rather than generalizing, and the comparisons with other models (which may or may not have been similarly decontaminated) would be unfair.
Training Configuration
StarCoderBase (Section 5.5):
The model is trained for 250,000 iterations with a global batch size of 4 million tokens (512 sequences × 8,192 tokens), for a total of 1 trillion tokens. The optimizer is Adam (Kingma & Ma, 2015) with:
$\beta_1 = 0.9$(first moment decay)$\beta_2 = 0.95$(second moment decay)$\epsilon = 10^{-8}$(numerical stability constant)- Weight decay = 0.1
The learning rate schedule follows a cosine decay from $3 \times 10^{-4}$ to $3 \times 10^{-5}$ after a linear warmup of 2,000 iterations. The warmup phase is short relative to total training (0.8% of iterations), which is typical for large Transformer models — the model needs to quickly escape the random initialization regime before settling into stable optimization.
StarCoder (Python fine-tuning):
Starting from the StarCoderBase checkpoint, the model is fine-tuned on the Python subset of the training data for 2 epochs. The learning rate is reduced to $5 \times 10^{-5}$ decaying to $5 \times 10^{-6}$, with 1,000 iterations of linear warmup (8,500 total steps). The lower learning rate reflects the fine-tuning setting: the model has already learned general code patterns and needs only to adjust its distribution toward Python.
The choice of 2 epochs is deliberate — more epochs risk overfitting to the Python distribution and degrading multi-language performance (a phenomenon the paper would later verify by showing StarCoder remains competitive on non-Python languages in Table 15). Two epochs represents roughly 35B Python tokens, compared to the 1T tokens of pre-training that included Python in its natural proportion (7.88% = ~79B Python tokens, though not all tokens would be seen due to the single-epoch pre-training).
Multi-node GPU setup (Section 5.6):
The training infrastructure is described in detail, reflecting the engineering complexity of training a 15.5B-parameter model:
- Hardware: 512 NVIDIA A100 80GB GPUs distributed across 64 nodes (8 GPUs per node).
- 3D parallelism: the model is partitioned using tensor parallelism (rank 4) and pipeline parallelism (rank 4), requiring 16 GPUs (2 nodes) for one model replica. With 512 GPUs, this enables 32-fold data parallelism (512/16 = 32), meaning 32 independent micro-batches are processed simultaneously.
- Micro-batch size: 1 sequence per micro-batch, accumulated over 16 steps to achieve a global batch size of 512 sequences (32 data-parallel replicas × 16 accumulation steps = 512).
- Distributed optimizer: Megatron-LM's distributed optimizer is used, which shards optimizer state across data-parallel workers, reducing per-GPU memory usage. The paper notes this leads to "slightly higher throughput in this configuration."
- Precision: BF16 (Brain Floating Point 16) is used instead of FP16 despite causing "10% lower throughput." The paper states this is "to avoid training instabilities" — BF16 has the same dynamic range as FP32 (8-bit exponent) but reduced mantissa precision (7 bits vs. 23), making it more stable for large models where gradient spikes can cause FP16 overflow.
- Stability: "Except for a few restarts, we did not experience significant training instabilities." The "few restarts" likely refer to occasional loss spikes or hardware failures that required checkpoint recovery, a common reality in large-scale training.
Carbon Emissions
The paper reports CO2 emissions using the methodology from Lacoste et al. (2019) (Section 5.7):
- Total GPU hours: 320,256 (for StarCoderBase)
- Average GPU power: 280W
- Total electricity: 89,671.68 kWh
- Carbon intensity (us-west-2 AWS): 0.15495 kgCO2e/kWh
- Power Usage Effectiveness (PUE): 1.2
- Total emissions: 16.68 tonnes CO2eq (StarCoderBase) + 0.58 tonnes (StarCoder fine-tuning) = ~17.3 tonnes total
This is a relatively modest carbon footprint for a 15.5B-parameter model — substantially lower than the estimated emissions of models like GPT-3 or PaLM — reflecting the efficiency of the training setup (high GPU utilization, efficient attention via FlashAttention) and the relatively small training token count (1T tokens vs. 300B+ tokens for GPT-3's 175B model).
Attribution Tools
The paper builds two complementary tools for tracing model outputs back to training data (Section 9):
Bloom filter membership checker (Section 9.1):
A Bloom filter (Bloom, 1970) is a probabilistic data structure that can answer "is this element in the set?" with one-sided error: false positives are possible (the filter may claim an element is present when it is not), but false negatives are impossible (if the filter says an element is absent, it definitely is). The paper builds a Bloom filter over all 50-character substrings of the training data, producing a 26 GB artifact that is ~3% of the training data size.
The 50-character window represents a design tradeoff: shorter windows would produce more false positives (many 20-character strings like import numpy as np appear in many files), while longer windows would require more exact memorization to trigger a match and might miss partially-copied generations. The 50-character threshold is approximately 10–15 tokens — long enough to be distinctive but short enough to catch meaningful copying.
The Bloom filter is integrated into the VSCode extension as a "rapid, first-pass attribution method" that can quickly flag model outputs potentially copied from training data. If a match is detected, users can proceed to the full search index for verification.
BM25 search index (Section 9.2):
The training dataset is indexed using Elasticsearch 7.17 with the following preprocessing:
- Lowercase filter: all text is lowercased for case-insensitive matching.
- ASCII folding filter: Unicode characters are folded to their ASCII equivalents (é→e, ñ→n, etc.), handling the variety of character encodings in source code.
- 3-gram tokenizer: text is tokenized into overlapping 3-character sequences, making the index robust to minor edits (insertions, deletions) because partial matches still score highly under BM25.
- BM25 similarity: the default Lucene implementation of BM25, a probabilistic retrieval function that scores documents based on term frequency, inverse document frequency, and document length normalization.
Two separate indexes are provided: one for the Python subset and one for the entire dataset. Both run in single-node mode, meaning they are designed for interactive querying by individual users rather than high-throughput production serving. The indexes also store username and license fields as keyword fields, enabling filtering by repository owner or license type.
Two-stage attribution process: the VSCode extension uses the Bloom filter as a fast first pass. If a 50-character match is found, the user is directed to the BM25 search index, where they can locate the specific file and repository that contains the matching code. This two-stage design reflects the different computational profiles of the two tools: Bloom filter queries are constant-time and memory-efficient, making them suitable for interactive use, while BM25 search is more expensive but provides precise source attribution.
4. Key Insights and Innovations
Innovation 1: Openness Is Not a Performance Sacrifice — It's a Different Optimization Objective
The paper's most intellectually distinctive contribution is its reframing of the open-vs-closed model debate. Prior to StarCoder, the dominant assumption in the Code LLM community — reinforced by the performance gap between models like GPT-3/Codex and open alternatives — was that achieving competitive performance required some degree of closure: proprietary training data (CodeGen-Mono's undisclosed Python dataset), restricted model access (code-cushman-001 via paid API), undisclosed data curation (LLaMA, CodeGeeX), or non-commercial licensing (InCoder). The implicit model was a spectrum where openness and performance traded off against each other.
StarCoder breaks this assumed tradeoff by treating openness not as a constraint to work around but as a different optimization objective that demands different engineering investments. The paper demonstrates that matching code-cushman-001 (the 12B model powering early GitHub Copilot) is achievable with fully open data, weights, and curation pipelines — but only if you invest in the data governance infrastructure that closed models can ignore. Specifically:
-
Data quality at scale requires community processes, not just automated filters. The visual inspection by 18 community annotators across 300 file extensions, documented in a public Google Sheet, is not a nice-to-have transparency gesture — it's a prerequisite for training on permissively licensed data that hasn't been pre-cleaned by proprietary pipelines. When you can't use whatever code you find, you have to understand what you're training on.
-
PII redaction becomes a first-class engineering problem. Closed models can (in principle) train on unredacted data and rely on output filters; open models that release training data must actually remove sensitive information. The paper's 800 GPU-hour PII pipeline, 22,950 annotated entities, and pseudo-labeling procedure represent an investment that closed-model developers simply don't have to make.
-
Attribution is an open-model requirement, not a feature. The Bloom filter and BM25 index are motivated by legal analysis (Henderson et al., 2023) arguing that fair use protection depends on demonstrating that outputs are novel, not memorized. Closed models face this same legal exposure but can choose not to provide tools; open models must build them.
The significance of this reframing extends beyond code generation. If the paper's claim holds — that open models can match closed ones when data governance is treated as a core engineering discipline rather than an afterthought — it implies that the performance gap in other domains (text, multimodal) may similarly reflect underinvestment in open data curation rather than any fundamental advantage of proprietary data. The paper doesn't prove this for other domains, but it establishes a template for testing it.
This is a fundamental reframing, not an incremental improvement. Prior work (SantaCoder, PolyCoder, BLOOM) demonstrated that open models were possible; StarCoder demonstrates that they can be competitive if you're willing to do the unglamorous work of data inspection, PII annotation, and attribution infrastructure. The evidence is the multi-language benchmark table (Table 15), where StarCoderBase's 19-language average is competitive with code-cushman-001 despite being fully open — a result that would have seemed unlikely under the prior "openness costs performance" assumption.
Innovation 2: Fill-in-the-Middle as a General-Purpose Capability, Not a Code Completion Feature
The paper's second conceptual contribution is elevating Fill-in-the-Middle from a specialized code completion technique to a general-purpose model capability that enables a family of downstream tasks. Prior work on FIM (Bavarian et al., 2022; Fried et al., 2022; Ben Allal et al., 2023) treated it primarily as a mechanism for better code completion in IDEs — you give the model prefix and suffix, it fills the gap. This framing makes FIM seem like a narrow optimization for a specific UX pattern.
StarCoder's evaluation reframes FIM as a fundamentally different way to interact with a language model. The paper demonstrates this through task diversity:
-
Type prediction (Tables 18, 19): the model conditions on function signature and body to infill return types, achieving 77.4% non-None F1 on Python return types and 38.3% of TypeScript packages that type-check. This is not "code completion" in the IDE sense — it's a program analysis task that would traditionally require a specialized type inference engine.
-
Docstring generation (Table 20): the model infills documentation conditioned on function signature and body, achieving 21.38 BLEU on the CodeXGLUE summarization benchmark (zero-shot). This is a code-to-text generation task that FIM makes possible without any task-specific architecture.
-
Security-relevant code repair (Table 16): the model infills code in security-sensitive scenarios, conditioning on surrounding context to avoid introducing vulnerabilities. The FIM variant (Insertion mode) achieves 98.70% valid code — substantially higher than the 85.50% in Completion mode, suggesting that bidirectional context genuinely helps the model produce safer code.
-
Commit message generation (Appendix E.1): by conditioning on code-before and commit-message, the model infills code-after, effectively performing instruction-guided code editing without any instruction tuning.
What makes this intellectually distinctive is that the paper demonstrates these capabilities emerge from a single training objective — next-token prediction on FIM-formatted data applied 50% of the time — without task-specific heads, fine-tuning, or architectural modifications. The model learns a general skill ("generate coherent text given surrounding context") that transfers across tasks because the training data exposes it to diverse instantiations of that pattern (code gaps, type gaps, documentation gaps, commit diffs).
This reframing is fundamental because it changes how researchers should think about model capabilities: FIM is not a feature to bolt onto a code model; it's a training paradigm that teaches the model a more general form of conditional generation. The paper's evaluation of FIM on type prediction, docstring generation, and security benchmarks — tasks far outside the original "code completion" framing — provides the empirical evidence for this claim.
Innovation 3: PII Redaction as a Machine Learning Problem, Not a Regex Problem
The paper's third contribution is the systematic demonstration that regex-based PII detection is fundamentally inadequate for code training data, and that building a competitive PII pipeline requires the same level of ML engineering as building the model itself. This is a diagnostic finding with significant implications for the field.
Prior work on PII in code datasets (Ben Allal et al., 2023, in the SantaCoder paper) relied primarily on regular expressions and the detect-secrets tool. The assumption — reasonable but untested — was that secrets in code follow sufficiently regular patterns that regexes would achieve high recall. Table 8 demolishes this assumption: for API keys, the regex approach achieves 3.62% precision. This means that 96 out of every 100 "keys" flagged by detect-secrets are false positives — legitimate code that happens to look key-like. The paper identifies specific failure modes: "especially in specific programming languages like Go and C-sharp that weren't well represented in the regex evaluation."
This finding matters beyond StarCoder because it implies that every prior code dataset trained on unredacted or regex-redacted GitHub code likely contains substantial quantities of exposed secrets. The 3.62% precision on keys means that if you use regex-based filtering, you face an impossible choice: set a high detection threshold and miss most keys (recall was only 49.15%), or set a low threshold and redact enormous amounts of legitimate code — destroying training data quality either way.
The paper's response is to treat PII detection as a Named Entity Recognition problem requiring a custom pre-trained encoder (StarEncoder), 22,950 crowd-sourced annotations across 12,000 files in 31 programming languages, pseudo-labeling with domain-specific trigger-word filtering, and careful post-processing. The result is still imperfect — 70.41% F1 on keys — but it's an order-of-magnitude improvement over the regex baseline and, crucially, the paper is transparent about the remaining limitations (IDs excluded entirely, usernames only 61.49% F1).
The significance of this contribution extends beyond code: it establishes that responsible data release in the LLM era requires ML-based PII detection trained on annotated data for the specific domain, and that regex-based approaches — which are still common in practice — are insufficient. The paper's release of the PII annotation dataset under gated access further enables the community to build on this finding.
This is an incremental improvement to PII detection methodology (NER for PII existed before StarCoder), but a fundamental diagnostic for the field: the finding that regex precision on keys is 3.62% should change how every Code LLM developer approaches data cleaning. The evidence is Tables 8 and 9, with the 3.62% precision figure serving as the paper's most damning indictment of the status quo.
Innovation 4: The "Natural Distribution" Principle for Multi-Language Training
The paper's fourth contribution is methodological rather than architectural: the empirical validation that training on the natural distribution of programming languages — rather than upsampling low-resource languages or downsampling high-resource ones — produces strong multi-language performance without catastrophic interference. This may seem like an obvious default, but it was not, and the paper provides a principled defense backed by training dynamics evidence.
Prior work in multilingual NLP (and multi-language code) often applies temperature-based sampling or heuristic up-weighting to balance language distributions. The intuition is that high-resource languages like Python and JavaScript dominate the data and would "crowd out" low-resource languages if trained on proportionally. CodeGen (Nijkamp et al., 2023), for instance, trained on a curated set of 6 languages, implicitly making a selection decision rather than trusting the natural distribution.
StarCoder's approach is different: sample proportionally to volume, with explicit caps only on data-heavy formats (JSON, YAML, CSS) where the goal is learning syntax, not memorizing data. The paper provides two justifications for this choice:
-
Utilitarian: "the largest amount of available data comes from popular programming languages and would, therefore, benefit a larger group of end-users." If 95% of your users write Python, JavaScript, Java, or C++, and those languages already dominate the training data, then proportional sampling directly optimizes for user needs.
-
Empirical: after deduplication, "several high-resource programming languages... had a similar amount of data ranging from 44–87 GB." The natural distribution had already produced a reasonably balanced high-resource tier, reducing the need for manual rebalancing.
The paper's training dynamics analysis (Figure 2) provides retrospective validation of this choice. The figure shows that performance on low-resource languages (R, Lua, Julia) does plateau or decline in later training, and the dependence of pass@1 on data size shows that "performance improves only for languages with large enough amounts of data (≳1 GB)." This is a negative result with practical implications: upsampling low-resource languages might not help if the fundamental constraint is absolute data volume rather than relative proportion. The paper's manual inspection of R completions (Table D.3) — showing "significant variance in per-problem success rates" that "varies in what appears to be a completely uncorrelated manner" — further supports the interpretation that the model has reached the limit of what can be learned from limited data, not that it's being crowded out by Python.
This is an incremental methodological contribution: the proportional sampling approach was also used in SantaCoder, but StarCoder validates it at 15× the scale and across 3× the languages, with the training dynamics analysis providing the empirical justification that was missing from prior work. The evidence is Figure 2 and Tables 1-2, which together establish that natural distribution training produces a Pareto-optimal allocation of model capacity across languages without manual tuning.
Innovation 5: The Attribution-Tool-as-Governance Infrastructure
The paper's final conceptual contribution is treating attribution tools not as optional transparency add-ons but as integral governance infrastructure required for responsible deployment. This reframes the conversation around model release from "what should we disclose?" to "what tools should we provide to enable ongoing accountability?"
Prior to StarCoder, model documentation focused on static artifacts: model cards (Mitchell et al., 2019), dataset cards, and technical reports describing the training process. These are useful for initial assessment but provide no mechanism for users to investigate specific model outputs. The "Am I in The Stack" tool from the original Stack paper (Kocetkov et al., 2022) enabled developers to check whether their repositories were included in the dataset, but it operated at the repository-name level and couldn't answer the question "did the model copy this specific code snippet?"
StarCoder's two-stage attribution system — Bloom filter for fast membership checking, BM25 index for precise source location — creates a new category of model documentation: interactive, queryable, and integrated into the development environment. The VSCode extension embedding means that a developer using StarCoder for code completion can, in real time, check whether a suggestion was copied from training data and trace it to the source repository. This operationalizes the legal analysis from Henderson et al. (2023) cited in Section 1: fair use protection is strongest when models generate novel content, and attribution tools provide the mechanism to verify novelty.
The intellectual contribution is the integration of legal requirements, ML engineering, and developer tooling into a unified governance framework. The Bloom filter's design choices — 50-character strings, 26 GB size (~3% of data), false-positive-prone but false-negative-free — reflect an understanding that the tool is a first-pass filter in a legal and practical workflow, not a perfect classifier. The BM25 index's design — 3-gram tokenizer for edit-robust matching, keyword fields for license and username filtering — reflects the expectation that users will want to investigate matches, not just detect them.
This is a fundamental contribution to LLM governance practice because it shifts the burden of proof: rather than asking users to trust that the model generates novel code, the tools enable them to verify it. The paper doesn't claim these tools are sufficient for legal compliance — the limitations section explicitly notes they "do not attempt to distinguish between generic code (e.g., boilerplate) or protected content" — but it establishes a new standard for what constitutes responsible model release. Future open models will be compared against this standard, and closed models will face pressure to provide equivalent functionality. The evidence is Section 9 and the integration of the tools into the VSCode demo, which demonstrates that attribution is not just a research artifact but a practical, deployable system.
5. Experimental Analysis
Evaluation Methodology
-
Dataset. The paper evaluates on a diverse suite of code and natural language benchmarks. For code, the primary benchmarks are HumanEval (Chen et al., 2021, 164 handwritten Python problems with test cases), MBPP (Austin et al., 2021, ~1,000 crowd-sourced Python problems), MultiPL-E (Cassano et al., 2023, translating HumanEval and MBPP into 18 additional languages), DS-1000 (Lai et al., 2022, 1,000 Python data science problems across 7 libraries), ODEX (Wang et al., 2022, 945 open and closed-domain Python queries in 4 natural languages), the Asleep at the Keyboard security benchmark (Pearce et al., 2022, 89 scenarios across 18 CWE vulnerability classes), single-line FIM benchmarks for Python/Java/JavaScript (Fried et al., 2022; Ben Allal et al., 2023), Python return type prediction (Pradel et al., 2020; Fried et al., 2022), TypeScript type prediction (Yee & Guha, 2023), and the CodeXGLUE code summarization benchmark (Lu et al., 2021). For natural language, the paper uses GSM8K (Cobbe et al., 2021, middle-school math word problems), MMLU (Hendrycks et al., 2020, 57-domain multiple-choice), CoQA (Reddy et al., 2019, conversational QA), StereoSet (Nadeem et al., 2021, social bias measurement), RealToxicityPrompts (Gehman et al., 2020, toxicity evaluation), and HELM reasoning tasks (Liang et al., 2022). The paper notes that training data was decontaminated by removing files containing docstrings or solutions from HumanEval, MBPP, APPS, GSM8K, and DS-1000 (Section 5.2), with Python seeing 558 files removed. The specific splits used are the standard test sets for each benchmark; for DS-1000 and ODEX the full 1,000 and 945 examples are used, while for MultiPL-E the translated HumanEval (164 problems) and MBPP (500 problems) are evaluated per language.
-
Base model(s). The paper evaluates two models from the StarCoder family: StarCoderBase (15.5B parameters, trained on 1 trillion tokens across 86 programming languages plus GitHub issues, Git commits, and Jupyter notebooks from The Stack v1.2) and StarCoder (StarCoderBase fine-tuned on 35B additional Python tokens). Both share the same architecture: decoder-only Transformer with Multi-Query Attention, FlashAttention, 8K context length, and Fill-in-the-Middle capability. The choice of 15.5B parameters positions these models between the largest open Code LLMs (CodeGen-16B, CodeGeeX-13B) and substantially larger closed models (code-davinci-002 at 175B, PaLM at 540B), enabling direct open-vs-closed comparison at similar scale (Section 6).
-
Metrics. For code generation benchmarks (HumanEval, MBPP, MultiPL-E, DS-1000, ODEX), the primary metric is pass@k (Chen et al., 2021): the fraction of problems solved, where a problem is considered solved if at least one of k samples passes all test cases. The paper focuses on pass@1 (single-attempt success rate) for most comparisons, generating n=200 samples for open-access models and n=20 for API models to estimate the metric. Pass@k is computed using the unbiased estimator from Chen et al. (2021). For the Asleep at the Keyboard security benchmark, metrics are Valid (percentage of syntactically valid completions, verified by compiling with py_compile for Python and gcc for C) and Insecure (percentage of valid completions that contain the vulnerability being tested). For the single-line FIM benchmark, line exact match accuracy is used. For Python return type prediction, F1 score is reported on normalized annotations, both overall and excluding trivial None types. For TypeScript type prediction, the metrics are packages that type-check (✓), files with no errors, and percentage of trivial annotations. For code summarization, smoothed 4-gram BLEU (Papineni et al., 2002) is reported against reference docstrings. For natural language tasks: GSM8K uses 8-shot accuracy with greedy decoding, plus majority voting accuracy at 100 samples for CoT and 40 samples for PAL; MMLU uses 5-shot accuracy; CoQA uses zero-shot F1; StereoSet uses stereotype score (closer to 50% is better), language modeling score, and ICAT score (Equation 1); RealToxicityPrompts reports the percentage of responses flagged toxic by a RoBERTa-based classifier and by an offensive word list; HELM reasoning tasks report per-task accuracy or equivalent metrics as defined by Liang et al. (2022). For perplexity evaluation with long contexts, perplexity is computed on the last 1K tokens of 8K-token chunks, comparing 2K vs. 8K context windows (Section 6.4).
-
Baselines. The paper compares against a comprehensive set of both open-access and closed-access models. Open-access baselines include: CodeGen-16B-Multi (Nijkamp et al., 2023, 16B parameters, trained on the Pile plus C/C++/Go/Java/JavaScript/Python from BigQuery), CodeGen-16B-Mono (same architecture, fine-tuned on a proprietary Python dataset), CodeGeeX-13B (Zheng et al., 2023, 13B parameters, trained on 23 languages from the Pile, CodeParrot, and additional data), SantaCoder (Ben Allal et al., 2023, 1.1B parameters, the prior BigCode model with FIM support), InCoder-6B (Fried et al., 2022, 6B parameters, FIM-capable), LLaMA (Touvron et al., 2023, 7B/13B/33B/65B parameters, general-purpose not code-specific), GPT-NeoX-20B (Black et al., 2022), BLOOM-176B (Scao et al., 2022), OPT (Zhang et al., 2022, 66B/175B), and others listed in the HELM evaluation (Table 27). Closed-access baselines include: code-cushman-001 (OpenAI, 12B parameters, the initial Copilot model), code-davinci-001 (OpenAI, accessed via API), code-davinci-002 (OpenAI, 175B parameters, accessed via API), PaLM-540B (Chowdhery et al., 2022), and LaMDA-137B (Thoppilan et al., 2022). For GSM8K, results from LLaMA (CoT) are taken from Touvron et al. (2023). For HELM reasoning tasks, all models classified as "limited" or "open" access with coverage on a majority of tasks as of May 1, 2023 are included (Table 27).
-
Generation budget / compute accounting. The paper does not use a unified compute budget for test-time compute scaling (unlike the reference example's focus on generation budgets). Instead, evaluations follow standard per-benchmark protocols: for pass@1, n=200 samples are generated from open-access models (n=20 for API models) with temperature 0.2; for pass@k with k>1, temperature 0.8 is used; for DS-1000, 40 samples are generated with temperature 0.2, top_p=0.5, max_length=1,024; for ODEX, greedy decoding is used; for the security benchmark, 25 completions per scenario at temperature 0.2; for GSM8K, PAL uses greedy decoding while majority voting uses nucleus sampling with p=0.95 and temperature 0.7 (following Gao et al., 2022). The training compute budget for the models themselves is reported in Section 5.7 (320,256 GPU-hours for StarCoderBase, ~3.5% additional for StarCoder).
-
Cross-validation / statistical protocol. The paper does not report cross-validation or statistical significance testing for benchmark comparisons. For the PII detection model evaluation, the annotated dataset is split into 7,878 training examples and 4,000 test examples "ensuring that both splits have a balanced representation of the different PII types" (Section 4.3). The PII model's performance is reported with precision, recall, and F1 on this held-out test set (Tables 8 and 9). For the training dynamics analysis (Figure 2), performance is evaluated at four checkpoints (400B, 600B, 800B, 1000B tokens), and the paper reports R² values for the linear fit between pass@1 and log-dataset-size, ranging from 0.399 at 600B to 0.510 at 1000B. For qualitative evaluation, manual inspection of R completions (Table D.3) reports raw pass counts out of 200 samples for 13 problems showing high variance between the 800B and 1000B checkpoints. The paper does not apply cross-validation to the compute-optimal strategy selection that characterizes the reference example; StarCoder is evaluated as a fixed model rather than within an adaptive test-time compute framework.
Main Quantitative Results
Python Code Generation: HumanEval and MBPP
Headline results (Table 12): StarCoder achieves 33.6% pass@1 on HumanEval and 52.7% on MBPP, making it the highest-performing open-access model on both benchmarks. StarCoderBase achieves 30.4% on HumanEval and 49.0% on MBPP — competitive with CodeGen-16B-Mono (29.3%, 35.3%) despite CodeGen-Mono being fine-tuned on Python.
Open-access comparison: Against the next-best open-access models, StarCoder substantially outperforms CodeGen-Mono on MBPP (52.7% vs. 35.3%, a +17.4 percentage point gap) and on HumanEval (33.6% vs. 29.3%, a +4.3 point gap). Against CodeGeeX-13B, the margins are larger: +10.7 points on HumanEval and +28.3 points on MBPP. Against the largest LLaMA model (65B), StarCoder outperforms by +9.9 points on HumanEval and +15.0 points on MBPP despite having 4.2× fewer parameters.
Closed-access comparison: StarCoder matches code-cushman-001 (33.5% HumanEval) at 33.6% and exceeds it on MBPP (52.7% vs. 45.9%), establishing that an open-access model can match the performance of the model that initially powered GitHub Copilot. However, StarCoder remains substantially behind code-davinci-002 (45.9% HumanEval, 60.3% MBPP), a 175B-parameter model with approximately 11× more parameters.
Key qualification: The paper notes that StarCoderBase, trained only on the multi-language corpus with Python in its natural proportion (7.88%), achieves 30.4% HumanEval — competitive with the Python-fine-tuned CodeGen-Mono (29.3%). This suggests that the additional Python fine-tuning (35B tokens) provides a +3.2 percentage point boost, a meaningful but not transformative improvement over the base model's already-strong Python performance.
Python Data Science: DS-1000
Headline results (Table 13): StarCoder achieves 26.0% overall pass@1 on DS-1000 (completion mode), substantially exceeding every other model. StarCoderBase achieves 23.8% — surpassing code-cushman-001 (18.1%) by +5.7 points.
Per-library breakdown: StarCoder outperforms all other models on all 7 libraries in completion mode. The gaps are particularly large on Matplotlib (51.7% vs. code-cushman-001's 40.7%), NumPy (29.7% vs. 21.8%), SciPy (20.2% vs. 11.3%), and Scikit-Learn (29.5% vs. 18.0%). On Pandas, the hardest library, StarCoder achieves 11.4% vs. code-cushman-001's 7.9%.
Insertion mode: StarCoder achieves 25.4% in insertion mode, slightly below its completion score (26.0%). This is consistent across models that support both modes — StarCoderBase achieves 24.0% insertion vs. 23.8% completion, InCoder-6B achieves 7.5% insertion vs. 7.4% completion. The small differences suggest that FIM capability does not substantially change performance on DS-1000, where the infilling tasks are constructed differently from standard code completion.
Correlation with HumanEval: The paper explicitly highlights that model rankings on DS-1000 differ from HumanEval/MBPP. CodeGen-Mono achieves 31.7% on Matplotlib (HumanEval: 29.3%), comparable to StarCoder on that library, but drops to only 3.4% on Pandas vs. StarCoder's 11.4%. This confirms the finding by Lai et al. (2022) that "model performance on HumanEval and MBPP benchmarks does not always correlate with performance on the more realistic DS-1000 benchmarks" and demonstrates the value of evaluating on diverse, real-world coding tasks rather than only algorithmic puzzles.
Open-Domain Coding: ODEX
Headline results (Table 14): On the ODEX benchmark, StarCoderBase achieves 46.5% overall accuracy on English queries, substantially exceeding code-davinci-001 (33.6%), SantaCoder (37.7%), and code-cushman-001 (31.9%). StarCoder achieves 44.7% on English but higher scores on Spanish (37.6%), Japanese (44.2%), and Russian (50.4%).
Open vs. closed domain gap: The paper notes that StarCoder models exhibit "smaller gaps between open- and closed-domain queries than other baseline models." On English, StarCoderBase drops from 53.0% (closed) to 40.7% (open), a gap of 12.3 points, while code-davinci-001 drops from 41.0% to 26.9% (14.1 points) and CodeGen-16B-Mono drops from 43.1% to 25.2% (17.9 points). This pattern holds across languages, suggesting that StarCoder's multi-language pre-training on diverse code (including library usage in Jupyter notebooks and real GitHub repositories) enables better generalization to open-domain coding with unfamiliar libraries.
Multi-lingual performance: StarCoder achieves its highest accuracy on Russian (50.4%) and lowest on Spanish (37.6%), a 12.8-point range. StarCoderBase shows more variability: 46.5% on English vs. 30.1% on Spanish. The paper does not investigate why Spanish performance is lower, but the ODEX benchmark includes natural language instructions in each target language, suggesting that the model's exposure to Spanish technical text in GitHub issues and Markdown during training influences this capability.
Multi-Language Code Generation: MultiPL-E
Headline results (Table 15): Across all 19 programming languages in MultiPL-E HumanEval, StarCoderBase outperforms other open-access multi-language models (CodeGen-16B-Multi, CodeGeeX). In several cases, performance is more than 2× higher. StarCoderBase is competitive with code-cushman-001 on most languages.
Language-specific highlights: StarCoderBase achieves its highest pass@1 on TypeScript (32.15%), JavaScript (31.70%), C++ (30.56%), and Java (28.53%). It substantially exceeds baselines on Julia (21.09% vs. CodeGen-16B-Multi's 0.00% and code-cushman-001's 1.54%), R (10.18% vs. CodeGen-Multi's 6.45% and code-cushman-001's 10.99%), and Lua (26.61% vs. CodeGen-Multi's 8.50%). On Ruby, StarCoderBase achieves 17.25%, substantially below code-cushman-001's 28.63% — one of the few languages where the closed model has a decisive advantage. On Racket, StarCoderBase achieves 11.77% vs. code-cushman-001's 7.05%, an unexpected strength on a low-resource language.
Fine-tuning effect: Despite being fine-tuned on Python, StarCoder remains competitive on most languages and "slightly outperforms StarCoderBase on certain languages" including TypeScript (32.29% vs. 32.15%), Python (33.57% vs. 30.35%), C++ (31.55% vs. 30.56%), and Java (30.22% vs. 28.53%). The paper acknowledges that "at this time, we can only speculate on why this is the case" and suggests "further investigation of the open training data is likely to help shed light on this finding." This is a genuinely surprising result — fine-tuning on a single language typically degrades multi-language performance — and the paper treats it as an open question rather than a claimed achievement.
Swift performance: StarCoder achieves 22.74% on Swift despite Swift being excluded from training "due to human error" (Section 3.1). This suggests transfer learning from related languages (likely Objective-C or C-family languages in the training data), demonstrating the model's ability to generalize to unseen programming languages.
Security: Asleep at the Keyboard
Headline results (Table 16): StarCoderBase in insertion (FIM) mode achieves 98.70% valid code and 35.87% of valid completions containing the tested vulnerability. In completion mode, it achieves 85.50% valid and 39.77% insecure.
Comparison to baselines: Among models with >95% valid code, StarCoderBase has the lowest insecure rate. CodeGen-16B-Multi achieves 95.50% valid but 43.25% insecure; code-cushman-001 achieves 96.40% valid but 42.32% insecure. InCoder-6B has a slightly lower insecure rate (34.31% insertion, 35.48% completion) but its valid rate is also lower (85.40% insertion, 87.10% completion), so the lower insecurity may partly reflect less capable code generation overall.
Insertion vs. completion: The insertion (FIM) mode substantially improves the valid code rate for StarCoderBase (85.50% → 98.70%) while reducing the insecure rate (39.77% → 35.87%). This suggests that bidirectional context helps the model produce syntactically correct code and may provide security-relevant cues from the surrounding code that reduce vulnerability introduction. Comparison with code-davinci-002 (Table D.2) shows the larger closed model achieves 98.40% valid in completion mode and 98.60% in insertion mode, but with higher insecure rates (42.99% and 42.70% respectively) — meaning StarCoderBase's security advantage is not simply a function of size.
Fill-in-the-Middle Capabilities
Single-line infilling (Table 17): StarCoder achieves 0.73 line exact match on Java, 0.74 on JavaScript, and 0.62 on Python, substantially exceeding SantaCoder (0.62, 0.60, 0.44) and InCoder-6B (0.49, 0.51, 0.31). The gap is largest on Python (0.62 vs. 0.31 for InCoder), suggesting that increased model scale particularly benefits infilling in the language with the most training data.
Python return type prediction (Table 18): StarCoderBase achieves 77.4% non-None F1 and 86.6% overall F1, exceeding InCoder-6B (59.1%, 46.8%) and SantaCoder (66.9%, 78.5%). StarCoder achieves nearly identical scores (77.1%, 86.4%), indicating that Python fine-tuning does not improve type prediction. The paper notes that evaluation functions were taken from GitHub repositories and "may overlap with the training data" — a potential inflation of scores that the paper acknowledges but does not quantify.
TypeScript type prediction (Table 19): StarCoderBase produces types that cause 38.3% of packages to type-check, compared to InCoder's 23.4%. Across all files, 78.0% have no errors vs. InCoder's 75.1%. StarCoderBase also produces fewer trivial annotations (45.2% vs. 47.9%), suggesting more informative type predictions. This evaluation uses packages that have never been translated to TypeScript, reducing the likelihood of data contamination — a methodological strength the paper highlights.
Docstring generation (Table 20): StarCoder achieves 21.99 BLEU on the CodeXGLUE Python code summarization task, exceeding StarCoderBase (21.38), SantaCoder (19.74), and InCoder-6B (18.27). The paper again notes potential overlap with training data since the evaluation functions come from public GitHub repositories.
Training Dynamics
Performance by language over training (Figure 2, right): The training dynamics plot shows pass@1 on MultiPL-E languages at 400B, 600B, 800B, and 1000B token checkpoints. High-resource languages (Python, Java, JavaScript, C++) show consistent improvement throughout training, with the curves suggesting further gains from longer training. Some low-resource languages plateau or decline: R drops substantially between 800B and 1000B checkpoints, and Perl shows minimal improvement after 600B.
Performance vs. data size (Figure 2, left): The left plot shows pass@1 vs. log-dataset-size, with a linear fit for each checkpoint (excluding the leftmost point where transfer learning is expected to break the log-linear relationship). The R² values increase from 0.399 at 600B to 0.510 at 1000B, indicating a strengthening relationship between data volume and performance as training progresses. The slope increases from 600B to 1000B while the intercept decreases, meaning "performance improves only for languages with large enough amounts of data (≳1 GB)." This corroborates the data weighting decision: low-resource languages are fundamentally data-limited, and upsampling them during training would not overcome the absolute data scarcity.
Variance in low-resource languages (Table D.3): Manual inspection of R completions at different checkpoints reveals "significant variance in per-problem success rates" with "what appears to be a completely uncorrelated manner" between checkpoints. For problem HumanEval_0, the pass count (out of 200) fluctuates from 20 (400B) to 171 (600B) to 197 (800B) to 5 (1000B). This pattern — large, uncorrelated swings — is consistent across 13 identified problems and suggests that low-resource language performance is driven by brittle memorization rather than robust generalization, with the model gaining and losing specific problem-solving capabilities as training progresses.
Long-Context Perplexity
Results (Table 21): Across all 10 evaluated languages, using an 8K token context window reduces perplexity compared to a 2K window. The reductions are language-dependent: from 2.01→1.79 on C++ (11.0% reduction), 1.98→1.68 on JavaScript (15.2%), 1.72→1.48 on R (13.9%), and 2.16→2.02 on Ruby (6.5%). The smallest relative reduction is on Ruby (which has the least training data among the languages, Table 2), consistent with the hypothesis that longer contexts help most when the model has learned strong language-specific patterns.
Evaluation design: The perplexity evaluation uses 10 GNU Public License repositories per language downloaded from GitHub, ensuring no overlap with the training data (which is restricted to permissively licensed code). The 1K-token evaluation regions are always the last portion of each 8K chunk, with the conditioning context either being the preceding 1K tokens (2K window condition) or the preceding 7K tokens (8K window condition). This design measures whether the model benefits from additional file- and repository-level context beyond the immediately preceding tokens.
Natural Language Reasoning: GSM8K
Results (Table 22): StarCoderBase achieves 21.5% on GSM8K with PAL (Program-Aided Language models, generating Python programs as intermediate reasoning), substantially exceeding CodeGen-Mono (13.1%) and CodeGen-Multi (8.6%) and exceeding LLaMA-13B (16.9%). With majority voting over 40 PAL samples, StarCoderBase reaches 31.2%, compared to LLaMA-13B's 28.5%. However, StarCoderBase substantially underperforms LLaMA-33B (38.7% PAL, 50.3% with majority voting).
CoT vs. PAL: StarCoderBase achieves only 8.4% with Chain-of-Thought prompting, compared to 21.5% with PAL — a 2.6× improvement from generating code rather than natural language reasoning steps. This is consistent with the model being primarily trained on code, where it has stronger generative capabilities. The LLaMA models show the opposite pattern at smaller scales: LLaMA-7B achieves 11.0% CoT vs. 10.5% PAL; LLaMA-13B achieves 17.8% CoT vs. 16.9% PAL. Only LLaMA-33B sees PAL (38.7%) outperform CoT (35.6%), suggesting that code-as-reasoning benefits from both code training data and sufficient model scale.
Natural Language Understanding and Safety
MMLU (Table 23): StarCoderBase achieves 34.2% 5-shot accuracy on MMLU, exceeding CodeGen-Multi (27.8%) and GPT-NeoX-20B (32.9%), but underperforming LLaMA-7B (35.1%) and LLaMA-13B (46.9%). The gap to LLaMA-13B (12.7 points) despite similar parameter counts indicates that general-purpose language understanding benefits more from text-heavy pre-training (LLaMA's 1T+ tokens of natural language) than code-heavy pre-training.
CoQA (Table 24): StarCoderBase achieves 0.67 zero-shot F1 on conversational question answering, exceeding CodeGen-Multi (0.59) but trailing LLaMA-7B (0.71), LLaMA-13B (0.73), and GPT-NeoX-20B (0.73). This pattern is consistent with MMLU: the model's natural language understanding is competitive with similarly-sized code-focused models but weaker than general-purpose language models.
Social bias — StereoSet (Table 25): StarCoderBase achieves the lowest stereotype scores across all four bias domains (gender: 58.76%, profession: 53.24%, race: 56.48%, religion: 55.69%) compared to LLaMA-13B and CodeGen-Multi-16B. The ICAT scores are correspondingly higher: 76.65 overall vs. LLaMA-13B's 64.14 and CodeGen-Multi's 67.55. The paper notes that StarCoderBase's language modeling score (86.18) is competitive (LLaMA-13B: 87.62, CodeGen-Multi: 87.25), indicating that "StarCoderBase's lower stereotype scores are not simply due to worse language modeling." The paper also reports CrowS-Pairs results (Table D.4), where StarCoder achieves 61.94 overall stereotype score, between CodeGen-Multi (59.08) and LLaMA-13B (67.84) — a less favorable result than StereoSet, possibly reflecting methodological differences between the two bias benchmarks that the paper does not analyze.
Toxicity — RealToxicityPrompts (Table 26): StarCoderBase generates toxic responses (as flagged by a RoBERTa classifier) in 0.42% of cases, compared to 0.74% for LLaMA-13B and 0.21% for CodeGen-Multi-16B. Using an offensive word list, 1.12% of StarCoderBase responses contain offensive tokens, vs. 1.43% for LLaMA-13B and 0.82% for CodeGen-Multi. StarCoderBase is thus intermediate: less toxic than LLaMA-13B but more toxic than CodeGen-Multi. The paper does not analyze why CodeGen-Multi achieves the lowest toxicity scores.
HELM Reasoning Tasks
Results (Table 27): StarCoderBase substantially outperforms all other open-access models on HELM reasoning tasks and often matches or exceeds much larger closed models. On Synthetic Reasoning (Abstract Symbols), StarCoderBase achieves 44.0%, trailing only code-davinci-002 (54.0%) and text-davinci-003 (50.2%) while exceeding all other models including Luminous Supreme (70B, 31.2%) and GPT-NeoX-20B (20.4%). On Dyck Languages, StarCoderBase achieves 85.4% — the highest score of any model in the table, exceeding code-davinci-002 (80.5%) by +4.9 points. On bAbI, it achieves 50.4%, competitive with most models. On Legal Support, it achieves 53.2%, comparable to the best models in the table.
Weakness on math: On GSM8K and MATH, StarCoderBase achieves 8.4% and 15.1% respectively — substantially below code-davinci-002 (56.8%, 41.0% MATH, 43.3% MATH with CoT) and text-davinci-003 (50.6%, 39.0%, 44.9%). The paper's PAL results show that StarCoderBase can improve to 21.5% on GSM8K with code-based reasoning (Table 22), but the HELM evaluation uses standard prompting, which substantially underestimates the model's mathematical reasoning capability when allowed to generate code.
Ranking across tasks: The paper orders models by their average rank on the tasks. StarCoderBase ranks highly, behind only code-davinci-002, text-davinci-003, and Luminous Supreme among models evaluated on a majority of tasks, and ahead of all other open-access models including BLOOM-176B and OPT-175B. The paper speculates that "the mixture of code and natural language in the training data contributes to the model's strong performance on these reasoning tasks."
Ablation Studies and Robustness Checks
PII detection: NER vs. regex baseline (Table 8). The most striking ablation compares the fine-tuned PII detection model against regular expressions. For API keys, regex precision is only 3.62%, meaning 96% of regex-detected "keys" are false positives. The NER model achieves 56.66% F1 without pseudo-labels and 70.41% F1 with pseudo-labels, representing an order-of-magnitude improvement. For emails, both approaches are strong (regex: 96.83% F1, NER + pseudo-labels: 98.15% F1). This ablation empirically justifies the substantial investment in the PII annotation pipeline: regex-based approaches are fundamentally inadequate for PII types lacking regular structure.
PII detection: pseudo-labeling (Tables 8 and 9). Adding pseudo-labeled training data before fine-tuning on the annotated dataset improves F1 scores across all PII types. The most dramatic improvement is on keys: recall increases from 53.38% to 80.81%, nearly doubling. Password F1 improves from 73.39% to 81.57%, primarily from precision improvement (59.16% → 70.94%). IP address and email improvements are marginal (<1 point F1). Username F1 improves only from 59.39% to 61.49% — essentially no benefit, which the paper attributes to the model confusing usernames with decorators and path values.
PII detection: post-processing (described in Section 4.3). The paper adds four post-processing steps based on observed detection errors but does not ablate their individual contributions. These include: ignoring secrets with <4 characters, requiring names to contain a space, filtering non-gibberish and short keys, and validating IP addresses for syntax and privacy. Without ablation, the marginal benefit of each filter cannot be assessed, but the overall PII redaction quality depends on these heuristics, especially for the key and password categories where the raw model precision is low.
FIM rate and mode (Section 5.1). The paper applies FIM to 50% of code training examples, with PSM and SPMv2 modes each at 50% probability. No ablation of the FIM rate or mode distribution is reported. The choice of 50% is motivated by preserving both left-to-right and infilling capabilities, but the paper does not test alternative rates (e.g., 25%, 75%) to determine whether the 50% split is optimal or whether infilling performance could be improved with more FIM training.
Context window length (Table 21). The perplexity comparison between 2K and 8K context windows shows consistent reductions across languages, confirming that the longer context provides measurable benefits. However, the evaluation uses evaluative perplexity — a measure of how well the model predicts held-out text — not a downstream task metric. The paper does not evaluate whether the 8K context improves performance on code completion, type prediction, or other tasks, leaving open the question of whether the perplexity reduction translates to practical gains.
StarCoder vs. StarCoderBase (multiple tables). Across the evaluation suite, the paper provides an implicit ablation of Python fine-tuning. On HumanEval, StarCoder improves over StarCoderBase by +3.2 points (33.6% vs. 30.4%); on MBPP, by +3.7 points (52.7% vs. 49.0%); on DS-1000, by +2.2 points (26.0% vs. 23.8%). On MultiPL-E, the effect is inconsistent: some non-Python languages improve (TypeScript: +0.14, C++: +0.99) while others decline (Go: -3.86, Ruby: -16.01 — though Ruby's baseline is anomalous at 17.25% for StarCoderBase and 1.24% for StarCoder, likely indicating evaluation variance rather than catastrophic forgetting). On natural language tasks, the differences are small: MMLU 33.9% vs. 34.2% (StarCoderBase slightly better), CoQA 0.67 vs. 0.67 (identical), StereoSet overall ICAT 76.65 for StarCoderBase (StarCoder not evaluated). This pattern suggests that Python fine-tuning provides moderate Python-specific gains with limited degradation on other languages, but the anomalous Ruby result and the incomplete evaluation coverage prevent strong conclusions.
Training data volume and language performance (Figure 2, left). The relationship between pass@1 and log-dataset-size is approximately linear for languages with sufficient data, with R² values between 0.399 and 0.510. This provides a rough scaling law for multi-language code performance: each doubling of training data volume yields a predictable pass@1 improvement for languages above ~1 GB. The paper does not test whether this relationship holds for other model sizes or training durations, making it suggestive rather than definitive.
Commit window size (Section 3.4). The paper uses full files for 20% of commit examples and windowed context (0-32 lines around changes) for 80%. No ablation of this ratio is reported. The window size of 0-32 lines was chosen to balance providing sufficient context with preventing memorization, but the optimal window size for learning code transformations is an empirical question that the paper does not investigate.
Issue quality filters (Section 3.3). The four-stage GitHub issues filtering pipeline removes 18% (automated text), 17% of events (bots), 14% of issues (low engagement), and an unspecified percentage (non-English). The paper reports the volume reduction at each stage but does not ablate the individual filters to determine which contribute most to data quality. The decision to remove non-English issues — made because the PII model was English-only — is a significant tradeoff that the paper acknowledges but does not quantify in terms of lost training data diversity.
JSON/YAML/CSS weighting (Section 3.6). The caps on JSON (1 GB), YAML (1 GB), and CSS (3 GB) represent substantial reductions from their natural volumes (5.62 GB, 3.76 GB, and 11.93 GB respectively after filtering). The paper does not ablate these caps or compare model performance with different cap values. The stated rationale — preventing memorization while learning format — is plausible but untested; a model trained with higher caps might perform better on JSON/YAML/CSS tasks, or might not, and the paper provides no evidence either way.
Critical Assessment
The central claim that StarCoder "outperforms every open LLM for code that supports multiple programming languages" (Section 1) is strongly supported for the benchmarks evaluated. On HumanEval, StarCoder (33.6%) exceeds CodeGen-Mono (29.3%) by +4.3 points and CodeGeeX (22.9%) by +10.7 points (Table 12). On MBPP, StarCoder (52.7%) exceeds CodeGen-Mono (35.3%) by +17.4 points and CodeGeeX (24.4%) by +28.3 points. On MultiPL-E across 19 languages, StarCoderBase outperforms CodeGen-16B-Multi on 17 of 19 languages and CodeGeeX on 15 of 19 (Table 15). On DS-1000, StarCoder (26.0%) exceeds CodeGen-Mono (11.7%) by +14.3 points (Table 13). On ODEX English, StarCoderBase (46.5%) exceeds CodeGen-Mono (33.7%) by +12.8 points (Table 14).
However, the "every open LLM" claim requires qualification. The comparison set, while comprehensive, does not include all possible open models. Notably, Replit's 3B-parameter code model, the CodeGeeX2 series, and various open-source fine-tuned variants (WizardCoder, OctoCoder, etc.) were available at the time of writing but not evaluated. More significantly, the claim that StarCoder "matches or outperforms the OpenAI code-cushman-001 model" (Section 1) is supported on aggregate but with language-specific exceptions: code-cushman-001 outperforms StarCoderBase by more than 5 points on Ruby (28.63% vs. 17.25%), Swift (22.12% vs. 16.74%), and C++ (30.59% vs. 30.56%, a marginal difference). On HumanEval Python, the models are essentially tied (33.5% vs. 33.6%). The claim is therefore accurate but masks non-trivial variation across languages.
A genuine strength of the evaluation is its breadth. The paper evaluates on 10 distinct code benchmarks (HumanEval, MBPP, MultiPL-E × 19 languages, DS-1000 × 7 libraries, ODEX, Asleep at the Keyboard, single-line FIM, return type prediction, TypeScript type prediction, docstring generation) plus 6 natural language benchmarks (GSM8K, MMLU, CoQA, StereoSet, RealToxicityPrompts, HELM reasoning). This is substantially more comprehensive than the evaluation sections of comparable papers (CodeGen evaluates on HumanEval, MMLU, and a few custom benchmarks; CodeGeeX primarily on HumanEval-X; InCoder on HumanEval, MBPP, and FIM tasks). The inclusion of security (Asleep at the Keyboard), bias (StereoSet, CrowS-Pairs), and toxicity (RealToxicityPrompts) evaluations is particularly notable because most Code LLM papers ignore safety dimensions. The DS-1000 and ODEX evaluations address the criticism that HumanEval and MBPP are not representative of real-world programming, and the FIM evaluations on type prediction and docstring generation demonstrate capabilities beyond code completion.
The paper's most significant experimental weakness is the absence of confidence intervals or statistical significance testing. All benchmark scores are reported as point estimates without standard errors, despite many being computed from 200 samples. For pass@1 on HumanEval (164 problems), a 33.6% score represents 55 solved problems, and the standard error under binomial assumption is approximately 3.7 percentage points — meaning that StarCoder's "lead" over code-cushman-001 (33.5%) is well within sampling error. The paper does not report pass@1 variance or use bootstrap confidence intervals, and it does not apply statistical tests when comparing models. The comparison to CodeGen-Mono on MBPP (52.7% vs. 35.3%) is likely statistically significant, but the comparison to code-cushman-001 on HumanEval (33.6% vs. 33.5%) almost certainly is not. The MultiPL-E evaluations, based on translated HumanEval problems (164 per language), have the same sample size limitation. For low-resource languages where pass@1 is in single digits, the error bars are proportionally enormous: StarCoderBase's 1.24% on Ruby represents 2 of 164 problems solved, and the difference from CodeGen-Multi's 0.00% could easily arise from sampling noise.
The decontamination protocol has a known but unquantified limitation. The paper removes files matching docstrings or solutions from HumanEval, MBPP, APPS, GSM8K, and DS-1000 (Section 5.2). However, for several evaluations — Python return type prediction, TypeScript type prediction, docstring generation — the evaluation data comes from public GitHub repositories that "may overlap with the training data" (Sections 6.2.3). The paper acknowledges this for return type prediction and docstring generation but does not quantify the overlap or report decontaminated scores. This creates uncertainty about whether StarCoder's strong performance on these tasks reflects genuine generalization or partial memorization. The TypeScript type prediction evaluation partially addresses this by using "JavaScript packages that have never been translated to TypeScript" (Section 6.2.3), but the Python return type and docstring evaluations use standard datasets without such safeguards.
The comparison to code-cushman-001 is confounded by unknown training data, architecture, and inference details. code-cushman-001 is a 12B-parameter model from OpenAI with undisclosed training data, architecture, and training methodology. The paper's claim that StarCoder "matches or outperforms" this model is therefore comparing two models that may differ in numerous unobservable ways. It is possible that code-cushman-001 was trained on less data, or on a different language distribution, or with different optimization — the point estimate equality on HumanEval tells us nothing about which model is "better" in a causal sense, only that they achieve similar scores on this specific benchmark. The paper correctly treats this as a performance milestone rather than a causal claim, but readers may overinterpret the comparison.
The training dynamics analysis (Figure 2) is suggestive but incomplete. The relationship between pass@1 and log-dataset-size is fit with a linear regression, but the paper does not test whether this relationship holds out-of-sample (e.g., does it predict performance at a held-out checkpoint or for a held-out language?). The R² values (0.399–0.510) indicate that data volume explains roughly half the variance in pass@1 across languages, leaving substantial unexplained variance. The paper does not investigate other factors that might explain this residual variance — language complexity, syntactic similarity to high-resource languages, average file length, or code comment density. The finding that R performance degrades between 800B and 1000B checkpoints, and that individual problem pass rates vary uncorrelatedly, is important but treated as an observation rather than a phenomenon to be explained.
The long-context evaluation measures perplexity, not task performance. Table 21 shows that 8K context reduces perplexity relative to 2K context, which is expected — more context provides more information. But the paper does not demonstrate that this reduction translates to improved code completion, type prediction, or any downstream task. A model with lower perplexity is not guaranteed to produce better code; it might simply be more confident about its incorrect predictions. The paper would be strengthened by, for example, evaluating code completion accuracy with 2K vs. 8K context on a task where the additional context provides information needed for correctness (e.g., function definitions from earlier in the file).
The security evaluation (Table 16) does not compare to the strongest baselines. code-davinci-002 is evaluated on the same benchmark in Table D.2 and achieves higher valid rates (98.40% completion) but also higher insecure rates (42.99%). This suggests a tradeoff: larger models generate more valid code but may also be more prone to reproducing common vulnerability patterns. The paper does not investigate why StarCoderBase achieves lower insecure rates than code-davinci-002 — is it the training data (permissively licensed code might be higher quality), the model size (larger models may memorize more vulnerable code), or the architecture (FIM capability might help)? Without this analysis, the security results are reported but not explained.
Missing ablation: the effect of PII redaction on model performance. The paper describes an extensive PII redaction pipeline but never evaluates whether the redaction affects downstream code generation quality. Does replacing <NAME> and <EMAIL> tokens introduce artifacts that degrade the model's ability to generate realistic code? Does training on redacted data change the distribution of generated identifiers? These questions are relevant for users who will interact with the model on tasks involving realistic data (e.g., generating test fixtures, database schemas, or configuration files). The lack of this ablation is a significant gap given the paper's emphasis on PII redaction as a core contribution.
Missing evaluation: memorization and verbatim reproduction. Despite the paper's focus on attribution tools and the legal analysis of fair use, it does not evaluate whether StarCoder memorizes and reproduces training data verbatim. The membership checking tool (Section 9.1) is presented as a tool for users, not as an evaluation methodology. A systematic evaluation — e.g., measuring the rate at which the model reproduces training sequences of varying lengths, similar to the memorization analyses in Carlini et al. (2023) for text models — would substantially strengthen the paper's responsible release claims by quantifying the residual memorization risk after PII redaction and deduplication.
The paper's carbon emissions reporting (16.68 tonnes CO2eq) is commendably transparent but incomplete. It reports emissions for StarCoderBase and StarCoder training but does not account for the full lifecycle: the PII annotation effort (1,399 workers), the StarEncoder pre-training (64 GPUs for 2 days), the PII inference run (800 GPU-hours), or the multiple training checkpoints evaluated in Figure 2. Including these would increase the total but likely not by an order of magnitude. The paper also does not report emissions for the baseline models it compares against, making it impossible to assess whether StarCoder's training was more or less carbon-efficient than comparable models.
The paper does not evaluate whether the attribution tools work as intended. The Bloom filter membership checker and BM25 search index are described in Section 9 but never evaluated. What is the false positive rate of the Bloom filter on typical code queries? What is the recall of the BM25 index for finding copied code snippets? Can the tools actually help users determine whether a generation is novel or memorized? The paper treats these as infrastructure contributions rather than systems to be evaluated, but their practical utility — and hence the paper's responsible release claims — depends on their accuracy, which is unmeasured.
6. Limitations and Trade-offs
The Difficulty Estimation Cost Is Unaccounted
The assumption or constraint. The paper's PII redaction pipeline and attribution tools rely on substantial computational infrastructure whose costs are reported but not amortized into any efficiency claim. More critically, the paper's entire data curation pipeline — community visual inspection of 30,000 files across 300 extensions, the PII annotation dataset collection involving 1,399 crowd-workers, the pseudo-labeling procedure on 18,000 unlabeled files, and the PII model inference run across 815 GB of training data (800 GPU-hours) — represents an enormous upfront investment that is externalized from all performance comparisons. The paper states this investment transparently (Sections 3.1, 4.1, 4.3) but never frames it as a cost that must be paid to achieve the reported benchmark scores.
The consequence. A practitioner seeking to replicate StarCoder's performance on a new dataset cannot simply apply the described architecture and training procedure — they must also budget for the data curation infrastructure. The 800 GPU-hours for PII inference alone is comparable to training a modestly-sized model. The paper's model is therefore not "open" in the sense of being cheap to reproduce; it is open in the sense that the artifacts (weights, data, code) are available, but the process that produced them required resources — particularly the community coordination and annotation effort — that individual practitioners or small labs cannot replicate. This undermines the paper's implicit claim that openness is a straightforward alternative to closed development. The headline performance numbers are contingent on the PII redaction quality, deduplication thoroughness, and data filtering accuracy, all of which are functions of the substantial unaccounted curation budget.
What evidence exists in the paper. The paper provides explicit cost figures for several components: 320,256 GPU-hours for StarCoderBase training (Section 5.7), 800 GPU-hours for PII inference (Section 4.3), 64 GPUs for ~2 days for StarEncoder pre-training (Section 4.2), and the PII annotation effort involving 1,399 workers earning ~$27 each (Section 4.1). These numbers are reported but not aggregated into a total "cost of openness" figure, and no baseline comparisons account for curation costs.
Mitigation status. Not mitigated. The paper treats these costs as transparency disclosures rather than limitations to be addressed. Future work could investigate whether the PII pipeline can be made more computationally efficient (e.g., through model distillation or selective inference), whether the community inspection process can be partially automated, or whether a lighter-weight curation pipeline would yield similar model quality. The paper does not suggest such work.
Hard Problems Remain Unsolved — and the Paper Has No Method for Identifying Them
The assumption or constraint. The paper's performance claims are averaged across all problems in each benchmark, but the training dynamics analysis (Figure 2) reveals that low-resource languages and difficult problems see limited or negative improvement from additional training. For languages with less than ~1 GB of training data, pass@1 plateaus or declines at later checkpoints. For the hardest individual problems, performance is brittle and uncorrelated across checkpoints: Table D.3 shows that problem HumanEval_0 in R goes from 20 correct out of 200 at 400B tokens, to 171 at 600B, to 197 at 800B, and down to 5 at 1000B — an essentially random walk. The paper acknowledges this pattern but provides no mechanism for predicting which problems or languages will exhibit this brittleness, and no strategy for improving performance on them beyond training on more data.
The consequence. A practitioner deploying StarCoder faces an unknown reliability boundary. For tasks involving low-resource languages (R, Perl, Lua, Julia, Racket) or uncommon programming patterns, the model may produce correct solutions, or it may fail in ways that cannot be anticipated from aggregate benchmark scores. The MultiPL-E evaluation (Table 15) quantifies this for individual languages — R at 10.18%, Perl at 16.32%, Racket at 11.77% — but a user writing Racket code cannot know from these numbers whether their specific task will succeed. The lack of a difficulty estimation mechanism (unlike, for example, the paper analyzed in the reference example, which bins problems by the base model's pass@1 rate) means that users have no way to assess whether StarCoder is likely to succeed on their particular query before committing time and compute.
This limitation is particularly acute because the paper provides no failure analysis for low-resource language generations. The manual inspection of R completions (Section 6.3) identifies that failures are "caused by minor mistakes, e.g., not taking the absolute value when computing GCD, not converting a string to a character array, or not checking edge cases" — but this is an anecdotal observation, not a systematic categorization that could inform users about what types of errors to expect or how to mitigate them.
What evidence exists in the paper. Figure 2 (right) shows the performance trajectories for 19 languages over training, with clear divergence between high-resource languages (continuing to improve) and low-resource languages (plateauing or declining). Figure 2 (left) shows the log-linear relationship between data volume and pass@1, with the slope increasing at later checkpoints — implying that the rich get richer while data-poor languages fall further behind. Table D.3 provides concrete evidence of per-problem instability for R, but only for 13 selected problems. The paper does not report similar analysis for other low-resource languages.
Mitigation status. Partially mitigated by transparency. The paper reports the phenomenon honestly and provides the training dynamics data that enables other researchers to study it. The data weighting decision — following the natural distribution rather than upsampling low-resource languages — is defended as principled (Section 3.6), but this defense essentially accepts the limitation rather than addressing it. The paper does not propose or evaluate any method for improving low-resource language performance (e.g., targeted fine-tuning, data augmentation, or transfer learning techniques).
The Open-Weight Release Creates an Irreversible Safety Risk That the Paper's Guardrails Cannot Fully Contain
The assumption or constraint. The paper acknowledges this limitation explicitly in Section 10.1:
"without appropriate guardrails, open LLM development poses a higher risk of misuse, as increased model access also increases the likelihood of harm caused by the model. Even though a released API can be shut down, once the model weights are released, it is nearly impossible to retract them."
The paper implements several guardrails: an OpenRAIL-M license with enforceable use restrictions, a PII redaction pipeline that masks sensitive entities in training data, attribution tools that help detect copied generations, and a malicious code detection step that removed 654 files from The Stack v1.2 (Section 10.2). But the fundamental tension remains: once the weights are public, no license, tool, or use restriction can prevent a determined adversary from using the model for harmful purposes — generating malware, identifying vulnerabilities in open-source software, automating social engineering attacks in code review contexts, or fine-tuning the model on malicious code to remove any safety conditioning.
The consequence. The paper's safety evaluation (Sections 7.3, 10) measures the model's tendency to generate toxic or biased text and its rate of generating code with known security vulnerabilities — but these are baseline safety properties, not adversarial robustness evaluations. The security benchmark (Table 16) shows that StarCoderBase generates vulnerable code at a rate of 35.87% in insertion mode, which is lower than alternatives but still non-trivial — and this is the rate for unintentional vulnerability generation. An adversary actively prompting the model to produce malicious code would likely achieve far higher success rates. The paper does not evaluate whether the model can be jailbroken to ignore its implicit safety conditioning, or whether it can generate functional malware when prompted adversarially.
The PII redaction pipeline, despite its sophistication, has known failure modes: it excludes the ID category entirely (Section 4.3), achieves only 70.41% F1 on keys even with pseudo-labeling (Table 8), and does not redact usernames not participating in issue conversations (Section 4.3). This means the training data — and potentially the model's memorized outputs — may still contain exposed secrets that an adversary could extract through targeted prompting. The paper's investigation of memorization is limited to the attribution tools (Section 9), which are designed for user-side detection, not adversarial extraction.
What evidence exists in the paper. The StereoSet (Table 25) and RealToxicityPrompts (Table 26) evaluations establish baseline safety properties. The Asleep at the Keyboard evaluation (Table 16) measures unintentional vulnerability generation. The PII detection model performance figures (Tables 8 and 9) quantify residual PII risk. The community opt-out feedback (Section 10.3) reveals that some developers were concerned about "the potential for model generations to be traced back to their work, resulting in potential legal liability" — a concern the attribution tools partially address but cannot eliminate. The paper does not conduct adversarial safety evaluations, red-teaming exercises, or extraction attacks against its own model.
Mitigation status. Partially mitigated through the license, attribution tools, and transparency. The OpenRAIL-M license includes use restrictions against generating malware and disseminating PII, and the paper argues that the license provisions are enforceable. The attribution tools enable detection of copied training data, which could help identify malicious use. The paper's extensive documentation of limitations (Section 10.2) demonstrates awareness of the problem. However, these are governance mitigations, not technical ones — they rely on legal enforcement and user cooperation, neither of which can be guaranteed. The paper does not propose technical mechanisms (e.g., safety conditioning during training, output filtering, or capability restrictions) that would make the model intrinsically harder to misuse, beyond the existing PII redaction and training data curation.
The Attribution Tools Are Unevaluated Infrastructure with Unknown Practical Utility
The assumption or constraint. The paper presents the Bloom filter membership checker and BM25 search index as key contributions toward responsible release (Section 1, Section 9) and grounds their importance in the legal analysis of fair use (Section 1, citing Henderson et al., 2023). However, these tools are never evaluated for accuracy, usability, or practical effectiveness. The paper describes their design (50-character Bloom filter, 3-gram BM25 tokenizer) but reports no metrics on false positive rates, recall for detecting copied code, latency in interactive use, or whether the two-stage workflow (Bloom filter first pass → BM25 search for verification) actually helps users make decisions about code reuse.
The consequence. The paper's governance claims — that the tools "can help users detect and locate model generations that may have been copied from the training set" (Section 1) — rest on unevaluated infrastructure. There are several specific failure modes that the paper does not investigate:
- False negatives in the Bloom filter: the Bloom filter is built on 50-character substrings. If the model copies a shorter snippet (e.g., a 30-character API call or a 40-character function signature), or if it makes minor edits to a copied snippet such that no 50-character substring exactly matches, the Bloom filter will report no match. The paper does not measure how often this occurs in practice.
- False positives in the Bloom filter: Bloom filters have one-sided error — false positives are possible. The paper notes this (Section 10.2) but does not quantify the rate. If a user's perfectly novel code generation triggers a false positive, they may waste time investigating a non-existent match in the BM25 index, or they may incorrectly conclude the generation is unsafe to use.
- The attribution tools do not distinguish between generic and unique code. The paper explicitly acknowledges this limitation (Section 10.2): "Both attribution tools do not attempt to distinguish between generic code (e.g., boilerplate) or protected content." This is a fundamental gap. A match on a 50-character string like
def __init__(self, *args, **kwargs):orimport numpy as npis meaningless for attribution purposes — such snippets appear in thousands of repositories and are not copyrightable. Yet the tools will flag them identically to a match on a unique 200-line algorithm implementation. Users are left to make this distinction manually, which the tools provide no support for.
The practical consequence is that the paper's attribution infrastructure may create a false sense of security. Users who see no Bloom filter match may assume a generation is novel when it actually contains copied but slightly modified code. Users who see a match may overcorrect by rejecting generations that are safe to use. The paper provides no evidence that the tools, as deployed, improve decision-making about code reuse.
What evidence exists in the paper. None. Section 9 describes the tools' design but reports no evaluation metrics. The VSCode integration is mentioned but not demonstrated or evaluated in a user study. The paper does not report examples of the tools successfully identifying copied code, or measure their latency, memory footprint, or accuracy on representative queries. The limitation is acknowledged in Section 10.2 ("Both attribution tools do not attempt to distinguish between generic code... or protected content") but the deeper problem — that the tools are entirely unevaluated — is not acknowledged.
Mitigation status. Not mitigated. The paper treats the tools as infrastructure contributions whose value is self-evident, but this assumption is untested. Future work could evaluate the Bloom filter's precision and recall on a benchmark of known-copied and known-novel code generations, measure the BM25 index's retrieval accuracy, conduct user studies on whether the VSCode integration helps developers make appropriate reuse decisions, and develop methods for automatically distinguishing generic from unique code in attribution matches. The paper does not propose any of these evaluations.
The Evaluation Methodology Weakens the Strength of Key Performance Claims
The assumption or constraint. The paper makes strong comparative claims — "StarCoder outperforms every open LLM for code that supports multiple programming languages" (Section 1) and "StarCoder matches or outperforms the OpenAI code-cushman-001 model" (Section 1) — but the experimental design has several methodological weaknesses that reduce confidence in the precision and reliability of these claims.
The consequence. The most significant methodological gaps are:
-
No confidence intervals or significance testing. All benchmark scores are reported as point estimates. For pass@1 on HumanEval (164 problems), a score of 33.6% (55 problems solved) has a binomial standard error of approximately 3.7 percentage points — meaning StarCoder's reported "lead" over code-cushman-001 (33.5%, or ~55 problems) is well within sampling error. The paper reports no bootstrap confidence intervals, no standard errors, and applies no statistical tests to determine whether observed differences are distinguishable from noise. On MultiPL-E HumanEval translations (also 164 problems per language), the effective sample size limitations are identical, and for low-resource languages where pass@1 is in single digits (e.g., StarCoderBase's 1.24% on Ruby ≈ 2 problems solved), the differences between models could easily arise from which specific 2 of 164 problems happened to be solved.
-
Evaluation data contamination is acknowledged but not quantified. The paper decontaminates training data against HumanEval, MBPP, APPS, GSM8K, and DS-1000 (Section 5.2), removing 558 Python files. However, for the Python return type prediction, TypeScript type prediction, and docstring generation evaluations (Sections 6.2.3), the evaluation data comes from public GitHub repositories and "may overlap with the training data" — an acknowledgment made explicitly but without any quantification of the overlap or decontaminated scores. For the TypeScript type prediction evaluation, the paper mitigates this by using packages "that have never been translated to TypeScript" (Table 19), but the return type prediction and docstring generation evaluations use standard datasets without such safeguards. This means the reported F1 scores (77.4% for Python return types, 21.38 BLEU for docstring generation) may partially reflect memorization rather than generalization, and the comparisons to models trained on different data (InCoder, SantaCoder) are confounded by potentially different levels of benchmark contamination.
-
The code-cushman-001 comparison is confounded by unknown differences. The paper's central closed-model comparison target is a model with undisclosed training data, architecture, and training methodology. code-cushman-001 may have been trained on less data, or a different language distribution, or with different optimization — the point estimate equality on HumanEval (33.5% vs. 33.6%) tells us nothing about which model is "better" in a causal sense. The paper treats this comparison as a performance milestone (which is reasonable) but the strength of the claim ("matches or outperforms") implies a more precise equivalence than the evidence supports. When StarCoder outperforms code-cushman-001 by +6.8 points on MBPP (52.7% vs. 45.9%) but trails by −11.4 points on Ruby (17.25% vs. 28.63%), it is unclear whether these differences reflect genuine capability gaps, differences in training data composition, or evaluation noise.
-
The DS-1000 and ODEX evaluations, while more realistic than HumanEval, have their own limitations. DS-1000's 1,000 problems span 7 libraries but are all constructed from StackOverflow questions — a specific source that may have particular characteristics (e.g., typical question complexity, answer style) not representative of general data science coding. ODEX's 945 problems include both open and closed-domain queries but are limited to Python. Neither benchmark evaluates multi-file programming, repository-level code understanding, or collaborative coding scenarios that characterize real-world software development.
What evidence exists in the paper. The sample sizes are transparent: HumanEval = 164 problems, MBPP = ~500 problems in the standard split, DS-1000 = 1,000 problems, MultiPL-E = 164 or 500 problems per language. The decontamination note for return type prediction and docstring generation appears as a caveat in Section 6.2.3: "we note that the functions in this evaluation set were taken from GitHub repositories, they may overlap with the training data." The paper does not report confidence intervals, standard errors, or statistical tests anywhere in the evaluation section.
Mitigation status. Partially mitigated by evaluation breadth. While no single benchmark comparison is statistically robust, the consistent pattern across 10 different code benchmarks (HumanEval, MBPP, MultiPL-E × 19 languages, DS-1000 × 7 libraries, ODEX, Asleep at the Keyboard, single-line FIM, return type prediction, TypeScript type prediction, docstring generation) provides converging evidence that StarCoder is genuinely stronger than prior open-access models. If the HumanEval result were a statistical fluke, it would be unlikely to see consistent advantages on DS-1000, ODEX, and the MultiPL-E suite. However, for the specific claim about matching code-cushman-001, the evidence is weaker — the MultiPL-E table (Table 15) shows the two models trading wins across languages, and the aggregate equivalence on HumanEval is within sampling error. The paper does not address the statistical limitations directly and does not propose confidence interval reporting or significance testing for future work.
7. Implications and Future Directions
How This Work Changes the Landscape
This paper fundamentally reframes open-access code model development as a systems engineering discipline where data governance is not a constraint on performance but a prerequisite for it. The shift is conceptual rather than architectural: prior to StarCoder, the field tacitly accepted that openness and competitiveness traded off against each other — that matching closed-model performance required some degree of opacity, whether in training data (CodeGen-Mono's undisclosed Python dataset), model access (code-cushman-001 via paid API), or licensing (LLaMA's non-commercial restriction). StarCoder demonstrates that this tradeoff is an artifact of underinvestment in data curation infrastructure, not a fundamental limitation of open development.
The magnitude of this shift is best understood through the paper's diagnostic finding about regex-based PII detection: the detect-secrets tool achieves only 3.62% precision on API keys (Table 8), meaning 96 out of every 100 detected "keys" are false positives. This is not a minor implementation detail — it implies that every prior code model trained on unredacted or regex-redacted GitHub data contained substantial quantities of exposed secrets, and that the community's standard data cleaning practices were fundamentally inadequate. The paper's response — a custom-trained encoder model, 22,950 crowd-sourced annotations across 12,000 files in 31 programming languages, pseudo-labeling with domain-specific trigger-word filtering, and 800 GPU-hours of inference — redefines what "responsible data curation" means for code training. This diagnostic alone makes the paper a significant methodological contribution, even independent of the model's benchmark scores.
The paper also reframes Fill-in-the-Middle from a code completion feature to a general-purpose model capability. Prior work (Bavarian et al., 2022; Fried et al., 2022; Ben Allal et al., 2023) treated FIM primarily as an IDE enhancement — you give the model prefix and suffix, it fills the gap. StarCoder's evaluation demonstrates that FIM enables a family of tasks that share an underlying "conditional generation" structure: type prediction (Tables 18 and 19), docstring generation (Table 20), security-relevant code repair (Table 16 — insertion mode achieves 98.70% valid code vs. 85.50% in completion mode), and instruction-guided code editing via the commit template (Appendix E.1). These tasks were previously treated as separate problems requiring specialized architectures or fine-tuning; StarCoder shows they emerge from a single training objective — next-token prediction on FIM-formatted data applied 50% of the time. This reframes FIM as a training paradigm for teaching bidirectional conditioning, not a feature to bolt onto a left-to-right model.
The paper reconciles a latent contradiction in the field about multi-language code model training. Prior work assumed that high-resource languages would "crowd out" low-resource ones, motivating manual upsampling or language-specific fine-tuning (CodeGen-Mono's Python specialization, CodeGeeX's curated 23-language selection). StarCoder's training dynamics analysis (Figure 2) provides evidence against this assumption: the relationship between pass@1 and log-dataset-size strengthens at later checkpoints (R² increases from 0.399 at 600B tokens to 0.510 at 1000B), and performance declines for languages with less than ~1 GB of data regardless of their proportion in the training mix. This implies that low-resource language performance is fundamentally data-limited, not proportion-limited — upsampling would not help, only acquiring more data would. The paper's proportional sampling strategy, validated at 15× the scale and 3× the languages of SantaCoder, establishes a principled default for multi-language code training that prior work had not empirically justified.
Perhaps most significantly, the paper introduces the attribution-tool-as-governance-infrastructure as a new category of model documentation. Prior to StarCoder, responsible release focused on static artifacts: model cards, dataset cards, technical reports. These are useful for initial assessment but provide no mechanism for ongoing accountability — users cannot investigate whether a specific generation was copied from training data. The two-stage attribution system (Bloom filter for fast membership checking, BM25 index for precise source location), integrated into the VSCode development environment, creates an interactive, queryable, deployment-time accountability mechanism that operationalizes the legal analysis from Henderson et al. (2023) cited in Section 1: fair use protection is strongest when models generate novel content, and attribution tools provide the mechanism to verify novelty. This shifts the burden of proof from "trust us" to "verify for yourself," establishing a new standard that future open models will be measured against — and that closed models will face pressure to match.
One research direction becomes less attractive as a result of this work: the development of ever-larger open models trained on uncurated or minimally-curated data. The paper's finding that PII redaction quality requires ML-based NER trained on domain-specific annotated data (regex precision on keys: 3.62%) means that scaling up without scaling curation infrastructure is irresponsible. A 100B-parameter open model trained on regex-redacted GitHub data would, by the paper's evidence, contain more memorized secrets than StarCoder, not fewer, because larger models memorize more. The paper implicitly argues that the field should prioritize curation infrastructure investment over raw parameter scaling — a prioritization that reverses the dominant trend in the open LLM community at the time of writing.
Follow-Up Research This Work Enables
Systematic evaluation of memorization and verbatim reproduction in StarCoder. The paper builds attribution tools for detecting copied code but never uses them to evaluate the model itself. A natural follow-up would measure the rate at which StarCoder reproduces training sequences of varying lengths, using the methodology from Carlini et al. ("Quantifying Memorization Across Neural Language Models," 2023) adapted for code. Specifically: prompt the model with the first 50–200 tokens from random training files at varying temperatures, measure how often it reproduces the next 50, 100, or 200 tokens exactly, and correlate reproduction rate with file frequency in the training set (deduplication count), PII presence, and license type. The paper's Bloom filter provides a lightweight first-pass detector; the BM25 index enables precise source location. A strong follow-up would quantify: (a) memorization rates for different sequence lengths and languages, (b) whether deduplication (near-dedup with Jaccard 0.7, Section 3.5) suppresses memorization for copied files, (c) whether PII redaction reduces memorization of sensitive entities (do <NAME> and <EMAIL> tokens appear in memorized outputs at lower rates than original names and emails?), and (d) whether memorization rates differ between permissively licensed code and the general distribution of GitHub code. This would transform the paper's governance claims from infrastructure to evidence.
Evaluating whether the attribution tools actually change developer behavior. The paper presents the VSCode-integrated Bloom filter and BM25 search index as responsible release infrastructure, but never measures whether developers use them, understand their outputs, or make better code reuse decisions because of them. A concrete follow-up would be a controlled user study: recruit professional developers, give them code generation tasks using a StarCoder-powered completion tool, randomize whether they have access to the attribution tools, and measure: (a) how often they accept completions flagged by the Bloom filter vs. unflagged completions, (b) whether they investigate BM25 search results and change their acceptance decision based on source license, (c) their self-reported understanding of whether a flagged generation is "safe to use" (with ground truth established by expert review), and (d) their trust in the model overall. The paper's own limitation note — that the tools "do not attempt to distinguish between generic code (e.g., boilerplate) or protected content" (Section 10.2) — predicts that users will struggle with false positives on boilerplate matches, and a user study would quantify this struggle. A negative result (users ignore the tools or make worse decisions with them than without) would be just as valuable as a positive one, because it would refine how attribution infrastructure should be designed.
Combining StarCoder's FIM capability with automated program repair benchmarks. The paper demonstrates that insertion (FIM) mode substantially improves the valid code rate on the Asleep at the Keyboard security benchmark (85.50% → 98.70%, Table 16) and reduces the insecure rate (39.77% → 35.87%). This suggests FIM could be applied to automated program repair — fixing bugs, vulnerabilities, or type errors by conditioning on surrounding correct code. A concrete follow-up would evaluate StarCoder on established program repair benchmarks (Defects4J for Java, BugsInPy for Python, or the ManyBugs benchmark) by: (a) providing the buggy function with surrounding context as prefix and suffix, (b) having the model infill a corrected version, (c) measuring repair rate (fraction of bugs fixed with all tests passing) and comparing to non-FIM baselines and specialized repair tools (e.g., SequenceR, CODIT). The paper's type prediction results (Tables 18 and 19) already show that FIM enables code-to-annotation tasks; repair extends this to code-to-code transformation. The key question is whether the general-purpose FIM capability matches or approaches specialized repair systems, or whether task-specific fine-tuning is necessary.
Stress-testing the PII redaction pipeline against adversarial extraction. The paper's PII detection model achieves 70.41% F1 on keys and 81.57% F1 on passwords even with pseudo-labeling (Tables 8 and 9), meaning roughly 20–30% of secrets in the training data may remain unredacted. An adversarial extraction evaluation would systematically probe whether these residual secrets can be elicited from the model: (a) prompt StarCoder with partial API key prefixes (e.g., "sk-", "AIza", "ghp_"), (b) measure how often the model completes them with valid-looking keys, (c) check whether completed keys correspond to real (possibly revoked) credentials by testing against the respective APIs, and (d) compare extraction rates for StarCoder vs. a hypothetical baseline trained on unredacted data (or vs. code-cushman-001, though its training data is unknown). This would directly test the paper's responsible release claim: if the redaction pipeline reduces extractable secrets but does not eliminate them, the residual risk needs quantification. A negative result (the model rarely or never completes partial keys with valid credentials) would strengthen the paper's governance claims; a positive result (extractable secrets exist) would motivate investment in stronger redaction or output filtering.
Training a "difficulty estimator" for low-resource language problems in StarCoder. The training dynamics analysis (Figure 2) reveals that low-resource language performance is brittle and problem-specific — Table D.3 shows R pass counts fluctuating from 20 to 171 to 197 to 5 across checkpoints for the same problem, with no correlation across problems. This suggests that StarCoder's capability on low-resource languages is not well-characterized by a single pass@1 number. A concrete follow-up would build a per-problem difficulty estimator analogous to the approach in the reference example paper: (a) generate 200+ samples for each low-resource language problem in MultiPL-E at multiple checkpoints, (b) compute the empirical pass@1 as a "difficulty" metric, (c) train a lightweight classifier (potentially using StarEncoder or a distilled variant) to predict difficulty from the problem text and target language alone, without generating samples, and (d) evaluate whether the classifier can identify which problems StarCoder will reliably solve vs. which it will fail on, across languages. If successful, this would give practitioners a deployable tool for deciding when to trust StarCoder on low-resource language tasks; if unsuccessful, it would establish a fundamental unpredictability that the paper currently only hints at.
Evaluating StarCoder's training data attribution tools as a mechanism for license compliance. The paper's legal analysis (Section 1, citing Henderson et al., 2023) argues that fair use protection is strongest when models generate novel content, and that attribution tools can help users verify novelty. But the paper never tests whether the tools can actually distinguish between code generated under different license conditions — e.g., can a user reliably determine whether a StarCoder completion is derived from an MIT-licensed snippet vs. a GPL-licensed snippet, and does this distinction matter for their intended use? A concrete follow-up would: (a) construct a benchmark of prompts designed to elicit code that exists in the training set under specific licenses (MIT, Apache, GPL, BSD), (b) measure whether the BM25 index retrieves the correct source file and whether the retrieved license matches the ground truth, (c) evaluate whether the Bloom filter's false positive rate varies by license type (are GPL snippets more or less likely to produce false positives than MIT snippets?), and (d) survey legal experts on whether the tool's outputs would satisfy the due diligence requirements for different use cases (internal tooling, distributed products, open-source contributions). This would bridge the gap between the paper's technical infrastructure and its legal motivation, testing whether the tools actually serve their stated purpose.
Practical Applications and Downstream Use Cases
On-device code completion for permissively licensed projects. Organizations developing software under permissive licenses (MIT, Apache, BSD) can deploy StarCoder locally as a code completion tool without the legal uncertainty associated with closed models trained on undisclosed data. Because StarCoder's training data is entirely permissively licensed and its attribution tools enable tracing completions back to source, a developer who receives a completion flagged by the Bloom filter can investigate whether it derives from code with compatible license terms — and if the completion is novel, it carries no license obligations. The paper's MBPP result of 52.7% pass@1 (Table 12) means that for typical algorithmic coding tasks, the model produces a correct solution on the first attempt more than half the time. The FIM capability — which improves valid code generation from 85.50% to 98.70% (Table 16) — means that completions conditioned on surrounding context are overwhelmingly syntactically valid, reducing the developer's debugging burden. For organizations that have avoided AI code tools due to license concerns, StarCoder provides a deployable alternative with auditable provenance.
Automated type annotation and documentation for large codebases. StarCoder's strong performance on return type prediction (77.4% non-None F1, Table 18) and docstring generation (21.38 BLEU, Table 20) — both enabled by the FIM architecture — means the model can be deployed as a batch processing tool for adding type annotations and documentation to existing, untyped codebases. A team with a million-line Python codebase that lacks type annotations could: (a) extract all function signatures and bodies, (b) format them using the FIM template, (c) have StarCoder infill return type annotations, (d) have a type checker (mypy, pyright) validate the generated annotations, and (e) manually review only the annotations that fail type checking. The paper's evaluation on packages that have never been translated to TypeScript (Table 19) — where 38.3% of packages type-check after StarCoder's annotations vs. 23.4% for InCoder — demonstrates that this workflow is viable even for languages with limited training data, as long as the model has seen similar type annotation patterns in related languages. The 8K context window (which reduces perplexity by 6–15% across languages, Table 21) enables the model to see entire function definitions plus surrounding context in a single forward pass, making batch processing efficient.
Data science code generation with domain-specific library support. The DS-1000 results (Table 13) show StarCoder achieving 26.0% overall pass@1 on data science tasks across 7 libraries, substantially exceeding code-cushman-001 (18.1%) and CodeGen-Mono (11.7%). A data science team using pandas, numpy, scikit-learn, and matplotlib could integrate StarCoder into their Jupyter notebook workflow — the model was explicitly trained on structured Jupyter notebooks (Section 3.2) in the text-code-output format, so it naturally handles the alternating documentation-code-output pattern common in data science. The model's 51.7% pass@1 on Matplotlib tasks and 29.7% on NumPy tasks means that for visualization and numerical computation, it provides correct solutions on a substantial fraction of queries. Because StarCoder's training data includes the formatted output of code cells (Section 3.2), it can even predict the output of a piece of code — the paper demonstrates this capability in Appendix E.1 with examples like predicting is_prime(3) → True — enabling a form of interactive exploration where the model suggests both code and its expected behavior before execution.
Security-aware code review assistance. The paper's Asleep at the Keyboard evaluation (Table 16) shows that StarCoder in insertion (FIM) mode generates code with a lower insecure rate (35.87%) than both CodeGen-16B-Multi (43.25%) and code-cushman-001 (42.32%), and with a higher valid rate (98.70%). This suggests deployment as a code review tool: when a developer writes code that touches security-sensitive functionality (authentication, input validation, cryptographic operations, SQL queries), the surrounding context can be used as FIM prefix and suffix, and StarCoder can generate alternative implementations. A reviewer could compare the developer's code against the model's suggestion, checking whether the suggestion avoids common vulnerability patterns. The paper's lower insecure rate for FIM vs. completion mode (35.87% vs. 39.77%) indicates that bidirectional context genuinely helps the model avoid introducing vulnerabilities, making the FIM variant the appropriate deployment mode for security applications. The limitation — that 35.87% of valid completions still contain vulnerabilities — means this tool would augment, not replace, human code review.
When to Prefer This Method
The paper articulates an explicit tradeoff between open-access and closed-access development paradigms, though it does not frame this as a user-facing "when to prefer" decision rule. The choice, as the paper presents it, is between:
-
Deploying StarCoder or another fully open model: appropriate when the deployment context requires auditability of training data, license compliance verification, on-premises or air-gapped operation without API dependencies, or the ability to fine-tune on proprietary code without legal uncertainty about output ownership. The paper's attribution tools (Section 9) and PII redaction pipeline (Section 4) provide infrastructure for verifying these properties. The cost is a performance gap relative to the largest closed models — code-davinci-002 at 175B parameters achieves 45.9% on HumanEval vs. StarCoder's 33.6% (Table 12), and 46.68% on MultiPL-E Python vs. 30.35% (Table D.1) — so the tradeoff is measurable: roughly 12 percentage points on Python benchmarks in exchange for full transparency and deployability.
-
Using closed-access models like code-cushman-001 or code-davinci-002: appropriate when maximum benchmark performance is the dominant consideration and the organization accepts the legal and operational constraints of API access — undisclosed training data provenance, inability to inspect or modify the model, dependency on the provider's continued service and pricing, and uncertainty about whether outputs may inadvertently reproduce copyrighted or GPL-licensed training data. The paper's evidence that StarCoder matches code-cushman-001 (33.6% vs. 33.5% on HumanEval, 52.7% vs. 45.9% on MBPP, Table 12) suggests that for the specific task of Python function generation from docstrings, the performance gap to the "practical" closed frontier has been closed — but the gap to the largest closed models remains substantial.
The paper does not articulate a tradeoff between StarCoder and other open-access models of similar size, because its evaluation shows StarCoder as dominating: it outperforms CodeGen-16B-Mono on all benchmarks, CodeGeeX-13B on all benchmarks, and provides FIM capability and 8K context that neither competitor offers. The decision rule within the open-access space is therefore a straightforward preference for StarCoder absent specific constraints (e.g., a requirement for non-English natural language support beyond the ODEX languages evaluated, or a deployment environment where the 15.5B parameter count is infeasible and a smaller model like SantaCoder at 1.1B is necessary).