Messenger RNA therapeutics hold great promise but are limited by suboptimal protein expression. Here, the authors develop RiboDecode, a deep learning framework that generates optimized mRNA codon sequences to significantly enhance translation efficiency and therapeutic efficacy in both vaccines and protein replacement therapies.