Despite advances in prostate cancer treatment, including androgen deprivation therapy, metastatic castration resistant prostate cancer (mCRPC) remains largely incurable. Recent advances in collecting and sharing large quantities of genomic records from patients with primary and metastatic prostate cancer have not yet been matched with advances in computational model development to shed light on the underlying biology of mCRPC. Here we developed a biologically informed deep learning model (P-NET) that can accurately identify advanced prostate cancer samples based on their genomic profiles. By using a sparse model architecture that encodes different biological entities including genes, pathways, and biological processes, we were able to interpret the model in a way that is not matched by typical deep learning models. In a systematic unbiased way, P-NET recovered known biology of mCRPC via AR, TP53, RB1, and PTEN disruption, as well as less expected genes such as MDM4. We showed experimentally that MDM4 mediates enzalutamide resistance, showing that it may be a potential therapeutic target. We envision that our model will be helpful in both predicting clinical outcomes of cancer patients and generating biological hypotheses to better understand the underlying cancer biology.