This section describes the FMforME system architecture, the six defect detection predicates, the Self-Examine correction mechanism, the Fusion 360 CAD execution layer, and the experimental design.
2.2. System Architecture
FMforME employs a three-layer pipeline architecture, illustrated in
Figure 1. Data flows sequentially from natural language input through LLM generation, runtime constraint verification, and CAD execution, with a feedback loop from Layer 2 back to Layer 1 when violations are detected.
Layer 1—LLM Generation. An LLM backend receives a natural language part description and a structured system prompt containing ten physical validity rules. The system prompt explicitly specifies: Poisson ratio must be strictly within (0, 0.5), Young’s modulus must use GPa units (not Pa), density in kg/m
3, yield strength must be less than tensile strength (
), all dimensions must be positive, boundary condition nodes must differ from load application nodes, and at least one boundary condition must specify
type = "fixed" covering all six rigid-body degrees of freedom. For each backend, the API is called with structured JSON output enforcement and
temperature = 1.0 to promote output diversity [
41]. The output is a ModelSpec JSON object whose required interface fields are summarized in
Table 1; the complete JSON example is provided in
Supplementary Material. The contract includes
part_type,
dimensions,
material,
boundary_conditions,
loads, and
mesh.
The Monitor will then validate each field against the six defect predicates:
poisson_ratio is checked to be within
(D5), dimensions are verified positive (D2), boundary-condition coverage is assessed (D1), load and BC node sets are checked for conflicts (D4), mesh element type and quality are validated (D6), and geometric ratios are checked for stress concentration risks (D3). If any ERROR-level violation is detected, the Self-Examine feedback loop triggers and the LLM receives a structured correction prompt; an illustrative feedback message is provided in
Supplementary Material.
For controlled experiments, the generator supports seeded defect injection: after JSON generation, a specified field path (e.g., material.poisson_ratio) is overwritten with a controlled invalid or degraded value. For scalar and local defects (D1, D2, D3, D5, and D6), the injected field directly determines the target condition. For the relational D4 load–boundary-condition conflict, the injection is additionally audited after generation by checking whether the resulting load and boundary-condition node sets actually intersect.
Layer 2—Runtime Monitor. The Monitor executes six defect detection predicates (D1–D6) in priority order D5 → D4 → D1 → D2 → D3 → D6. This order reflects detectability and engineering importance: material violations (D5) are the most common AI errors and should be caught first [
2]. Each predicate outputs
Violation objects containing defect ID, severity (ERROR or WARN), human-readable description, the JSON field path of the violation, the actual value, and an engineering standard reference. The aggregated
ViolationReport includes a boolean
passed flag: any ERROR-level violation causes the report to fail.
Layer 3—CAD Execution. Validated specifications are written to a shared bridge directory (
~/fusion_bridge/clean_spec.json). A Fusion 360 add-in written in Python 3.12.2 continuously monitors this directory. Upon detecting a new specification, it constructs parametric solid models using Autodesk Fusion 360 build v.2703.1.11 (May 2026 Product Update) and the native
adsk.fusion API. Results are written back as
result.json. The add-in uses a background thread for file-system polling combined with Fusion’s CustomEvent mechanism to ensure all API calls execute on the main thread [
42].
The layer interface protocol is specified as follows. During LLM generation, the input is a natural-language part request plus the structured system prompt, and the expected output is a raw JSON string conforming to the ModelSpec contract. Empty or malformed responses are recorded as SYSTEM-level parse failures and are not passed to the Monitor because no valid ModelSpec exists.
After parsing, the field normalization step converts the JSON object into a normalized ModelSpec dictionary. Missing optional containers are represented as empty dictionaries or arrays where possible, and variant field names are mapped to canonical keys before predicate evaluation. The Runtime Monitor then consumes the normalized ModelSpec and returns a ViolationReport containing passed, n_errors, n_warnings, and a list of violations. ERROR level violations block CAD execution and trigger Self-Examine, whereas WARN-only reports are logged and allowed to proceed.
For Self-Examine, the original prompt is combined with structured violation feedback and sent back to the LLM to generate a new ModelSpec candidate. The loop terminates when no ERROR remains or when the retry budget is exhausted. Finally, Monitor-passed specifications are written to clean_spec.json for Fusion 360 execution, and the CAD add-in writes the build outcome to result.json. CAD build failures, when they occur, are logged as Layer 3 failures rather than Monitor failures, keeping generation, verification, and CAD build failure modes distinguishable.
The complete control flow of this interface is summarized in Protocol Box 1. It makes explicit which layer produces each artifact, which return paths are blocking, and where parse, verification, retry, and CAD execution failures are separated.
Input: natural-language request P, retry budget R
Output: SUCCESS, SYSTEM_ERROR, SELF_EXAMINE_FAILED, or CAD_ERROR
2.3. Defect Detection Predicates (D1–D6)
The six defect predicates form the core of the Monitor’s verification logic.
Table 2 summarizes the taxonomy with engineering standard references.
The use of six predicates was not arbitrary. Candidate checks were included only when they satisfied four criteria: (1) the defect can cause CAD construction failure, singular or ill-conditioned FEA models, or physically unreliable downstream interpretation; (2) the defect can be evaluated deterministically from ModelSpec fields before CAD execution; (3) the rule has support from engineering standards, numerical-analysis theory, CAD/FEA quality-control literature, or documented LLM engineering failure modes; and (4) the defect represents a distinct failure dimension rather than a minor variant of another rule. Fewer predicates would merge materially different failure mechanisms—for example, treating material admissibility, boundary-condition sufficiency, and mesh topology as one generic validity check would make the feedback less actionable for Self-Examine correction. Conversely, adding many narrowly specialized predicates at this stage, such as manufacturability tolerances, assembly interference, contact definitions, fatigue design codes, or domain-specific safety factors, would require part- or industry-specific assumptions that are not consistently available in the current ModelSpec and would reduce portability across the tested component families. The resulting six predicates therefore provide a deliberately compact middle ground: they cover boundary completeness, dimensional validity, geometric stress-risk features, load–constraint consistency, material admissibility, and mesh topology while leaving manufacturing, assembly, and domain-code checks for future extensions.
D1—Unconstrained Degrees of Freedom. This predicate addresses rigid body motion, the fundamental FEA error in which insufficient boundary conditions leave the stiffness matrix
singular. If no boundary conditions are defined, D1 raises an ERROR. For non-fixed constraints, the Monitor enumerates missing translational and rotational DOF and reports a WARN. In the current implementation, a
type = "fixed" constraint is treated as strong evidence of full support, an abstraction whose boundary is examined in the controlled boundary-case analysis below [
37,
38].
D2—Negative Stiffness. Per Bathe’s FEM theory [
37], the stiffness matrix
requires positive definiteness. Zero or negative cross-sections produce non-positive entries on
’s diagonal, leading to solver failure or unphysical displacements. D2 scans all scalar dimension fields (nominal_diameter, thickness, bore_diameter, outer_diameter, ball_diameter, etc.). Negative values always trigger ERROR. Zero values trigger ERROR for structurally critical parameters and WARN for secondary parameters. For shaft-type parts, adjacent segment diameter ratios exceeding 10:1 trigger WARN, as extreme cross-section changes produce stress concentration [
39].
D3—Stress Singularity. Based on classical linear elastic fracture mechanics [
39], D3 detects geometric features that cause unbounded stress in linear elastic FEA. For all part types: zero fillet radius at re-entrant corners triggers WARN (elastostatic stress at a mathematically sharp corner is theoretically infinite); mesh maximum aspect ratio exceeding 50 triggers WARN. For ball bearings specifically, six additional rules apply:
ball_count = 0 triggers ERROR (no load transfer path);
ball_count < 3 triggers WARN;
ball_diameter triggers ERROR;
ball_diameter exceeding the radial gap between inner and outer races triggers ERROR (ball cannot physically fit);
ball_diameter exceeding 80% of radial gap triggers WARN (insufficient raceway wall thickness); and
bore_diameter≥
outer_diameter triggers ERROR (impossible bearing geometry per ISO 15 [
43]).
D4—Load-Boundary Condition Conflict. Per ASME V&V 10-2019 Section 5.1 [
38], a load applied at a constrained node is absorbed by the constraint and contributes nothing to the structural response. D4 computes the set intersection of node identifiers appearing in both
boundary_conditions and
loads arrays and reports a WARN for any conflict.
D5—Material Property Violation. This is typically the most frequently triggered predicate, as LLMs commonly generate physically impossible material parameters [
2,
3]. Default material bounds—derived from standard engineering references [
44]—are:
GPa,
(strict thermodynamic constraint),
(100, 25,000) kg/m
3,
MPa,
MPa. The first three parameters trigger ERROR when out of range, while isolated yield-strength or tensile-strength range violations trigger WARN because they may reflect material-selection uncertainty. The cross-field consistency check
is stricter: if yield strength is not lower than ultimate tensile strength, D5 reports an ERROR because the material model is physically inconsistent.
D6—Mesh Topology Error. This predicate validates mesh quality against the Verdict geometric quality library [
40], which operationalizes Knupp’s algebraic mesh quality metrics [
45]. A negative or zero minimum Jacobian determinant indicates inverted or degenerate elements and triggers ERROR. Values below 0.3 and 0.5 trigger progressively less severe WARN messages. Element types are checked against the canonical set {
tet4,
tet10,
hex8,
hex20,
shell3,
shell4,
wedge6}; solver-specific aliases such as
C3D8R are logged as WARN rather than blocked, because they are representation mismatches rather than necessarily invalid meshes.
2.4. Self-Examine Correction Mechanism
The Self-Examine subsystem implements an iterative refinement loop, adapting the Self-Refine paradigm [
16] and the ReAct reasoning-acting framework [
17] for use in the engineering domain. Unlike generic self-refinement approaches, the engineering context demands that feedback be (1) grounded in verifiable standards, (2) cite specific JSON field paths, and (3) provide actionable parameter-level guidance. The CRITIC framework’s insight [
18]—that external, deterministic verification signals are more reliable than self-evaluation—is directly applicable here: our Monitor serves as the external verifier, generating deterministic violation reports that guide the next LLM attempt.
When the Monitor reports failure, the format_violation_feedback() function constructs a structured correction prompt containing five sections: (i) a header indicating rejection by the Runtime Monitor; (ii) a list of CRITICAL ERRORS, each annotated with defect ID (D1–D6), natural language description, the violating JSON field path, the actual value, and the engineering standard reference (e.g., ASME V&V 10-2019 Section 4); (iii) a list of WARNINGS with identical annotation; (iv) a FIX INSTRUCTIONS section providing specific, actionable guidance for each defect type (e.g., “D5: ensure poisson_ratio is strictly between 0 and 0.5; for steel, use 0.3”); and (v) an output format reminder. The feedback is appended to the original system prompt and the LLM regenerates the entire ModelSpec.
The loop continues until either the specification passes (no ERROR-level violations) or the maximum retry count (3, corresponding to one initial attempt plus up to three correction cycles) is exhausted. Per the diminishing-returns pattern documented by Madaan et al. [
16], the majority of improvements occur within the first 1–2 refinement steps.
The retry-limit choice was evaluated empirically using the recorded Self-Examine histories. For V4-Flash, 54 cases triggered correction: 49 were resolved on the first retry, an additional 3 on the second retry, and no additional success was observed on the third retry. The two cases that exhausted all three retries continued to report ERROR-level boundary-condition coverage issues across attempts, with load/support consistency warnings appearing in the same specifications. For V4-Pro and Qwen 3.6 Flash, all 46 triggered cases in each backend were corrected within a single retry. Gemini 3.5 Flash triggered correction in 47 cases: 46 were resolved on the first retry and one additional case was resolved on the second retry. These distributions support max_retries = 3 as a bounded cost setting that captures the observed correction gains while retaining a small margin for difficult multi field cases.
Table 3 summarizes the sensitivity analysis based on recorded Self-Examine histories. Setting the retry budget to one correction cycle already captures nearly all observed gains. In V4-Flash, 49 of 54 triggered cases were fixed after one correction cycle, while 3 additional cases required a second cycle; in Gemini 3.5 Flash, 1 of the 47 triggered cases also required a second cycle. Allowing a third correction cycle did not recover any additional successful case in the recorded histories.
The two permanent V4-Flash failures were further inspected to clarify why additional retries did not resolve them. Both cases remained blocked by D1 boundary-condition coverage after three correction attempts. The failed revisions did not require changing a single scalar value; instead, they required coordinated changes across the boundary-condition array, explicit degree-of-freedom coverage, and in one case the load/support node-set relation. This explains why the field-level feedback was sufficient for scalar material, dimensional, and mesh corrections but less effective for these multi-field constraint repairs.
Table 4 summarizes these two cases.
2.6. Experimental Design
A total of 141 test cases were designed and executed for each of four LLM backends, yielding 564 total test executions across the experiment. The test suite comprised two complementary groups, with each seeded defect configuration repeated twice ( replicates) to assess detection consistency.
Seeded Defect Tests (96 cases per model). After LLM generation, a controlled defect condition is injected into the ModelSpec JSON at a specified field path (e.g., injecting poisson_ratio = 0.6 for a D5 material violation test). For scalar or local predicates, the injected value directly creates the target invalid or degraded condition. For D4, which depends on the relation between loads and boundary_conditions, the attempted injection is audited by recomputing the node-set intersection after injection; only cases in which an intersection is actually present are treated as realized D4 conflicts for Monitor detection scoring. The test is scored as a successful detection if the expected realized defect type appears in the Monitor’s violation list for the first (pre-correction) generation attempt. A total of 48 unique seeded configurations were designed, with each configuration repeated twice ( replicates), yielding seeded trials per model. The 48 configurations were evenly distributed across the six defect types (8 unique configurations per defect type × 2 replicates = 16 trials per defect). To ensure coverage of distinct geometric contexts, the configurations within each defect type were assigned to the three part types in proportion to their physical relevance: for example, D3 (stress singularity) configurations emphasized ball bearings and L-brackets where fillet radii and geometric ratios are critical, while D4 (load-BC conflict) configurations spanned all three part types. A complete listing of all 48 seeded configurations with their defect types, injected field paths, part-type assignments, and expected severity levels (ERROR/WARN) is provided in the accompanying data repository.
The 48 configurations were generated using the seeded injection logic implemented in the FMforME test pipeline rather than by random sampling. Each configuration specifies five items: a defect category (D1–D6), a target ModelSpec field path, an injected value or replacement rule, an expected severity level (ERROR or WARN), and the applicable part family. The LLM first generates a baseline ModelSpec; the injector then overwrites the selected JSON field to create a controlled invalid or degraded specification. The seeded detection score is therefore computed on the injected first attempt ModelSpec, allowing the same engineering failure mode to be tested across different LLM baseline outputs.
The 48 unique configurations follow a balanced coverage design: each of the six defect families contains eight configurations. Within each family, the configurations vary the field path, perturbation magnitude, severity level, and part relevance. For example, D5 covers material fields such as Poisson’s ratio, Young’s modulus, density, and strength consistency; D1 covers absent boundary conditions, partial DOF constraints, and nominal fixed constraints with incomplete DOF information; D4 covers node set conflicts between loads and boundary_conditions; D2 and D3 cover invalid dimensions, geometric ratios, fillet radius, and bearing feasibility constraints; and D6 covers element type vocabulary, minimum Jacobian, and aspect ratio.
The selection criteria were informed by both recent LLM assisted engineering studies and conventional CAD/FEA quality control. Alexiadis and Ghiassi showed that LLMs can drive geometry and mesh generation as well as multiphysics setup, while still encountering errors in complex geometry and boundary definition [
3]. Shafiq et al. reported performance differences across LLMs in geometry generation, Boolean operations, simulation file completeness, material properties, and boundary conditions [
2]. Baker et al. identified weak spatial and geometric reasoning as a major bottleneck for LLMs in mechanical engineering [
11]. In parallel, the CAD quality taxonomy of Gonzalez-Lluch et al. provides a basis for relating geometric, topological, and semantic model quality issues to downstream CAD reliability [
23]. Thus, the seeded suite should be interpreted as a structured coverage sample of known CAD/FEA failure modes, not as a random sample of all possible LLM errors; broader statistical representativeness would require larger logs of naturally occurring LLM-CAD failures.
To make this representativeness claim more explicit, the 48 configurations should be read as a safety-coverage benchmark rather than as an empirical frequency model. External quantitative benchmarks support this coverage-oriented interpretation. Shafiq et al. reported solver-input success rates of 78–88%, but only 70% success for simple geometry generation, 56% for assembly geometry generation, and no successful Boolean-operation implementation in their evaluated assembly tasks [
2]. FEABench similarly shows that even tool-using LLM agents do not always produce executable engineering API calls, with the best reported strategy reaching 88% executable COMSOL API generation [
14]. Text2CAD-Bench provides a larger text-to-parametric-CAD reference set of 600 human-curated examples and reports that performance degrades substantially as topology and CAD-feature complexity increase [
15]. The present natural-generation logs provide an internal quantitative check on this coverage: across 180 natural tests, D6 terminology or mesh warnings appeared 133 times, D1 boundary-condition warnings or errors appeared 31 times, one D4 load–support warning appeared, and V4-Pro produced 14 pre-Monitor parse failures. In contrast, D2, D3, and D5 did not appear spontaneously in the 45 natural tests per model, but they were retained in the seeded suite because invalid dimensions, stress-concentration geometry, and material-property violations are well-established high-consequence CAD/FEA failure modes. Therefore, the seeded suite combines observed natural LLM-CAD failure modes with safety-critical but less frequent engineering invalidities, while not claiming to reproduce the population frequency of real-world LLM-CAD errors.
Natural Generation Tests (N1–N45, 45 cases per model). Fifteen independent natural generation runs were performed for each of the three part types (bolt, L-bracket, and ball bearing), yielding natural tests per model. No manual modification was applied to these specifications. The natural generation design uses the same number of trials for all three component families to avoid part-type bias in the reported natural issue rate and pass-rate estimates. These tests serve two purposes: measuring the frequency with which LLMs spontaneously produce specifications containing WARN or ERROR violations or unparseable outputs, and assessing cross-model differences in output quality under identical prompting and decoding conditions.
Test Execution Procedure. The LLM calls, seeded defect injection, Monitor evaluation, Self-Examine retries, result logging, and metric aggregation were executed by the experimental Python pipeline. No manual visual judgment was used to decide whether a predicate detected an injected defect; detection was scored by matching the expected seeded defect label against the Monitor’s first-attempt violation report. For Layer 3, Fusion 360 imposes an application-level execution constraint: the CAD add-in must be started inside the Fusion 360 environment before it can receive events through the Autodesk API. Once the add-in is active, it automatically reads each Monitor-approved clean_spec.json, constructs the parametric model through the Fusion API, and writes the build outcome to result.json. Thus, the experimental detection, correction, and scoring stages are algorithmic, while the Fusion-side launch requirement reflects the host Autodesk Fusion 360 CAD software environment (build v.2703.1.11, May 2026 Product Update).
Statistical Methodology. For each defect category and overall detection rate, Wilson score 95% confidence intervals were computed (suitable for binomial proportions, particularly near 0 or 1). Because the Monitor is deterministic rather than a stochastic classifier, reliability is assessed through observed detection rates, confidence intervals, parse-failure rates, boundary-case analysis, and downstream Fusion 360 build outcomes rather than through chance-level significance tests.
The experiment configuration evaluated four LLM backends: DeepSeek-V4-Flash, DeepSeek-V4-Pro, Qwen 3.6 Flash, and Gemini 3.5 Flash. These are the model versions used throughout the experiment and reported in the corresponding execution logs. The experimental pipeline used Python 3.12.2, and Layer 3 used Autodesk Fusion 360 build v.2703.1.11 (May 2026 Product Update). All four backends used temperature 1.0 and max_tokens = 2048; Self-Examine was enabled with max_retries = 3; and the Monitor operated in non-strict mode, in which critical physical violations are classified as ERROR and borderline cases as WARN. These backends were selected because they were accessible during the project, supported structured JSON generation or OpenAI compatible calling conventions, and represented practical deployment profiles spanning low-latency, larger Pro-tier, OpenAI-compatible, and independent third-party model-family settings. From an engineering deployment perspective, DeepSeek and Qwen style models are attractive because of their relatively low operating cost and the availability of deployment paths that are more compatible with private or on premise engineering data workflows than closed cloud only models; Gemini 3.5 Flash provides an independent cross-family reference point within the same benchmark design. The goal of the experiment was to verify that FMforME can operate as a backend-independent verification layer across different API interfaces and output behaviors, rather than to rank all available LLMs. Broader evaluation on GPT, Claude, and additional local or proprietary model families remains future work. Extending the comparison to GPT, Claude, and other proprietary or local model families would require the same balanced benchmark design, including identical seeded configurations, natural prompts, retry settings, parse-failure accounting, Fusion 360 execution procedure, and latency logging. The present four-backend experiment should therefore be interpreted as an initial cross-interface validation of the framework rather than as a comprehensive model leaderboard. Layer 1 was invoked for all 564 test cases. Parseable outputs proceeded to Layer 2 Monitor verification and Self-Examine correction when required, while Monitor-passed specifications proceeded to Layer 3 Fusion 360 parametric modeling. All experiments were conducted on a Windows 11 system with an Intel Core i7 processor and 16 GB RAM. The complete source code and experimental data are available in the accompanying repository.