Latent attention on masked patches for flow reconstruction
Authors: Ben Eze, Luca Magri, Andrea Nóvoa
Organizations: Aeronautics Dept., Imperial College London, Exhibition Rd, London SW7 2BX, UK · DIMEAS, Politecnico di Torino, Corso Duca degli Abruzzi, 24, Torino, 10129, Italy · I-X, Imperial College London, 84 Wood Lane, London W12 0BZ, UK
Vision transformers have shown outstanding performance in image generation, yet their adoption in fluid dynamics remains limited. We introduce the Latent Attention on Masked Patches (LAMP) model, an interpretable regression-based modified vision transformer designed for masked flow reconstruction. LAMP follows a three-fold strategy: (i) partition of each flow snapshot into patches, (ii) patch-wise dimensionality reduction via proper orthogonal decomposition, and (iii) reconstruction of the full field from a masked input using a single-layer transformer trained via closed-form linear regression. We test the method on two canonical 2D unsteady wakes: a laminar wake past a bluff body, and a chaotic wake past two cylinders. On the laminar case, LAMP accurately reconstructs the full flow field from a 90%-masked and noisy input, across signal-to-noise ratios between 10 and 30dB. Further, the learned attention matrix yields interpretable multi-fidelity optimal sensor-placement maps. LAMP's performance on the chaotic wake is limited, but outperforms other regression methods such as gappy POD. The modularity of the framework, however, naturally accommodates nonlinear compression and deep attention blocks, thereby providing an efficient baseline for nonlinear, high-dimensional masked flow reconstruction.
Figures & tables
Figure 1: Pictorial illustration of the patch-wise latent attention model (LAMP). A linear autoencoder embeds the input in a lower-dimensional latent space, where predictions can be made efficiently. The predictions are pair-wise (i.e. each patch predicts every other patch) and weighted with a confidence score.
Figure 2: Patch-wise POD reconstruction performance for varying patch size P . Loss LAE versus (a) latent dimension Ne and (b) compression factor D/Ne .
Figure 3: Reconstruction error Lpred for varying noise levels, patch size P and latent dimension Ne , all with 10% patches unmasked. The input is noisy masked data with SNR = (a) ∞ (noise-free), (b) 30 dB, (c) 20 dB, (d) 10 dB. The loss is computed against the noise-free target Xtest and the model is trained on noise-free data. Horizontal dashed lines show the noise variance. Lpred is calculated for 25 random patch arrangements and the median is plotted. An example reconstruction for the noise-free case with P=16 , Ne=8 is shown.
Figure 4: Predictive-power maps for varying P and Ne . Patches with higher predictive power predict the rest of the patches with lower average loss.
Figure 5: Masked reconstruction of the chaotic wake from 25% unmasked patches, patches placed at the locations of highest predictive power. The reconstruction of one snapshot with the best model ( P=48,Ne=250 ) is shown on the right.
Physics-informed surrogate models can accelerate computational fluid dynamics simulations. However, many existing methods reproduce global flow patterns more reliably than localized multiscale structures. This study presents a physics-informed Fourier-wavelet transformer for next-step velocity-field reconstruction in real-world flow benchmarks. The proposed formulation combines hybrid Fourier-wavelet spectral encoding with physics-biased self-attention based on partial differential equation residual diagnostics. It also uses self-supervised pretraining through Masked Physics Prediction and Equation Consistency Prediction. The experiments are conducted on two real benchmark cases: cylinder-wake flow and fluid-structure interaction. All approaches are evaluated under a shared local protocol and compared with spectral, transformer-based, operator-learning, and physics-informed neural-network baselines. On the cylinder-wake benchmark, the proposed model achieves the best aggregate accuracy, with an all-channel normalized mean-squared error of 0.05875 and an all-channel Pearson correlation coefficient of 0.97019. On the fluid-structure-interaction benchmark, it gives the lowest all-channel normalized mean-squared error of 2.70×10−4, compared with 4.02×10−4 for the strongest baseline. Component-wise field comparisons and scale-separated diagnostics further show stronger recovery of localized wake structures, including near-body, wake-core, and far-wake features. The results demonstrate improved real-world flow reconstruction while maintaining a practical accuracy-cost tradeoff.
Somyajit Chakraborty, Ming Pan, Xizhong Chen
Shanghai Jiao Tong University, Department of Chemistry and Chemical Engineering 800 Dongchuan Road, Minhang District, Shanghai, 200240, China
Reconstructing flow fields from sparse measurements is a fundamental problem in fluid mechanics with broad implications for modeling, control, and design. In this work, we propose a novel operator learning framework that leverages the architecture of language models to perform flow reconstruction in a mesh-free manner. We reformulate flow field reconstruction as a sequence-to-sequence learning task, where sparse measurements are treated as context and unobserved locations as queries. Our model learns to reconstruct the full flow field from sparse inputs, effectively capturing spatial correlations and long-range dependencies. We evaluate the proposed approach on four benchmark datasets: (1) two-dimensional vortex street simulations, (2) daily average temperature data across the contiguous United States, (3) three-dimensional blood flow simulations based on dissipative particle dynamics, and (4) three-dimensional turbulent jet flow measurements obtained via particle tracking velocimetry. Across all cases, our method demonstrates competitive reconstruction accuracy, even with highly incomplete data (less than 10% observed), and achieves efficient performance. The results highlight the potential of language models as robust and scalable tools for scientific data reconstruction, and suggest a promising direction toward the development of foundation models for scientific and engineering applications.
Transformer surrogates for 3D flow prediction compress an industrial mesh into a small set of tokens from which every prediction point reads. Two operations follow: the retrieval step in which a point gathers information from the compressed representation, and the feed-forward layer that transforms what it retrieved. In current backbones both are blind to where the point sits in the flow. We condition both on wall-related physical signals. Distance-aware cross-attention (DA-CA) reshapes each volume query by its wall distance before retrieval, so that a point deep in the boundary layer draws different geometric information than one in the outer flow. Surface-volume mixture-of-experts (SVMoE) replaces the shared feed-forward layer with a small set of experts, routed by wall distance for volume points and by local geometry for surface points. Neither mechanism is tied to one architecture, so we apply both unchanged to AB-UPT and Transolver-3. On DrivAerML with 50 training cases, DA-CA reduces the volume pressure error by 10.1%, and DA-CA and SVMoE together reduce it by 12.5%; DA-CA improves the near-wall region at some cost in the far region, which SVMoE recovers, and the volume experts settle into near-wall, transition, and free-stream bands without routing supervision. Retrained on 300 cases, the conditioning improves every field quantity, reducing volume pressure and velocity errors by 33.1% and 18.6% on AB-UPT and by 21.4% and 21.3% on Transolver-3. Under Leave-One-Body-Out evaluation on DrivAerNet++, it reduces the volume pressure error on unseen body types by up to 14.2%.
Sanghyeon Kim, Sunwoong Yang, Namwoo Kang
Division of Future Vehicle Korea Advanced Institute of Science and Technology Daejeon, 34051, Republic of Korea · Department of Mechanical Engineering Hanyang University Ansan, 15588, Republic of Korea · Cho Chun Shik Graduate School of Mobility Korea Advanced Institute of Science and Technology Narnia Labs Daejeon, 34051, Republic of Korea