The distribution of ocean sound speed profiles (SSPs) profoundly influences the design of underwater acoustic communication and positioning systems. Conventional methods for measuring sound speed by instruments entail high time costs, while sound speed inversion methods offer rapid estimation of SSPs. However, these methods heavily rely on sonar observational data and lack the capacity to swiftly estimate SSPs in arbitrary oceanic regions, particularly in scenarios with few-shot data. Precisely estimating non-cooperative maritime SSPs under such conditions poses a significant challenge. To explore temporal distribution patterns of sound speed and achieve precise SSP predictions with limited data, we propose a hierarchical long short-term memory transfer learning (H-LSTM-TL) framework. The core idea involves pre-training the base model on extensive public datasets, transferring the acquired knowledge to task models, and fine-tuning the task model on few-shot data to predict future SSPs. Through H-LSTM-TL, it accelerates model convergence, enhances sensitivity to few-shot input data, alleviates overfitting issues, and notably improves the accuracy of SSP predictions. Experimental results demonstrate that the H-LSTM-TL model exhibits strong generalization capabilities in few-shot data scenarios, effectively reducing overfitting problems and proving its applicability for rapid prediction of SSPs.