Live data from Hacker News

Relicensing with AI-Assisted Rewrite

tuananh.net

301–310 of 408 posts

Re: Relicensing with AI-Assisted Rewrite

#301
post #292

I am pretty sure this article is predicated on a misunderstanding of what a "clean room" implementation means. It does not mean "as long as you never read the original code, whatever you write is yours". If you had a hermetically sealed code base that just happened to coincide line for line with the codebase for GCC, it would still be a copy. Traditionally, a human-driven clean room implementation would have a vanish…

This reminds me of a full rewrite. When a developer reimplements a complete new version of code from scratch, with an understanding only, a new implementation generally should be an improvement on any source code not equal. In today’s world, letting LLMs replicate anything will generate average code as “good” and generally create equivalent or more bloat anyways unless well managed.

The world is chock-full of rewrites that came out disastrously worse than the thing they intended to replace. One of Spolsky's most-quoted articles of all time was about this.

https://www.joelonsoftware.com/2000/04/06/things-you-should-...

> They did it by making the single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch.

Re: Relicensing with AI-Assisted Rewrite

#302
post #260

The maintainer's response: https://github.com/chardet/chardet/issues/327#issuecomment-4... The second part here is problematic, but fascinating: "I then started in an empty repository with no access to the old source tree, and explicitly instructed Claude not to base anything on LGPL/GPL-licensed code." Problem - Claude almost certainly was trained on the LGPL/GPL original code. It knows that is how to solve the prob…

There was a paper that proposed a content based hashing mask for traning

The idea is you have some window size, maybe 32 tokens. Hash it into a seed for a pseudo random number generator. Generate random numbers in the range 0..1 for each token in the window. Compare this number against a threshold. Don't count the loss for any tokens with a rng value higher than the threshold.

It learns well enough because you get the gist of reading the meaning of something when the occasional word is missing, especially if you are learning the same thing expressed many ways.

It can't learn verbatim however. Anything that it fills in will be semantically similar, but different enough to get cause any direct quoting onto another path after just a few words.

Re: Relicensing with AI-Assisted Rewrite

#303
post #285

Earlier quoted context omitted.

Ok, but what if in the future I could guarantee that my generative model was not trained on the work I want to replicate. Like say X library is the only library in town for some task, but it has a restrictive license. Can I use a model that was guaranteed not trained on X to generate a new library Z that competes with X with a more permissive license? What if someone looks and finds a lot of similarities?

I wish you luck proving it wasn't trained on the original library or any work that infringed itself.

I think there could be a market for "permissive/open models" in the future where a company specifically makes LLM models that are trained on a large corpus of public domain or permissively licensed text/code only and you can prove it by downloading the corpus yourself and reproducing the exact same model if desired. Proving that all MIT licensed code is non-infringing is probably impossible though at that point copyright law is meaningless because everyone would be in violation if you dig deep enough.

Re: Relicensing with AI-Assisted Rewrite

#304

Earlier quoted context omitted.

> With LLMs, the probability is much higher (since in truth they are very much not a "clean room" at all). I beg to differ. Please examine any of my recent codebases on github (same username); I have cleanroom-reimplemented par2 (par2z), bzip2 (bzip2z), rar (rarz), 7zip (z7z), so maybe I am a good test case for this (I haven't announced this anywhere until now, right here, so here we go...) https://github.com/pmarrec…

Bu that's not really what danlitt said, right? They did not claim that it's impossible for an LLM to generate something different, merely that it's not a clean room implementation since the LLM, one must assume, is trained on the code it's re-implementing.

BUt LLM has seen millions (?) of other code-bases too. If you give it a functional spec it has no reason to prefer any one of those code-bases in particular. Except perhaps if it has seen the original spec (if such can be read from public sources) associated with the old implementation, and the new spec is a copy of the old spec.

Re: Relicensing with AI-Assisted Rewrite

#305
I get the arguments being made here that the second “team,” that’s supposed to be in a clean room, which isn’t supposed to have read the original source code does have some essence of that source code in its weights.

However, this is solved if somebody trains a model with only code that does not have restrictive licenses. Then, the maintainers of the package in question here could never claim that the clean room implementation derived from their code because their code is known to not be in the training set.

It would probably be expensive to create this model, but I have to agree that especially if someone does manage this, it’s kind of the end of copyleft.

Re: Relicensing with AI-Assisted Rewrite

#306

Wasn't this already a thing in the past? e.g. Team A: - reads the code - writes specifications and tests based on the code - gives those specifications to Team B Team B: - reads the specs and the tests - writes new code based on the above The thinking being that Team B never sees the code then it's "innovative" and you are not "laundering" the code. On a side note: what happens in a copyright lawsuit concerning code…

Yep , as i recall this was the original 'clean room' implementattion that was made with regard to IBM clones and the BIOS program that was used to initialize them.

Also a few years bcak theer was the csae of SAP(?) i tthink where they did a reimplementation indipendently via the design documents.

Those two were upheld on litigation and bear out to this day.

This case however is neither a clean room implementation nor relicensable.

A good example if the author had wanted to be correct would have been the sudo rewrite , which ubuntu is doing with their sudo-rs in rust.Not bug for bug compatible as they have already deviated from some usablility choices but more valid than this.

Re: Relicensing with AI-Assisted Rewrite

#307
post #69

By design you can't know if the LLM doing the rewrite was exposed to the original code base. Unless the AI company is disclosing their training material, which they won't because they don't want to admit breaking the law.

I don't see how this is different from current human poaching practices. i.e. It appears to be currently legal to hire an employee from company A who has been "tainted" by company A's [proprietary AI secrets/proprietary CPU architecture secrets/etc] in order to develop a competing offering for company B. i.e. It's not illegal for a human who worked at Intel for 20 years to go work for AMD even though they are certainly "tainted" with all sorts of copyrighted/proprietary knowledge that will surely leak through at AMD. Maybe patents are a first line of defense for company A, but that can't prevent adjacent solutions that aren't outright duplications and circumvent the patent.

Re: Relicensing with AI-Assisted Rewrite

#308

I am pretty sure this article is predicated on a misunderstanding of what a "clean room" implementation means. It does not mean "as long as you never read the original code, whatever you write is yours". If you had a hermetically sealed code base that just happened to coincide line for line with the codebase for GCC, it would still be a copy. Traditionally, a human-driven clean room implementation would have a vanish…

The actual meaning of a "clean room implementation" is that it is derived from an API and not from an implementation I know you were simplifying, and not to take away from your well-made broader point, but an API-derived implementation can still result in problems, as in Google vs Oracle [1]. The Supreme Court found in favor of Google (6-2) along "fair use" lines, but the case dodged setting any precedent on the natu…

This is exactly what I had in mind when I said I was simplifying :) it is a valid point.

Re: Relicensing with AI-Assisted Rewrite

#309

I am pretty sure this article is predicated on a misunderstanding of what a "clean room" implementation means. It does not mean "as long as you never read the original code, whatever you write is yours". If you had a hermetically sealed code base that just happened to coincide line for line with the codebase for GCC, it would still be a copy. Traditionally, a human-driven clean room implementation would have a vanish…

> With LLMs, the probability is much higher (since in truth they are very much not a "clean room" at all). I beg to differ. Please examine any of my recent codebases on github (same username); I have cleanroom-reimplemented par2 (par2z), bzip2 (bzip2z), rar (rarz), 7zip (z7z), so maybe I am a good test case for this (I haven't announced this anywhere until now, right here, so here we go...) https://github.com/pmarrec…

I only said the probability is higher, not that the probability is 1!

Re: Relicensing with AI-Assisted Rewrite

#310
post #260

The maintainer's response: https://github.com/chardet/chardet/issues/327#issuecomment-4... The second part here is problematic, but fascinating: "I then started in an empty repository with no access to the old source tree, and explicitly instructed Claude not to base anything on LGPL/GPL-licensed code." Problem - Claude almost certainly was trained on the LGPL/GPL original code. It knows that is how to solve the prob…

Also the maintainer's ground-up rewrite argument is very flimsy when they used chardet's test-data and freely admit to:

> I've been the primary maintainer and contributor to this project for >12 years

> I have had extensive exposure to the original codebase: I've been maintaining it for over a decade. A traditional clean-room approach involves a strict separation between people with knowledge of the original and people writing the new implementation, and that separation did not exist here.

> I reviewed, tested, and iterated on every piece of the result using Claude.

> I was deeply involved in designing, reviewing, and iterating on every aspect of it.

Post reply on HN