We investigate the effectiveness of tuning HMC parameters using
information from the gradients of the HMC acceptance probability with
respect to the parameters. In particular, the optimization of the
trajectory length and parameters for higher order integrators will be
studied in the context of pure gauge and dynamical fermion actions.