Abstract: We examine the behavior of mortgage borrowers over several economic cycles usingan unprecedented dataset of origination and monthly performance records for over 120million mortgages originated across the US between 1995 and 2014. Our deep learningmodel of multi-period mortgage delinquency, foreclosure, and prepayment risk uncoversthe highly nonlinear influence on borrower behavior of an exceptionally broad range ofloan-specific and macroeconomic variables down to the zip-code level. In particular,most variables strongly interact. Prepayments involve the greatest nonlinear e↵ectsamong all events. We demonstrate the significant implications of the nonlinearities forrisk management, investment management, and mortgage-backed securities.