Manuscript Offprint

arXiv:2610.12618

Mesh-Native Tokenisation: Retrofitting Foundation Models to Unstructured Data

Georg Maierhofer, Miles Cranmer, Payel Mukhopadhyay

ABSTRACT

Physics foundation models are an increasingly popular approach for building versatile emulators for spatiotemporal systems. They require tokenisation layers that lift physical field data into a latent representation suitable for dynamic processing. A typical choice for this layer is a convolutional encoder, which lifts field information in a locality-aware way and can be trained very efficiently. However, this choice cannot be applied to a large class of scientific computing problems where data are represented on unstructured meshes, for example simulations on domains with curved boundaries. Such data typically require graph neural network architectures, which are more expensive to train and, in the form currently used, encode information differently from their CNN counterparts, thus limiting the portability of physics emulators between these data regimes. In this work we introduce MeshNative Convolution (MNC), a locality-aware tokenisation layer that encodes unstructured mesh-based data in a way that is analogous to CNNs. This approach leads to models that can be trained once on mesh data and then deployed to arbitrary unstructured meshes, even if these are irregular, with minimal retraining. We show that this tokenisation approach can be used to retrofit grid-pretrained foundation models efficiently on unstructured meshes and provide theoretical results to confirm the consistency of this approach with classical CNN encoders. We demonstrate the favourable performance of this retrofitting approach, which in many cases reaches acceptable accuracy even in zero-shot deployment, and outperforms existing baselines after only a few epochs of fine-tuning, thus providing an efficient bridge between the two data regimes.

1 INTRODUCTION

Machine-learning surrogates are increasingly used to predict the evolution of complex physical systems across a wide range of scientific domains (Wyder et al., 2026; Yermakov et al., 2026; Riva et al., 2026). Many recent large pretrained models for continuum physics adopt an encoder-processor-decoder architecture, in which discretised fields are encoded into latent tokens, evolved by a large processor, and decoded back to physical space (McCabe et al., 2024; Herde et al., 2024; McCabe et al., 2026; Mukhopadhyay et al., 2026). Many of the most advanced models build on processors that originate in computer vision, thus relying on tokenisation layers, which lift physical information, often using strided convolutions (McCabe et al., 2024; Mukhopadhyay et al., 2026). This has proven to be a particularly efficient choice, as dense convolutions on regular grid data are highly optimised on modern accelerators (Chetlur et al., 2014), but it restricts the admissible data to structured grids (cf. Fig. 1a). However, in many scientific applications field information is not available on regular grids due to the presence of irregular or curved boundaries (engineering parts, wave modelling in coastal regions, weather forecasting) or the requirement to represent information at finer resolution in regions of the computational domain that show finer features (e.g. boundary layers in fluids, or turbulent structures behind jet engines). In such cases data are often represented on unstructured meshes (cf. Fig. 1b).

While graph neural networks (GNNs) are a natural choice for processing such data, they are more expensive to train and, in the form currently used, encode information differently from their CNN counterparts, thus limiting the portability of physics emulators between these data regimes (Pfaff et al., 2021). A convolutional token has an explicit physical footprint, which mirrors the dynamics it summarises: many continuum models are formulated using local differential operators, motivating tokens whose physical footprint is controlled independently of the mesh. Standard mesh-edge message passing instead defines neighbourhoods by graph hops, whose physical extent varies with the local edge length (Gilmer et al., 2017; Pfaff et al., 2021), and supplying coordinates as features does not remove this dependence directly. To overcome this, we introduce Mesh-Native Convolution (MNC), a locality-aware tokenisation layer that encodes unstructured mesh-based data analogously to CNNs. MNC specifies the window geometrically and aggregates information through a continuous analogue of a convolutional kernel (Fig. 2). This leads to a highly versatile tokenisation layer that can be used to retrofit grid-pretrained foundation models efficiently on unstructured meshes. We show that this approach is consistent with classical CNN encoders, thus permitting the direct transfer of weights from grid-pretrained models, and demonstrate the mesh-agnostic performance of this approach in zero-shot deployment. In particular, our contributions are as follows:

  1. A mesh-native convolutional tokeniser. We introduce mesh-native convolution (MNC), a tokenisation layer for unstructured mesh-based data. This encoder is able to lift continuous physical information from unstructured data points, removing the restriction to grid-based data.

  2. Exact consistency with CNN encoders. We prove that MNC is consistent with classical CNN encoders, thus permitting the direct loading of weights from grid-pretrained models.

  3. Retrofitting pretrained foundation models to meshes. We show through extensive numerical examples that retrofitting state-of-the-art physics emulators and foundation models with MNC reaches acceptable accuracy zero-shot (cf. Table 1) and outperforms existing baselines after only a few epochs of fine-tuning, thus providing an efficient bridge between the two data regimes.

Figure

Figure 1: (a) MNC loads grid-pretrained weights directly onto a mesh-compatible GNN architecture, for consistent retrofitting of pretrained physics emulators. (b) Zero-shot shear-flow single-step prediction after grid pretraining, including MNC (ours), GINO (Li et al., 2023c) and LNO (Wang & Wang, 2024). Values are normalised MSE for the displayed trajectories.

References (79)

  • Universal physics transformers: A framework for efficiently scaling neural operators
  • A mathematical guide to operator learning
  • The Mathematical Theory of Finite Element Methods
  • cuDNN: Efficient Primitives for Deep Learning
  • Probabilistic Retrofitting of Learned Simulators
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • SplineCNN: Fast geometric deep learning with continuous B-spline kernels
  • Neural message passing for quantum chemistry
  • CALM-PDE: Continuous and Adaptive Convolutions for Latent Space Modeling of Time-dependent PDEs
  • Poseidon: Efficient foundation models for PDEs
  • A fast neural hybrid newton solver adapted to implicit methods for nonlinear dynamics
  • Semi-supervised classification with graph convolutional networks
  • Neural operator: Learning maps between function spaces with applications to pdes
  • Transformer for partial differential equations' operator learning
  • Fourier Neural Operator with Learned Deformations for PDEs on General Geometries
  • Geometry-Informed Neural Operator for Large-Scale 3D PDEs
  • Transolver++: An accurate neural solver for PDEs on million-scale geometries
  • Georg Maierhofer. Physics-informed reduced-order modelling with equivariant spectral submanifolds. arXiv preprint arXiv:2608.04239, 2026. (opens arXiv in a new tab)
  • Multiple Physics Pretraining for Spatiotemporal Surrogate Models (opens the publisher in a new tab)
  • Walrus: A Cross-domain Foundation Model for Continuum Dynamics
  • Overtone: Cyclic Patch Modulation for Clean, Efficient, and Flexible Physics Emulators
  • a large-scale collection of diverse physics simulations for machine learning
  • Learning mesh-based simulation with graph networks (opens arXiv in a new tab)
  • CTF4Nuclear: Common Task Framework for Nuclear Fission and Fusion Models (opens arXiv in a new tab)
  • G-Adaptivity: optimised graph-based mesh relocation for finite element methods
  • Operator Learning with Neural Fields: Tackling PDEs on General Geometries
  • RoFormer: Enhanced Transformer with Rotary Position Embedding
  • Discretization Invariant Networks for Learning Maps between Neural Fields
  • Latent Neural Operator for Solving Forward and Inverse PDE Problems
  • Transolver: A fast transformer solver for PDEs on general geometries
  • Common Task Framework For a Critical Evaluation of Scientific Machine Learning Algorithms
  • The Seismic Wavefield Common Task Framework
  • The offset loaded into the encoder is
  • Even kernel sizes simply give half-integer offsets relative to the window centre and the differences between offsets remain integer multiples of $h_x$, $h_y$
  • Preserve the pointwise projections, activations, feature normalisation and token order
  • Suppose the mesh nodes satisfy $c_n \sum_j \delta_{\mathbf{p}_j^{(n)}} \rightharpoonup \rho(y) \, dy$, with $c_n \downarrow 0$ and $\rho \in L^1(\Omega)$ positive almost everywhere
  • This is the bilinear interpolant of $\kappa$, extended by zero
  • Each tensor-product hat integrates to $a_h$, proving the middle identity
  • Their boundaries have zero $\rho$ dy measure, so weak convergence applies to these indicators
  • The bias-free output can then be written as
  • We take $w = 1$ and no bias
  • Each vertex in the origin’s GCN neighbourhood (blue) is labelled with its contribution to $G_{\Gamma}(\mathbf{1})_{0}$, the origin’s own label being its self-loop
  • Every vertex in the origin’s one-ring, including the origin, has degree six and self-loop degree seven
  • Even vertices have degree eight and odd vertices degree four
  • Both triangulations comprise right isosceles triangles of diameter $\sqrt{2}\eta$, and both represent the same constant field exactly
  • This counterexample isolates connectivity, since the sample locations themselves do not change, and shows that for the degree-normalised GCN the output depends on how the vertices are connected, not only on the sampled field, even as $\eta \to 0$
  • The Well mesh twins are triangulations of the original grids, so grid and mesh tokenisers see exactly the same samples
  • The concentration is nearly uniform ( $1 \pm 5 \cdot 10^{-4}$), so a tensor channel is shown
  • For Experiment 3 each mesh is therefore refined uniformly three times
  • Parameter counts are for the four-channel datasets (TRL2D, shear flow) and, in brackets, for the eleven-channel active-matter dataset
  • The latent lattice has 64 square cells along the short axis of the domain (64 × 192 on TRL2D, 64 × 64 on active matter), and the GNO radius is set to 1.5 latent cells instead of the reference value, which would produce an impractical number of edges on grids of 5 · 10$^{4}$-1.3 · 10$^{5}$ nodes
  • Positions are normalised by the domain's $x$-extent
  • One “epoch” in Figure 6 is 100 mesh-training updates
  • By design, one learning rate is used for every architecture and stage; we did not tune it per architecture
  • The random-initialisation arm uses the same architecture and recipe from Walrus's own initialisation
  • The architectures and optimiser settings are given in Appendix C; the tokeniser reconstruction comparison in Appendix F uses a different protocol, detailed there
  • For shear flow we resplit the official training files by trajectory, stratified by $(Re, Sc)$, into 727/84/84 trajectories after dropping one duplicate; grid pretraining and all mesh training use only the training trajectories of this split
  • Field values at its nodes are bilinear interpolants of the simulation arrays, computed from cached weights
  • 192 for TRL2D, 256 for active matter and 512 for shear flow
  • On the grid all $w_j$ are equal and this is the VRMSE of The Well
  • All reported numbers are from the final checkpoint of a run; the validation split is monitored but not used for model or checkpoint selection
  • the first nodes of each refined mesh are the original ones, in order and with their original values, so all levels are compared on the same nodes
  • The retrofitted Overtone+MNC model already resolves the mixing layer zero-shot, with a fainter error field than any baseline at any stage, and fine-tuning reduces its error further; trained from scratch, the same architecture ends slightly above the fine-tuned retrofit
  • The complete GINO and LNO models of the forecasting experiments are much larger and have their own processors (Appendix C); their results should not be conflated with those reported here
  • The Well grid twins use identical samples; cylinder flow uses native meshes
  • On the Well grid twins all models see identical samples: MNC matches the CNN, while the other tokenisers have higher errors under this protocol
  • GINO and LNO also benefit from pretraining at initialisation, but remain at substantially higher errors and approach their scratch-trained levels as training proceeds
  • Numbers are the density VRMSE of this window
  • Figure 1c shows the corresponding zero-shot reconstructions
  • GroupNorm and GELU are applied between stages
  • The Well controls use identical field samples for CNN, MNC and the baselines
  • Kernel MLPs act on relative coordinates with a 16-channel sinusoidal embedding; the latent width is 64
  • Position and field MLPs produce 48-channel embeddings
  • They have 69,669 and 153,263 parameters
  • MNC is approximately six times slower than dense CNN execution on these grid twins, and it is not uniformly faster than the other mesh tokenisers
  • No MNC parameters are newly initialised in this within-dataset transplant
  • Field values are obtained by bilinear resampling
  • Channels are matched by name, and the convolutional stencil is re-instantiated at the target resolution using a characteristic mesh spacing
  • $e=0$ is zero-shot; “scratch” has no pretraining