For what its worth, I think the answer is the student. There are lots of examples of students discovering something amazing during their graduate work, leaving the university, patenting something, or starting a business. For example, the google founders were graduate students and dropped out. I was a graduate student and I never signed anything saying that the university had rights to my ideas and/or products. When I was an employee at a corporation, the corporation did make me sign something that made it clear they owned all my ideas and output while I was employed with them.