arXiv:2609.07222cs.AISep 2026

Manuscript Offprint

arXiv:2609.07222

Distance-Aware Attention and Wall-Distance Expert Routing for Transformer-Based 3D Flow Prediction

Sanghyeon Kim, Sunwoong Yang, Namwoo Kang

Sanghyeon Kim

Division of Future Vehicle

Korea Advanced Institute of Science and Technology

Daejeon, 34051, Republic of Korea

csmd2012@kaist.ac.kr

Sunwoong Yang

Department of Mechanical Engineering

Hanyang University

Ansan, 15588, Republic of Korea

sunwoongy@hanyang.ac.kr

Namwoo Kang

Cho Chun Shik Graduate School of Mobility

Korea Advanced Institute of Science and Technology

Narnia Labs

Daejeon, 34051, Republic of Korea

nwkang@kaist.ac.kr

September 9, 2026

ABSTRACT

Transformer surrogates for three-dimensional flow prediction compress an industrial mesh into a small set of tokens from which every prediction point reads. Two operations then follow, the retrieval step in which a point gathers information from the compressed representation and the feed-forward layer that transforms what it retrieved, and 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 refers to a construct specific to one architecture, so we apply both unchanged to AB-UPT and Transolver-3. On DrivAerML with 50 training cases, a data budget typical of high-fidelity CFD, DA-CA reduces the volume pressure error by 10.1%, and DA-CA and SVMoE together reduce it by 12.5%; a wall-distance decomposition shows that 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. To test whether these gains are tied to the small data budget or to the backbone they were developed on, we retrain both backbones 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. Because routing is indexed by wall distance rather than by body type, the design also transfers: under Leave-One-Body-Out evaluation on DrivAerNet++ it reduces the volume pressure error on unseen body types by up to 14.2%.

1 Introduction

For engineering design, predicting a three-dimensional flow field is not a simple problem of reconstructing hundreds of millions of solution values. It is a problem of preserving the localized flow structures that determine performance. Drag, lift, heat transfer, and pressure loss are controlled by thin boundary layers, separated shear layers, recirculation zones, and wakes. These regions may occupy only a small fraction of the computational domain but dominate the quantities of interest, whereas the surrounding free stream is typically smooth and substantially easier to approximate. This severe imbalance creates a fundamental challenge: a model can be accurate over most of the domain but still fail precisely where critical engineering decisions are made.

Obtaining such fields at industrial fidelity remains computationally expensive. In the DrivAerML dataset (Ashton et al., 2024), for example, each vehicle variant is resolved on roughly 8.8 million surface cells and 160 million volume cells, and a single hybrid RANS-LES case runs for about 40 hours on 1536 CPU cores, some 60,000 core-hours, to produce one time-averaged flow field. While this cost may be acceptable for the final verification stage of a design cycle, where a small number of mature candidates are evaluated, it is prohibitive for early-stage design exploration, where hundreds or thousands of candidate geometries may need to be screened.

Neural surrogates address this gap by amortizing the cost of high-fidelity simulation. Once trained on a set of pre-computed solutions, graph neural operators, neural fields, and transformer-based models infer new flow fields orders of magnitude faster than the underlying solver (Karniadakis et al., 2021; Wang et al., 2023; Ranade et al., 2025; Alkin et al., 2025). Fast inference alone, however, does not make a surrogate useful; accuracy in the regions that matter also depends on whether geometry merely enters as an input or directly shapes the computation used to produce each prediction. Two decisions are central: which parts of the geometry should influence each prediction point, and whether all points should be transformed by the same mapping or by mappings adapted to their physical regimes.

Both decisions are shaped by how these models achieve scalability. An industrial mesh cannot be attended over directly, so a transformer surrogate first compresses the problem into a small set of tokens and then lets every prediction point read from that compact set. AB-UPT selects a subset of mesh points as anchor tokens and lets the remaining points cross-attend to them (Alkin et al., 2025), while Transolver assigns points to a small number of learned physical-state slices and recovers each point's features from those slices (Wu et al., 2024). In both, a retrieval step decides which part of the compressed representation influences a given point, and a transformation step, the feed-forward layer that follows, decides how the retrieved information is mapped. Because these two sites are properties of the family rather than of one model, we develop the two mechanisms on AB-UPT, where their effect on attention is easiest to inspect, and then apply them unchanged to Transolver-3 (Zhou et al., 2026), the most recent member of the Transolver family, which we adopt as a second baseline.

Scalability, however, does not settle either of the two decisions above. The retrieval step decides which part of the compressed representation influences a given point from learned feature similarity alone, without being told where in the flow that point sits, that is, how deep it lies in the boundary layer. The feed-forward layer that follows applies one mapping to every token: surface and volume tokens share the same weights, as do volume points in the boundary layer and in the free stream, despite their different physical balances (Schlichting and Gersten, 2017). Prior surrogates may encode geometry in token features (Alkin et al., 2024, 2025) or inject it into attention (Adams et al., 2025; Zhdanov et al., 2025), but geometry can be present in the representation without directly determining where information is gathered or which mapping is applied. Distance-dependent information transfer and regime-dependent transformation must then be inferred implicitly from the training data, making them more likely to remain tied to the geometries seen during training than to physical variables that carry over to new ones.

This reliance on implicit learning is especially problematic in high-fidelity CFD, where the cost of supervision limits both the number of geometries available and the compute that can be spent on training. Under such budgets, relying on the network to infer spatial locality and wall-dependent behavior from examples alone is inefficient. Empirically, in the unconditioned anchor-based baseline, cross-attention varies only weakly with distance even though the prediction error stays concentrated in the near-wall and separated-flow regions (Section 4.1). Moreover, enlarging the training set beyond roughly 50 cases yields only marginal gains under a fixed compute budget (Section 3.2). This does not mean that more data cannot help; it means the data at hand is used more effectively when the relevant physical structure enters the computation explicitly. Reducing the high-fidelity requirement itself, by transferring from cheaper low-fidelity solutions or by adding PDE residuals to the loss (Yang et al., 2024, 2025), is a complementary route that we do not pursue here. Together, these observations motivate direct intervention at the two computational sites identified above.

We address the two decisions with physical signals matched to their respective roles. The first decision is what a point gathers from the surface. A point buried in the boundary layer and a point in the outer flow do not need the same thing: near the wall the local orientation of the surface and the shear it carries dominate the solution, while further out the overall shape matters more, and how deep a point sits is what separates the two cases. Distance-Aware Cross-Attention (DA-CA) supplies exactly that, letting each query's wall distance dwd_w reshape the query before the attention score is formed. The second decision is how the gathered information is transformed. A point inside the boundary layer and a point in the free stream are governed by different physics and should not be transformed by the same nonlinear mapping. Surface-Volume Mixture-of-Experts (SVMoE) therefore replaces the single shared mapping with branch-specific expert mixtures, routing volume tokens by their wall distance dwd_w and surface tokens, for which dwd_w is trivially zero, by a local geometric descriptor. The two mechanisms read the same coordinate in the volume but inject it at different points: DA-CA changes what a token retrieves, whereas SVMoE changes how what it retrieved is transformed.

The main contributions are as follows.

  1. Distance-Aware Cross-Attention (DA-CA). In three-dimensional flow fields, prediction error concentrates in the thin band of volume points closest to the body, yet conventional attention scores every query-anchor pair by learned feature similarity alone, with no notion of where the query sits relative to the wall. The proposed DA-CA conditions each volume query on its own wall distance before the score is formed, so that a point deep in the boundary layer looks for different information than one in the outer flow. On the DrivAerML dataset, this reduces the volume pressure error by 10.1%.

  2. Surface-Volume Mixture-of-Experts (SVMoE). Near-wall shear, wake recirculation, and outer flow are governed by different physics, yet in conventional methods one and the same feed-forward transformation is applied to all of them. Where DA-CA conditions what a point gathers, the proposed SVMoE conditions how it transforms what it gathered. It replaces the single feed-forward network with a small set of experts and lets each volume point choose among them by its wall distance, with a separate mixture for surface points. Without supervision on the assignment, the volume experts organize into near-wall, transition, and free-stream bands. Combined with DA-CA, this reduces the volume pressure error by 12.5%.

  3. Robustness to data scale and backbone. The gains above are measured at the data budget the method targets and on the backbone it was developed on, which leaves open whether they are tied to either. Since neither mechanism refers to anchors, slices, or any other construct specific to one architecture, we retrain both AB-UPT and Transolver-3, with and without the components, on 300 DrivAerML cases under an identical protocol. The conditioning improves every field quantity on both backbones, reducing the volume pressure error by 33.1% on AB-UPT and 21.4% on Transolver-3: the benefit adds to, rather than substitutes for, additional data, and does not depend on whether the compressed representation is a set of anchor tokens or of physical-state slices.

  4. Generalization performance. Both components are developed on DrivAerML, so we test whether they carry over to geometries they were not tuned on. On the DrivAerNet++ dataset, with one car body type held out from training at a time, the volume pressure error on the unseen body type falls by up to 14.2%.

References (29)