A research team from MIT, IBM, and Red Hat has developed GIFT, a method that turns "near-miss failures" produced by AI that generates CAD programs from images into new training data. In the main evaluation using GenCAD-Code, average IoU—a measure of shape agreement—rose from 0.698 to 0.782. The team reports that GIFT matched the performance of a conventional model that generates 10 candidates at inference time and picks the best one, using only about 2 candidates. However, this doesn't mean the computation has disappeared. This is research that lightens the search burden at usage time by paying the cost of pre-generating roughly 1 million candidates and filtering them through a CAD kernel upfront.
GIFT is not a new CAD application or a foundation model. Building on its predecessor, CAD-Coder, it is a data augmentation framework that feeds correct solutions and failures discovered by the model during inference back into supervised learning. MIT announced the research results on July 16, 2026, and states that the work was presented at the International Conference on Machine Learning.
Adding Alternative Code That Produces the Same Shape as Correct Answers
Creating editable CAD from an image requires more than just producing a 3D shape. CAD-Coder, the foundation on which GIFT is built, takes a single image and a fixed prompt as input and generates CadQuery Python code. Running the code constructs a solid with parameters in B-Rep or STEP format. The key difference from methods that directly output a fixed mesh is that designers can later modify dimensions and processing steps.
Conventional supervised learning has a weakness in linking images and correct code one-to-one. Even for the same solid, there isn't just one sequence of combining extrusions and cuts. Yet if there's only one reference code, even a geometrically correct alternative code gets treated as an incorrect answer. GIFT executes the generated code in OpenCASCADE and measures IoU against the correct shape, judging based on the resulting shape rather than the string of code.
There are two training signal streams. GIFT-REJECT retains candidates with IoU between 0.9 and 0.99 as high-quality alternative solutions, treating them as additional correct code for the original image. Rather than selecting a single exact match and finishing, this allows learning a broader distribution of programs that arrive at the same shape.
GIFT-FAIL handles executable failures with IoU between 0.5 and 0.9. It doesn't teach the model to memorize failed code as correct. Instead, it builds an incomplete 3D shape from the failed code, converts it back into an image, and pairs this "image of an incorrect shape" with the original correct code. The model learns to recover the correct code from input that includes gaps or misalignments in the shape. This is a design that separates diversifying successful examples from recovery from failure as distinct teaching signals.
From 0.698 to 0.782: Breaking Down the Fifth of Inference Candidates
In tests with GenCAD-Code, ordinary supervised fine-tuning (SFT) achieved an average IoU of 0.698. Adding general data augmentation only brought it up to 0.710. Meanwhile, GIFT-REJECT, which uses high-quality alternative solutions, reached 0.742; GIFT-FAIL, which uses failure shapes, reached 0.761; and GIFT, which combines both, reached 0.782.
| Training Method | Average IoU |
|---|---|
| SFT | 0.698 |
| SFT + General Data Augmentation | 0.710 |
| GIFT-REJECT | 0.742 |
| GIFT-FAIL | 0.761 |
| GIFT | 0.782 |
The rise from 0.698 to 0.782 represents an increase of 0.084, a relative improvement of about 12%. Since combining both mechanisms outperforms either one alone, increasing correct alternative solutions and specifically learning from recoverable failures are complementary.
The figure of "reducing inference computation by approximately 80%" is not a value directly measured from processing time or total GPU hours. In the paper's inference scaling table, SFT reaches an IoU of 0.807 when generating 10 candidates and selecting the best. GIFT achieved 0.802 with 2 candidates and 0.809 with 3 candidates. Since a level nearly equivalent to 10 candidates is reached with about 2 candidates, the research team expresses this as approximately 80% less computation on a candidate-count basis.
This difference also showed up in single-shot generation. The "amortization gap"—the performance difference between generating 1 candidate versus 10—shrank from 15.5% for SFT to 5.2% for GIFT. It's more accurate to view this as approaching a model that readily produces high-quality code in fewer attempts, rather than a model that searches for the correct answer through repeated trials.
Offline Computation: Pre-Generating 1 Million Candidates
In exchange for reducing candidates at usage time, GIFT shifts the computational burden to data creation before training. Starting from approximately 80,000 training images, the research team combined 5 stages ranging from 8 to 128 candidates per image with 29 types of generation settings, producing roughly 1 million raw candidates. By executing and comparing shapes with a CAD kernel and selecting alternative solutions and recoverable failures, the fine-tuning dataset grew from approximately 163,000 pairs to approximately 370,000 pairs.
Fine-tuning used 8 units of 80GB A100 GPUs, with a maximum of 10 epochs set. According to the paper, actual convergence occurred in 3 to 4 epochs. Therefore, the 80% reduction is not a reduction rate of the total cost including generating roughly 1 million candidates, CAD execution, and IoU calculation. It's a one-time offline payment, with the results stored in the model's weights, making repeated inference cheaper. The more the model is used, the easier it becomes to recoup the upfront cost.
This separation has implementation advantages. Evaluating CAD code requires a CPU-based geometry kernel, and incorporating this into each step of online reinforcement learning tends to leave GPUs waiting for results. GIFT consolidates candidate search and verification beforehand, then returns to ordinary supervised fine-tuning afterward. It doesn't require additional manual labeling or specialized architecture, making it easy to incorporate into existing models for problems where a deterministic verifier can be used.
However, without the ability to match against a correct shape, the same cycle cannot be constructed. GIFT didn't autonomously discover designs using only the model—known correct CAD and OpenCASCADE function as the grader.
High IoU Doesn't Guarantee Manufacturability
What an IoU of 0.782 shows is shape overlap according to GenCAD-Code's evaluation procedure. In the evaluation, the generated shape and correct shape are centered, scale-normalized, aligned to principal axes of inertia, and the highest IoU among axis permutations is taken. This is a reasonable approach for comparing shape itself while excluding differences in absolute dimensions and coordinate systems. However, a high number doesn't necessarily mean the dimensions and orientation are correct. Material properties and load resistance are also outside the scope of evaluation.
In a preliminary evaluation using 400 real-world images, absolute IoU dropped significantly compared to the standard test. The percentage of code that could be executed was also lower for GIFT at 96.75% compared to SFT's 97.60%. While GIFT reduced pure code generation failures from 1.18% to 0.60%, execution failures in OpenCASCADE increased from 1.18% to 2.45%. Executability and shape accuracy are separate metrics, and with real images, improvement in one doesn't guarantee improvement in the other.
The research team also acknowledges that GIFT requires a deterministic geometry kernel and correct CAD programs. It is not a mechanism that scores and continuously learns from photos without correct answers or novel designs on the fly. Manufacturability and real-world performance are positioned as targets for future extension.
GIFT's achievement demonstrates that useful candidates already discovered by CAD-generating AI during inference can be fed back into the model rather than discarded. The conditions for advancing to practical use include measuring accuracy with scale-preserving images and preparing a grader that can automatically verify dimensional tolerances, manufacturing constraints, and physical performance. Once connected to that point, failure transforms from the cost of retrying into an asset that improves the next design.
