A semiconductor device includes a substrate, first, second, and third gate lines disposed over the substrate, the first and second gate lines defining a first trench with a first aspect ratio, the second and third gate lines defining a second trench with a second aspect ratio, a first insulating layer formed to decrease the first and second aspect ratios, and a second insulating layer disposed over the first insulating layer to fill the first and second trenches.