AdditiveLLM: Large language models predict defects in metals additive manufacturing

P. S. Pak, Amir Barati Farimani

Introduction

Laser Powder Bed Fusion (L-PBF) is a cornerstone of metal additive manufacturing, yet it remains plagued by defects stemming from suboptimal process parameters. Traditional methods for defect prediction—ranging from physical simulations to experimental trial-and-error—are either computationally prohibitive or excessively costly. This paper introduces AdditiveLLM, a suite of Large Language Models (LLMs) fine-tuned to predict defect regimes directly from text-based process parameters. By framing defect prediction as a multi-label classification task, the researchers achieved over 93% accuracy, demonstrating that LLMs can serve as efficient surrogate models for complex physical processes.

The Challenge of Defect Prediction

In L-PBF, parameters such as laser power, scan speed, and hatch spacing must be perfectly balanced. Deviations lead to three primary defect regimes: Keyholing (deep, unstable melt pools), Lack of Fusion (unmelted powder), and Balling (surface instabilities). Traditionally, identifying these regimes requires domain expertise or heavy fluid dynamic simulations to determine melt pool dimensions.

High-level conceptual flow from process parameters to defect labels via melt pool dimensions.

Methodology: LLMs as Surrogate Models

The core innovation of AdditiveLLM is treating physical parameter sets as text. The researchers fine-tuned four architectures—DistilBERT, SciBERT, Llama-3.2-1B, and T5-Small—to map input parameters to one or more of the four labels (Keyholing, Lack of Fusion, Balling, or None). They utilized binary cross-entropy loss to accommodate overlapping defects, such as a build suffering from both Keyholing and Lack of Fusion simultaneously.

Two training formats were evaluated:

  1. Baseline: A structured format using [SEP] tokens to isolate parameters (e.g., <material>[SEP]<power>...).
  2. Prompt: Natural language queries (e.g., "Can you detail the potential imperfections...") generated via ChatGPT to simulate real-world user interaction.

Dataset Construction and Labeling

The models were trained on a dataset of 2,779 data points from the MeltpoolNet database and FLOW-3D simulations, covering materials like Ti-6Al-4V and SS316L. These raw dimensions were converted into defect labels using established physical criteria based on melt pool width, depth, and length ratios.

Detailed workflow showing the generation of the Process Parameter Defect Dataset and the LLM fine-tuning process.

To ensure robustness, the data was augmented into two massive sets: a Baseline Dataset (~724,000 pairs) and a Prompt Dataset (over 70 million pairs) using 100 unique natural language templates to simulate diverse user queries.

Key Results and Insights

  • Performance Leaders: Llama-3.2-1B dominated the baseline tasks with 93.68% accuracy after 25 epochs. On natural language prompts, T5-Small proved surprisingly resilient, leading with 88.13% accuracy.
  • Syntax Sensitivity: Models trained on structured data failed when presented with natural language, highlighting a reliance on syntax over pure numerical reasoning. This suggests that models must be exposed to conversational variety to be useful in real-world applications.
  • Scaling and Latent Space: Larger models like Llama 3 showed continuous improvement with training time, while smaller models plateaued. Principal Component Analysis (PCA) revealed that while Balling is easily distinguished in the model's latent space, Keyholing and Lack of Fusion share significant overlap, likely due to the specific assumptions used during data augmentation.

Limitations and Future Work

While promising, AdditiveLLM faces challenges with numerical precision. Standard LLM tokenizers often struggle with continuous values, which can bottleneck performance on precise physical parameters. Future research will focus on specialized numerical tokenizers and expanding the model's reach to a broader array of materials and manufacturing processes.

Summary updated

Abstract

In this work we investigate the ability of large language models to predict additive manufacturing defect regimes given a set of process parameter inputs. For this task we utilize a process parameter defect dataset to fine-tune a collection of models, titled AdditiveLLM , for the purpose of predicting potential defect regimes including Keyholing , Lack of Fusion , and Balling . We compare different methods of input formatting in order to gauge the model’s performance to correctly predict defect regimes on our sparse Baseline dataset and our natural language Prompt dataset. The model displays robust predictive capability, achieving a Baseline accuracy of 94% and Prompt accuracy of 82% when asked to provide the defect regimes associated with a set of process parameters. The incorporation of natural language input further simplifies the task of process parameters selection, enabling users to identify optimal settings specific to their build. • Explores usage of LLMs to predict process parameter dependent defects. • Compares fine-tuning of 4 LLMs including DistilBERT, SciBERT, Llama, and T5. • Achieves an accuracy of 93% for sparse inputs and 88% for NLP inputs. • Utilizes dataset comprised of simulation and experimental data.
BibTeX
@inproceedings{pak2025additivellm,
  author = {P. S. Pak and Amir Barati Farimani},
  title = {{AdditiveLLM: Large language models predict defects in metals additive manufacturing}},
  booktitle = {Additive},
  year = {2025},
  doi = {10.1016/j.addlet.2025.100292},
}
Figure