Efficient learning in sequential optimization