We developed a fab-wide advanced process control system to control the critical dimension (CD) of gate electrode length in semiconductors. We also developed a model equation that predicts the gate CD by considering the structures of gate electrode and shallow trench isolation. This prediction model was also used to perform a factor analysis of gate CD variation. The effectiveness of the model in controlling feedforward was evaluated by both simulation and experiment. The CD variation of the wafers was improved from 8.9 nm in its 3 sigma without control to 3.5 nm with lot-to-lot feedforward control.