The one-paragraph version
HiFi-BRep is a generative model that creates boundary representations — the precise surface-plus-connectivity format real CAD software uses — by learning a cleaner internal code and then decoding shape and structure together. It first compresses a B-Rep into a fixed-length latent code using an encoder that only lets faces and edges talk to each other if they actually touch, and that avoids filler padding noise by summarizing with learnable queries. It then reconstructs faces, edges, and which-edge-touches-which-face in one parallel pass, training the model to put exactly two faces on every edge as a differentiable goal rather than fixing it afterward. On the standard DeepCAD and ABC datasets, this gives the highest rate of fully valid, watertight solids and the fastest generation time among the compared methods, though it still only handles closed solids within a fixed size budget and still leans on a CAD kernel for final trimming.
The problem they're solving, and why it matters
A boundary representation, usually shortened to B-Rep, describes a 3D solid as parametric geometry plus topology. Geometry means the actual mathematical shapes: faces as curved surface patches, edges as curved segments, vertices as points. Topology means how they connect: which edges bound which face, which faces meet at which edge.
That combination is what makes B-Reps the standard for engineering and manufacturing — unlike a point cloud or mesh, a B-Rep can say “this is a perfect cylinder of radius 10 with a through-hole” and be machined from it. But it is brutally hard to generate with neural networks because the rules are strict: every edge must be shared by exactly two faces for a closed manifold solid, every face loop must close head-to-tail, surfaces and curves must meet cleanly. One small slip can make the whole model unbuildable.
The paper argues prior work is brittle in two ways. Representation brittleness: to handle models with different numbers of faces and edges, methods pad short sequences with dummy tokens, which adds statistical noise, and they let unrelated parts exchange information, which contaminates features. Generation brittleness: methods generate in cascades — first faces, then edges, then topology — so early mistakes lock in and propagate, and they enforce validity only in non-differentiable post-processing, meaning training never directly learns “be valid.”
The key idea, in plain words
Make the latent code high-fidelity, then decode everything at once with validity built into training.
Think of a simple cube with a cylindrical hole: 6 outer faces plus the inner hole wall, and many edges where those faces meet. A noisy encoder might blur the hole wall with the opposite outer face just because they are both in the same attention window. HiFi-BRep’s encoder instead uses the true edge-face adjacency as a hard mask: an edge token is only allowed to attend to the faces it actually touches, and vice versa. It then summarizes the variable number of face and edge tokens into a fixed number of summary slots using learnable queries — learned “listeners” that pull out relevant information — instead of averaging over a padded sequence full of dummies.
For generation, instead of generating geometry and then guessing topology, predict counts, geometry, and adjacency jointly in one stage. Crucially, turn the rule “each edge has two faces” into a learning signal: for each edge, the model must split its probability mass equally between its two true neighboring faces. At test time it simply picks the top two faces per edge. Geometry and topology can thus correct each other during learning, rather than topology trying to repair frozen geometry.
How it actually works, step by step
1. Compact input formulation. Each face is stored as a bounding box plus a grid of control points for a Bézier surface. Each edge is stored as a bounding box plus control points for a Bézier curve plus its two explicit endpoints. Topology is a single binary edge-face adjacency matrix that says which edge touches which face. Bézier here means a smooth patch or curve controlled by a handful of points — moving a control point bends the shape. Using curves that carry their own endpoints automatically helps satisfy “each edge has two vertices.” The explicit matrix can naturally represent multiple distinct edges shared by the same pair of faces, which the paper shows is common: after splitting periodic seams, about 63% of ABC models have at least one face pair sharing more than one edge.
2. Topology-aware dual-stream encoder. Faces and edges start as separate token sequences made by small neural networks that embed their boxes and control points. They then go through stacked BiModalBlocks. Inside each block, faces attend to faces and edges attend to edges to gather context, but cross-attention between faces and edges is masked by the true adjacency — non-neighboring pairs get effectively zero weight. After several blocks, a set of, in the paper’s setup, 48 learnable encoder queries attends to all real face and edge tokens, ignoring padded slots, to produce the HiFi latent. That latent is treated variationally, meaning the encoder outputs a mean and variance to sample from, with a penalty to keep the space smooth.
3. Single-stage validity-constrained decoder. Starting from the latent, the decoder first predicts how many faces and how many edges to make, which defines which slots are real versus padding for everything downstream. Learnable face queries and edge queries then cross-attend to the latent, attend within their own stream, and attend across streams to become topology-aware features. Separate heads regress the boxes, control points, and endpoints, using a function that forces box sizes to stay positive. For topology, face and edge features are projected into a shared space and compared to get a compatibility score for every edge-face pair. During training, each valid edge row is supervised to put equal mass on its two true faces with a row-wise softmax loss — the authors call this the two-peak objective. At inference, each edge picks its two highest-scoring faces.
4. Training and sampling. The variational autoencoder is trained with reconstruction losses on geometry, classification losses on counts, the row-wise adjacency loss, and the usual latent regularization, all computed only on valid slots. After that latent space is frozen, a Diffusion Transformer denoiser is trained to generate latents from noise, optionally steered by a condition injected via adaptive layer normalization, which is just a way to let a class label, point cloud, or image shift and scale the denoiser’s activations. Point clouds use a PointNet++ encoder, images and sketches use a pretrained DINOv2 encoder. Sampling means denoising a random latent, then decoding it once with the pretrained decoder and assembling a solid with OpenCascade.
What they showed — results, honestly, with limitations
On unconditional generation, HiFi-BRep leads on full validity, which here means not just exportable as a STEP file but confirmed closed and watertight with finite volume.
On DeepCAD, it reaches 72.20% Valid with 90.38% Compilability — meaning exportable — and the lowest Chamfer-distance fidelity score of 1.05, with Coverage of 70.40%. The gap between merely compilable and truly valid is 18.18 points, versus 49.28 points for the strongest baseline DTGBrepGen, which is compilable 92.48% of the time but valid only 43.20%. On the harder ABC set, HiFi-BRep is valid 32.66% of the time with 35.61% compilability, again the highest validity and a tiny 2.95-point gap, while DTGBrepGen gets better distributional scores but only 24.88% valid from 50.55% compilable. In plain terms: HiFi-BRep produces fewer files overall on ABC, but when it produces one it is much more likely to actually be solid.
Ablations on reconstruction support the design: removing joint one-stage decoding and instead predicting topology from decoded geometry in a second network drops validity from 95.2% to 69.3% and adjacency accuracy from 97.5% to 73.2%. Replacing the two-peak loss with independent per-pair decisions, or removing the encoder topology mask, also hurts validity. Reconstruction stays above 61.5% valid even for rare high-face-count models. It is also fastest end-to-end at 3.83 seconds per shape versus 8.09, 23.55, and 26.28 for BRepGen, DTGBrepGen, and BrepDiff, though its post-processing is slightly slower than BRepGen’s because it must sample and fit control-point surfaces.
Limitations are stated clearly. The method targets only closed, watertight solids within fixed maximum face and edge budgets. It does not handle open sheets, assemblies, or non-manifold configurations. Even with the two-peak prior, failures remain: loops that fail to form a trimmable patch so the kernel drops a face, T-junctions or duplicated segments after vertex merging, and sliver or self-intersecting patches from ill-conditioned control points. Exact intersection and trimming are still delegated to the CAD kernel, which explains the remaining compilable-but-not-valid cases. Conditional results for class, point cloud, partial scan, sketch, and single- or multi-view inputs are shown qualitatively, without validity numbers in the main paper, so that part is promising but less quantified.
Why this might matter to me
For spatial reasoning in LLMs and VLMs, the topology-masked attention is a concrete pattern for grounding: only allow cross-modal or cross-part messages along known or predicted adjacency, rather than full attention that invites hallucinated connections. The count-first-then-detail decoding is also a useful template for teaching a language model to commit to structure before filling in parameters.
For world models, the lesson is to make physical legality differentiable during learning, not a filter after sampling. The two-peak “each edge has two faces” loss is a small example of turning a symbolic constraint into a soft target distribution; similar row-wise competition could encode contact, support, or closure constraints in scene dynamics.
For text-to-CAD and parametric geometry, this moves away from sketch-and-extrude operation sequences, which are limited by small history datasets and fixed vocabularies, toward direct B-Rep synthesis that preserves editability via control points and explicit adjacency. Conditioning via a single vector injected into diffusion leaves room to plug in language embeddings alongside the demonstrated point-cloud and DINOv2 image features.
For 3D generation and scene representation, the decoupled variational autoencoder plus latent diffusion setup, the query-based pooling to a fixed latent from variable topology, and the explicit handling of multi-edges between the same face pair all transfer to parts, objects, and potentially assemblies — provided the fixed-budget and closed-solid limits are relaxed with variable-length queries and stronger global consistency checks, which the authors list as future work.
Terms worth knowing
B-Rep: boundary representation; a CAD model as parametric faces, edges, vertices plus how they connect. Topology vs. geometry: topology is connectivity — which touches which; geometry is shape — where surfaces and curves sit in space. Manifold / watertight: manifold here means every edge is shared by exactly two faces; watertight means the faces close with no gaps so volume is well defined. Edge-face adjacency / incidence matrix: a table with one row per edge and one column per face, marked 1 where that edge bounds that face. Padding noise: spurious signal from dummy tokens added to make all models the same length; the paper avoids it with masking and query pooling. Topo-Mask: hard attention mask that only permits messages between topologically adjacent faces and edges. Learnable queries: trainable vectors that attend to a variable set and compress it to a fixed set, used for both encoding to latent and decoding to faces and edges. Two-peak objective: training target that forces each edge to assign equal probability to its two true faces, enforcing manifoldness differentiably. Compilability vs. Valid: compilable means OpenCascade could build a STEP file; valid means it is also closed, manifold-consistent, and has finite volume. Latent diffusion: generate by denoising random noise in a learned compressed space, then decoding once to a full model.