We study the contribution of doctoral students to innovation at 2,300 American science and engineering departments from 1973 to 1998. Macroeconomic and policy shocks in source countries that differentially affect enrolments across fields and universities isolate exogenous variation in the supply of students. Both US and international students contribute significantly to the production of knowledge at scientific laboratories, and their contributions are statistically comparable, consistent with an optimising department. A theoretical model of scholarships helps us to infer the productivity effects of student quality. Visa restrictions limiting entry of high-quality students are found to be particularly costly for academic innovation.