A new approach based on sensitivity analysis for optimizing the microstructure development during the forging processes is proposed in this work. The analytical sensitivities of the recrystallization volume fraction and dynamically recrystalized grain size with respect to the design variables are derived. The mean grain size in each finite element is introduced so that the complex recrystallization mechanics, such as no recrystallization, partial recrystallization and complete recrystallization are all considered. The objective is to minimize a function describing the variance of mean grain size and the average value of mean grain size in the whole final product. Two constraints are imposed on die underfill and excessive material waste. Two different kinds of design variables are considered, including state parameter (initial shape of billet) and process parameter (die velocity). The optimization scheme is demonstrated with the design of a turbine disk made of Waspaloy in non-isothermal forging process. The optimal initial shape of billet and the die velocity are obtained.