This work introduces GalProTE, a proof-of-concept Machine Learning model, leveraging Transformer Encoder architecture to efficiently determine the stellar age, metallicity, and dust attenuation of galaxies from optical spectra. Designed to address the challenges posed by the vast datasets produced by modern astronomical surveys, GalProTE offers a significant improvement in processing speed while maintaining accuracy. Using the E-MILES spectral library, we generate a dataset of 111,936 diverse templates by expanding the original 636 simple stellar population models with varying extinction levels, combinations of multiple spectra, and noise modifications. This ensures robust training over the spectral range of 4750–7100 Å at a resolution of 2.5 Å. GalProTE architecture employs four parallel attention-based encoders with varying kernel sizes to capture diverse spectral features. The model demonstrates a mean squared error (MSE) of 0.27% with a standard deviation of 0.10% between the input spectra and the GalProTE-generated spectra for the synthetic test dataset. Performance evaluation against real data from two galaxies in the PHANGS-MUSE survey (NGC4254 and NGC5068) demonstrates its ability to extract physical parameters efficiently, with spectral fit residuals showing a mean of -0.02% and 0.28%, and standard deviations of 4.3% and 5.3%, respectively. To contextualize these results, we compare age, metallicity and dust attenuation maps generated by GalProTE with those of pPXF, a state-of-the-art spectral fitting tool. While pPXF achieves robust results, it requires approximately 11 seconds per spectrum. In contrast, GalProTE processes a spectrum in less than 4 milliseconds—a speedup factor exceeding 2,750, while also consuming 68 times less power per spectrum. The comparison with pPXF maps from PHANGS-MUSE underscores GalProTE’s capacity to enhance traditional methods through machine learning, paving the way for faster, more energy-efficient, and more comprehensive analyses of galactic properties. This study demonstrates the potential of GalProTE as an efficient, scalable, and sustainable solution for processing large astronomical surveys.