This paper introduces GAC-FAS, a novel learning objective designed to enhance the domain generalization (DG) of face anti-spoofing (FAS) models. Traditional FAS methods often struggle with domain shifts, and while some approaches aim to remove domain-specific features, they may not guarantee consistent maintenance of domain-invariant features or convergence to a flat minimum, which is crucial for robust generalization. GAC-FAS addresses these limitations by encouraging the model to converge towards an optimal flat minimum without requiring additional learning modules. Unlike conventional sharpness-aware minimizers, GAC-FAS identifies ascending points for each domain and aligns the generalization gradient updates at these points with empirical risk minimization (ERM) gradient updates, ensuring the model is robust against domain shifts. The efficacy of GAC-FAS is demonstrated through rigorous testing on challenging cross-domain FAS datasets, where it achieves state-of-the-art performance. The code for GAC-FAS is available at <https://github.com/leminhbinh0209/CVPR24-FAS>.This paper introduces GAC-FAS, a novel learning objective designed to enhance the domain generalization (DG) of face anti-spoofing (FAS) models. Traditional FAS methods often struggle with domain shifts, and while some approaches aim to remove domain-specific features, they may not guarantee consistent maintenance of domain-invariant features or convergence to a flat minimum, which is crucial for robust generalization. GAC-FAS addresses these limitations by encouraging the model to converge towards an optimal flat minimum without requiring additional learning modules. Unlike conventional sharpness-aware minimizers, GAC-FAS identifies ascending points for each domain and aligns the generalization gradient updates at these points with empirical risk minimization (ERM) gradient updates, ensuring the model is robust against domain shifts. The efficacy of GAC-FAS is demonstrated through rigorous testing on challenging cross-domain FAS datasets, where it achieves state-of-the-art performance. The code for GAC-FAS is available at <https://github.com/leminhbinh0209/CVPR24-FAS>.