When AI helps you code, who owns the finished product?
- Reference: 1715758215
- News link: https://www.theregister.co.uk/2024/05/15/ai_coding_complications/
- Source link:
I say that having started with 8085 assembly code, then moving on to C, then C++, then Java. Once the web came along I learned the three Ps: Perl, PHP and Python.
Python stuck – more than two decades later it remains my go-to language. I'm far from alone; these days, many introductory computing courses teach Python. This means most scientists and engineers have at least a passing familiarity with it, so when they need to code something, they use Python. Enormous libraries of Python “solutions” can therefore be found online. If you have a coding problem, chances are that someone else has already solved it.
[1]
This explains why Python became the de facto language for machine learning and artificial intelligence; researchers working on ML algorithms want to test their hypotheses and optimize their approaches - without having to sweat the details of the code. With Python, researchers don't have to put a lot of effort into their code; instead, they can focus on the problem they're solving. That kicked off a virtuous cycle of development: pretty much everything in artificial intelligence today - except for the lowest-level, tightest loops of bit-banging and matrix multiplications - is written in Python.
[2]
[3]
Recently, an attorney who specializes in Intellectual Property Law requested my assistance prototyping a tool he'd dreamed up - using generative AI to automate some of the boring, fiddly bits of research that IP lawyers do daily. I leapt at the opportunity to get my hands into a bit of “product-oriented' AI coding, and realized I could even take advantage of a bit of AI myself, using OpenAI's GPT-4.
All five of the big foundation models (GPT-4, Microsoft Copilot, Google Gemini, Anthropic Claude and Meta AI) were fed trillions of “tokens” of text during their lengthy training, including pretty much every last example of source code that could be scraped off the open web and open-source code repositories.
[4]
A lot of that code is Python, which means all these models can do a decent job writing Python.
Knowing this, I wanted to learn if I could use AI to '10x' myself: could I make software ten times faster, using AI, than I could using just my wetware?
To test that idea, I soon learned that I'd have to adapt my playful coding approach to something more rigorous. Did I understand the problem I wanted to solve? Could I express it clearly? Could I communicate my understanding to the AI in a sufficiently direct and unambiguous prompt that it would generate the response I sought?
[5]
That was my first big 'aha' moment: to realise the benefits of AI, I'd have to completely rework my workflow into something much more formal, considered, and structured - a process a lot less fun than idly flipping from editor to command line. Working with an AI as an accelerator transforms the work.
If I hadn't already been coding for nearly a half a century it would have taken me a lot longer to intuit how I needed to change my practice, conforming myself to what the AI demands; as it is, I see what I need to do - though I am resisting. It feels less fun that way. Then again, that's always going to be the nature of the trade-off - sure, you can work faster, but you probably won't enjoy the process.
However, when faced with writing a function to extract a set of relevant data from a huge and deeply nested XML document, I relished the assistance of GPT-4. I could have spent a day writing bits of code, exploring Python's xml module. I did throw an hour at the problem, before deciding this work could be better performed by the AI. It took me a few minutes to structure an effective prompt, and fed that in, along with an example of the XML file - a 'one-shot' prompt. The AI quickly gave me a function that fit the bill perfectly and even ran first time. But after a few modifications it became clear that I didn't understand the structure of the XML document and the AI-generated code reflected my poor understanding. That led to my second 'aha' moment: garbage in, garbage out.
I prompted GPT-4 to modify the function to reflect my deeper understanding; it generated a new version of the function. I pasted that into my code, then added single-line additions, tuning it to my specific needs. I got it to a point where around 80 percent of the output was AI generated, and 20 percent was my own work. That's when I had my third and biggest 'aha': Whose code is this?
In the age of AI, one thing the legal system has so far been unambiguously clear on revolves around the [6]ownership of AI generated content : as it has not been created by a human being, it cannot be copyrighted. The AI doesn't own it, the AI's creators don't own it, and whoever prompted the AI to generate this content doesn't own it either. That code cannot have an owner.
Who owns this code that I've written for this attorney? I've plastered a copyright notice at the top of the source - as I've always done - but does that mean anything? A core function in this code is largely AI-generated; and while the rest of my code may be artisanal, bespoke, human-crafted Python, any coder working with an IDE hooked into [7]Github Copilot or getting help from GPT-4 will likely create code containing so many AI-written tidbits that it's very hard to know where the human ends and the machine begins.
Is any of that code copyrightable? Or is all the software we're writing today so thoroughly compromised it might no longer be defensible as a work protected by copyright?
I asked the attorney who'd brought me in to solve their problem. "Well, you own the copyright over the compilation," he said, pointing to a recent ruling where [8]an author was awarded copyright over an AI-generated collection of texts - because of their role as curator of that collection.
What does that mean for source code, where one line may be human-written (and therefore protected) while the next line may be AI-generated (and unprotected)? "It's a mess," the attorney admitted.
[9]Devaluing content created by AI is lazy and ignores history
[10]It's time we add friction to digital experiences and slow them down
[11]Apple has botched 3D for decades. So good luck with the Vision Pro, Tim
[12]Go ahead, let the unknowable security risks of Windows Copilot onto your PC fleet
We’ve run into this mess at ludicrous speed, blithely unaware that using these AI-powered coding tools turns the copyright protections every software firm takes for granted into a sort of Swiss cheese of loopholes, exceptions, and issues to eventually be tested in court cases.
It seems unlikely commercial organisations will turn their backs on the productivity increases promised by AI coding tools. The allure of 10x-ing an engineering team will almost certainly drown out any of the risks voiced by a legal department that urges caution.
Blasting ahead at full speed will work until it doesn't - when some major software company learns that their crown jewels have been ablated away by the consistent incorporation of generative AI. By then, it will be far too late for anyone else. ®
Get our [13]Tech Resources
[1] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/aiml&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2ZkSHwIb0GBuBA4yyQbhRTQAAABY&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/aiml&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZkSHwIb0GBuBA4yyQbhRTQAAABY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/aiml&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZkSHwIb0GBuBA4yyQbhRTQAAABY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/aiml&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZkSHwIb0GBuBA4yyQbhRTQAAABY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/aiml&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZkSHwIb0GBuBA4yyQbhRTQAAABY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[6] https://www.theregister.com/2024/02/13/uspto_ai_patents/
[7] https://www.theregister.com/2024/02/27/github_copilot_enterprise/
[8] https://arstechnica.com/tech-policy/2024/04/author-granted-copyright-over-book-with-ai-generated-text-with-a-twist/
[9] https://www.theregister.com/2024/04/17/devaluing_ai_content_is_lazy/
[10] https://www.theregister.com/2024/02/14/friction_is_good/
[11] https://www.theregister.com/2024/01/24/apple_vision_pro_good_luck/
[12] https://www.theregister.com/2023/10/11/microsoft_expects_it_pros_to/
[13] https://whitepapers.theregister.com/
Sometimes only a classic Buffy quote will do
Could you contemplate getting over yourself for a second?
Is any of that code copyrightable?
The more interesting question, to my mind, is whether any of that code is already subject to copyright as a result of AI having regurgitated code it previously ingested.
Whereas you know for certain that you cannot claim copyright yourself in the code AI produced for you, you do not know for certain whether someone else can. And even if pending lawsuits determine that AI training is "fair use", I doubt that the verbatim reproduction of part of a copyright work will get a pass on the same basis.
But, whatever our problems, lawyers are going to make lots of money, so let's focus on the positives.
Re: Is any of that code copyrightable?
I think this copyright thing when it comes to AI is a bit like patent trolling.
The AI doesn't "steal" any inventions or whatever. If you for example wrote a for loop that does something to database models, you are not creating anything new nor ground breaking. There is probably thousands of identical functions independently created by others.
If you browse open source code, you can find snippets of functionally very much the same code, just variables are called slightly different, formatting style is different etc. but it is the same.
If I create a hello world app, push it to Github and then ask LLM to create hello world app for me and I see it is the same as the one I created, do I have a case?
Re: Is any of that code copyrightable?
I think the problem is that you can't be sure.
Whereas boilerplate code may not be an issue in reality, the more specific the problem to which you're seeking a solution the more likely it is the AI will hone in on a specific result rather than a synthesis of results. It may well be that specific result has a permissive licence in any case - but AI won't tell you that so the mechanism that exists to resolve this uncertainty is unavailable.
A significant chunk of the economy is based around notions of intellectual property and its value. As the courts have already decided that artificial intellectual property has zero value, there will inevitably be considerable interest in preventing the former being transformed into the latter.
PS: Not my downvote.
Re: Is any of that code copyrightable?
Every code is very much boilerplate. Everything can be done in only so many ways.
The problem with copyright here, is that everyone wants to claim rights to common sentences, if I could use language analogy.
I could agree if what LLM is implementing is a process with an active patent (that is not lodged in a jurisdiction that waves everything through). Perhaps that may be a gray area, but anything else I don't see a case.
Re: Is any of that code copyrightable?
"Every code is very much boilerplate. Everything can be done in only so many ways."
I suspect the inventors and owners of compression or encryption algorithms would disagree. Fortunately for us they are mostly academics who allow free use, mostly. Some still remember GIF compression licensing. The evil geniuses behind the TikTok recommendation algorithm might be peeved if a LLM spit out an exact copy. As a developer myself I am aware that I am usually standing on the shoulders of giants, who had an amazing idea one day that turned a chore into a few lines of code. Now that genius idea is just a framework function call away, so it's easy to forget the debt that's owed. My boilerplate code relies on hundreds of previous genius ideas.
Re: Is any of that code copyrightable?
> just variables are called slightly different, formatting style is different
I did some binary reverse engineering on a 64KiB bootrom in a RISC-V SoC (using Ghidra). And was able to traceback at least one tiny fragment of the binary to source code that is GPL licensed (~10 lines of source code). If they had done as you suggested the binary file would still produce roughly the same binary code.
Re: Is any of that code copyrightable?
Not sure what you mean. Compilers may optimise functionally same but visually different code to the same binary. The fact that something matches GPL code is meaningless, because that same GPL code may match differently licensed code somewhere else.
It's like saying that in your comment "If they had done as you suggested" sentence, you basically lifted it from Call The Midwife Season 12 Episode 4. You have no respect for intellectual property!
Re: Is any of that code copyrightable?
"whether any of that code is already subject to copyright as a result of AI having regurgitated code it previously ingested"
Yes, absolutely. BUT
- Is it at all possible, given some source code written by AI, to definitively say "this code is coming from such-and-such copyrighted source"? (I would say, probably not, at least not to a legal standard of certainty)
- given that uncertainty, what is the default assumption? ie. is the onus on the original copyright holder to prove the code is theirs?
- Is it even possible, given some source code, to definitively say "this part is human written" or "this part is AI-written"? (I would say, probably not, at least not to a legal standard of certainty). It's probably highly likely that a skilled coder can reformat / refactor AI-generated code to keep the same functionality while looking like their style.
- given that uncertainty, what is the default assumption? Does a coder somehow have to prove all of their code is personally written? Or can anyone who copied their code do so with impunity and use "it's AI-written" as a blanket defence?
"lawyers are going to make lots of money"
seems like a certainty!!
Re: Is any of that code copyrightable?
Such a conundrum:
void pointlessLoop() {
// This code is human written
for(int8_t i=0; i<8; i++) {
printf("%d\n", i);
}
// This code is AI written
for(int8_t i=0; i<8; i++) {
printf("%d\n", i);
}
}
Re: Is any of that code copyrightable?
Probably neither as it is too short and required little creativity.
That said, copyright is not patent. Copyright covers concrete expressions of ideas, copying and derived works. Provenance matters much more here. Two programmers can independently(!) write very similar code and both have copyright to their respective works. That is just how it is.
Re: Is any of that code copyrightable?
Just like LLM based on one's prompt.
Hammer
When a hammer helps you create a cabinet, who owns the marks it leaves on the wood?
Re: Hammer
Mark my words, I own the marks because it is hammered into the marks that I missed the mark so many times that it is my trademark.
Re: Hammer
Apprentice marks you mean.
If you write something in a high level language you would expect to own the code. However to use it it needs compiling and with the complexity and optimization heurustics of modern compilers you may not really understand the final code ... and it's quite possible that some of those ideas that gives the compilation came from compiler writers analyzing the results on someone else's code.
So maybe the AI generated python is just an intermediate stage in the compilation of the very high level language "code" you give to the AI tool?
Brilliant point!
This sort of thing came up decades ago
Some of the code that comes out of a C compiler came straight from the C compiler. This includes the start up code and the intro to non-trivial functions. GCC comes with explicit licenses for that code so anyone can use GCC to create non-GPL binaries from their own source code. If a compiler does not come with such a license then its only value is to trap people who do not check what the license permits before selling the resulting binaries.
Well, you don't own the copyright on all that code used in your projects that you copied from random websites when searchnig for solutions to your problems either.
Licenses
Does the AI understand and respect the licenses of the code that it bases its suggestions on?
I can’t use third party code in my commercial environment unless the license allows me to.
Even then my organisation has strict rules about importing third party code modules. So if the AI has lifted something almost verbatim from a public repository and I lightly preen it before committing it internally then am I compliant? I don't even have the information to answer that question.
And of course there’s the moral argument of helping yourself to someone else’s intellectual output. Where physical goods are concerned there’s a word for that. Theft.
Fundamentals
" Did I understand the problem I wanted to solve? Could I express it clearly? Could I communicate my understanding to the AI in a sufficiently direct and unambiguous prompt that it would generate the response I sought? "
I would jolly well hope so, whether the third point referred to prompting AI or merely to documenting the code. One of the huge problems with current software development is that these three absolute prerequisites for adequate engineering are no longer considered important. Instead, we 'design' as we code, which leads to the incoherent messes that dominate the product space. Nobody would build even an office block like this, so why do we tolerate it when building software?
"We’ve run into this mess at ludicrous speed, blithely unaware that using these AI-powered coding tools turns the copyright protections every software firm takes for granted into a sort of Swiss cheese of loopholes, exceptions, and issues to eventually be tested in court cases."
Who's this "we"? It's been blindingly obvious to some of us.