Rust-lang/rust is adopting an LLM policy

(blog.rust-lang.org)

80 points | by afdbcreid 8 hours ago ago

58 comments

  • matheusmoreira 6 hours ago ago

    The exact rules on LLM generated code submission live here:

    https://forge.rust-lang.org/policies/llm-usage.html

    https://rustc-dev-guide.rust-lang.org/llm-guidance/writing.h...

    > Pre-arranged, non-critical, high-quality, well-tested, and well-reviewed code changes that are originally created by an LLM are allowed, with disclosure.

    They clearly put a lot of thought into this and it shows. Huge respect.

    > New contributors cannot create a PR using an LLM unless they first talk with a reviewer.

    New contributors do not have community connections. I don't know any rust-lang/rust reviewer.

    What is the correct procedure for this?

    > Harassment is not allowed.

    > You may not harass people for using an LLM, regardless of whether or not their use is banned by the policy.

    Refreshing take. Not a fan of heavy handed moderation, but I'm still very happy to see that they have this stance given the racism-tier insults I've gotten on forums without it.

    I especially like this rule:

    > Don’t try to be the police for whether someone has used an LLM. You are not required to “actively look” for whether an LLM was involved.

    • jynelson 5 hours ago ago

      > New contributors do not have community connections. I don't know any rust-lang/rust reviewer.

      > What is the correct procedure for this?

      there's a #llm-mentoring [0] Zulip stream linked in the dev-guide [1].

      [0]: https://rust-lang.zulipchat.com/join/rlfvpemsaacs3pfi6kwqnqj... [1]: https://rustc-dev-guide.rust-lang.org/llm-guidance/writing.h...

    • pas 6 hours ago ago

      > What is the correct procedure for this?

      in general to work on something that will get "into the rust compiler" it needs at least an RFC and then a Major Change Proposal [0]

      in practice it starts with asking on zulip [1]

      [0] https://forge.rust-lang.org/compiler/proposals-and-stabiliza...

      [1] https://forge.rust-lang.org/how-to-start-contributing.html

      • panstromek 6 hours ago ago

        Asking on zulip is the good first step, yes. But RFC or MCP is only needed for bigger changes. Majority of changes will not need that, especially the ones contributed by newcomers.

    • Cthulhu_ 6 hours ago ago

      > What is the correct procedure for this?

      Get involved with the project before submitting PRs, participate in discussions, etc. But if it's a change you want to contribute, don't use an LLM to write it.

      • matheusmoreira 6 hours ago ago

        > But if it's a change you want to contribute, don't use an LLM to write it.

        The rules I quoted say LLM code generation is allowed should the developer contact a reviewer first and they agree to review it.

        My question was about the exact procedure and etiquette for contacting these reviewers. For example, Linux has a get_maintainer.pl people can use to figure out who to email should they want to contribute something.

  • minimaxir 8 hours ago ago

    > Harassment is not allowed. You may not harass people for using an LLM, regardless of whether or not their use is banned by the policy. You must follow the Code of Conduct at all times when interacting with the Rust project.

    This policy I like.

    • feverzsj 6 hours ago ago

      You know rustaceans hate anything LLM when mods have to make this a rule.

      • LoganDark 6 hours ago ago

        It's not "rustaceans" as one whole. It's a very vocal minority (both rustacean and not) that make it everyone else's problem that they don't agree with the AI industry as a whole. I've had people try to convince me that I'm destroying the planet by using LLMs just because the process of creating the LLM was harmful to the climate. But that's like saying software piracy harms sales. Maybe the argument has more merit for models hosted in the cloud, but I use local ones too.

        There's a shameboard that curates a list of projects that don't explicitly and unconditionally ban all use of generative AI. Their term for projects that have a policy other than a total ban is "permissive" and it is treated as a sign to avoid that project/community. It's such a mess. Cancel culture is never the answer. I believe it is the right move to ban this completely unproductive and toxic kind of behavior.

        • duskdozer 6 hours ago ago

          If you can understand that some behavior is toxic and should be banned, then you should understand the people behind "cancel culture." Alternatively, if you see "cancelling" "cancel culture" as not "cancel culture", then you can understand the paradox of tolerance, and why an idealistic fully tolerant approach is not possible either way.

          • matheusmoreira 5 hours ago ago

            Banning someone is not the same as canceling them though.

            Banishment is just enforcement of boundaries. It gets rid of a problematic person in a specific space where their behavior is not tolerated. It's about the community, not the banished. Once the troublemaker is gone, that's the end of it. Everyone goes back to their normal activities.

            Cancel culture consists of people going out of their way to get a person banned everywhere else and even fired by their employers. People launch entire campaigns against the problematic person and make a concerted effort to ruin their life. Not that different from the Kiwi Farms.

            Assertiveness and aggression.

          • LoganDark 5 hours ago ago

            Cancel culture is specifically about disparaging groups or individuals, not merely condemning behavior. It has to do with targeted attacks, harassment and defamation. It's absolutely not the same thing as my comment, which merely points out the existence of some behavior and that I disagree with it.

            What I'm talking about is the practice of following people around for using AI, rooting around for evidence that a project doesn't fully ban AI, etc. and publicly shaming them, harassing them, attacking them. People who do this don't accept neutrality or even mere skepticism, they demand full unconditional bans or else they make themselves a huge nuisance and try to harm you. That's cancel culture, plain and simple.

      • imtringued 6 hours ago ago

        If you look at the Codeberg community, you'll find that this rule makes sense. The anti AI community is pretty toxic, probably more toxic than people throwing AI slop at reviewers.

        • zahlman 6 hours ago ago

          In my experience, anti-AI coders are nowhere near as obnoxious (or even outright harmful) about it as their artist/graphic-designer counterparts.

        • matheusmoreira 6 hours ago ago

          Lobsters too.

  • weli 5 hours ago ago

    I really dislike every kind of rule that says something along the lines "if it's LLM generated you must self-disclose otherwise it is against the rules". Because this quickly leads to witch hunting and easy persecution of IC's under the pretense "it looks generated by an LLM" or they just investigate you and put you on cooldown from being able to contribute while they check for signs of "LLM-generated code". It's no different than laws giving any officer the right to violate your rights based on flaky probable cause "you have slurred speech therefore I will search your car to see any open containers". This can lead to a soft coup by anti-llm individuals which will make communities slowly drift towards a group of elitists that gatekeep any newcomer.

    • matheusmoreira 5 hours ago ago

      I don't disagree with you. I too hate disclosing LLM usage. I hate giving free advertising to trillion dollar corporations. There's also the fact people will probably look down on me for it and assume I'm incompetent because I used an LLM, and I've actually ended up sitting on reviewed and tested patches to open source projects because of this.

      However, we should be polite and respect their house rules. They are being reasonable and even made an effort to preempt these exact objections:

      > Harassment is not allowed.

      > You may not harass people for using an LLM, regardless of whether or not their use is banned by the policy.

      > Don’t try to be the police for whether someone has used an LLM. You are not required to “actively look” for whether an LLM was involved.

      • ChrisRR 4 hours ago ago

        > There's also the fact people will probably look down on me for it and assume I'm incompetent because I used an LLM

        I've seen so many arguments (mainly from non-developers) claiming that anyone who uses an llm to generate code doesn't know how to program. They can't understand the difference between people using an LLM to blindly churn out code, and people developing with an LLM to generate the boring bits

      • m4xp 4 hours ago ago

        Disclosure can't go away, i dont care if you say which model you used. But i think it's within any project rights to not accept any llm assisted contributions.

        • matheusmoreira 4 hours ago ago

          The disclosure is fine, it's this stigma surrounding LLMs that is a problem.

          • IsTom 3 hours ago ago

            We'll yet see where the wind blows, but there's a real possibility of copyright issues for machine-generated code down the line.

      • orphea 5 hours ago ago

        > I hate giving free advertising to trillion dollar corporations.

        Are you required to tell you used Anthropic™ (or whichever your AI provider of the month is) to generate this code, and not only that *an LLM* was involved?

        • matheusmoreira 5 hours ago ago

          A project I wanted to contribute to requried git trailers in the commit message.

            Generated-by: Claude Fable 5
    • DarkNova6 5 hours ago ago

      I don't understand this obsession with clear cut categorization. Systems always have a human component and while we like to collectively deny this fact from a tech-sphere, there are always humans that will make the final call and if anything we should encourage the use of human trust and judgement.

      We have focused so much on technological advancement, but our understanding of human systems and building an environment of trust that is not eroded by perverse incentives atrophies.

    • winstonwinston 4 hours ago ago

      You can’t be upset because they want to know the truth, seriously. When a project has concerns about generated code, it is for a reason.

      • weli 3 hours ago ago

        I'm not upset because LLM disclosure is mandatory. I'm upset about the consequences this has and how easy this makes for people to gatekeep new IC's under false and difficult to prove pretenses.

        "This looks like AI, closed". And you as a new IC with no connections, no community visibility have no recourse to fight back against it. Anti-ai people love boasting about humans > systems and forget about those humans that will surely be negatively affected by this, even if low number.

        If you are a new programmer who is just learning and spend time creating a PR for a project you have a lot of respect for and the first interaction is someone falsely accuses you of using LLM's then closes your PR you've now removed someone who could have genuinely grown into your community from ever joining.

        Not only that but since now you are by default a suspect of having used an LLM (and you need to prove you didn't use one) why even bother not using one? You are going to get accused of it either way.

        • jynelson 3 hours ago ago

          that is not what the policy says. it says "authors must disclose", "reviewers don't need to play detective", and "if a reviewer is not sure whether a post is LLM-created they should handle it privately, consulting mods". and the recourse is "go to this zulip channel", because closing a PR isn't the same as geting banned.

          • weli 2 hours ago ago

            For the morale of the person who created the PR, closing every PR you make is pretty similar to just being banned

    • nasso_dev 5 hours ago ago

      imho disclosing use of LLMs is just being transparent and honest. is it that hard? deliberately hiding this should absolutely get you in trouble, because trust is the most important thing to have in open-source

      as you probably have seen in TFA, the policy does not ban LLM usage. its just asking for disclosure so that maintainers know how much effort was put in a PR

      and, please, open-source maintainers owe us nothing. refusing to merge a patch is not the same as cops searching your car. this is merely maintainers trying to evaluate how they should spend their precious time

      • trelane 2 hours ago ago

        > disclosing use of LLMs is just being transparent and honest. is it that hard?

        Your assertion here is irrelevant to the poster's point.

        You're focused on the "happy path:" everyone has perfect information and judges correctly. If the submitter used AI, they say so and the commenters on the PR agree. If the submitter did not use AI, they don't say they used AI, and the commenters on the PR agree. This is the diagonal elements on the "used AI" confusion matrix.

        The commenter is pointing out that information and judgment are not perfect and they're concerned about the off-diagonal elements of the confusion matrix. Especially the "Didn't use AI, but some commenters believe that they did" element.

      • matheusmoreira 5 hours ago ago

        I agree with you that trust and transparency are important, but please understand that disclosure is not a simple matter.

        There is stigma surrounding LLM usage. There are consequences. Disclosing can lead to harassment and direct harm to one's reputation. I've been called "slop fetishist" and "clanker lover" before.

        • jynelson 5 hours ago ago

          yes. there's a reason there's exactly two things in the policy that are marked as moderation consequences and they're directly next to each other. "no harassment" doesn't work if people are paranoid that any PR could be LLM slop, and "disclosure is required" doesn't work if people are worried about harassment. you need both, and you need them to go into force at the same time.

          • matheusmoreira 4 hours ago ago

            Completely agree. Making harassment of LLM users explicitly against the rules was very welcome. It's something I haven't seen in other LLM policies. It instantly gained my respect.

    • ChrisRR 5 hours ago ago

      I sort of agree, but sort of not. I do agree that any use of AI should be disclosed, but I have also seen some subreddits where the top comments of every post is either raging about the use of AI, or arguing about AI when AI wasn't used.

      It's just so tiresome

  • andsoitis 8 hours ago ago

    In a nutshell: It's fine to use LLMs to answer questions, analyze, distill, refine, check, suggest, review. But not to create.

    • seanhunter 6 hours ago ago

      Yes, and I think the reasons set out in TFA are interesting, which on my reading are:

      1) Code is the least interesting bit in some ways - they’re trying to build not only rust but a community of experts around rust which is able to maintain and improve it in the long term and the authors of prs need to understand the code deeply and show a willingness to be part of that long run. Llm-generated code even if it looks polished doesn’t indicate a human author who deeply understands it and is willing to be part of that long term maintenance.

      2) They don’t have (and don’t want to enforce) a community consensus that llms are good or llms are bad. They just want some rules written down so everyone knows where they stand and people of either camp (and none) can get on with it.

      Seems a pretty reasonable approach to me although I don’t really use rust much so don’t have a vested interest.

      • nirbendavid 5 hours ago ago

        [flagged]

      • incrudible 6 hours ago ago

        No codebase worth being deeply invested in is deeply understood by anyone, including the original authors. The eternal maintenance argument is tiresome. If there is a problem in need of fixing, you figure it out, you do not depend on some author being available, and LLMs are exceptionally helpful in this regard as well. Then, if the LLM has trouble figuring out, so will another human. It is a code smell.

        • seanhunter 4 hours ago ago

          Strongly disagree. The obvious counterexample is in the foss world is ffmpeg, which I would submit is deeply understood by Fabrice Bellard. As a sibling points out, there are also various worthwhile single author projects.

          Outside the world of foss there are for example multiple games that are highly respected that were all entirely or largely developed by a single developer. Rimworld, Songs of Syx, Dwarf Fortress, Ostranauts and many others. In a proprietary context I have myself deeply understood codebases and worked with others who have also.

          That being said, you are arguing against a straw man that neither I nor the rust article propose. They are not saying maintainers need to understand all the code they are saying the person submitting a pr needs to deeply understand that pr. Why? Because they want to build a community who deeply understand various aspects of rust so when things need maintenance there are experts around who even if they don’t know a particular piece are invested in the success of the project and know enough to get up the curve and fix whatever needs to be fixed.

          • bryanlarsen 5 minutes ago ago

            I have a bunch of single-author projects that I wrote myself that I no longer have a deep understanding of. None are near as large as your references.

            Fabrice Bellard is obviously a superhuman, but I expect even he relies on re-analyzing code he previously wrote and has subsequently forgot. This doesn't take him long because he knows his own conventions and proclivities. But I'm confident he doesn't "deeply understand" the entire code base. He has a shallow understanding of the entire code base. He has a deep understanding of crucial parts of it. And he has the ability to quickly re-establish a deep understanding of any piece.

        • zahlman 6 hours ago ago

          There are all kinds of projects out there that have had significant impact on the world, which were written and maintained over the course of years by a single, highly capable developer. The way people talk about code nowadays, just because they have more powerful authoring tools, is frankly disgraceful. Imagine if modern construction techniques had become a reason to stop caring about the natural beauty of wood grain.

    • thunky 37 minutes ago ago

      This implies that "create" is the hard part that we should not offload to machines.

      But IME all of the other things are the hard part.

      So basically it's fine to get the LLM to think for you and give you the answers as long as you understand Rust syntax well enough to type it all out yourself?

      This also seems like it will produce worse code, because it's preventing the LLM from doing the easy/boring part that it's good at.

    • duskdozer 6 hours ago ago

      Creation is still allowed:

      >Pre-arranged, non-critical, high-quality, well-tested, and well-reviewed code changes that are originally created by an LLM are allowed, with disclosure.

      • matheusmoreira 6 hours ago ago

        It's technically an experiment, but it's definitely good to see they're keeping an open mind about this.

        > Experiment: LLM-created code changes intended for review

        > We leave space open to experiment with LLMs to inform future policies.

        > This experiment is meant to inform future non-experimental policy, not to serve as the perpetual LLM usage policy.

    • ares623 7 hours ago ago

      Hmm, that doesn't sound too bad. So you basically get to use a tool to help with the tedious parts, without being allowed to use the same tool to pass off said tedium to others.

      This closes the gap. A key insight. A load bearing difference.

      Now, is writing code considered tedium, for a project like Rust?

    • socalgal2 6 hours ago ago

      Sounds like the beginning of the end of rust to me

      AI is a jet engine - Banning is for creation is like saying "we require you to go by ship/car/propeller-plane"

      Yes, a policy that says AI slop PRs will not be tolerated. But I've had AI track down real hard to find bugs in several projects and provide correct fixes. I've also had AI build new features and new products. The project that ignores this acceleration will eventually fall behind the ones that embrace it.

      • Cthulhu_ 6 hours ago ago

        I love how your analogy actually works with the real world. You can't fly a jet plane until you've got all the various licenses and logged flying hours in prop planes first.

      • happyweasel 6 hours ago ago

        "AI is a jet engine "

        and rust just wants to ensure you are a capable pilot that can actually steer a plane before stealing everyone else's attention

      • imtringued 6 hours ago ago

        Why does a language need higher developer velocity? Why is acceleration needed?

        Acceleration makes sense for end user applications, where you're allowed to break whatever you see fit, but I don't see how it helps with core infrastructure like a programming language, where every mistake is multiplied a million fold.

        • Cthulhu_ 6 hours ago ago

          Exactly this. There's plenty of boring software out there where writing the actual code is a chore. That's where AI works pretty well, as long as the people at the controls understand and can explain the problem and non-functionals.

          For projects like Rust, coding velocity is not the bottleneck, speed / productivity is not a priority.

      • ares623 6 hours ago ago

        you're free to fork and improve it with your favorite harness. Go get 'em tiger.

  • luciana1u 4 hours ago ago

    the policy has a rule against harassing people for using LLMs. somewhere a maintainer is writing a CoC violation for being too polite about AI slop.

  • piokoch 6 hours ago ago

    The question is: is such policy even enforceable? If someone is "clever" enough to drop em-dashes and some bold highlights how one would know if something is AI generated or not?

    • duskdozer 6 hours ago ago

      > Some parts of the policy are unenforceable. This is not a bug. The goal is not to catch every violation, but to create a clear bright-line rule: Disclosure is required for all public LLM text, unless specifically exempted by the policy. This allows moderators to identify violations based on actions, not on intent, and only consider intent when deciding how to respond.

  • satvikpendem 6 hours ago ago

    Good rules but Rust already has AI code in its codebase now.

    • Cthulhu_ 6 hours ago ago

      Nobody's denying that, what is your point? Or are you assuming they're banning LLM code wholesale based on just the headline?