What's in a Name? Evaluating Assembly-Part Semantic Knowledge in Language Models through User-Provided Names in CAD Files

Peter Meltzer, Joseph G. Lambourne, Daniele GrandiarXiv 2023 · DOI · OpenReview

TL;DR

This paper explores whether Large Language Models (LLMs) can understand the semantic relationships between parts in mechanical assemblies, using the natural language names designers assign to these parts in CAD files. They demonstrate that pre-trained LLMs already possess significant domain knowledge and can outperform specialized models, with further improvements seen after fine-tuning on a new CAD text dataset.

What Problem Does This Paper Address?

Mechanical engineers and designers use natural language extensively to describe requirements, document intent, and communicate ideas. Computer-Aided Design (CAD) software is a primary tool for this, where assemblies are built from parts, and these parts are given natural language names. While the geometry of parts and their relationships have been extensively studied, the rich semantic information embedded in these user-provided names has largely been ignored. This information could be invaluable for tasks like searching design repositories, building engineering knowledge bases, and improving CAD software functionality (e.g., part recommendations, automated categorization). The challenge is to effectively extract and leverage this unstructured text data to understand part-part and part-whole relationships within assemblies.

Methods

The authors propose using natural language names from CAD files as a source of semantic knowledge for LLMs. They developed three self-supervised tasks to evaluate LLM performance:

  1. Two Parts: Predicting whether two parts belong to the same assembly. This is framed as a binary classification task using a small Multi-Layer Perceptron (MLP) that takes concatenated LLM embeddings of part names as input.
  2. Missing Part: Predicting a missing part from an assembly given the remaining parts. This is framed as a classification problem where an LLM embedding of the missing part is predicted using a Set Transformer, which is invariant to the order of input parts.
  3. Document Name: Predicting the document's name (which often describes the assembly) given the set of its part names. This is also framed using a Set Transformer, similar to the "Missing Part" task.

They evaluate both pre-trained LLMs (specifically DistilBERT) and fine-tuned versions of these models on their custom dataset.

Datasets

The primary dataset used is the ABC dataset, a large corpus of CAD models from OnShape users. The authors extracted and cleaned natural language strings from part names, feature names, and document names within this dataset. This cleaned corpus was used for both training and evaluation. They also mention using standard datasets for pre-training LLMs, such as English Wikipedia and BookCorpus.

Key Insights and Ideas

  • LLMs Already Understand Mechanical Engineering: Pre-trained LLMs, despite not being specifically trained on CAD data, already possess a surprising amount of domain-specific knowledge relevant to mechanical engineering. This allows them to outperform traditional statistical methods and even specialized models like TechNet on tasks involving CAD part names.
  • User-Provided Names are Rich Sources of Information: The natural language names designers use are not just arbitrary labels; they contain valuable semantic cues about part function, relationships, and assembly context.
  • Fine-tuning Boosts Performance: Fine-tuning LLMs on the newly created CAD text corpus further improves performance across all evaluated tasks, demonstrating the value of this domain-specific data.
  • Limitations of Text-Only Models: The study highlights that relying solely on text can be limiting due to ambiguous naming conventions and the potential for "trivial solutions" (e.g., predicting "pin 3" when given "pin 1, 2, 4"). This strongly motivates the need for multi-modal approaches.

Key Results

  • "Two Parts" Task: DistilBERT (pre-trained) achieved 68.0% accuracy, outperforming TechNet (61.6%) and FastText (66.6%). Fine-tuned DistilBERT (DistilBERT-FT) reached 68.9% accuracy. Traditional Bag-of-Words (BOW) approaches performed at random (around 50%).
  • "Missing Part" Task: DistilBERT-FT achieved 32.1% accuracy, significantly outperforming TechNet (1.8%) and FastText (20.8%). This task is particularly challenging, with random chance at 0.2%.
  • "Document Name" Task: DistilBERT-FT achieved 19.3% accuracy, again outperforming TechNet (3.3%) and FastText (11.3%). This task is the most challenging, with random chance at 0.2%.
  • The authors also found that approximately 20% of OnShape document names consist of descriptive phrases, indicating a good potential for automated categorization.

Limitations and Future Work

  • Ambiguous Naming: The ABC dataset contains many ambiguous part names that provide little semantic or geometric information. This limits the effectiveness of text-only models.
  • Trivial Solutions: Highly correlated text in part names can lead to models finding "easy" solutions that don't necessarily reflect deep semantic understanding. The use of FastText as a baseline helped to identify these gains over trivial solutions.
  • Future Work: The authors strongly advocate for multi-modal models that combine text with geometry information to overcome the limitations of text-only approaches. They also plan to investigate how embeddings from multi-modal training can improve semantic clustering of geometries and support generative workflows in CAD software. They are also releasing their data and code to encourage further research.

Summary updated

Abstract

Semantic knowledge of part-part and part-whole relationships in assemblies is useful for a variety of tasks from searching design repositories to the construction of engineering knowledge bases. In this work we propose that the natural language names designers use in Computer Aided Design (CAD) software are a valuable source of such knowledge, and that Large Language Models (LLMs) contain useful domain-specific information for working with this data as well as other CAD and engineering-related tasks. In particular we extract and clean a large corpus of natural language part, feature and document names and use this to quantitatively demonstrate that a pre-trained language model can outperform numerous benchmarks on three self-supervised tasks, without ever having seen this data before. Moreover, we show that fine-tuning on the text data corpus further boosts the performance on all tasks, thus demonstrating the value of the text data which until now has been largely ignored. We also identify key limitations to using LLMs with text data alone, and our findings provide a strong motivation for further work into multi-modal text-geometry models. To aid and encourage further work in this area we make all our data and code publicly available.
BibTeX
@misc{meltzer2023what,
  author = {Peter Meltzer and Joseph G. Lambourne and Daniele Grandi},
  title = {{What's in a Name? Evaluating Assembly-Part Semantic Knowledge in Language Models through User-Provided Names in CAD Files}},
  year = {2023},
  eprint = {2304.14275},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.14275},
}
Figure