Failure Modes and Data-Efficient Remedies for Transformer-Based Prediction of Viscoplastic Flows
Authors: Maedeh Saberi, Hugo Franca, Maziyar Jalaal, Safa Jamali
Organizations: Department of Mechanical and Industrial Engineering, Northeastern University, Boston, 02115, Massachusetts, USA · Van der Waals-Zeeman Institute, Institute of Physics, University of Amsterdam, 1098XH, Amsterdam, The Netherlands · Department of Applied Mathematics and Theoretical Physics, University of Cambridge, Cambridge CB3 0WA, United Kingdom
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.
Figures & tables
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 ux(x,y) . During training (dashed line), the prediction is compared against the simulated steady state under one of three objectives. Each experiment reported in Section 3 uses one representation and one objective; all other architectural and optimization settings are held fixed. The fields shown are for Re=0.25 , Bi=0.5 .
Figure 2: Comparison of ground truth data ( top row ) vs. RheOFormer predictions ( bottom row ) for steady state streamwise velocity fields at Re=0.1 and three representative Bi . From left to right: (a) Bi=0.00 (Newtonian limit), (b) Bi=0.40 (moderate viscoplastic behavior), and (c) Bi=0.72 (strong plug region). Color scales differ between cases for clarity.
Figure 3: Sensitivity of prediction accuracy to the number of training cases, for Re=0.01 and Re=1.0 , over three training seeds. Each sample corresponds to one (Re,Bi) training case selected from the full dataset of 21 Bi per Re .
Figure 4: Representative steady state velocity profiles across the channel, comparing ground truth (solid black) to RheOFormer predictions (orange dots): (a) Re=0.01 , Bi=0.024 (mean error 7.2% ); (b) Re=0.01 , Bi=0.072 (mean error 46.4% ); (c) Re=1 , Bi=2.4 (mean error 0.4% ); (d) Re=1 , Bi=7.2 (mean error 21.8% ). Panels (a,c) correspond to Bi/Re=2.4 and panels (b,d) to Bi/Re=7.2 . At the lower Bi/Re (a,c), the predictions capture the velocity profile, closely at Re=1 and with a slightly underpredicted core at Re=0.01 . At the higher Bi/Re (b,d), the model fails to reproduce the flat plug region and systematically underestimates the flatness.
Figure 5: Comparison of input representations for predicting the plateau velocity, all trained with the relative L2 loss. Each panel compares the ground truth (solid black) with RheOFormer predictions obtained with (i) the velocity ux alone (orange, dash-dotted), (ii) ux augmented with ∂ux/∂y (magenta, dashed), and (iii) ux augmented with log∣∂ux/∂y∣ (cyan, dotted). The left column corresponds to Re=0.01 and the right column to Re=1 : (a) Bi=0.024 ; (b) Bi=0.072 ; (c) Bi=2.4 ; (d) Bi=7.2 . At Re=1 (c,d), the ∂ux/∂y 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 Re=0.01 (a,b), the ∂ux/∂y 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.
Figure 6: Effect of different loss formulations on prediction accuracy for representative Re – Bi cases. Each panel compares the ground truth velocity profile (solid black) with predictions obtained using (i) the baseline relative L2 loss (orange, dash-dotted), (ii) a plateau-weighted loss (magenta, dashed), and (iii) a Sobolev loss (cyan, dotted). The left column corresponds to Re=0.01 and the right column to Re=1 : (a) Bi=0.024 ; (b) Bi=0.072 ; (c) Bi=2.4 ; (d) Bi=7.2 . At Re=1 both modified losses raise the plateau height that the baseline underpredicts, with the Sobolev loss performing best. At Re=0.01 , 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.
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 L2 loss on ux (orange, dash-dotted), (ii) the relative L2 loss on log∣ux∣ (magenta, dashed), and (iii) the Sobolev loss (cyan, dotted). The left column corresponds to Re=0.01 and the right column to Re=1 : (a) Bi=0.024 ; (b) Bi=0.072 ; (c) Bi=2.4 ; (d) Bi=7.2 . At Re=1 both log-velocity training and the Sobolev loss reproduce the plateau height to within about 2%, clearly outperforming the baseline. At Re=0.01 , 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%).
Figure 8: Extrapolation performance of the model trained only on low Reynolds numbers ( Re=0.01,0.025,0.05,0.075,0.1 ) and evaluated on higher Re flows. (a) Mean prediction error as a function of Bi/Re for Re=0.25,0.5,0.75, and 1.0 . (b) Re=0.25 , (c) Re=0.5 , (d) Re=0.75 , and (e) Re=1.0 : representative velocity profiles, each at the Bi near the midpoint of its range.
Figure 9: Extrapolation performance of the model trained only on high Reynolds numbers ( Re=0.1,0.25,0.5,0.75,1.0 ) and evaluated on lower Re flows. (a) Mean prediction error across the Bi/Re range for Re=0.01,0.025,0.05, and 0.075 . (b) Re=0.01 , (c) Re=0.025 , (d) Re=0.05 , and (e) Re=0.075 : representative velocity profiles, each at a characteristic Bi .
Figure 10: Extrapolation performance of RheOFormer trained only on low Bi ( Bi/Re≤4 ) and evaluated on flows with larger Bi . (a) Mean prediction error as a function of Bi/Re over the testing range. (b) Re=0.01 , (c) Re=0.05 , (d) Re=0.1 , and (e) Re=1.0 : representative velocity profiles at the largest tested Bi .
Figure 11: Extrapolation performance of RheOFormer trained only on large Bi and evaluated on flows with smaller Bi . (a) Mean prediction error as a function of Bi/Re over the testing range. (b) Re=0.01 , (c) Re=0.1 , (d) Re=0.5 , and (e) Re=1.0 : representative velocity profiles at the Newtonian limit ( Bi=0 ).
Figure 12: Effect of targeted sampling on extrapolation across the Re range. (a) Mean prediction error versus Re before (dashed) and after (solid) targeted sampling, for models trained on low Re augmented with a few high- Re corner cases (blue), and for models trained on high Re augmented with a few low- Re cases (red). (b) Re=0.01 , Bi=0.068 , model trained on high Re . (c) Re=1 , Bi=0.4 , model trained on low Re . 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 Bi range. (a) Mean prediction error for each Re before (dashed) and after (solid) adding a minimal number of corner cases at extreme Bi . (b) Re=0.01 , Bi=0.068 , model trained on low Bi (blue). (c) Re=1.0 , Bi=0.4 , model trained on high Bi (red). Panels (b) and (c) compare the ground truth with predictions before and after targeted sampling.
Figure 14: Sensitivity of steady state prediction accuracy to the amount and timing of transient input. (a) Log-velocity model: error averaged over all Re as a function of the number of input snapshots k , for input sequences starting at different times ts . (b) Comparison with the persistence baseline, for k=3 snapshots starting at ts=0 : persistence (dashed), and RheOFormer trained on ux (dash-dotted) and on log∣ux∣ (solid). (c) Log-velocity model with a window of k=3 snapshots starting at different times ts : RheOFormer (solid) and persistence (dashed) for each Re .
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Figure 15: Validation of the numerical data obtained from Basilisk against analytical solutions. All simulations shown use Re=1 , Kˉ=10 , and ϵ=10−4 . Four values of Bi are shown, illustrating that the Basilisk solution captures the yielding well, even for highly plugged flows.
Department of Mechanical and Industrial Engineering, Northeastern University, Boston, MA 02115, USA · Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, PA 15213, USA
Department of Mechanical and Industrial Engineering, Northeastern University, Boston, Massachusetts 02115, USA · Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, Pennsylvania 15213, USA