You can file a patent based on idea that you had that came from discussions with other people. For example, somebody came up with a wheeled cart, somebody came up with an engine and you have an idea to just combine those two ideas by putting an engine on a car. It is patentable even if the material is not 100% your own.
What is patentable is a novel idea. You need to bring something new to the table, and that AI definitely can do. The fact the knowledge it uses comes from training material has nothing to do with it. Almost everything factual you know comes from other people anyway.
e.g in "somebody came up with a wheeled cart, somebody came up with an engine" your patent would not cover either sub idea (contextually, the thing the "AI" came up with), so all something needs to do is say given the non-patentable idea you got from a machine your patent covers an obvious application then your patent is invalid. A whole bunch of laws passed over the last decade to try to limit the validity of "X but on a Y" (where Y is in the theme of computer, internet, etc) style BS patents.
The whole point is the machine is mechanically converting a pile of data into a "invention", and it does not matter where the data comes from.
When the machine does that, you personally did not, and when you claim in a patent application that you invented a thing, you're saying that you did the thinking or reasoning or whatever. Otherwise your teachers could wait for you to come up with an patentable idea and patent it claiming that it was their invention.
Either the AI is conscious and alive, etc, etc in which case you're the teacher in the argument (and can't claim to be an inventor but rather a slave owner) or it's a mechanical device operating over data and producing a functionally deterministic result (the randomness in "AI" is artificially added solely to produce the appearance of non-deterministic output) in which case there's no invention: anyone could put the same data in and get the same thing out so on.