We propose Intermediate Layer Optimization (ILO), a novel optimizationalgorithm for solving inverse problems with deep generative models. Instead ofoptimizing only over the initial latent code, we progressively change the inputlayer obtaining successively more expressive generators. To explore the higherdimensional spaces, our method searches for latent codes that lie within asmall $l_1$ ball around the manifold induced by the previous layer. Ourtheoretical analysis shows that by keeping the radius of the ball relativelysmall, we can improve the established error bound for compressed sensing withdeep generative models. We empirically show that our approach outperformsstate-of-the-art methods introduced in StyleGAN-2 and PULSE for a wide range ofinverse problems including inpainting, denoising, super-resolution andcompressed sensing.