In practical examples they use first order derivative which actually is what you get with the framework right now. If you are trying to learn a function f (which in this case is a  already trained network) you can compute gradients of the output wrt input. and m(x|O) is the network which is learning to approximate f.
In short, they apply an MSE not only over output but over gradients too.