Relicensing with AI-Assisted Rewrite

(tuananh.net)

64 points | by tuananh 2 hours ago

15 comments

  • nairboon 1 hour ago
    That code is still LGPL, it doesn't matter what some release engineer writes in the release notes on Github. All original authors and copyright holders must have explicitly agreed to relicense under a different license, otherwise the code stays LGPL licensed.

    Also the mentioned SCOTUS decision is concerned with authorship of generative AI products. That's very different of this case. Here we're talking about a tool that transformed source code and somehow magically got rid of copyright due to this transformation? Imagine the consequences to the US copyright industry if that were actually possible.

  • samrus 56 minutes ago
    > The ownership void: If the code is truly a “new” work created by a machine, it might technically be in the public domain the moment it’s generated, rendering the MIT license moot.

    Im struggling to see where this conclusion came from. To me it sounds like the AI-written work can not be coppywritten, and so its kind of like a copy pasting the original code. Copy pasting the original code doesnt make it public domain. Ai gen code cant be copywritten, or entered into the public domain, or used for purposes outside of the original code's license. Whats the paradox here?

    • laksjhdlka 51 minutes ago
      They say "if" it's a new work, then it might not be copyrightable, I guess. You suppose that it's still the original work, and hence it's still got that copyright.

      I think they are rhetorically asking if your position is correct.

  • kshri24 1 hour ago
    > The ownership void: If the code is truly a “new” work created by a machine, it might technically be in the public domain the moment it’s generated, rendering the MIT license moot.

    How would that work? We still have no legal conclusion on whether AI model generated code, that is trained on all publicly available source (irrespective of type of license), is legal or not. IANAL but IMHO it is totally illegal as no permission was sought from authors of source code the models were trained on. So there is no way to just release the code created by a machine into public domain without knowing how the model was inspired to come up with the generated code in the first place. Pretty sure it would be considered in the scope of "reverse engineering" and that is not specific only to humans. You can extend it to machines as well.

    EDIT: I would go so far as to say the most restrictive license that the model is trained on should be applied to all model generated code. And a licensing model with original authors (all Github users who contributed code in some form) should be setup to be reimbursed by AI companies. In other words, a % of profits must flow back to community as a whole every time code-related tokens are generated. Even if everyone receives pennies it doesn't matter. That is fair. Also should extend to artists whose art was used for training.

    • kouteiheika 38 minutes ago
      > I would go so far as to say the most restrictive license that the model is trained on should be applied to all model generated code.

      That license is called "All Rights Reserved", in which case you wouldn't be able to legally use the output for anything.

      There are research models out there which are trained on only permissively licensed data (i.e. no "All Rights Reserved" data), but they're, colloquially speaking, dumb as bricks when compared to state-of-art.

      But I guess the funniest consequence of the "model outputs are a derivative work of their training data" would be that it'd essentially wipe out (or at very least force a revert to a pre-AI era commit) every open source project which may have included any AI-generated or AI-assisted code, which currently pretty much includes every major open source project out there. And it would also make it impossible to legally train any new models whose training data isn't strictly pre-AI, since otherwise you wouldn't know whether your training data is contaminated or not.

      • progval 8 minutes ago
        > There are research models out there which are trained on only permissively licensed data

        Models whose authors tried to train only on permissively licensed data.

        For example https://huggingface.co/bigcode/starcoder2-15b tried to be a permissively licensed dataset, but it filtered only on repository-level license, not file-level. So when searching for "under the terms of the GNU General Public License" on https://huggingface.co/spaces/bigcode/search-v2 back when it was working, you would find it was trained on many files with a GPL header.

      • kshri24 20 minutes ago
        I agree with your assessment. Which is why I was proposing a middle-ground where an agreement is setup between the model training company and the collective of developers/artists et all and come up with a license agreement where they are rewarded for their original work for perpetuity. A tiny % of the profits can be shared, which would be a form of UBI. This is fair not only because companies are using AI generated output but developers themselves are also paying and using AI generated output that is trained on other developer's input. I would feel good (in my conscience) that I am not "stealing" someone else's effort and they are being paid for it.
    • adrianN 51 minutes ago
      We‘ll have to wait until the technology progresses sufficiently that AI cuts into Disney’s profit.
    • thedevilslawyer 52 minutes ago
      That's unpractical enough that you might as well wish for UBI and world peace rather than this.
      • kshri24 51 minutes ago
        Why is it impractical? Github already has a sponsor system. Also this can be a form of UBI.
  • zozbot234 50 minutes ago
    If you ask a LLM to derive a spec that has no expressive element of the original code (a clean-room human team can carefully verify this), and then ask another instance of the LLM (with fresh context) to write out code from the spec, how is that different from a "clean room" rewrite? The agent that writes the new code only ever sees the spec, and by assumption (the assumption that's made in all clean room rewrites) the spec is purely factual with all copyrightable expression having been distilled out.
    • miroljub 43 minutes ago
      The new agent who writes code has probably at least parts of the original code as training data.

      We can't speak about clean room implementation from LLM since they are technically capable only of spitting their training data in different ways, not of any original creation.

      • nubg 6 minutes ago
        Only in the case of open source code
    • gf000 42 minutes ago
      I guess it depends on if the source data set is part of the training data or not (if it's open source it is likely part of it).

      A lawyer could easily argue that the model itself stores a representation of the original, and thus it can never do a "fresh context".

      And to be perfectly honest, LLMs can quote a lot of text verbatim.

  • mfabbri77 1 hour ago
    This has the potential to kill open source, or at least the most restrictive licenses (GPL, AGPL, ...): if a license no longer protects software from unwanted use, the only possible strategy is to make the development closed source.
    • _dwt 48 minutes ago
      Yes, this is the reason I've completely stopped releasing any open-source projects. I'm discovering that newer models are somewhat capable of reverse-engineering even compiled WebAssembly, etc. too, so I can feel a sort of "dark forest theory" taking hold. Why publish anything - open or closed - to be ripped off at negligible marginal cost?
  • pu_pe 33 minutes ago
    Licensing issues aside, the chardet rewrite seems to be clearly superior to the original in performance too. It's likely that many open source projects could benefit from a similar approach.
  • Tomte 1 hour ago
    > The original author, a2mark , saw this as a potential GPL violation

    Mark Pilgrim! Now that‘s a name I haven‘t read in a long time.

  • Retr0id 1 hour ago
    > In traditional software law, a “clean room” rewrite requires two teams

    Is the "clean room" process meaningfully backed by legal precedent?

    • karlding 1 hour ago
      I am not a lawyer, but from my understanding the legal precedent is NEC v. Intel which established that clean-room software development is not infringing, even if it performs the same functionality as the original.

      As an aside, this clean room engineering is one of the plot points of Season 1 of the fictional TV show Halt and Catch Fire where they do this with the BIOS image they dumped.

    • Firehawke 1 hour ago
      Sure. The reimplementation of the IBM PC BIOS that gave birth to IBM Compatibles is the canonical example.
    • estimator7292 1 hour ago
      Yes. Compaq's reverse engineering of the IBM PC BIOS set the precedent.
    • devmor 1 hour ago
      It is the reason AMD exists.
  • anilgulecha 1 hour ago
    This is precedent setting. In this case the rewrite was in same language, but if there's a python GPL project, and it's tests (spec) were used to rewrite specs in rust, and then an implementation in rust, can the second project be legally MIT, or any other?

    If yes, this in a sense allows a path around GPL requirements. Linux's MIT version would be out in the next 1-2 years.

    • yjftsjthsd-h 4 minutes ago
      > but if there's a python GPL project, and it's tests (spec) were used to rewrite specs in rust, and then an implementation in rust, can the second project be legally MIT, or any other?

      Isn't that what https://github.com/uutils/coreutils is? GNU coreutils spec and test suite, used to produce a rust MIT implementation. (Granted, by humans AFAIK)

    • mlaretallack 1 hour ago
      Its very important to understand the "how" it was done. The GPL hands the "compile" step, and the result is still GPL. The clean Room process uses 2 teams, separated by a specification. So you would have to

      1. Generate specification on what the system does. 2. Pass to another "clean" system 3. Second clean system implements based just on the specification, without any information on the original.

      That 3rd step is the hardest, especially for well known projects.

      • microtonal 56 minutes ago
        So what if a frontier model company trains two models, one including 50% of the world's open source project and the second model the other 50% (or ten models with 90-10)?

        Then the model that is familiar with the code can write specs. The model that does not have knowledge of the project can implement them.

        Would that be a proper clean room implementation?

        Seems like a pretty evil, profitable product "rewrite any code base with an inconvenient license to your proprietary version, legally".

        • anilgulecha 46 minutes ago
          LLM training is unnecessary in what we're discussing. Merely LLM using: original code -> specs as facts -> specs to tests -> tests to new code.
      • anilgulecha 1 hour ago
        1 is claude-code1, outputs tests as text.

        2. Dumped into a file.

        3. claude-code that converts this to tests in the target language, and implements the app that passes the tests.

        3 is no longer hard - look at all the reimplementations from ccc, to rewrites popping up. They all have a well defined test suite as common theme. So much so that tldraw author raised a (joke) issue to remove tests from the project.

    • nairboon 1 hour ago
      No, GPL still holds even if you transform the source code from one language to another language.
      • anilgulecha 1 hour ago
        That why I carved it out to just the specs. If they can be read as "facts", then the new code is not derived but arrived at with TTD.

        The thesis I propose is that tests are more akin to facts, or can be stated as facts, and facts are not copyright-able. That's what makes this case interesting.

        • nairboon 1 hour ago
          I assumed that "tests" refers to a program too, which in this example is likely GPL. Thus GPL would stick already on the AI-rewrite of GPL test code.

          If "tests" should mean a proper specification let's say some IETF RFC of a protocol, then that would be different.

          • anilgulecha 1 hour ago
            Yes, I had not specified in my original comment. But in the SOTA LLM world code/text boundary is so blurry, so as to be non-existent.
  • DrammBA 1 hour ago
    I like the idea of AI-generated ~code~ anything being public domain. Public data in, public domain out.
    • lejalv 1 hour ago
      This could be read as a reformulation of the old adage - "what's mine is mine, and what is yours, is mine too".

      So, you can pilfer the commons ("public") but not stuff unavailable in source form.

      If we expand your thought experiment to other forms of expression, say videos on YT or Netflix, then yes.

    • kshri24 1 hour ago
      I don't think you can classify "public data in" as public domain. Public data could also include commercial licenses which forbid using it in any way other than what the license states. Just because the source is open for viewing does not necessarily mean it is OSL.

      That's the core issue here. All models are trained on ALL source code that is publicly available irrespective of how it was licensed. It is illegal but every company training LLMs is doing it anyways.

      • thedevilslawyer 1 hour ago
        Copyright is not a blacklist but an allowlist of things kept aside for the holder. Everything else is free game. LLM ingestion comes under fair use so no worries. If someone can get their hand on it, nothing in law stops it from training ingestion.

        We can debate if this law is moral. Like the GP I took agree public data in -> public domain out is what's right for society. Copyright as an artificial concept has gone on for long enough.

        • gf000 38 minutes ago
          There are hardly any rulings/laws about the topic, and it quite obviously changes the picture of licenses.
        • kshri24 1 hour ago
          > LLM ingestion comes under fair use

          I don't think so. It is no where "limited use". Entirety of the source code is ingested for training the model. In other words, it meets the bar of "heart of the work" being used for training. There are other factors as well, such as not harming owner's ability to profit from original work.

          • thedevilslawyer 51 minutes ago
            https://www.skadden.com/insights/publications/2025/07/fair-u...

            Both Meta and Anthropic were vindicated for their use. Only for Anthropic was their fine for not buying upfront.

            • kshri24 49 minutes ago
              This hasn't gone to Supreme Court yet. And this is just USA. Courts in rest of the World will also have to take a call. It is not as simple as you make it out to be. Developers are spread across the World with majority living outside USA. Jurisdiction matters in these things.
    • benob 1 hour ago
      What about doing that with movies and music?
      • zodmaner 1 hour ago
        The results would be the same: AI generated music and movies will be public domain.
  • foota 1 hour ago
    I think the more interesting question here would be if someone could fine tune an open weight model to remove knowledge of a particular library (not sure how you'd do that, but maybe possible?) and then try to get it to produce a clean room implementation.
    • benob 1 hour ago
      I don't think this would qualify as clean room (the Library was involved in learning to generate programs as a whole). However, it should be possible to remove the library from the OLMO training data and retrain it from scratch.

      But what about training without having seen any human written program? Coul a model learn from randomly generated programs?

  • est 42 minutes ago
    Uh, patricide?

    The key leap from gpt3 to gpt-3.5 (aka ChatGPT) was code-davinci-002, which is trained upon Github source code after OpenAI-Microsoft partnership.

    Open source code contributed much to LLM's amazing CoT consistency. If there's no Open Source movement, LLM would be developed much later.

  • himata4113 1 hour ago
    I mean in my opinion GPL licensed code should just infect models forcing them to follow the license.

    You can do this a lot by saying things like: complete the code "<snippet from gpl licensed code>".

    And if now the models are GPL licensed the problem of relicensing is gone since the code produced by these models should in theory be also GPL licensed.

    Unfortunately, there is a dumb clause that computer generated code cannot be copyrighted or licensed to begin with.

    • kshri24 1 hour ago
      > Unfortunately, there is a dumb clause that computer generated code cannot be copyrighted or licensed to begin with.

      Can you point to the clause? I have never seen it in any GPL license.

  • verdverm 2 hours ago
    Interesting questions raised by recent SCOTUS refusal to hear appeals related to AI an copyright-ability, and how that may affect licensing in open source.

    Hoping the HN community can bring more color to this, there are some members who know about these subjects.