The present invention is concerned with novel substituted triazole and imidazole derivatives of Formula (I) wherein R1, R2, A1, A2, A3, A4, X, and Het1 have the meaning defined in the claims. The compounds according to the present invention are useful as gamma secretase modulators. The invention further relates to processes for preparing such novel compounds, pharmaceutical compositions comprising said compounds as an active ingredient as well as the use of said compounds as a medicament.