GNU编译器集合(GCC)指导委员会已批准一项AI贡献政策,禁止项目接受包含大语言模型生成内容或衍生自该内容的法律意义重大贡献 [2]。根据该政策,"法律意义重大"的阈值定义为约15行代码和/或文本 [2]。GCC社区的核心担忧在于,AI生成代码的最大风险并非代码质量本身,而是工程判断和责任承担的缺失 [1]。
政策允许GCC维护者在满足常规审查要求且明确标注使用了大语言模型的情况下,接受法律意义不重大的贡献 [1]。此外,GCC维护者可选择接受全部或部分由大语言模型生成的法律意义重大的测试用例 [2]。与此同时,政策明确允许将大语言模型用于研究、分析、漏洞发现和补丁审查等非贡献用途 [2]。GCC委员会表示该政策预期会演变,并将定期重新审视其内容 [2]。
开源社区对AI生成代码的谨慎态度正在扩大。Zig编程语言社区已明确禁止AI生成代码贡献 [1],而OpenJDK也宣布了临时政策,禁止在其贡献中包含由大语言模型或类似深度学习系统生成的内容 [3]。OpenJDK政策特别指出,即使贡献者编辑了AI生成代码的部分行数也不允许提交相关成果 [3]。
Major open source communities are implementing strict policies to limit the use of large language model-generated code in critical contributions. The GNU Compiler Collection (GCC) steering committee has adopted a policy prohibiting contributions that contain or are derived from LLM-generated content with legal significance, defined as more than approximately 15 lines of code and/or text [2]. The underlying concern reflects skepticism about AI-generated code: the primary risk is not quality but rather the absence of human engineering judgment and accountability [1]. Under GCC's framework, maintainers may accept LLM-generated test cases at their discretion, and AI tools remain permitted for research, analysis, vulnerability discovery, and patch review purposes—provided the outputs do not become contributions themselves [2]. The committee indicated the policy is expected to evolve and will be revisited periodically [2].
Similar restrictions are taking hold elsewhere. Linux founder Linus Torvalds has requested that AI-assisted contributions be flagged with an "Assisted-by" tag [1], while the Zig programming language community has explicitly banned AI-generated code contributions [1]. OpenJDK has announced an interim policy prohibiting any large language model, diffusion model, or comparable deep learning system-generated content—including source code, text, and images—from its contributions [3]. OpenJDK's policy allows contributors to privately use AI tools for understanding, debugging, reviewing code, and research, but explicitly forbids submission of edited AI-generated code: "If I use a generative AI tool to create 100 lines of code, and then edit ten of those lines myself, may I contribute the result? No." [3] The policy notes that AI tools are often trained on copyrighted and licensed content, and their output can infringe copyrights and licenses, while also producing "plausible-looking but incorrect code" that would jeopardize critical system properties [3]. Oracle, as the enterprise sponsor of OpenJDK, is developing a comprehensive policy to replace the interim measures [3].