if the generation is independent of the existing code
well, that's the big question, isn't it? if the code is used for training AI and the AI reproduces the same code, is that really independent?
i don't think so.
Copyright protects against copying. It doesn't protect against someone creating the same content by means other than copying.
if the code is the same, how do you prove it's not a copy?
it's the same problem as with plagiarism, isn't it?