# BigCode

**BigCode** 是一个开放的科学合作项目，由 [Hugging Face](https://www.edgepedia.org/zh/hugging-face) 与 [ServiceNow](https://www.edgepedia.org/zh/servicenow) Research 于 2022 年 9 月 26 日发起，致力于以负责任的方式开发面向代码的大型语言模型（代码 LLM）。<sup>[1](https://techcrunch.com/2022/09/26/hugging-face-and-servicenow-launch-bigcode-a-project-to-open-source-code-generating-ai-systems/)</sup><sup> • </sup><sup>[2](https://www.servicenow.com/research/opensource/bigcode.html)</sup> 受 [BigScience](https://www.edgepedia.org/zh/bigscience) 启发——该合作项目于 2022 年发布了一个开放的多语言模型——BigCode 公开释出其数据集、训练代码和模型，并组织数据治理工具，例如为源代码所有者提供的退出机制。<sup>[2](https://www.servicenow.com/research/opensource/bigcode.html)</sup><sup> • </sup><sup>[3](https://www.bigcode-project.org/docs/about/the-stack/)</sup> 其最知名的成果是 The Stack 数据集系列以及 SantaCoder、StarCoder 和 StarCoder2 模型系列。<sup>[4](https://www.bigcode-project.org/docs/about/timeline/)</sup>

| 关键事实 | 详情 |
|---|---|
| 成立时间 | 2022 年 9 月 26 日，由 Hugging Face 与 ServiceNow Research 发起<sup>[1](https://techcrunch.com/2022/09/26/hugging-face-and-servicenow-launch-bigcode-a-project-to-open-source-code-generating-ai-systems/)</sup> |
| 旗舰数据集 | The Stack：v1.0 版本包含 30 种语言、3.1 TB 宽松许可代码；v1.1 版本包含 358 种语言、6 TB<sup>[5](https://arxiv.org/abs/2211.15533)</sup><sup> • </sup><sup>[3](https://www.bigcode-project.org/docs/about/the-stack/)</sup> |
| 首个模型 | SantaCoder，11 亿参数多语言模型，2022 年 12 月 22 日发布<sup>[4](https://www.bigcode-project.org/docs/about/timeline/)</sup> |
| StarCoder | 155 亿参数，8K 上下文；StarCoderBase 在来自 The Stack 的 1 万亿 token 上训练，StarCoder 则在 350 亿 Python token 上微调；2023 年 5 月 4 日发布<sup>[6](https://arxiv.org/abs/2305.06161)</sup><sup> • </sup><sup>[4](https://www.bigcode-project.org/docs/about/timeline/)</sup> |
| 许可证 | StarCoder 模型以 BigCode OpenRAIL-M 许可证发布<sup>[8](https://huggingface.co/bigcode/starcoder/blob/main/README.md)</sup> |

## 使命与组织

BigCode 提出三项研究目标：为代码 LLM 建立覆盖多样任务和编程语言的代表性评估套件；为代码 LLM 实施负责任的数据治理与开发；以及更快的训练与推理方法。<sup>[2](https://www.servicenow.com/research/opensource/bigcode.html)</sup> 该项目面向具有专业背景、能够投入时间的 AI 研究人员开放，通过社区网络研讨会、工作组和专项工作组开展工作。<sup>[1](https://techcrunch.com/2022/09/26/hugging-face-and-servicenow-launch-bigcode-a-project-to-open-source-code-generating-ai-systems/)</sup><sup> • </sup><sup>[7](https://newsroom.servicenow.com/press-releases/details/2024/ServiceNow-Hugging-Face-and-NVIDIA-launch-New-Open-Access-LLMs-Help-Developers-Tap-Generative-AI-to-Build-Enterprise-Applications-02-28-2024-traffic/default.aspx)</sup> ServiceNow Research 大型语言模型实验室负责人 Harm de Vries 是该项目的联合负责人之一。<sup>[9](https://s205.q4cdn.com/537566246/files/doc_news/ServiceNow-and-Hugging-Face-release-StarCoder-an-open-access-large-language-model-for-code-generation-05-04-2023-traffic-2023.pdf)</sup>

## The Stack 数据集

The Stack 是 BigCode 的预训练数据集，由宽松许可的源代码构成，于 2022 年 10 月 27 日首次发布，为 3.1 TB 的集合，覆盖 30 种编程语言和 18 种宽松许可证。<sup>[4](https://www.bigcode-project.org/docs/about/timeline/)</sup><sup> • </sup><sup>[5](https://arxiv.org/abs/2211.15533)</sup> 2022 年 12 月 1 日发布的 1.1 版本移除了三种弱 copyleft 许可证（MPL、EPL 和 LGPL），将许可证列表扩展至 193 种，语言覆盖从 30 种增至 358 种，产出约 6 TB 的近似去重数据集。<sup>[3](https://www.bigcode-project.org/docs/about/the-stack/)</sup> 2023 年 3 月 20 日宣布的 1.2 版本移除了截至 2023 年 2 月 9 日提交的退出请求所涉及的代码，并初步标记了恶意文件。<sup>[3](https://www.bigcode-project.org/docs/about/the-stack/)</sup><sup> • </sup><sup>[4](https://www.bigcode-project.org/docs/about/timeline/)</sup>

**数据治理。** 除数据集外，BigCode 于 2022 年 11 月 15 日发布了“Am I in The Stack”搜索工具，让开发者可以查询自己的代码是否在数据集中；同时推出退出机制，仓库所有者可提交移除请求，并在后续版本中予以执行。<sup>[4](https://www.bigcode-project.org/docs/about/timeline/)</sup><sup> • </sup><sup>[3](https://www.bigcode-project.org/docs/about/the-stack/)</sup> 该项目还公开了其个人可识别信息（PII）检测与匿名化流程、一个用于移除与代码生成基准测试样本匹配文件的去污染脚本，以及针对行长度、字母数字字符比例和其他质量信号的预处理过滤器。<sup>[10](https://github.com/bigcode-project/bigcode-dataset)</sup> StarCoder 训练集基于 The Stack v1.2，该版本从 102 TB 的原始源数据集处理至 6.4 TB 的宽松许可数据。<sup>[11](https://huggingface.co/datasets/bigcode/governance-card/blob/main/README.md)</sup>

## SantaCoder

该项目的首个模型 SantaCoder 于 2022 年 12 月 22 日发布，是一个 11 亿参数的模型，在 The Stack 的 Java、JavaScript 和 Python 子集上训练。<sup>[4](https://www.bigcode-project.org/docs/about/timeline/)</sup><sup> • </sup><sup>[12](https://arxiv.org/abs/2301.03988)</sup> 尽管体量较小，其最佳版本在 MultiPL-E 基准的 Java、JavaScript 和 Python 部分上，在从左到右生成和填充（在已有代码之间生成代码以填补空缺）方面，表现优于更大的开源多语言模型 InCoder-6.7B 和 CodeGen-Multi-2.7B。<sup>[12](https://arxiv.org/abs/2301.03988)</sup>

## StarCoder

StarCoder 和 StarCoderBase 于 2023 年 5 月 4 日发布。<sup>[4](https://www.bigcode-project.org/docs/about/timeline/)</sup> 两者均为 155 亿参数的模型，提供 8K 上下文窗口、填充能力，并借助多查询注意力实现快速大批量推理；在架构上遵循 GPT-2，采用多查询注意力和中间填充训练目标。<sup>[6](https://arxiv.org/abs/2305.06161)</sup><sup> • </sup><sup>[8](https://huggingface.co/bigcode/starcoder/blob/main/README.md)</sup> StarCoderBase 在来自 The Stack 的 1 万亿 token 上训练，覆盖 80 多种编程语言，随后 StarCoder 在 350 亿 Python token 上微调。<sup>[6](https://arxiv.org/abs/2305.06161)</sup><sup> • </sup><sup>[8](https://huggingface.co/bigcode/starcoder/blob/main/README.md)</sup>

这些模型使用该项目所称的迄今最全面的代码 LLM 评估，借助其自有的开源评估工具进行了评测。<sup>[6](https://arxiv.org/abs/2305.06161)</sup><sup> • </sup><sup>[13](https://github.com/bigcode-project/bigcode-evaluation-harness/issues/82)</sup> 在 [HumanEval](https://www.edgepedia.org/zh/humaneval)——一个根据函数签名和文档字符串完成函数的 Python 基准——上，StarCoderBase 表现优于所有支持多编程语言的开放代码 LLM，并达到或超过了 OpenAI 的 code-cushman-001；通过提示，StarCoder 在 HumanEval 上可达 40% 的 pass@1（单次生成尝试通过测试的概率），同时保持其他语言的性能。<sup>[6](https://arxiv.org/abs/2305.06161)</sup> 该项目的博客报告称，StarCoder 和 StarCoderBase 在这些基准上均优于包括 PaLM、LaMDA 和 LLaMA 在内的规模大得多的模型，并且一个定制的练习提示将 StarCoder 的 HumanEval 得分从 34% 提升至 40% 以上，该项目称之为当时开放模型的新最佳结果。<sup>[14](https://huggingface.co/blog/starcoder)</sup>

为实现安全的开放获取发布，团队使用了改进的 PII 脱敏流程和一个溯源追踪工具，让用户可以搜索预训练数据以识别生成代码的来源，并以商业可行的开放负责任 AI 模型许可证版本（BigCode OpenRAIL-M）发布模型。<sup>[6](https://arxiv.org/abs/2305.06161)</sup><sup> • </sup><sup>[8](https://huggingface.co/bigcode/starcoder/blob/main/README.md)</sup>

## StarCoder2 与 The Stack v2

2024 年 2 月 28 日，ServiceNow、Hugging Face 和 NVIDIA 发布了 StarCoder2，这是由 BigCode 社区开发的开放获取代码 LLM 系列，包含 3B、7B 和 15B 三种规模。<sup>[7](https://newsroom.servicenow.com/press-releases/details/2024/ServiceNow-Hugging-Face-and-NVIDIA-launch-New-Open-Access-LLMs-Help-Developers-Tap-Generative-AI-to-Build-Enterprise-Applications-02-28-2024-traffic/default.aspx)</sup> 其基础是 The Stack v2，与 [Software Heritage](https://www.edgepedia.org/zh/software-heritage) 在其源代码档案基础上共同构建，规模超过 The Stack v1 的 7 倍；由此产生的训练集是首个 StarCoder 数据集的 4 倍。<sup>[7](https://newsroom.servicenow.com/press-releases/details/2024/ServiceNow-Hugging-Face-and-NVIDIA-launch-New-Open-Access-LLMs-Help-Developers-Tap-Generative-AI-to-Build-Enterprise-Applications-02-28-2024-traffic/default.aspx)</sup><sup> • </sup><sup>[15](https://arxiv.org/abs/2402.19173)</sup>

训练分布在合作伙伴的框架上：3B 模型使用 ServiceNow 的 Fast LLM 框架，7B 模型使用 Hugging Face 的 nanotron，15B 模型使用 NVIDIA 的 NeMo 和 [TensorRT-LLM](https://www.edgepedia.org/zh/tensorrt-llm)。<sup>[7](https://newsroom.servicenow.com/press-releases/details/2024/ServiceNow-Hugging-Face-and-NVIDIA-launch-New-Open-Access-LLMs-Help-Developers-Tap-Generative-AI-to-Build-Enterprise-Applications-02-28-2024-traffic/default.aspx)</sup> 此次发布围绕一套可复现的评估套件构建，覆盖 HumanEval(+)、MBPP(+)、DS-1000 和 MultiPL-E，在该比较中 StarCoder2-15B 在 HumanEval+ 上取得 62.0% 的 pass@1，是所评估的大型开放模型中的最强结果。<sup>[16](https://www.gen.qa/starcoder2-code-llm-evaluation-explained/)</sup>

## 评估基础设施

BigCode 维护 bigcode-evaluation-harness，这是一个开源工具，用于在 HumanEval（指标 pass@k）和 MultiPL-E 等基准上评估代码模型；同时还维护 BigCode 模型排行榜，在 HumanEval 和 MultiPL-E 上比较基础代码生成模型，并使用固定生成设置（top-p 0.95、温度 0.2、50 个样本）测量吞吐量。<sup>[13](https://github.com/bigcode-project/bigcode-evaluation-harness/issues/82)</sup><sup> • </sup><sup>[17](https://api-inference.huggingface.co/spaces/bigcode/bigcode-models-leaderboard/blob/0e82940d5a28ef7945120cb263e9456c8fd16d6d/app.py)</sup> 该评估工具已被其他评估代码 LLM 的团队广泛复用。<sup>[13](https://github.com/bigcode-project/bigcode-evaluation-harness/issues/82)</sup>

## References

1. [Hugging Face and ServiceNow launch BigCode, TechCrunch (September 26, 2022)](https://techcrunch.com/2022/09/26/hugging-face-and-servicenow-launch-bigcode-a-project-to-open-source-code-generating-ai-systems/)
2. [BigCode, ServiceNow AI Research](https://www.servicenow.com/research/opensource/bigcode.html)
3. [Datasets, BigCode project documentation](https://www.bigcode-project.org/docs/about/the-stack/)
4. [Milestones, BigCode project documentation](https://www.bigcode-project.org/docs/about/timeline/)
5. [The Stack: 3 TB of permissively licensed source code, arXiv:2211.15533](https://arxiv.org/abs/2211.15533)
6. [StarCoder: may the source be with you!, arXiv:2305.06161](https://arxiv.org/abs/2305.06161)
7. [ServiceNow, Hugging Face, and NVIDIA launch new open-access LLMs, ServiceNow Newsroom (February 28, 2024)](https://newsroom.servicenow.com/press-releases/details/2024/ServiceNow-Hugging-Face-and-NVIDIA-launch-New-Open-Access-LLMs-Help-Developers-Tap-Generative-AI-to-Build-Enterprise-Applications-02-28-2024-traffic/default.aspx)
8. [bigcode/starcoder model card, Hugging Face](https://huggingface.co/bigcode/starcoder/blob/main/README.md)
9. [ServiceNow and Hugging Face release StarCoder, ServiceNow press release (May 4, 2023)](https://s205.q4cdn.com/537566246/files/doc_news/ServiceNow-and-Hugging-Face-release-StarCoder-an-open-access-large-language-model-for-code-generation-05-04-2023-traffic-2023.pdf)
10. [bigcode-project/bigcode-dataset, GitHub](https://github.com/bigcode-project/bigcode-dataset)
11. [bigcode/governance-card README, Hugging Face](https://huggingface.co/datasets/bigcode/governance-card/blob/main/README.md)
12. [SantaCoder: don't reach for the stars!, arXiv:2301.03988](https://arxiv.org/abs/2301.03988)
13. [bigcode-evaluation-harness, GitHub](https://github.com/bigcode-project/bigcode-evaluation-harness/issues/82)
14. [StarCoder: A State-of-the-Art LLM for Code, Hugging Face blog](https://huggingface.co/blog/starcoder)
15. [StarCoder 2 and The Stack v2: The Next Generation, arXiv:2402.19173](https://arxiv.org/abs/2402.19173)
16. [How BigCode Benchmarks StarCoder2, Gen.QA](https://www.gen.qa/starcoder2-code-llm-evaluation-explained/)
17. [BigCode models leaderboard source, Hugging Face Spaces](https://api-inference.huggingface.co/spaces/bigcode/bigcode-models-leaderboard/blob/0e82940d5a28ef7945120cb263e9456c8fd16d6d/app.py)

---
*Initially written Oct 15, 2026 · Edited: Oct 25, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › AI companies, people, and products

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/bigcode

English original: https://www.edgepedia.org/bigcode
