The step size is computed by solving $$ (A + \mu I) h = -g $$
I could find in some literature that one can compute the step size by solving $$ (A + \mu \operatorname{diag}(A) ) h = -g $$ It is said that this is helpful for error valley problems, where the error surface at minima is flat and long. I am not able to decide whether the diagonal of $A$ should be used in general for all cases, or the identity matrix $I$ is more appropriate.
Some information:
Levenberg-Marquardt algorithm: An iterative technique that locates the minimum of a function that is expressed as the sum of squares of nonlinear functions.
$g$: Gradient matrix (Jacobian x Function values)
$A$: Approximate Hessian matrix (JacobianTransposed x Jacobian)
$\mu$: Damping factor
$h$: Step size