Estimating porosity from seismic data is critical for studying underground rock properties, assessing energy reserves, and subsequent reservoir exploration and development. For reservoirs with strong heterogeneity, the endeavor to accurately and stably characterize spatial variations in porosity often encounters considerable challenges due to the rapid lateral changes of formations. In view of this, establishing a robust mapping relationship from seismic data to reservoir properties in three-dimensional (3D) space is important in addressing this challenge. We propose to transform the conventional one-dimensional (1D) sequence-to-point (STP) prediction paradigm into a 3D sequence-to-sequence (STS) prediction paradigm to enable machine learning to extract 3D seismic data features. 3D STS prediction presents valuable potential for enhancing the geological continuity and vertical characterization ability of porosity compared to STP. Building upon the 3D STS prediction model, three strategies from different perspectives are introduced to further enhance the performance of seismic porosity estimation. First, we apply a translation-based data augmentation (DA) strategy to mitigate the problem of sparsely labeled data. Second, we propose spatial constraints (SC) considering absolute coordinates and relative time to boost the spatial delineation of porosity. Third, to incorporate geological insights into machine learning, we impose geologic constraints (GC) by measuring the data distribution similarity between around-the-well predictions and well labels. Compared with data augmentation strategies, incorporating spatial constraints and geologic constraints to STS yields more substantial improvements, which illustrates the importance of prior knowledge for physical parameter inversion. Finally, the combined application of these three strategies and the 3D STS method gives better generalization performance and geological plausibility in the porosity prediction for investigated carbonate reservoirs, outperforming other methods, and decreasing error by an average of 8% across 48 wells compared to STP.