A profile model can be selected for use in examining a structure formed on
a semiconductor wafer using optical metrology by obtaining an initial
profile model having a set of profile parameters. A machine learning
system is trained using the initial profile model. A simulated
diffraction signal is generated for an optimized profile model using the
trained machine learning system, where the optimized profile model has a
set of profile parameters with the same or fewer profile parameters than
the initial profile model. A determination is made as to whether the one
or more termination criteria are met. If the one or more termination
criteria are met, the optimized profile model is modified and another
simulated diffraction signal is generated using the same trained machine
learning system.