Skip to main navigation Skip to search Skip to main content

Beyond language: Applying MLX transformers to engineering physics

Research output: Contribution to journal › Article › peer-review

88 Downloads (Pure)

Abstract

Transformer Neural Networks are driving an explosion of activity and discovery in the field of Large Language Models (LLMs). In contrast, there have been only a few attempts to apply Transformers in engineering physics. Aiming to offer an easy entry point to physics-centric Transformers, we introduce a physics-informed Transformer model for solving the heat conduction problem in a 2D plate with Dirichlet boundary conditions. The model is implemented in the machine learning framework MLX and leverages the unified memory of Apple M-series processors. The use of MLX means that the models can be trained and perform predictions efficiently on personal machines with only modest memory requirements. To train, validate and test the Transformer model we solve the 2D heat conduction problem using central finite differences. Each finite difference solution in these sets is initialized with four random Dirichlet boundary conditions, a uniform but random internal temperature distribution and a randomly selected thermal diffusivity. Validation is performed in-line during training to monitor against over-fitting. The excellent performance of the trained model is demonstrated by predicting the evolution of the temperature field to steady state for the unseen test set of conditions.

Original languageEnglish
Article number104871
Number of pages29
JournalResults in Engineering
Volume26
Early online date11 Apr 2025
DOIs
Publication statusPublished - Jun 2025

Bibliographical note

Copyright:
© 2025 The Authors

Keywords

  • Heat conduction
  • MLX framework
  • Physics-informed transformers

ASJC Scopus subject areas

  • General Engineering

Fingerprint

Dive into the research topics of 'Beyond language: Applying MLX transformers to engineering physics'. Together they form a unique fingerprint.

Cite this