# What is the purpose of an oracle in optimization?

I am reading a textbook on convex optimization, and in it there was an extremely short discussion of so called "oracle model" on page 136, which has left me confused.

Pardon my ignorance but why do people in optimization bother with an "oracle model"?

1. Oracle model assumes that we do not know our objective function. Does this actually occur in practice?

2. Oracle model returns the function value $f(x)$ and perhaps gradient information $\nabla f(x)$. Why the seemingly arbitrary restriction on the type of information that can be "queried" from such an object?

3. In the text, it says: "If we are given a parameter problem description, we can construct an oracle for it, which simply evaluates the required functions and derivatives when queried." Is this sentence simply saying if we had a parameter problem description i.e., the objective function is known, then we can write a Python script that calculates its gradient? I don't understand the importance of constructing an oracle, or even what it means to construct an oracle.

All this talk of oracles, queries and black boxes has left me confused, how can this idea of an oracle be helpful?

In optimization theory and computational practice, there's a difference between having a formula for the function that you want to minimize and having access to a routine that can compute values of that function. If you're given an explicit formula for the objective function then you can compute its gradient and Hessian (if the function is twice continuously differentiable), determine a Lipschitz constant for the gradient, etc. If all you've got is the ability to call the function to compute values of $f(x)$ and perhaps $\nabla f(x)$, then you have limited information to work with.
For example, it can be shown that for smooth convex functions, using only values of $f(x)$ and $\nabla f(x)$ at specific points, the best possible algorithm has $f(x^{k})-f(x^{*})$ decreasing at a rate of $O(1/k^{2})$ where $k$ is counting the number of evaluations of $f(x)$ and $\nabla f(x)$. Furthermore, Nesterov's accelerated gradient method is optimal in that it achieves this $O(1/k^{2})$ convergence.