Introduction
Visual Program Inference (VPI) aims to represent complex visual data, such as 3D models or vector graphics, as structured computer programs. For example, instead of a raw point cloud, a chair might be represented as a sequence of operations: "union(seat_cube, leg_cylinders)". Such representations are highly desirable for downstream tasks like editing, compression, and structural analysis. However, learning these programs without human-labeled data is challenging because the search space of possible programs is infinite and non-differentiable.
Existing unsupervised methods often treat programs as flat sequences of text tokens, ignoring their inherent geometric and logical structure. This frequently leads to models getting trapped in local minima, resulting in "messy" or inefficient code that poorly approximates the target shape.
The SIRI Framework
To address these limitations, we introduce SIRI (Sparse Intermittent Rewrite Injection). SIRI is a bootstrapped learning framework that iteratively improves a neural program generator by injecting high-quality program rewrites into the training loop.
As shown in the framework overview, SIRI operates in a continuous cycle of Search, Rewrite, and Train. Unlike naive approaches that might replace every predicted program with an optimized version (which leads to overfitting and loss of exploration), SIRI employs Sparse Injection. By only rewriting a small, intermittent subset of the training data, the model maintains structural diversity while gradually internalizing the improvements provided by the rewriting process.
The Rewriting Family
The core of SIRI's optimization power lies in its "Rewriting Family," a set of three distinct operations designed to refine program structure and parameters:
- Parameter Optimization (PO): Uses gradient-based methods to fine-tune continuous values, such as the exact coordinates, rotation, or scale of geometric primitives.
- Code Pruning (CP): A greedy search algorithm that identifies and removes "dead code"—sub-expressions that do not contribute to the final rendered shape.
- Code Grafting (CG): A structural optimization that replaces underperforming code segments with superior sub-programs retrieved from a global cache of successful expressions.
Experimental Results and Parsimony
SIRI was evaluated across multiple domains, including 2D Constructive Solid Geometry (CSG), 3D CSG, and the more complex ShapeAssembly language. Across all benchmarks, SIRI significantly outperformed previous state-of-the-art bootstrapped methods like PLAD in terms of Intersection over Union (IoU) and Chamfer Distance.
A standout result of this approach is its parsimony. While traditional neural architectures often approximate shapes using hundreds of tiny, overlapping primitives, SIRI discovers clean, human-interpretable structures. In 3D CSG tasks, SIRI achieved superior reconstruction accuracy using only 8–12 primitives, whereas specialized architectures like CSG-Stump required over 150 primitives to achieve comparable results.
Conclusion
SIRI demonstrates that treating programs as structured objects rather than simple strings allows for the integration of powerful geometric priors. By combining sparse injection with a diverse family of rewriters, the framework enables the unsupervised discovery of accurate, compact, and highly editable visual programs. Future work will explore extending these rewriting families to support the discovery of higher-level functional abstractions and reusable code modules.
Summary updated