WorksComputer Science
Failure Modes and Data-Efficient Remedies for Transformer-Based Prediction of Viscoplastic Flows
Abstract
Fast and accurate prediction of viscoplastic flows remains a challenge in computational rheology due to yield surfaces, discontinuous gradients, and strongly nonlinear transitions between yielded and unyielded regions. Transformer-based neural operators such as RheOFormer have recently shown strong potential for surrogate modeling of non-Newtonian flows. However, their applicability to viscoplastic systems and their efficacy in recovering realistic flows remain poorly understood. In this work, we present the first systematic investigation of RheOFormer applied to steady Bingham channel flow. By isolating the problem to a simple geometry and constitutive model, we examine how dataset structure, numerical value range, and input representation govern the model's ability to interpolate and extrapolate within the parameter space. The data regimes in which RheOFormer remains accurate and those in which errors emerge are identified, particularly for plug-dominated flows and for conditions outside the velocity scales or flow structures represented during training. Upon identifying these failure modes, targeted enhancements to the input representation and loss formulation are introduced to better predict low-gradient plug regions. Logarithmic velocity representations and gradient-aware loss formulations substantially improve accuracy in challenging regimes where the baseline formulation fails. In addition, extrapolation errors are reduced by augmenting the training set with only a few strategically selected cases spanning the missing physical regimes. Finally, a single partially developed snapshot suffices for an accurate steady-state prediction, and the model outperforms simply copying its input throughout flow development. These results highlight the importance of appropriate field representation and parameter-space coverage for data-efficient neural-operator prediction of viscoplastic flows.
Introduction
Yield-stress fluids exhibit a dual mechanical response: they deform as fluids when the local stress exceeds a critical value but remain nominally unyielded below that threshold. This behavior is encountered in materials ranging from pastes, cementitious suspensions, drilling fluids, and waxy crude oils to foods, biological materials, and printable inks [1, 2, 3, 4]. Their flow therefore differs fundamentally from that of Newtonian fluids. The domain is partitioned into yielded regions with finite deformation rates and unyielded regions that move approximately as rigid plugs, with the boundaries between them determined as part of the solution [5, 6]. Even in geometrically simple configurations, changes in forcing or material properties can alter the location and extent of these regions, producing solution families that involve both continuous changes in velocity scale and qualitative changes in flow structure [7, 8, 9].
The Bingham model provides the canonical continuum description of this behavior by combining a yield stress with a post-yield plastic viscosity [10, 11]. Despite its apparent simplicity, numerical simulation of Bingham flow remains nontrivial because the ideal constitutive law is nonsmooth at yielding and the yield surfaces are not known a priori [7, 12].
Computational treatments commonly employ regularized constitutive equations, variational inequalities, augmented-Lagrangian methods, or related approaches that avoid explicit tracking of the yielded–unyielded interface [13, 14]. Regularization makes the problem computationally tractable but introduces additional numerical scales and replaces perfectly rigid regions with zones of very small deformation rate. Comparisons against augmented-Lagrangian solutions indicate that this substitution can shift the apparent yield-surface location in some configurations [15]. Consequently, accuracy cannot be assessed through global velocity field alone: the predicted plug velocity, plug width, yield-surface position, wall shear, and flow rate can remain sensitive to spatial resolution, regularization, and solver tolerances. Pressure-driven channel flow is particularly useful in this context because it retains the essential yielded–unyielded structure while providing a controlled setting in which numerical and data-driven predictions can be systematically evaluated [12].
High-fidelity simulations of viscoplastic flows must generally be repeated as the Reynolds number (), Bingham number (), geometry, boundary conditions, or constitutive parameters change [16, 17, 18]. This repeated-solution requirement can become expensive in parameter studies, optimization, uncertainty quantification, and real-time process control. Scientific machine-learning methods offer a possible route to amortizing this cost by learning surrogate mappings from material and flow conditions to the corresponding solution fields [19]. Physics-informed neural networks have been extended to non-Newtonian and elastoviscoplastic systems by embedding the conservation and constitutive equations into the training objective [20, 21, 22, 23]. These methods have demonstrated considerable promise for forward prediction, inverse parameter estimation, and recovery of rheological behavior from limited observations [21, 24]. Variants such as non-Newtonian PINNs [25], fractional PINNs [26] and non-local PINNs [27] have extended these capabilities to flow prediction and parameter discovery for a range of rheological systems. ViscoelasticNet goes further still, inferring stress fields from velocity data alone while selecting among Oldroyd-B, Giesekus, and Phan–Thien–Tanner responses [28]. Visco-plastic flows have themselves received attention within this framework. Papanastasiou-regularized and augmented-Lagrangian PINN formulations have been used to predict and reconstruct steady Bingham flow fields [29, 30], and a convolutional network has been trained to reconstruct viscoplastic velocity fields and locate yield surfaces in superhydrophobic channels [31]. Lardy et al. further inferred viscoplastic constitutive laws, including the Herschel–Bulkley and Papanastasiou models, directly from velocity fields by jointly optimizing a neural representation of the flow and the constitutive model against the governing equations [24]. These studies demonstrate that learned models can recover plug structure in specific viscoplastic configurations. However, these approaches remain largely instance-specific, with separate models trained for fixed configurations rather than a single mapping that transfers across the material and flow parameters defining the problem. Despite these successes, conventional neural network models face significant challenges when applied to strongly non-Newtonian flows. Sharp transitions, stiff nonlinearities, and long-horizon temporal dependencies degrade their accuracy, while their reliance on pointwise loss formulations makes it difficult to capture the global operator structure of the underlying PDEs.
Motivated by these limitations, neural operators represent a more recent paradigm aimed at overcoming these challenges by learning the solution operator of a partial differential equation rather than predicting individual states for fixed problem configurations. Architectures such as DeepONet [32] and the Fourier Neural Operator (FNO) [33] have demonstrated strong performance across a range of smooth systems, including Navier–Stokes and diffusion [34]. Their accuracy is not uniform across problem types, however. Systematic benchmarking has shown that operator-learning performance can degrade on fields containing sharp or localized structure, while FNO-type architectures in particular attenuate high-wavenumber content by construction through spectral truncation [35]. This is one manifestation of spectral bias, the tendency of neural networks to fit smooth global structure before localized features [36]. The consequence is that thin layers and abrupt transitions are systematically oversmoothed, which is directly relevant to flows containing yield surfaces. Within rheology, Mangal et al. demonstrated
that DeepONet- and FNO-based models can learn families of thixotropic elastoviscoplastic and Giesekus constitutive responses under varied flow protocols [37]. Transformer-based neural operators further extend this capability through attention mechanisms that enable the model to capture global spatial correlations and long-range dependencies in the solution field [38, 39]. Building on these advances, RheOFormer was recently introduced as a transformer-based neural operator tailored for rheological systems, with initial studies focusing primarily on viscoelastic flows [40]. However, its applicability and limitations for viscoplastic fluids remain largely unexplored. Yield surfaces, discontinuous gradients, and extended plug regions introduce numerical features distinct from those encountered in the viscoelastic systems previously considered with RheOFormer, raising open questions about its ability to accurately represent and generalize across such regimes.
A second consideration is the amount and distribution of training data required for reliable operator learning. Purely data-driven operators generally perform best within the distribution represented during training, while accuracy can degrade substantially under out-of-distribution prediction. Zhu et al. [41] quantified this for DeepONets by relating extrapolation error to a distance between training and test function spaces, and proposed fine-tuning and multifidelity strategies that restore accuracy when either the governing equations or sparse additional observations are available [42, 43]. This framing raises a question specific to viscoplastic flows. Because and affect the solution in qualitatively different ways, one rescaling the velocity magnitude and the other reorganizing the flow into yielded and unyielded regions, moving outside the training range along the two axes need not produce the same kind of failure or require the same additional training information.
Here, we use pressure-driven Bingham channel flow as a controlled benchmark to identify the conditions under which RheOFormer succeeds or fails when predicting steady viscoplastic flow from limited early-time information. This flow is chosen because its exact steady solution is known and its yield surfaces are flat and fixed. The objective is not to introduce a new neural-operator architecture, but to separate the effects of training-set size, numerical representation, and parameter-space coverage. The study is carried out in different stages. First, the dependence of prediction accuracy of the baseline formulation on the number and distribution of training cases is quantified. We then examine a systematic failure of the baseline formulation in plug-dominated flows, in which the plateau velocity is underpredicted, and test whether velocity-gradient inputs, logarithmically scaled representations, low-shear-weighted objectives, and Sobolev-type losses improve the reconstruction of the plug velocity and yielded–unyielded transition. Next, we distinguish shifts in velocity magnitude across the range from changes in profile structure across the range. Finally, we determine whether a small number of strategically selected anchor cases spanning the Newtonian-like and plug-dominated limits can convert out-of-distribution failures into accurate interpolation over an expanded parameter domain. We also examine how the number and timing of the input snapshots affect the prediction, and compare the model with the trivial predictor that copies its last input. This analysis provides a physically interpretable account of how field representation and regime coverage govern the accuracy and data-efficiency of neural-operator prediction for viscoplastic flow.
In the following sections, Section 2 describes the dataset generation, model architecture, and training objectives, with the governing equations and numerical details given in Appendix § 5. Section 3 then presents a detailed analysis of model performance, including interpolation, extrapolation behavior, failure modes, and the corresponding methodological improvements.
Methods
Training dataset
To generate the training dataset, two-dimensional pressure-driven Bingham flows were simulated using the Basilisk flow solver. As described in detail in Appendix § 5, our simulations are defined by three parameters only: , and . To systematically sample different rheological regimes and velocity scales, simulations are performed for nine Reynolds numbers,
For each Reynolds number, 21 values of are considered, uniformly distributed between the Newtonian limit and . The nondimensional pressure gradient is kept fixed in all simulations as . This parameter range spans flows from Newtonian behavior to strongly viscoplastic regimes with substantial unyielded plug regions. See Appendix § 5 for additional details of the equations being solved and the numerical scheme used to obtain their solutions. Equation (A.8) shows that, for fixed , the steady profile can be written as , so that only rescales the velocity magnitude, while the profile shape is set by alone. In the present dataset, varying at fixed therefore probes the model’s response to changes in velocity scale, whereas varying probes its response to changes in flow structure. We deliberately use the velocity fields in unnormalized form, since extrapolation in velocity scale is one of the failure modes under study.
The dataset is used in several different train–test configurations. In particular, we consider multiple training scenarios with varying dataset sizes and parameter-space coverage, allowing us to separately assess interpolation accuracy, extrapolation to unseen or , and sensitivity to the amount of temporal input information. The specifics of each split are reported alongside the corresponding results. All representative profiles shown in the figures are held-out cases that are not used for training.
In the remaining sections of this paper, all variables are dimensionless. For convenience, we omit the upper bars introduced in the nondimensionalization of Eq. (A.1).
RheOFormer Architecture
RheOFormer is a transformer-based neural operator specifically developed to approximate nonlinear solution operators arising in rheological partial differential equations (PDEs) [40]. Its design is intended to learn mappings between input and output fields across varying flow conditions rather than fitting individual trajectories independently. Originally introduced as a general framework for modeling complex fluid dynamics, RheOFormer integrates attention-based encoding [44] with coordinate-driven decoding [45] to capture both memory effects and long-range spatial correlations that commonly appear in viscoplastic and non-Newtonian flows. Figure 1 summarizes the framework, including the input representations and training objectives compared in Section 3.

Figure 1. Schematic of the RheOFormer framework as applied to steady Bingham channel flow. The model receives a short sequence of early-time velocity snapshots in one of four representations (left). The inputs are projected by a feed-forward embedding, encoded through self-attention layers with residual connections and layer normalization, and decoded by cross-attention. The output head returns the predicted steady state field . During training (dashed line), the prediction is compared against the simulated steady state under one of three objectives. Each experiment reported in § 3 uses one representation and one objective; all other architectural and optimization settings are held fixed. The fields shown are for , .
In our application, the model receives as input a limited number of early time spatial fields corresponding to the initial snapshots of the velocity component , along with their associated spatial coordinates. These snapshots are first projected into a latent representation through a feed-forward embedding network that preserves both local and global spatial information. This latent representation is subsequently processed by multiple layers of self-attention, enabling the model to identify the dominant spatial couplings that govern the evolution of the flow. Residual connections and layer normalization are incorporated throughout these layers, which ensures numerical stability and facilitates efficient optimization as the network depth increases.
Within each attention layer, every spatial point interacts with all others, allowing the model to learn highly nonlocal spatial dependencies that are essential for representing Bingham-type behavior. Although the Bingham constitutive law is local, the resulting velocity field and yield-surface location are determined through the domain-wide momentum balance, so the plug extent at one location depends on conditions throughout the domain. Mathematically, given a set of embedded input tokens , self-attention constructs queries, keys, and values via linear projections , , and . The attention output is computed as
which defines a global operator where each point aggregates information from all other points weighted by their pairwise similarity. Multi-head attention extends this mechanism by learning several such operators in parallel, thereby capturing multiple interaction scales and directional couplings that arise in viscoplastic flows.
To produce predictions on arbitrary spatial grids, RheOFormer employs a coordinate-based decoder that separates the output resolution from the resolution of the input snapshots. Spatial coordinates are embedded using random Fourier features [46], improving the network’s ability to represent high frequency structures such as sharp velocity gradients and yield surfaces. A cross-attention mechanism then links the encoded latent representation to these target coordinates, enabling the model to evaluate the learned operator at any desired spatial location, decoupling the output resolution from the input resolution. The final feed-forward module maps the decoded latent features back to the physical field quantities.
In the present study, we adapt this architecture to the task of predicting the steady state velocity field in the Bingham channel-flow dataset. By learning a mapping from a small set of early-time snapshots to the final steady state distribution, RheOFormer effectively reconstructs the long-time rheological behavior without explicitly simulating the full transient evolution. Formally, the model approximates , and all errors reported below are computed on this single output field. Once trained, the steady state is obtained in a single forward pass without explicit integration of the remaining transient dynamics. This operator learning approach significantly reduces computational cost while retaining the ability to capture the nonlinear convergence dynamics characteristic of viscoplastic flows.
Training Setup
Four representations of the velocity data are compared. The baseline uses the raw streamwise velocity as a single input channel. The second representation augments with the transverse gradient , providing explicit shear-rate information for distinguishing yielded and unyielded regions. The third replaces that second channel with , which expands the numerical range of small gradient magnitudes clustered near zero within the plug. The fourth applies an analogous transformation to the velocity field, mapping on both the input and the target, so that the network is trained and evaluated in logarithmic space and predictions are mapped back by exponentiation before errors are computed. To avoid the singularity of the logarithm at the no-slip walls, in the quiescent initial condition, and inside the plug, a small constant is added before the transformation, i.e. and ; this sets a floor on the transformed values at these locations. In every case the target quantity is the steady state field; only its representation during training differs. Reported errors are always computed on the physical velocity field, so values are directly comparable across representations.
In all baseline experiments, the model receives the first five temporal snapshots of the velocity field as input, spaced by (input window –), while the target is the steady state. This choice reflects a balance between providing sufficient early-time information and limiting input dimensionality, enabling the model to infer the eventual steady state structure of the flow. To systematically evaluate the influence of temporal information, we also conduct experiments in which the number of input frames is varied from one to five and the input window is shifted in time (§ 3.12). Across all cases, the model receives no explicit values of or ; instead, it is required to infer the underlying flow regime directly from the spatial patterns present in the input velocity fields alone. This constraint tests whether the operator recovers regime information from field structure rather than interpolating a parameter label, and it matches the practical setting in which early-time measurements are available but material parameters are not independently known.
Training is supervised using a relative loss computed between the predicted and ground truth steady state velocity fields. For a predicted steady state velocity field and the corresponding ground truth field , the relative loss for a batch of size is defined as
where the norms are computed jointly over all spatial nodes of the steady state field, and is a small regularization constant added to avoid division by zero. This normalization balances contributions across samples that differ significantly in magnitude due to variation in – conditions, thereby preventing the optimization from being dominated by high magnitude velocity values.
To further investigate whether incorporating derivative information improves predictive accuracy, we additionally employ a Sobolev training loss [47] that combines relative velocity and relative gradient errors within a unified objective. Let be the ground truth gradient directly obtained from the dataset. The gradient of the prediction, , is computed numerically during training. Both gradients are computed using the same numerical differentiation scheme. For a batch of size , the Sobolev loss is defined as
where all norms are computed jointly over spatial nodes, and is a small regularization constant preventing division by zero. The weights and control the relative importance of matching the velocity field and its spatial gradients, and are set to and in all experiments. In this formulation, the model is penalized not only for discrepancies in the predicted velocity field but also for mismatches in its spatial gradients, thereby encouraging more accurate reconstruction of shear layers and yield surfaces.
Building on the insight that regions with very small velocity gradients are particularly challenging for neural operators to reconstruct, we further incorporate a plateau-focused reweighting strategy. This approach directly targets the unyielded plug regions that are central to viscoplastic flow behavior. The loss selectively amplifies the contribution of grid points where the ground truth gradient indicates low-shear or nearly unyielded behavior. To identify such regions, we compute a mask directly from the ground truth velocity gradients. For each sample, a threshold is computed from the distribution of ground truth gradient magnitudes, and points satisfying are classified as plateau-region points. Formally, letting denote the ground truth gradient and the threshold, the mask is defined as
where denotes the Heaviside step function with .
The plateau loss then increases the weight of squared error contributions inside these masked regions. For a batch of size , this loss takes the form
where controls the additional penalty applied to plateau points. This formulation is intended to increase the contribution of low-shear regions during optimization and thereby encourage reconstruction of the extent and uniformity of the unyielded zones. In all experiments, is set in each sample to 10% of the range of the velocity gradient, , and , so that plateau points receive twice the weight of the remaining points.
Model optimization is performed using the AdamW optimizer (weight decay ) with a one-cycle learning-rate schedule: the learning rate rises from to a peak of over the first 10% of training and then decays to approximately for 1000 epochs. All experiments use the same architecture, with 8 self-attention layers, one attention head, and a latent width of 256. Batches contain up to 16 samples, so training sets smaller than this are processed full-batch. Each configuration is trained with three random seeds; the figures show one of these runs, and the averaged errors quoted in the text are means over the three seeds. Experiments are conducted under multiple dataset configurations to systematically assess interpolation, extrapolation across the – parameter space, and sensitivity to the amount of temporal input information.
Results
The ultimate goal of this work is to evaluate the ability of RheOFormer to infer the steady state behavior of viscoplastic channel flows from limited temporal information. Hence we seek to first demonstrate that the model successfully learns the underlying steady state physics across a range of flow regimes; and second, to probe the limits of this capability through controlled variations in the dataset and inputs. To this end, results are presented in a sequence of targeted validations, each designed to isolate a specific aspect of model performance, as detailed in the subsections below.
Steady State Prediction Across – Parameter Space
Before assessing the failure modes of the model with respect to data availability, RheOFormer’s ability to predict steady state velocity fields across the full range of and in the dataset is studied. In this baseline study, the model is trained using the full dataset, and its performance is evaluated on previously unseen flow conditions that lie within the parameter range spanned by the training data. Figure 2 shows three representative cases at with increasing , illustrating the transition from Newtonian-like flow () to strongly viscoplastic behavior with a well defined plug region (). In all cases, the model receives only the first five snapshots of the time evolution (–) and is tasked with predicting the final steady state distribution.

Figure 2. Comparison of ground truth data (top row) vs. RheOFormer predictions (bottom row) for steady state streamwise velocity fields at and three representative . From left to right: (a) (Newtonian limit), (b) (moderate viscoplastic behavior), and (c) (strong plug region). Color scales differ between cases for clarity.
For the Newtonian limit (), the predicted velocity field matches the ground truth almost exactly, capturing both the shape and magnitude of the parabolic profile. This agreement indicates that RheOFormer successfully learns the governing structure of shear dominated flows and their convergence toward steady state. As the increases (), the velocity profile begins to flatten due to the presence of an emerging unyielded core. RheOFormer captures this transition with high fidelity, successfully identifying both the onset and spatial extent of the plug region. This demonstrates the model’s ability to represent regime dependent structural changes in the flow rather than merely scaling velocity magnitude. Even in the strongly viscoplastic regime (), where the plug region occupies most of the channel and only thin shear layers remain near the walls, the model maintains excellent agreement with the reference solution. Notably, RheOFormer preserves both the uniformity of the plug region and the sharp velocity gradients within the boundary layers.
Overall, these results demonstrate that RheOFormer effectively learns the steady state behavior of Bingham fluids across a broad span of viscoplastic behavior, given that training is performed using a large volume of data spanning a broader range than the test conditions. By accurately resolving both shear dominated and plug dominated regimes, the model exhibits strong interpolation capability across the full – parameter space represented in the training data, providing a reliable baseline for the more challenging generalization studies that follow.
Sensitivity to Dataset Size
Building on the full dataset evaluation, we next systematically test the performance of RheOFormer upon variation of the amount of training data available. Understanding this sensitivity is essential for determining the minimal dataset size required for accurate steady state predictions, particularly since generating high fidelity viscoplastic simulations is computationally costly. To quantify this dependence, we train the model using varying numbers of samples corresponding to different values of and evaluate the resulting prediction error across two representative flow regimes, and , which correspond to the lower and upper bounds of the range in the dataset.
Figure 3 shows the relative error as a function of the number of samples used during training for two representative flow regimes, and . Across both values, the error decreases rapidly as the training set expands from 2 to approximately 5 samples. This steep drop indicates that RheOFormer can extract the essential structure of the steady state Bingham flows from only a handful of distinct flow conditions. With five training cases, the relative error is reduced to 0.14 at and 0.03 at , which corresponds to about 90–95% of the reduction achieved with ten cases; beyond this point, additional cases yield only diminishing improvements. These diminishing returns suggest that the global features of the steady state Bingham flow are quickly captured by the model, and that the benefits of adding more training cases are limited by the simplicity and low dimensionality of the geometry. Moreover, with the same five cases per , the log-velocity representation of § 3.4 reduces the mean error to about 1%, indicating that beyond this point accuracy is limited by the representation rather than by the amount of training data. Motivated by this trend, we adopt five representative cases per as the minimal training set size for the in-distribution experiments of § 3.3 and § 3.4; the training sets used in the remaining experiments are specified in the corresponding sections. This choice strikes a balance between computational efficiency and predictive performance, while still exposing the model to sufficiently diverse rheological behavior. At the flow is already steady within the input window (, § 3.12), so that the errors at this do not reflect a forecasting difficulty but the model’s treatment of small-magnitude fields: a predictor that simply copies the last input would be nearly exact there.

Figure 3. Sensitivity of prediction accuracy to the number of training cases, for and , over three training seeds. Each sample corresponds to one training case selected from the full dataset of 21 per .
Plateau Region Prediction Error
After establishing the minimal dataset size required for stable training, we next examine RheOFormer’s performance in flow regimes characterized by stronger viscoplastic behavior. These cases, which feature increasingly pronounced plug regions, provide a stringent test of the model’s ability to resolve low gradient structures that are not emphasized during training. Figure 4 shows representative velocity profiles for different and using only five training samples per . While RheOFormer captures the overall boundary layer structure in most cases, a systematic failure mode emerges as the increases. For low (Figure 4(a,Figure 4c)), the predictions remain accurate, with mean errors of 0.4% at and 7% at . As the increases, however, the flow transitions into a plug dominated regime in which becomes nearly zero over a substantial portion of the channel. In these regimes (Figure 4(b,Figure 4d)), the model fails to reproduce the plateau velocity and the yield surface correctly. This behavior occurs at both low and high and results in errors of 22% at and 46% at , which grow further as approaches its maximum. At the shear layers near the walls continue to be well resolved, while the magnitude of the unyielded plug is underpredicted by about 20% and at the plateau velocity profile becomes oscillatory with high error values.

Figure 4. Representative steady state velocity profiles across the channel, comparing ground truth (solid black) to RheOFormer predictions (orange dots): (a) , (mean error 7.2%); (b) , (mean error 46.4%); (c) , (mean error 0.4%); (d) , (mean error 21.8%). Panels (a,c) correspond to and panels (b,d) to . At the lower (a,c), the predictions capture the velocity profile, closely at and with a slightly underpredicted core at . At the higher (b,d), the model fails to reproduce the flat plug region and systematically underestimates the flatness.
Since panels (a,c) and (b,d) share the same , their ground truth profiles have identical shapes and differ only by a factor of 100 in magnitude (§ 2.1); the differences in prediction error between them therefore arise from the velocity scale rather than from differences in flow structure.
This failure mode originates from the fact that, in plug dominated flows, the velocity field contains extended regions with extremely small gradients, making the plateau visually and numerically subtle. When trained with the minimal dataset, the model naturally prioritizes fitting the high gradient boundary layers (where most velocity variation occurs) but pays insufficient attention to the low gradient regions that define the plug. This observation motivates the approaches investigated in § 3.4, where we introduce additional input features and loss formulations specifically designed to amplify or explicitly target the low gradient regions responsible for the plateau.
Improving Prediction Accuracy
Section 3.3 revealed a systematic failure mode of RheOFormer when predicting flows with pronounced plug regions: the model fails to reproduce the plateau velocity and hence fails to reproduce the unyielded region of the flow at high , particularly when extended plug regions dominate the flow. To address this limitation, we investigate several modifications to the input representation and loss formulation, with the goal of making plug region information more prominent during training.
Figure 5 summarizes the performance of the input-based strategies across representative – cases. Each panel compares the ground truth solution with predictions obtained using three different input configurations, all trained with the relative loss: (i) the raw velocity field ; (ii) the velocity field augmented with its gradient ; and (iii) the velocity field augmented with the logarithm of the gradient . These configurations are designed to progressively increase the model’s sensitivity to regions of weak shear by explicitly exposing gradient information and amplifying small magnitude variations. The following subsections analyze each approach in detail.

Figure 5. Comparison of input representations for predicting the plateau velocity, all trained with the relative loss. Each panel compares the ground truth (solid black) with RheOFormer predictions obtained with (i) the velocity alone (orange, dash-dotted), (ii) augmented with (magenta, dashed), and (iii) augmented with (cyan, dotted). The left column corresponds to and the right column to : (a) ; (b) ; (c) ; (d) . At (c,d), the input reproduces the profile to within about 3% and recovers the plateau height that the velocity-only model underpredicts, reducing the error from 21.8% to 4.3%, whereas the log-gradient input is less reliable, underpredicting the profile and not improving the plateau. At (a,b), the input introduces strong oscillations and overpredicts the plateau in (b), and the log-gradient input underpredicts it with oscillations and unphysical negative velocities near the walls.
Augmenting Inputs with Velocity Gradients: The first modification we explore is augmenting the input with the gradient field . The motivation for this approach is that unyielded plug regions are characterized by (nearly) vanishing velocity gradients, whereas yielded regions exhibit finite shear rates. By supplying as an additional input channel, the attention mechanism can exploit these cross-channel contrasts to more accurately infer the yield surfaces, thereby improving its ability to distinguish between plug regions and adjacent shear layers and to reconstruct the plateau region.
As seen in Figure 5, adding improves performance for cases with moderately large , specifically at (panels (c) and (d)) where the predicted profile and plateau height fall within about 3% of the ground truth; for the plug-dominated case (d), the error decreases about 5 times compared to training only with . This indicates that explicit access to shear information can enhance the model’s ability to infer the extent of the plug region when the velocity and its gradient are sufficiently large. However, in the strongly viscoplastic regimes (panels (b) and (d)), the limitations of this approach become clear. Because the gradient is nearly zero across most of the domain in plug-dominated flows, the added feature provides little meaningful signal and is easily dominated by numerical noise. This issue is most severe in low cases, where both the velocity magnitudes and their gradients are extremely small; in such regimes, the numerical noise becomes comparable to the signal itself, leading to visibly degraded predictions. As a result, the gradient-augmented model fails to reproduce the flat central region accurately. These observations indicate that simply providing raw gradient information is still insufficient for reliably resolving strongly plug dominated flows.
Augmenting Inputs with Logarithm of Velocity Gradients
To better resolve the near zero gradient values inside the plug, we next introduce the logarithm of the gradient magnitude, , as an additional input channel. This transformation expands the dynamic range of values that cluster near zero and amplifies subtle variations associated with the yielding boundary. Unlike the raw gradient, the log-gradient provides meaningful structure throughout the domain, even when is extremely small, making it more informative for learning the plug region behavior. This expectation is borne out at (Figure 5(a,Figure 5b)), where the log-gradient input gives the most accurate predictions of the three representations, with errors of 4–6% in (a) and 36–45% in (b) across training seeds, although the plateau is still underpredicted and the profiles remain oscillatory. At , however, the log-gradient input does not improve upon the raw gradient and its predictions vary strongly between training seeds, with errors of 4–31% in (c) and 6–21% in (d). A plausible reason is the short input window (): at high the flow in the channel core has not yet developed at these times, so that the near-zero early-time gradients are strongly amplified by the logarithm and dominate the input, whereas at the flow develops much faster. Among gradient-based inputs, the raw gradient therefore provides the largest gains at high , while the log-gradient is advantageous only at low , and neither fully resolves the plateau in strongly plug-dominated, low- flows. Averaged over all cases, the mean error is 6.3% with the raw gradient and 13.7% with the log-gradient, compared with 5.9% for alone.
Loss Formulations for Low Shear Emphasis
In addition to modifying the input representation, we evaluated several loss formulations designed to emphasize the plateau region directly. Three losses were tested: (i) the baseline relative loss, (ii) a plateau-weighted loss that amplifies errors at grid points where (Eq. (5)), and (iii) a Sobolev loss combining velocity and gradient errors. The baseline uses as the only input, while the plateau-weighted and Sobolev models receive together with , which is also needed to evaluate these two objectives. Figure 6 summarizes the performance of these losses across representative cases.

Figure 6. Effect of different loss formulations on prediction accuracy for representative – cases. Each panel compares the ground truth velocity profile (solid black) with predictions obtained using (i) the baseline relative loss (orange, dash-dotted), (ii) a plateau-weighted loss (magenta, dashed), and (iii) a Sobolev loss (cyan, dotted). The left column corresponds to and the right column to : (a) ; (b) ; (c) ; (d) . At both modified losses raise the plateau height that the baseline underpredicts, with the Sobolev loss performing best. At , the plateau loss introduces large oscillations and unphysical negative velocities at the walls, while the Sobolev loss yields smooth profiles with the lowest error of the three.
The relative loss performs well when the velocity field contains significant spatial variation (e.g. low flows), but it fails to reproduce the plateau velocity for large , where the gradients are nearly zero throughout most of the domain. Because the norm naturally focuses on high magnitude variations, it allocates disproportionate weight to the boundary layers and fails to sufficiently penalize errors in the plug. As a result, the model trained with this loss systematically underweights the plateau and fails to reproduce the flat central profile. The plateau-weighted loss attempts to correct this imbalance by explicitly increasing the contribution of low shear regions to the objective function. While this strategy improves accuracy in high cases, it becomes highly sensitive to the numerical values of the velocity field and tends to overlook small magnitudes and their variations during training, leading to instability and degraded predictions at low (panels (a) and (b)). Consequently, its performance varies significantly across the parameter space, producing large errors in some regimes despite improving others.
The Sobolev loss provides a more balanced and physically grounded alternative. By penalizing discrepancies in both the velocity and its spatial derivatives, it encourages the model to capture the flatness of the plug and the sharpness of the shear layers simultaneously. As shown in Figure 6, the Sobolev loss produces smooth, oscillation-free profiles and provides consistently improved predictions across all cases and training seeds, reducing the errors in (a) and (d) from 7–22% to 1–3% without requiring case specific tuning. Averaged over all cases, the mean error is 3.0% with the Sobolev loss, compared with 5.9% for the baseline and 7.3% for the plateau-weighted loss. Among the loss-based strategies evaluated, the Sobolev loss delivers the most stable and broadly applicable enhancement to the model’s accuracy, which is also physically meaningful, whereas the plateau-weighted loss gives smaller gains than the Sobolev loss at and is strongly unstable at . Logarithmic Velocity Representation: Finally, we investigate representing both the input and output velocity fields in logarithmic space, i.e., mapping before passing the data to the model. Since differences in the plateau region are small in absolute magnitude, this transformation rescales low velocity variations, amplifying subtle differences and enabling the model to identify patterns that are otherwise obscured.
This representation leads to a substantial improvement in the predictive accuracy at larger velocities (e.g. ). Figure 7 illustrates the effect of this transformation across a range of cases. In each panel, the log-velocity model is compared directly against the velocity-only baseline and the Sobolev loss. At , log-scaled training performs comparably to the Sobolev loss and much better than the baseline. Even in the most challenging high regimes, the log-velocity model achieves errors as low as 2%, accurately reproducing both the plug height and the shear layer transitions. Averaged over all cases, log-velocity training gives the lowest mean error of all strategies considered (1.0%). A key advantage of the log-velocity representation is its numerical stability. Unlike gradient-based inputs, which can be sensitive to noise when gradients are extremely small, the log-transform remains smooth and well behaved across the entire domain. At , although the log-velocity prediction remains smooth and free of oscillations, it still shows a small discrepancy for the velocity magnitudes, indicating that the low- plateau remains challenging even with this representation.

Figure 7. Comparison of the most effective input and loss strategies for capturing the plug-flow plateau. Each panel compares the ground truth velocity profile (solid black) with RheOFormer predictions obtained with (i) the relative loss on (orange, dash-dotted), (ii) the relative loss on (magenta, dashed), and (iii) the Sobolev loss (cyan, dotted). The left column corresponds to and the right column to : (a) ; (b) ; (c) ; (d) . At both log-velocity training and the Sobolev loss reproduce the plateau height to within about 2%, clearly outperforming the baseline. At , all three approaches show plateau errors, while log-velocity training gives the most accurate predictions in both cases. In the plug-dominated case (b), log-velocity training yields a smooth profile with an underpredicted plateau, while the Sobolev loss overpredicts the plateau (38.1%) and the baseline overpredicts it with large oscillations (46.4%).
These findings show that the most robust and broadly effective improvements arise from the use of log-scaled velocities and Sobolev loss, both of which amplify the subtle variations that define the plug region, with the clearest gains at larger velocities. The consistency of these enhancements across all tested flow regimes indicates that the plateau region prediction error is not fundamentally tied to model capacity or data scarcity, but rather to the numerical characteristics inherent to viscoplastic steady states, specifically, the prevalence of extremely small gradients that obscure meaningful structure. By adopting input representations that better emphasize low shear regions, RheOFormer is able to recover accurate predictions even in strongly viscoplastic flows with large plug regions.
Extrapolation Across the Range
The preceding sections focused on improving accuracy within the regime covered by the training dataset, particularly for flows exhibiting strong plug formation. We now examine a different and complementary challenge: the ability of RheOFormer to extrapolate across the dimension. Since the steady profile scales linearly with at fixed (§ 2.1), extrapolation along probes the model’s ability to predict velocity magnitudes outside the training range rather than new flow structures. In many operator learning settings, interpolation within the training distribution is achievable, whereas true extrapolation remains fundamentally difficult. To quantify these effects, we evaluate two extrapolation scenarios: (i) models trained exclusively on low and tested on higher , and (ii) models trained on high and tested at lower . Figure 8 and Figure 9 summarize the prediction errors and representative velocity profiles for these two settings. Unless otherwise stated, all extrapolation experiments in § 3.7–3.7 use the log-velocity configuration of § 3.4, the most accurate configuration identified above, so that the effect of parameter-space coverage is isolated from that of the representation and loss choices examined in previous Sections.

Figure 8. Extrapolation performance of the model trained only on low Reynolds numbers (, , , , ) and evaluated on higher flows. (a) Mean prediction error as a function of for , , , and . (b) , (c) , (d) , and (e) : representative velocity profiles, each at the near the midpoint of its range.

Figure 9. Extrapolation performance of the model trained only on high Reynolds numbers () and evaluated on lower flows. (a) Mean prediction error across the range for , and . (b) , (c) , (d) , and (e) : representative velocity profiles, each at a characteristic .
Extrapolation When Training on Low : We first train RheOFormer using only the flow profiles in the low Reynolds (, , , , ) regime, using all 21 values at each (105 training cases), and test it on flows at higher . This test directly probes whether a model exposed exclusively to low magnitude velocity fields can extrapolate to larger velocities associated with higher . Figure 8(a) reports the mean prediction error across the full range for test cases with , , , and . Two clear trends emerge. First, the prediction error increases systematically as the grows. The model performs reasonably well for some cases with , which lies close to the training regime, but accuracy degrades sharply as moves further from the values seen during training. For and , the errors exceed 35% over the entire range, indicating that the model cannot reconstruct the substantially larger velocity magnitudes associated with higher flows. Second, the error decreases with increasing . This behavior is expected since higher suppresses the maximum velocity and yields profiles that are closer in magnitude to those encountered in the low training set.
Panels (b)–(e) in Figure 8 show representative predictions, using for each the case whose lies near the midpoint of its testing range. At [Figure 8(b)], the model captures the overall shape of the velocity field with mean errors near 20%, although deviations remain noticeable, specifically in the plateau. As the increases, however, the model fails to reproduce the correct velocity magnitude. In Figure 8(c)–(Figure 8e), corresponding to , , and , the predicted profiles saturate around , far below the true peak values. This occurs because the largest velocities observed during training correspond to , leaving the model without exposure to the higher magnitudes required to reconstruct the target solutions.
These observations demonstrate that training exclusively on low regime enables only limited upward extrapolation. While the model can interpolate slightly beyond the training regime, its predictive accuracy rapidly collapses as the characteristic velocity scale departs from the range encoded in the training data. This highlights the importance of sampling across the full dynamical range when training a single operator intended for broad parameter coverage.
Extrapolation When Training on High : We now examine the inverse scenario to the previous subsection by training RheOFormer exclusively on high regime (, , , , ; all 21 values at each , 105 training cases) and evaluating its performance on low flows. This setting tests whether a model exposed primarily to large velocity magnitudes can recover the lower speed profiles characteristic of small flows. Figure 9(a) reveals a contrasting trend compared to the previous subsection. When predicting flows down to approximately –, the model maintains moderate error levels over a broad range of . This behavior reflects the fact that training on high cases exposes the model not only to large velocity magnitudes at low , but also to moderately small velocities at higher values. As decreases, the velocity magnitude increases, bringing the target profiles closer to those values already encountered during training. Consequently, the model is able to represent nearby low flows with reasonable quantitative accuracy. Nonetheless, the errors begin to rise sharply in cases where the velocity magnitudes fall below the range represented in the training data. Even for , high flows exhibit a significant increase in error, indicating that the model no longer has sufficient basis functions to reconstruct the solution accurately. This behavior mirrors the limitations observed in the previous subsection: once the target field departs substantially from the dynamical range encoded during training, performance rapidly degrades.
Panels (b)–(e) of Figure 9 show representative predictions at characteristic for each . For [Figure 9(e)], the model performs well with errors near 4%. At intermediate of 0.025 and 0.05 [panels (c) and (d)], the predictions remain qualitatively accurate, though errors increase to the 8–18% range. By contrast, when extrapolating to [panel (b)], the model fails to capture the correct velocity magnitude and produces errors close to 50%, primarily due to systematic overestimation of the plug height. These large discrepancies arise because such low velocity fields are absent from the training regime, preventing the model from reconstructing the required behavior. An asymmetry emerges when comparing the two extrapolation directions. Models trained on high flows extrapolate downward more effectively than models trained on low flows extrapolate upward. Since the steady profile shapes at fixed are identical across , this asymmetry reflects the range of velocity magnitudes contained in the training data rather than differences in flow structure: high- training sets already include moderately small velocities at high , whereas no low- case reaches the velocity magnitudes of high- flows. Nevertheless, both extrapolation directions ultimately fail when the target lies outside the dynamical regime captured during training.
Taken together, these results demonstrate that RheO-Former, like most operator learning frameworks, performs reliably within the convex hull of its training distribution but degrades sharply when asked to extrapolate across dynamically distinct regions of the – parameter space. This motivates the investigation in Section 3.7, where we show that strategically sampling representative cases across the full parameter range substantially reduces these extrapolation failures.
Extrapolation Across the Range
Having examined the extrapolation capabilities along axis, we now turn to the second key control parameter in Bingham flows: the . Whereas variations in only rescale the steady velocity magnitude, changes in control the strength and spatial extent of the plug region through the yield stress. As a result, varying induces qualitative changes in the flow structure rather than a simple rescaling of velocity magnitude. Extrapolating across is therefore a stringent test of whether RheOFormer has learned the underlying physics rather than simply interpolating among a few observed plug shapes.
Extrapolation When Training on Low : We first consider models trained only on weakly viscoplastic flows, i.e. on the lower half of the range, in which the plug occupies at most 40% of the channel, and then evaluate the performance on progressively larger where pronounced plug regions develop. In this setting, the training set contains velocity profiles with relatively mild flattening, and the model is asked to extrapolate toward increasingly plug dominated regimes that lie outside the observed range.
Here, the domain for each is divided into two equal halves. The lower half of the range, corresponding to weakly viscoplastic flows near the Newtonian limit, is used for training, while the upper half with stronger viscoplastic behavior is reserved for testing. In Figure 10(a), is normalized by , so that the parameter range spans for every ; the testing range therefore corresponds to , and the left edge of the axis marks the boundary with the training range. This normalization provides a consistent reference point for comparing the extrapolation behavior across all values. Figure 10 summarizes the resulting behavior. Panel (a) shows the mean prediction error as a function of the range for several . For all values, the prediction error generally increases as moves farther into the testing range, indicating increasing difficulty in extrapolating toward stronger viscoplastic behavior. The magnitude of this degradation, however, depends strongly on . The largest errors occur at low , with showing an increase of about two orders of magnitude across the extrapolation range. This suggests that the model, having been trained primarily on weakly viscoplastic profiles near the Newtonian limit, has limited ability to extrapolate the development of plug-dominated flow when both is high and is low. In contrast, the error increase is considerably smaller at moderate (0.075–0.25), where the errors remain below about 12%. At the highest (0.5–1), however, the errors again grow to 25–45% at the largest .

Figure 10. Extrapolation performance of RheOFormer trained only on low () and evaluated on flows with larger . (a) Mean prediction error as a function of over the testing range. (b) , (c) , (d) , and (e) : representative velocity profiles at the largest tested .
Panels (b)–(e) of Figure 10 illustrate representative predictions at the largest tested for each . At and [Figure 10(b), (Figure 10c)], the predictions are qualitatively incorrect: the model overestimates the velocity magnitude, produces a strongly distorted profile with spurious oscillations, and completely fails to represent the plateau region, resulting in extremely large errors. For [panel (d)], the model recovers the overall shape of the velocity profile but still underestimates the degree of flattening in the plateau region and the slope near the yield surfaces, resulting in an error of 11%. At [panel (e)] however, the plateau velocity is underestimated by about 40% and the profile contains large oscillations. In all cases, the plateau is not correctly reproduced because the model has never observed plug-like behavior in the training data and therefore lacks the functional structure needed to reconstruct it. These results indicate that training solely on low flows does not provide sufficient information for the model to infer how the plug region develops as the yield stress increases. The operator learned in this regime primarily encodes Newtonian-like behavior and fails to extrapolate to strongly viscoplastic states.
Extrapolation When Training on High
To complement the preceding analysis, we next consider the inverse extrapolation scenario in which RheOFormer is trained solely on strongly viscoplastic flows with large . In this training regime, the velocity fields are dominated by pronounced plug regions with minimal curvature. The model is then evaluated on flows with progressively smaller , where the velocity profiles transition toward more curved, Newtonian-like shapes. This test probes whether a model trained only on flattened, plug dominated profiles can extrapolate toward the fully yielded regime. For each , the upper half of the range is used for training, while the lower half is reserved for testing (the reverse of the low- setup above). In Figure 11(a), the testing range corresponds to ; the right edge of the axis marks the boundary with the training range, and the extrapolation distance increases toward .
Figure 11(a) shows that the prediction error generally increases as the test moves farther from the training regime. For low and moderate , this increase is gradual, indicating that the model can partially adjust to the weakening of the plug region. However, for higher values (0.25–1.0), the errors are substantially larger. This deterioration is expected, as the model has never encountered high curvature profiles or large velocity magnitudes in the high training set. Panels (b)–(e) show representative predictions at the Newtonian limit for each . At and (Figures 11(b, c)), the model produces smooth profiles with modest errors around 6%, but retains a residual plateau and fails to recover the correct parabolic curvature. This reflects the mismatch between the training data, where all examples contain a plug, and the Newtonian limit where no such plateau exists. At intermediate of 0.50 [panel (d)], the model increasingly underestimates centerline curvature and magnitude, leading to errors of roughly 25%. At the highest of 1.0, the predictions deteriorate sharply: the model cannot reproduce the large velocity values or the steep gradients in the shear layer and instead outputs an overly flattened profile with errors of about 65% [panel (e)].
These results reveal an extrapolation asymmetry complementary to that observed when training on low . Whereas extrapolation toward higher fails because the model has not learned the formation of plug regions, extrapolation toward lower fails because the model lacks exposure to the high curvature and large shear rates characteristic of Newtonian-like flow. Both directions underscore the necessity of broad parameter-space sampling when training a single neural operator intended to generalize across viscoplastic regimes.

Figure 11. Extrapolation performance of RheOFormer trained only on large and evaluated on flows with smaller . (a) Mean prediction error as a function of over the testing range. (b) , (c) , (d) , and (e) : representative velocity profiles at the Newtonian limit ().

Figure 12. Effect of targeted sampling on extrapolation across the range. (a) Mean prediction error versus before (dashed) and after (solid) targeted sampling, for models trained on low augmented with a few high- corner cases (blue), and for models trained on high augmented with a few low- cases (red). (b) , , model trained on high . (c) , , model trained on low . Panels (b) and (c) compare the ground truth with predictions before and after targeted sampling, using the same line styles and colors as in (a).

Figure 13. Effect of targeted sampling on extrapolation across the range. (a) Mean prediction error for each before (dashed) and after (solid) adding a minimal number of corner cases at extreme . (b) , , model trained on low (blue). (c) , , model trained on high (red). Panels (b) and (c) compare the ground truth with predictions before and after targeted sampling.
Resolving Extrapolation Limitations by Targeted Sampling
The extrapolation failures identified in previous Sections reveal a consistent underlying limitation of RheOFormer: prediction accuracy degrades primarily when the training dataset does not expose the model to qualitatively distinct physical regimes. In all extrapolation scenarios considered, the breakdown does not stem from insufficient resolution within a given regime, but rather from the absence of representative examples that encode fundamentally different flow structures or velocity scales. This observation motivates a targeted sampling strategy in which a minimal number of carefully selected corner cases are added to the training set to span the missing dynamical behaviors.
We first revisit extrapolation across the axis. When training is restricted to the low regime, the model is exposed only to low magnitude velocity fields and consequently fails to predict higher flows, as shown in § 3.7. To address this limitation, we augment the training set by adding a small number of representative high samples. Specifically, for each previously unseen , we include only three cases corresponding to the minimum, midpoint, and maximum value. This results in a total of just 12 additional training samples. Despite this minimal increase in dataset size, the improvement is substantial. As shown in Figure 12(a), the mean relative error decreases by more than an order of magnitude across the entire range. The model is no longer limited by velocity scale mismatch and successfully recovers both the magnitude and shape of the steady state profiles, as illustrated in Figure 12(c). These results indicate that exposure to a small number of representative high solutions is sufficient for the model to internalize the
@page 14/19 starts_mid=0 ends_mid=1

Figure 11 (PDF p. 14). Extrapolation performance of RheOFormer trained only on large and evaluated on flows with smaller . (a) Mean prediction error as a function of over the testing range. (b) , (c) , (d) , and (e) : representative velocity profiles at the Newtonian limit ().

Figure 12 (PDF p. 14). Effect of targeted sampling on extrapolation across the range. (a) Mean prediction error versus before (dashed) and after (solid) targeted sampling, for models trained on low augmented with a few high- corner cases (blue), and for models trained on high augmented with a few low- cases (red). (b) , , model trained on high . (c) , , model trained on low . Panels (b) and (c) compare the ground truth with predictions before and after targeted sampling, using the same line styles and colors as in (a).

Figure 13 (PDF p. 14). Effect of targeted sampling on extrapolation across the range. (a) Mean prediction error for each before (dashed) and after (solid) adding a minimal number of corner cases at extreme . (b) , , model trained on low (blue). (c) , , model trained on high (red). Panels (b) and (c) compare the ground truth with predictions before and after targeted sampling.
extrapolation toward higher fails because the model has not learned the formation of plug regions, extrapolation toward lower fails because the model lacks exposure to the high curvature and large shear rates characteristic of Newtonian-like flow. Both directions underscore the necessity of broad parameter-space sampling when training a single neural operator intended to generalize across viscoplastic regimes.
Resolving Extrapolation Limitations by Targeted Sampling
The extrapolation failures identified in previous Sections reveal a consistent underlying limitation of RheOFormer: prediction accuracy degrades primarily when the training dataset does not expose the model to qualitatively distinct physical regimes. In all extrapolation scenarios considered, the breakdown does not stem from insufficient resolution within a given regime, but rather from the absence of representative examples that encode fundamentally different flow structures or velocity scales. This observation motivates a targeted sampling strategy in which a minimal number of carefully selected corner cases are added to the training set to span the missing dynamical behaviors.
We first revisit extrapolation across the axis. When training is restricted to the low regime, the model is exposed only to low magnitude velocity fields and consequently fails to predict higher flows, as shown in § 3.7. To address this limitation, we augment the training set by adding a small number of representative high samples. Specifically, for each previously unseen , we include only three cases corresponding to the minimum, midpoint, and maximum value. This results in a total of just 12 additional training samples. Despite this minimal increase in dataset size, the improvement is substantial. As shown in Figure 12(a), the mean relative error decreases by more than an order of magnitude across the entire range. The model is no longer limited by velocity scale mismatch and successfully recovers both the magnitude and shape of the steady state profiles, as illustrated in Figure 12(c). These results indicate that exposure to a small number of representative high solutions is sufficient for the model to internalize the appropriate scaling behavior and transition between low and high velocity regimes.
A complementary improvement is observed when training is initially restricted to the high regime. In this case, the model tends to overestimate velocities and fails to reconstruct low flows. By symmetry with the previous experiment, we augment the training set by adding only two samples per unseen (corresponding to the minimum and maximum for ), for a total of eight additional samples. As shown in Figures 12(a) and (b), this minimal augmentation again leads to a dramatic reduction in extrapolation error.
An analogous pattern emerges for extrapolation across the axis. When training is limited to low flows, the model fails to predict strongly viscoplastic regimes characterized by wide plug regions and suppressed shear. In this case, the missing physics corresponds to the emergence of unyielded regions rather than changes in velocity magnitude. Remarkably, adding only a single training sample at the highest for each (nine additional samples in total) is sufficient to restore accurate predictions across the entire range (Figure 13(a), (b)). Conversely, when training is restricted to high regimes, the model struggles to recover the Newtonian-like behavior. Here, the absence of fully yielded reference states prevents the model from reconstructing high curvature velocity profiles. In this case, including a single Newtonian sample () for each (again nine additional samples in total) leads to a dramatic improvement in accuracy (Figure 13(a), (c)). This highlights the special role of the Newtonian limit as an extreme point in parameter space, enabling the operator to interpolate correctly between yielded and unyielded behaviors.
These results demonstrate that the dominant source of extrapolation error is not insufficient data volume or limited model capacity, but incomplete coverage of qualitatively distinct physical regimes. By adding a minimal number of strategically chosen corner cases that span the extremes of and , RheOFormer can generalize reliably across the full parameter space. While additional data naturally continue to improve performance, these findings show that even a very small number of representative samples can enable the model to internalize new physical behaviors and accurately interpolate between them.
Effect of Input Temporal Information
A natural question in operator learning for dynamical systems is whether providing additional temporal information improves the model’s ability to infer long time or steady state behavior. Intuitively, access to multiple early-time snapshots may help the model better infer the governing dynamics and thereby enhance steady state predictions. In this subsection, we explicitly test this hypothesis by systematically varying both the amount and the timing of the transient information supplied to RheOFormer while keeping all other aspects of the training procedure fixed. Specifically, the model receives consecutive snapshots of the transient flow evolution, uniformly spaced in time with and starting at time , so that the last input snapshot is taken at , and is asked to predict the steady state velocity field. The number of input frames is varied as and , and the start time is varied between and , so that the inputs range from a barely developed flow to an essentially steady one. All runs use the log-velocity configuration of Section 3.4 and the training set of five cases per (Sections 3.3–3.4); errors are reported as the relative error over the held-out cases, averaged over three training seeds. The model architecture, loss function, and training protocol are otherwise unchanged.
Figure 14(a) summarizes the error, averaged over all , as a function of the number of input snapshots . For input sequences starting at , a pronounced reduction in error is observed when increasing the input from a single snapshot to , by more than two orders of magnitude. Beyond this point, the error plateaus at 0.014–0.017, and the inclusion of additional snapshots yields no systematic improvement; the remaining variations are comparable to the variation between training seeds. As expected, the model does not require access to the initial condition itself. All simulations in the dataset start from a quiescent state with zero velocity, so that the initial snapshot carries no case-specific information. This explains the failure of at , where the input is identical for all cases. For every start time , a single snapshot already yields a good prediction for the steady state (2% error at and 1% for ), and increasing the input to five snapshots lowers the error by at most about 30%. This saturation indicates that RheOFormer does not rely on an extended temporal history: as soon as the input contains a partially developed flow field, one or a few snapshots are sufficient to identify the flow regime and infer its steady state. Since a single snapshot performs nearly as well as several, the relevant information is carried by the spatial structure of the developing field, namely its magnitude and the extent of the plug region, rather than by its temporal evolution.

Figure 14. Sensitivity of steady state prediction accuracy to the amount and timing of transient input. (a) Log-velocity model: error averaged over all as a function of the number of input snapshots , for input sequences starting at different times . (b) Comparison with the persistence baseline, for snapshots starting at : persistence (dashed), and RheOFormer trained on (dash-dotted) and on (solid). (c) Log-velocity model with a window of snapshots starting at different times : RheOFormer (solid) and persistence (dashed) for each .
To assess whether the model genuinely infers the long time behavior rather than reproducing its input, we compare it with the simplest possible predictor, which we refer to as persistence: the last input snapshot is taken directly as the prediction of the steady state, . The error of this baseline is a direct measure of how far the flow still is from its steady state at . Figure 14(b) shows this comparison for snapshots starting at , i.e. for inputs covering only –0.06. Because the viscous term scales as , the time required for the flow to develop increases with , and the persistence error rises accordingly, from below 0.10 at , where the flow is very close to steady at , to 0.80 at , where it has barely started. The log-velocity model, in contrast, maintains an error of 0.011–0.019 over the entire range, independently of how far the flow has developed. For it outperforms persistence, and the advantage grows with , reaching a factor of about 40–50 for . In this regime the operator performs genuine forecasting: from inputs that are far from the steady state, it infers the long time behavior rather than copying the input. The model trained on the raw velocity follows the same trend, only with larger errors. At the inputs are very close to the steady state and the task reduces to reconstructing a steady field from steady inputs, so persistence is essentially exact, while the model error (0.015 and 0.039) reflects the residual error.
Finally, Figure 14(c) extends the comparison with persistence to all input windows, by shifting the window later in time. The persistence error depends strongly on the start time and decreases rapidly once the flow approaches its steady state, which occurs later for larger , whereas the RheOFormer error remains nearly constant. As a result, RheOFormer outperforms persistence as long as the last input snapshot is taken before , which corresponds to the time required for the flow to develop. The advantage observed in Figure 14(b) is therefore not specific to the chosen window, but holds throughout the development of the flow. Moreover, the insensitivity of the model to the timing of the input holds for each individually and not only on average: the error remains around 0.5%–2% for and 2%–4% at for all start times. Hence, the model does not need the snapshots to be taken at a particular time and it can predict the steady state with the same accuracy from a window at the very beginning of the transient as from a window close to the steady state. The practical value of this ability is greatest precisely in the early-time regime, where only a short initial portion of the transient is available.
For the steady channel flows considered here, these results are consistent with the conclusions of the preceding sections: the composition of the training dataset in parameter space and the representation of distinct physical regimes are far more critical than the amount of temporal information provided. A single informative snapshot, or a few snapshots taken early in the transient, well before the flow has developed, are sufficient for an accurate steady state prediction.
Conclusion
In this work, we conducted a systematic examination of RheOFormer, an attention-based neural operator, for predicting steady state viscoplastic channel flows governed by Bingham physics. Beyond evaluating baseline accuracy, our objective was to understand the fundamental mechanisms that enable or hinder generalization across the full – parameter space, and to establish a practical and data efficient methodology for enabling accurate predictions using minimal data. Rather than focusing solely on performance metrics, this study emphasizes understanding why and where operator learning succeeds or fails for viscoplastic systems. The findings of this study reveal clear numerical characteristics of viscoplastic flows that shape model performance and motivate improvements in both input representation and loss design. Through this analysis, several methodological insights emerged that together form a generalizable roadmap for training RheOFormer on different physical systems.
Bingham flows introduce extended regions of nearly zero velocity gradients associated with unyielded plug regions. A central observation is that these low shear zones are numerically subtle and weakly penalized by standard loss functions, causing standard representations to underemphasize the plateau region and leading to systematic errors in the predicted plateau height when training data are limited. Importantly, this failure mode is not attributable to insufficient model capacity, but rather to the inherent numerical structure of viscoplastic flows, where meaningful spatial variations are concentrated in thin boundary layers. Recognizing this led to a series of methodological contributions aimed at improving plateau region accuracy. By augmenting the input representation with gradient-based features and, in particular, logarithmic transformations, we demonstrated that the numerical salience of low gradient regions can be significantly enhanced. The log-velocity representation consistently amplified weak shear information, enabling the model to recover the correct plateau velocity even in strongly viscoplastic regimes, and gave the lowest error of all strategies. The raw velocity gradient as an additional input improved the plateau prediction at high but not at low . In parallel, we evaluated several loss formulations and found that Sobolev loss provides a stable and physically grounded mechanism for jointly penalizing velocity and gradient errors, with the clearest gain in the highest- case at . At , however, where both the velocity magnitudes and their gradients are extremely small, none of the modifications fully resolves the plateau error, and accurate prediction of plug-dominated flows in this regime remains challenging. These representations and loss strategies offer a principled approach for addressing low gradient failure modes in neural operators applied to non-Newtonian flows.
In addition to improving accuracy within the training domain, we systematically probed the model’s ability to extrapolate along both the and dimensions. Our results revealed two important aspects of extrapolation behavior in RheOFormer. First, models trained only on low flows were unable to reconstruct the higher magnitude velocity profiles, while models trained exclusively on high flows systematically overestimated velocities and failed to recover the lower velocity magnitudes. This underscores the importance of the numerical range of values encountered during training: downward extrapolation performs slightly better because high- training sets already contain moderately small velocities at high , whereas upward extrapolation requires predicting velocity magnitudes and gradients outside the distribution observed during training. Second, our study highlights the necessity of covering the full spectrum of physical behaviors in the dimension. Models trained only on small cannot reconstruct viscoplastic flows with pronounced plug regions, while models trained solely on large struggle to reproduce Newtonian-like curvature in fully yielded states. Although fully yielded profiles lack a yield surface and are structurally simpler, their velocity magnitudes and shear rates at high exceed those encountered in the plug-dominated training data, making extrapolation toward them difficult. These findings emphasize a central practical implication: RheOFormer does not extrapolate reliably across dynamically distinct regimes unless the underlying physical and numerical space is adequately sampled. Motivated by this, we identified targeted sampling strategies that substantially mitigate these failures by selecting a minimal yet representative set of training cases that spans the extreme behaviors of the system.
Finally, the temporal input study showed that the model does not rely on an extended temporal history: apart from the uninformative initial condition, a single snapshot is nearly as informative as several, and the accuracy is nearly independent of when the input window is taken. Compared with the trivial predictor that copies the last input, RheOFormer is up to about 50 times more accurate while the flow is still developing, i.e. for input times up to .
The channel flow studied here is deliberately simple with flat and fixed yield surfaces, unidirectional velocity, and the steady profile that depends only on . Many viscoplastic flows of practical interest are much more complicated with dynamic heterogenous stress fields or deformable interfaces, where yield surfaces interact with a free surface and more complex boundary conditions. In the latter, the domain itself evolves in time, and the material stops in a shape set by the balance of driving forces and the yield stress[48, 49]. In these problems, fundamental to applications such as 3D printing, the quantity of interest is often the interface shape and the arrest time rather than a velocity field. Such flows are natural next tests for the strategies identified here, but would require alternative strategies for instance to the logarithmic velocity transform.
Overall, this study provides both conceptual understanding and actionable guidance for training RheOFormer on complex rheological systems with minimal data. The improvements introduced (log-scaled representations, gradient aware losses, and targeted sampling) are not specific to Bingham flow and are expected to transfer to other classes of complex fluids or general nonlinear PDEs where low gradient structures or sharp transitions challenge standard learning approaches. By clarifying the interplay between data structure, numerical representation, and operator learning performance, this work establishes a foundation for reliably training RheOFormer for a broad spectrum of rheological and physics-based modeling applications.
Numerical setup and validation
To generate the training dataset, two-dimensional pressure-driven Bingham flows were simulated using the Basilisk flow solver. The governing equations were nondimensionalized using the channel half-width as the characteristic length scale and a reference velocity as the velocity scale, giving
where , , , and are, respectively: density, position, time, velocity and pressure. Values with a bar on top are nondimensional.
The resulting dimensionless equations are
with
where
is the rate-of-deformation tensor, and the tensor norm is defined as
The Reynolds and Bingham numbers are defined as
where , , and denote the density, plastic viscosity, and yield stress, respectively.
The flow is driven by a constant streamwise pressure gradient. We define the dimensionless pressure-gradient parameter according to
where . Thus, .
With these nondimensionalization choices, the flow admits the following analytical solution for the velocity profile
The computational domain is the dimensionless rectangular channel , where correspond to the channel walls. No-slip boundary conditions are imposed at the upper and lower walls. At the inlet and outlet, the pressure is prescribed and the normal velocity gradient is set to zero, corresponding to the pressure-driven boundary conditions implemented in Basilisk.
The ideal Bingham constitutive relation is regularized using the Papanastasiou model [8]. Specifically, the apparent viscosity in Eq. (A.3) is replaced by
where the regularization parameter is kept fixed at .
The simulations are performed on a uniform Cartesian grid with spacing . Each simulation is advanced until a steady state is reached, defined by
The streamwise velocity field is recorded throughout each simulation. For use in the machine-learning model, the resulting velocity fields are downsampled to a spatial grid and subsequently to the grid used by the model.
In order to demonstrate that the data used in training correctly captures the expected yielding behavior, we show in Figure 15 a comparison between analytical solutions from Eq. (A.8) and numerical solutions obtained with Basilisk. We observe good agreement between these solutions, which validates that the data used in our training dataset contains a good representation of the yielding behavior of Bingham fluids.

Figure 15. Validation of the numerical data obtained from Basilisk against analytical solutions. All simulations shown use , , and . Four values of are shown, illustrating that the Basilisk solution captures the yielding well, even for highly plugged flows.
Declaration of competing interest
The authors declare that there is no conflict of interest.
Acknowledgements
M.S. and S.J. would like to acknowledge the support of DoD MURI Award N00014-23-1-2499.
CRediT authorship contribution statement
Maedeh Saberi: Methodology, Investigation, Programming, Validation, Data Curation, Visualization, Writing (Original Draft). Hugo França: Methodology, Programming, Validation, Data Curation, Writing (Original Draft). Maziyar Jalaal: Methodology, Writing (Review and Editing). Safa Jamali: Supervision, Project administration, Funding acquisition, Methodology, Investigation, Writing (Review and Editing).
References
- [1]N. Balmforth, R. Craster, Geophysical aspects of non-newtonian fluid mechanics, Geomorphological Fluid Mechanics (2001) 34–51.DOI
- [2]S. Blake, Visco-plastic models of lava domes, Springer, 1990, pp. 88–126.DOI
- [3]J. F. Steffe, Rheological methods in food process engineering, Free-man press, 1996.
- [4]D. Bonn, M. M. Denn, L. Berthier, T. Divoux, S. Manneville, Yield stress materials in soft condensed matter, Reviews of Modern Physics 89 (2017) 035005.DOI
- [5]E. J. Dean, R. Glowinski, G. Guidoboni, On the numerical simulation of bingham visco-plastic flow: old and new results, Journal of non-newtonian fluid mechanics 142 (2007) 36–62.DOI
- [6]P. Cousssot, Yield stress fluid flows: A review of experimental data, Journal of Non-Newtonian Fluid Mechanics 211 (2014) 31–49.
- [7]N. Balmforth, D. Hewitt, The implications of a fluid yield stress, Journal of Fluid Mechanics 1011 (2025) P1.DOI
- [8]T. C. Papanastasiou, Flows of materials with yield, Journal of rheology 31 (1987) 385–404.DOI
- [9]R. R. Huilgol, A. N. Alexandrou, G. C. Georgiou, Start-up plane poiseuille flow of a bingham fluid, Journal of Non-Newtonian Fluid Mechanics 265 (2019) 133–139.DOI
- [10]E. C. Bingham, Fluidity and plasticity, McGraw-Hill Book Company, Incorporated, 1922.
- [11]I. A. Frigaard, K. G. Paso, P. R. de Souza Mendes, Bingham’s model in the oil and gas industry, Rheologica Acta 56 (2017) 259–282.
- [12]T. Roberts, S. Cox, Predicting yielding in the pressure-driven flow of a bingham fluid in a serpentine channel, Journal of Non-Newtonian Fluid Mechanics 322 (2023) 105131.DOI
- [13]P. Saramito, A. Wach, Progress in numerical simulation of yield stress fluid flows, Rheologica Acta 56 (2017) 211–230. doi:10.1007/s00397-016-0859-9.DOI
- [14]E. Mitsoulis, J. Tsamopoulos, Numerical simulations of complex yield-stress fluid flows, Rheologica Acta 56 (2017) 231–258.DOI
- [15]I. Frigaard, C. Nouar, On the usage of viscosity regularisation methods for visco-plastic fluid flow computation, Journal of non-newtonian fluid mechanics 127 (2005) 1–26.
- [16]N. J. Balmforth, I. A. Frigaard, G. Ovarlez, Yielding to stress: recent developments in viscoplastic fluid mechanics, Annual review of fluid mechanics 46 (2014) 121–146.DOI
- [17]M. Jalaal, B. Stoeber, N. J. Balmforth, Spreading of viscoplastic droplets, Journal of Fluid Mechanics 914 (2021) A21.DOI
- [18]C. Xie, J. Zhang, V. Bertola, M. Wang, Lattice boltzmann modeling for multiphase viscoplastic fluid flow, Journal of Non-Newtonian Fluid Mechanics 234 (2016) 118–128.DOI
- [19]S. L. Brunton, J. N. Kutz, et al., Data-driven science and engineering, Machine learning, dynamical systems, and control (2019) 2019.
- [20]S. L. Brunton, B. R. Noack, P. Koumoutsakos, Machine learning for fluid mechanics, Annual review of fluid mechanics 52 (2020) 477–508.
- [21]M. Mahmoudabadbozchelou, S. Jamali, Rheology-informed neural networks (rhinns) for forward and inverse metamodelling of complex fluids, Scientific Reports 11 (2021) 12015. doi:10.1038/s41598-021-91518-3.DOI
- [22]K. R. Lemmon, G. H. McKinley, J. W. Swan, Scientific machine learning for modeling and simulating complex fluids, Proceedings of the National Academy of Sciences 120 (2023) e2304669120. doi:10.1073/pnas.2304669120.
- [23]D. Mangal, A. Jha, D. Dabiri, S. Jamali, Data-driven techniques in rheology: Developments, challenges and perspective, Current Opinion in Colloid & Interface Science 75 (2025) 101873.DOI
- [24]M. Lardy, S. Tilli, S. Gsell, Inferring viscoplastic models from velocity fields: A physics-informed neural network approach, Journal of Non-Newtonian Fluid Mechanics (2025) 105512.arxiv.org/abs/2506.17681
- [25]M. Mahmoudabadbozchelou, G. E. Karniadakis, S. Jamali, nn-pinns: Non-newtonian physics-informed neural networks for complex fluid modeling, Soft Matter 18 (2022) 172–185.DOI
- [26]D. Dabiri, J. DaRosa, M. Saadat, D. Mangal, S. Jamali, A detailed and comprehensive account of fractional physics-informed neural networks: From implementation to efficiency, arXiv preprint arXiv:2506.11241 (2025).arxiv.org/abs/2506.11241
- [27]S. Zolfaghari, S. Jamali, Non-local physics-informed neural networks for forward and inverse solutions of granular flows, arXiv preprint arXiv:2602.16081 (2026).
- [28]S. Thakur, M. Raissi, A. M. Ardekani, Viscoelasticnet: A physics informed neural network framework for stress discovery and model selection, Journal of Non-Newtonian Fluid Mechanics 330 (2024) 105265.DOI
- [29]Z. Gao, R. Yin, R. Zhai, J. Lin, D. Yin, A deep learning framework for solving the prediction and reconstruction problem of bingham fluid flow field, Physics of Fluids 36 (2024) 113119. doi:10.1063/5.0232534.DOI
- [30]J. Zhang, Physics-informed neural networks for bingham fluid flow simulation coupled with an augmented lagrange method, Applied-Math 3 (2023) 525–551.DOI
- [31]A. Joulaei, A. Pal, H. Rahmani, S. M. Taghavi, Deep learning-assisted prediction of viscoplastic flow in superhydrophobic channels, Physics of Fluids 37 (2025) 053106. doi:10.1063/5.0268119.
- [32]L. Lu, P. Jin, G. Pang, Z. Zhang, G. E. Karniadakis, Learning nonlinear operators via deeponet based on the universal approximation theorem of operators, Nature machine intelligence 3 (2021) 218–229.
- [33]Z. Li, N. Kovachki, K. Azizzadenesheli, B. Liu, K. Bhattacharya, A. Stuart, A. Anandkumar, Fourier neural operator for parametric partial differential equations, arXiv preprint arXiv:2010.08895 (2020).arxiv.org/abs/2010.08895
- [34]N. Kovachki, Z. Li, B. Liu, K. Azizzadenesheli, K. Bhattacharya, A. Stuart, A. Anandkumar, Neural operator: Learning maps between function spaces with applications to pdes, Journal of Machine Learning Research 24 (2023) 1–97.
- [35]L. Lu, X. Meng, S. Cai, Z. Mao, S. Goswami, Z. Zhang, G. E. Karniadakis, A comprehensive and fair comparison of two neural operators (with practical extensions) based on fair data, Computer Methods in Applied Mechanics and Engineering 393 (2022) 114778. doi:10.1016/j.cma.2022.114778.DOI
- [36]N. Rahaman, A. Baratin, D. Arpit, F. Draxler, M. Lin, F. Hamprecht, Y. Bengio, A. Courville, On the spectral bias of neural networks, in: International Conference on Machine Learning, 2019, pp. 5301–5310.arxiv.org/abs/1806.08734
- [37]D. Mangal, M. Saadat, S. Jamali, Learning a family of rheological constitutive models using neural operators, Journal of Rheology 69 (2025) 55–67.DOI
- [38]Z. Li, K. Meidani, A. B. Farimani, Transformer for partial differential equations’ operator learning, arXiv preprint arXiv:2205.13671 (2022).arxiv.org/abs/2205.13671
- [39]Z. Hao, Z. Wang, H. Su, C. Ying, Y. Dong, S. Liu, Z. Cheng, J. Song, J. Zhu, Gnot: A general neural operator transformer for operator learning, in: International Conference on Machine Learning, PMLR, 2023, pp. 12556–12569.arxiv.org/abs/2302.14376
- [40]M. Saberi, A. B. Farimani, S. Jamali, Rheoformer: A generative transformer model for simulation of complex fluids and flows, arXiv preprint arXiv:2510.01365 (2025).arxiv.org/abs/2510.01365
- [41]M. Zhu, H. Zhang, A. Jiao, G. E. Karniadakis, L. Lu, Reliable extrapolation of deep neural operators informed by physics or sparse observations, Computer Methods in Applied Mechanics and Engineering 412 (2023) 116064.DOI
- [42]S. Zolfaghari, N. Lauriello, I. Cusano, M. Ferranti, R. Pasquino, S. Jamali, Multi-fidelity machine learning for predicting startup stress growth and strain hardening in wormlike micellar solutions, arXiv preprint arXiv:2611.04115 (2026).arxiv.org/abs/2611.04115
- [43]S. Zolfaghari, Y. Xie, J. Yang, S. Jamali, Hierarchical multi-fidelity learning for predicting three-dimensional flame wrinkling and turbulent burning velocity, arXiv preprint arXiv:2605.08232 (2026).arxiv.org/abs/2605.08232
- [44]A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, J. Jones, A. N. Gomez, L. Kaiser, I. Polosukhin, Attention is all you need, Advances in neural information processing systems 30 (2017).
- [45]A. Rahimi, B. Recht, Random features for large-scale kernel machines, Advances in neural information processing systems 20 (2007).
- [46]M. Tancik, P. Srinivasan, B. Mildenhall, S. Fridovich-Keil, N. Raghavan, U. Singhal, R. Ramamoorthi, J. Barron, R. Ng, Fourier features let networks learn high frequency functions in low dimensional domains, Advances in neural information processing systems 33 (2020) 7537–7547.arxiv.org/abs/2006.10739
- [47]W. M. Czarnecki, S. Osindero, M. Jaderberg, G. Swirszcz, R. Pascanu, Sobolev training for neural networks, Advances in neural information processing systems 30 (2017).arxiv.org/abs/1706.04859
- [48]H. L. França, M. Jalaal, C. M. Oishi, Elasto-viscoplastic spreading: From plastocapillarity to elastocapillarity, Physical Review Research 6 (2024) 013226.arxiv.org/abs/2306.06640
- [49]J. van der Kolk, D. Tieman, M. Jalaal, Viscoplastic lines: printing a single filament of yield stress material on a surface, Journal of Fluid Mechanics 958 (2023) A34.arxiv.org/abs/2212.13306