Failure Modes and Data-Efficient Remedies for Transformer-Based Prediction of Viscoplastic Flows

Maedeh Saberi, Hugo Franca, Maziyar Jalaal, Safa JamaliarXiv 2026

Imagine you’re trying to squeeze the last bit of toothpaste out of a tube or watching ketchup stubbornly refuse to leave the bottle. You are witnessing the complex world of viscoplastic flows. These materials are "dual-natured": they act like solid chunks (plugs) until you apply enough stress, at which point they suddenly flow like liquids.

Predicting how these fluids behave is a nightmare for traditional computers because of the sharp, "nonsmooth" transitions between the solid-like and liquid-like regions. This paper explores how to use AI—specifically a Transformer-based model called RheOFormer—to predict these flows faster and more efficiently than ever before.

TL;DR

AI models usually struggle with the "sharp" boundaries found in materials like cement or toothpaste, often smoothing them out into a blurry mess. This paper identifies exactly why these "failure modes" happen and introduces clever mathematical fixes—like logarithmic scaling and "targeted sampling"—to achieve high-accuracy predictions using a surprisingly tiny amount of data.

What Problem Does This Paper Address?

In the world of fluid dynamics, we have "Newtonian" fluids (like water) that are relatively predictable. Then we have "Bingham" fluids (viscoplastic), which have a yield stress. Below a certain threshold, they don't move at all; above it, they flow. This creates a "plug" in the middle of a pipe where the fluid moves as one solid block.

Standard AI models suffer from spectral bias: they are naturally good at learning smooth, low-frequency patterns but terrible at capturing sharp "jumps" or flat plateaus. When an AI tries to predict a Bingham flow, it often underestimates the speed of the plug or fails to find the exact boundary where the fluid starts to shear. The authors wanted to find out if they could "teach" a Transformer to respect these physics without needing a supercomputer's worth of training data.

Methods

The researchers used RheOFormer, a neural operator based on the Transformer architecture (the same tech behind ChatGPT, but for physics).

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 Section 3 uses one representation and one objective; all other architectural and optimization settings are held fixed. The fields shown are for 𝑅𝑒= 0.25, 𝐵𝑖= 0.5.

To fix the AI's "blurry" vision, they introduced three key remedies:

  1. Logarithmic Representation: Instead of feeding the AI raw velocity numbers, they used the logarithm of the velocity. This "zooms in" on the tiny differences in the slow-moving regions, making the "plug" much more visible to the model.
  2. Sobolev Loss: Instead of just telling the AI to get the velocity right, they penalized it for getting the gradients (the rate of change) wrong. This forces the model to pay attention to the sharp edges.
  3. Targeted Sampling: Instead of throwing thousands of random examples at the AI, they strategically picked "corner cases"—the extremes of the parameter space—to act as anchors for the model's understanding.

Datasets

The study focused on 2D Bingham channel flow.

  • Source: Data was generated using Basilisk, a high-fidelity numerical solver.
  • Parameters: They varied the Reynolds number ($Re$, which relates to velocity/inertia) and the Bingham number ($Bi$, which relates to yield stress).
  • Scale: The dataset included 9 different $Re$ values and 21 $Bi$ values per $Re$, creating a comprehensive map of different flow regimes.

Key Insights and Ideas

  • The "Squinting" Effect: Standard models fail in "plug-dominated" flows because the velocity gradients are nearly zero. To the AI, these regions look like "nothing is happening," so it ignores them. Log-scaling acts like a magnifying glass for these subtle physics.
  • Data Efficiency is Real: You don't need a mountain of data. The authors found that just five well-chosen training cases were enough to capture 90-95% of the physics for a given regime.
  • The Extrapolation Boss Fight: AI is notoriously bad at predicting things it hasn't seen (extrapolation). If you train it on slow flows, it fails on fast ones. However, adding just 12 strategically selected "anchor" cases at the edges of the map allowed the model to generalize across the entire range.
  • Time is a Luxury: The model doesn't need to see the whole "movie" of the fluid starting to move. A single, partially developed snapshot from the very beginning is enough for the Transformer to "guess" the final, steady-state flow.

Key Results

The improvements were dramatic. While the baseline AI struggled significantly with plug flows, the "remedied" versions soared:

  • Accuracy: Using log-velocity representations reduced the mean error to a mere 1%.
  • Plug Recovery: In cases where the baseline model was off by 20-40% in predicting the "plug" height, the Sobolev-loss and log-input models matched the ground truth almost perfectly.
Figure 2: Comparison of ground truth data (top row) vs. RheOFormer predictions (bottom row) for steady state streamwise velocity fields at 𝑅𝑒= 0.1 and three representative 𝐵𝑖. From left to right: (a) 𝐵𝑖= 0.00 (Newtonian limit), (b) 𝐵𝑖= 0.40 (moderate viscoplastic behavior), and (c) 𝐵𝑖= 0.72 (strong plug region). Color scales differ between cases for clarity.
  • Efficiency: The model outperformed "persistence" (the trivial guess that the fluid won't change from its current state) by a factor of 40-50x during the early stages of flow development.

Limitations and Future Work

While successful, this study was a "controlled laboratory" experiment:

  • Simple Geometry: They used a straight channel. Real-world problems (like 3D printing or lava flows) involve complex, changing boundaries.
  • Steady State: The focus was on the final "resting" state of the flow. Predicting highly turbulent or chaotic transitions remains a future challenge.
  • Next Steps: The authors suggest applying these log-transform and sampling strategies to more complex scenarios, like fluids with "memory" (viscoelasticity) or flows with free surfaces (like a pile of wet concrete spreading out).

If you've ever been frustrated by a bottle of ketchup, take heart: we're finally teaching AI how to understand the struggle.

Summary updated

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.
BibTeX
@misc{saberi2026failure,
  author = {Maedeh Saberi and Hugo Franca and Maziyar Jalaal and Safa Jamali},
  title = {{Failure Modes and Data-Efficient Remedies for Transformer-Based Prediction of Viscoplastic Flows}},
  year = {2026},
  eprint = {2611.28267},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.28267},
}
Figure