For advanced CMOS processes, inverse lithography promises better patterning fidelity than conventional mask correction techniques due to a more complete exploration of the solution space. However, the success of inverse lithography relies highly on customized cost functions whose design and know-how have rarely been discussed. In this paper, we investigate the impacts of various objective functions and their superposition for inverse lithography patterning using a generic gradient descent approach. We investigate the most commonly used objective functions, which are the resist and aerial images, and also present a derivation for the aerial image contrast. We then discuss the resulting pattern fidelity and final mask characteristics for simple layouts with a single isolated contact and two nested contacts. We show that a cost function composed of a dominant resist-image component and a minor aerial-image or image-contrast component can achieve a good mask correction and contour targets when using inverse lithography patterning.