A high-quality crack-free AlN cap layer on GaN layer has been achieved using an AlN buffer layer directly grown on a silicon substrate at high temperature by radio frequency (RF) plasma-assisted molecular beam epitaxy. A two dimensional (2D) growth process guide to AlN cap layer of high grade crystal quality. The nucleation and the growth dynamics have been studied by in situ reflection high energy electron diffraction (RHEED) and ex situ by high resolution transmission electron microscopy (HR-TEM). The microstructure was investigated by energy-dispersive X-ray spectroscopy (EDX). It was disclosed that AlN is single crystalline with low defect. High densities of V-shaped pits were not detected at the interface between AlN and GaN layers. Contradictory the earlier reported V-shaped defects in nitride-based alloys; these V-shaped pits were condensed on top of the AlN layer because of H2 etching of the surface when a high temperature growth discontinuity between AlN and GaN layers.