Since no court has ruled on the latter question yet, let’s do a choose your own adventure:
Say that OpenAI trained a language detection model. The output of the model is simply a single vector that indicates which language that the input was written in. During training they use your copyrighted code as training data.
Would you consider that to be infringement?
1) If yes: consider instead of using fancy and scary mathematics like “neural networks”, it is just tabulating and counting keywords. Is it still infringement?
1) If no: what’s different about a neural network that outputs code, vs a neural network that outputs a single vector? Perhaps it’s the output that is infringing, not the weights?