In-context learning as a retraining-free paradigm for constitutive modeling.

Constitutive modeling is fundamental to computational solid mechanics, yet most existing approaches remain material-specific and require retraining or recalibration when materials change. Here we introduce In-Context Modeling (ICM), a retraining-free paradigm for constitutive modeling that infers constitutive behavior from physical context rather than material-specific optimization. Using hyperelasticity as a testbed, we demonstrate that ICM can be trained once on equilibrium deformation fields
Constitutive modeling is fundamental to computational solid mechanics, yet most existing approaches remain material-specific and require retraining or recalibration when materials change. Here we introduce In-Context Modeling (ICM), a retraining-free paradigm for constitutive modeling that infers constitutive behavior from physical context rather than material-specific optimization. Using hyperelasticity as a testbed, we demonstrate that ICM can be trained once on equilibrium deformation fields spanning diverse materials, geometries, and boundary conditions, enforcing physical equilibrium without stress labels. After training, the same model can be directly deployed on previously unseen hyperelastic materials without retraining. At inference, ICM treats a small set of nonuniform strain fields as physical context to generate constitutive response in a single forward pass. Numerical benchmarks and experimental validation demonstrate accurate stress prediction across out-of-distribution materials and boundary-value problems, together with substantial reductions in deployment cost compared with per-material learning approaches. These results establish in-context learning as a retraining-free paradigm for constitutive modeling, particularly valuable for heterogeneous biological tissues such as the brain, and suggest a pathway toward foundation models for computational mechanics.




