You can make your code something that cannot be _reproduced_ without a license, but you cannot stop someone from learning ideas from your published code. This does not require a license (only distributing, or making derivative works needs licenses).
Whether that learning comes via ML, or a real flesh human brain, i think, makes no distinction. You will need to lobby for an update to copyright laws to add a new right to be granted.
And just to be clear, a theory is all this is. It has never been tested in court.
The tech is there.
It won't ever leave.
If you cut off one head, three will replace it.
In my opinion: Copyright is a failure and the absolute best move, with the advantage AI has given to everyone, is to abolish copyright.
But practically what you need to do is to stop crawlers from reading your code/art by robots.txt or captcha. If your works don't get into CommonCrawl and similar datasets they won't be used for model training. I think you can still enable Google Bot while rejecting AI data collectors on your sites.
In these cases where an AI developer wants to train on the ideas without learning the expression they can re-generate the data using the "variations" method, works both in image and text. This will create substitute data, like anonymising PII.
>
However, I'd rather not see a separate license / mechanism for this, because now we would have people who'd be fine with their work being used this way, people like us who are not fine with this and people who don't know / care. And mixing code from people of these different groups, which the licenses you cited allow, is going to be a mess.
I also would like that this not be opt-out, but opt-in.
Eventually, we need the legal system to do its work quickly and tell us if fair use can be used to train ML models and in which conditions, so we can build a strong defense.
Congress decided to grant limited "rights" to copyright holders as incentives for them create, not to protect their work forever, but in exchange for it to be widely available and eventually in the public domain.
That these incentives take the form of limited protections is a side effect. That the original purpose is often corrupted and delivered ham-handedly has more to do with politics than purpose.
If we argued from first principles, we could invent a better system, but that system would undoubtedly allow for ingestion and manipulation by AI.
If like GPL you want to allow people to share your code further, and make derivative works, then you must ensure that those people lock such works behind restrictions in the same way, such that derivative works can also only be read after signing the license.
You can add malevolent code to your code base, which allows at best for the ml project to gain self-awareness (copilot "shodan") and at worst to just add maleware. Of course you then
Dont forget to remove the evil pre-compilation. If you do art, i think the best think to throw AI would be fractal details, aka your picture never ends upon zoom in, but just becomes more art. That or you try to throw the weights in another way.