For eg stable diffusion I actually dove a bit deeper on this:
The LAION dataset is -in itself- almost indisputably legal: It contains URLs of images, and tags describing those images[1]. To be sure: _It does not contain actual images_. People have made this mistake before, and LAION quite correctly reply that they don't have them. [2]
Stable diffusion's models are much smaller [3] than the LAION dataset which they use as their source. Again, the models do not contain images.
This is pretty suggestive that SD models should not be considered derivative works. Of course sometimes funny things happen in court, so we can't be sure until a court actually decides.
I don't currently run my own GPT or LLAMA, but those should have similar properties. (in fact, OpenAI appears to claim so.)
[1] https://laion.ai/blog/laion-5b/ (if you look for the files in any of the variations, you'll see it's in the order of terrabytes)
[2] https://www.vice.com/en/article/pkapb7/a-photographer-tried-...
[3] https://huggingface.co/stabilityai/stable-diffusion-xl-base-... : see under "files and versions", it's sd_xl_base_1.0.safetensors. File size is 6.9 GB