I understand what is derivative-free optimization, and I am thinking a similar problem where the function $f$ we are optimizing is unknown and the only information we can acquire is the derivative. In other words, we can get $(x_1, \nabla f(x_1)), \cdots, (x_n, \nabla f(x_n)$ to optimize the unknown function.
I know the current gradient based optimization tasks in machine learning are all using this idea to optimize the loss function. But as far as I can understand, all of those problems require the predefined loss function, and compute the gradient based on the predefined loss function at each time step $t$.
Are there any real world problems which don't have such a predefined loss function but give you the gradient of the function you are optimizing directly? In other words, you'll optimize an unknown loss function $f$, at each time step $t$, you choose $x_t$ and receive $\nabla f(x_t)$ as the feedback.