 This study proposes a new deep learning architecture called segmented attention network, SAM, to improve sleep staging accuracy. The architecture replaces the recurrent neural network, RNN, with a time sequence encoder, TSE, module for temporal learning, making it faster than existing models. The proposed model achieves high accuracy on three public data sets and one clinical data set, demonstrating its effectiveness in sleep staging. This article was authored by Wei Zhou, Hanyu Zhu, Ning Shen, and others.