When a language model is asked to lay out rooms in a house or blocks on a chip, current systems have it write coordinates. Each rectangle becomes a string of numbers for position and size. The model then fails in predictable ways: rooms overlap, boundaries miss the outline, and small arithmetic slips early in the sequence push later rooms out of place. Chip designers solved a version of this problem decades ago. They search over topological encodings, which are short symbolic descriptions of which block sits left of or above which. A deterministic linear-time decoder turns any legal description into a non-overlapping layout, and the best of these encodings are non-redundant: each distinct layout has exactly one description.
This note proposes making such a canonical encoding the output language of the model. A separate solver handles all geometry. The note then asks which property of the encoding actually helps a language model. There are three candidates: validity by construction, uniqueness of the target string, or compactness.
The claim is specific and falsifiable. Much of what the floorplanning literature calls LLM "spatial hallucination" comes from coordinate serialization rather than from a lack of spatial reasoning. A second, independent effect should also appear. Training on a canonical (one-to-one) encoding should beat training on a redundant encoding of the same layouts. With a redundant encoding, the supervision target for a given layout is split across many equivalent strings, and the model wastes capacity on that ambiguity. We also predict a limit. Maximally compact encodings, such as a dense bitstring, should hurt a pretrained model, because flipping one symbol rearranges the whole layout and the string looks nothing like the text the model was trained on. If this holds, it tells us how to pick an encoding for a language model. It would also turn floorplan generation into a clean testbed for separating structural errors from arithmetic errors in LLM reasoning.
Where This Sits
Coordinate-based systems. Existing LLM floorplanners all emit geometry directly, and they motivate this work. Tell2Design trains a T5 sequence-to-sequence model to produce integer box coordinates from 0 to 255. Human raters scored its handling of relational phrases like "between" at only 3.65/5. FloorPlan-DeepSeek predicts rooms one at a time as (type, x, y, w, h) vectors, with auxiliary losses to discourage overlap. That design addresses validity with a soft penalty rather than a guarantee. HouseTune and HouseLLM accept that the LLM's JSON boxes will be wrong and repair them with a conditional diffusion model. A diffusion model is a generator that learns to turn random noise into samples by removing noise step by step. None of these systems changes what the model is asked to write. That is the variable we manipulate.
Encodings and the solver. The VLSI encoding literature supplies the method and our decoder. Yao et al. give a bijection between mosaic floorplans and twin binary trees, with O(n) conversion in both directions. A mosaic floorplan is a rectangle cut into smaller rectangles with no gaps. They also show that mosaic floorplans are counted by Baxter numbers, and they relate these trees to sequence pairs and corner block lists, both of which are many-to-one. ECBL extends corner block lists with zero-size "false blocks" so that empty rooms can be represented. We reuse this to encode exterior voids in a building outline. He gives a (3n−3)-bit encoding that is optimal up to lower-order terms. This supplies our "maximally compact" condition. The encoding has never been used inside a learned generator.
Constraining evidence from LLM reasoning. Several papers limit what we should expect. Yang et al. find that models solving hard problems still fail easier variants through off-by-one and arithmetic slips. Coordinate strings invite exactly these errors. Cai et al. report a logic–syntax trade-off: following a rigid structure reduces logic errors but raises syntax errors. This predicts that strict encodings will have their own failure rate, which we must measure rather than assume away. Al-Khalili et al. show that final-answer accuracy can hide unsound intermediate logic. We use that point to motivate diagnosing which topological decision a model got wrong, not just whether the layout scores well.
The design of splitting symbolic choice from exact computation follows ASTRA, where an LLM sets high-level parameters and a linear program solves them. The agentic EDA survey notes that current chip-design agents treat physical layout as a black box driven by tool scripts. This work sits in that gap, but it tests one representational question rather than building an agent.
Research Program
We build one pipeline and vary only the model's output language. The model reads a specification: text for houses, or block areas and connectivity for chips. It writes a layout description. A deterministic back end decodes the description into a constraint graph, then solves a small linear program. The program fits block sizes to target areas and aspect ratios inside the outline and minimizes deviation from requested dimensions. Every condition shares this solver, so differences come from the encoding.
We compare five output languages over the same layouts:
- Coordinates, in Tell2Design's quantized box format.
- Free-form relations: an unstructured list of left-of and above statements, which the linear program resolves.
- Sequence pairs, which always decode to a non-overlapping packing but are heavily redundant.
- Twin binary trees in a readable bracketed syntax, which are canonical for mosaic layouts. We extend them with ECBL-style false blocks for voids.
- He's (3n−3)-bit string, which is canonical and near-optimally compact.
For the tree and bitstring languages, we implement prefix checkers wherever the legality conditions can be tested incrementally, and we use them for constrained decoding. Where full prefix checking is not possible, we report the rate of strings that fail to decode, rather than claiming validity by construction.
The central ablation isolates redundancy. We use the same sequence-pair language, trained in two ways:
- Canonical targets: one fixed representative per layout, obtained by mapping through the twin binary tree.
- Randomized targets: a uniformly random member of the layout's equivalence class at every training step.
The token vocabulary, sequence length, and decoder are identical, so any gap is attributable to label ambiguity alone.
The diagnostic contribution comes from the encodings themselves. Canonical encodings let us score every model, including the coordinate model, on topology separately from geometry. We convert any generated layout back to its canonical tree and ask two questions: was the adjacency structure right, and if so, was the geometry right? This answers the open question of whether LLM floorplan failures are structural or arithmetic.
Coverage is a real constraint. Some residential rooms are L-shaped and are not rectangles. We will report the fraction of RPLAN/Tell2Design layouts that the mosaic-plus-voids encoding represents exactly. The comparison is run on that subset, and the excluded fraction is reported as a limitation, not hidden.
Baselines
Do nothing. The naive reference point is the coordinate language decoded as-is, with no solver. This is the Tell2Design setup. The strongest reported number in this regime is Tell2Design's Micro IoU of 54.34 on its human-annotated split (Tell2Design), against roughly 64 for human drawings. We rerun this setup with our model backbone so that backbone strength does not confound the comparison.
Strongest autoregressive competitor. This is FloorPlan-DeepSeek's room-vector format with its non-overlap auxiliary loss (FloorPlan-DeepSeek). The paper reports FID 16.465, PSNR 76.564, and SSIM 0.934 on Tell2Design. We found no reported Micro IoU or overlap rate for it on Lacuna, so we will measure both.
Strongest two-stage competitor. This is HouseTune: LLM JSON followed by diffusion refinement (HouseTune). The paper reports a realism score of −0.03 against Tell2Design's −1.03, and a 79% gain in room-count and room-type compatibility. It is the most direct competitor for the claim that validity can be obtained without a learned repair stage.
Fairness. All learned baselines and all encoding arms fine-tune the same open-weight 7B-class base model. They use the same training layouts, the same token budget per epoch, and the same hyperparameter search budget. For HouseTune, we give the diffusion refiner its published training schedule and count its compute separately.
What beating them means. A canonical encoding "beats" a baseline if both of the following hold:
- It achieves 100% non-overlap (or reports its undecodable rate).
- It matches or exceeds the baseline's Micro IoU and text-constraint satisfaction on the same test split.
It must do so with less inference compute than diffusion refinement.
Ablations. Two ablations isolate the key ingredients. The canonical-versus-randomized sequence-pair ablation isolates non-redundancy. The readable-tree-versus-bitstring comparison isolates compactness.
Why not just…?
Why not just keep coordinates and legalize them afterward with the same linear program? This is the most serious threat, and we treat it as a baseline rather than a straw man. The coordinate model's output is fed through the same solver, with relative positions read off the boxes. If this condition matches the tree language on IoU and constraint satisfaction, the conclusion is that the solver matters and the output language does not. We would report that plainly. Our prediction is that it will fall short on relational constraints. Tell2Design's 3.65/5 on relational phrases suggests the coordinate model often gets the adjacency itself wrong, and legalization cannot fix a wrong topology. The topology-versus-geometry diagnostic tests this directly.
Why not just let the LLM write free-form spatial relations and hand them to a solver, as ASTRA does for negotiation? This is also a baseline, the free-form relations arm. Free relations can be contradictory, as in cycles of "left-of." They can also be incomplete, and they are highly redundant. The sequence-pair and tree arms test whether imposing a complete, canonical structure adds anything beyond "use a solver." If free relations do as well, the structure of classical encodings is unnecessary for LLMs, which is itself a useful negative result.
Why not just use diffusion refinement as HouseTune does? On small houses it may be competitive on realism. However, it offers no non-overlap guarantee, and its cost grows with the number of iterative denoising steps. The scaling experiment below compares validity and wall-clock time as block count grows. We expect the gap to open there, not at 6–10 rooms.
Why not just run simulated annealing over the encoding with no LLM? For text-specified houses, annealing cannot read the specification, so it is not a competitor on intent-following. On FloorSet, annealing is the right optimizer for area and wirelength. FloorSet reports that annealing leaves a large gap to its golden layouts and violates hard constraints. We therefore test the LLM only as a proposer of starting topologies for annealing, not as a replacement for it.
Proposed Experiments
Main comparison. We run all five languages plus the baselines on Tell2Design's human-annotated test set, restricted to the representable subset. Metrics are:
- Micro IoU
- overlap and out-of-outline rates
- satisfaction of adjacency and room-count constraints parsed from the text
- tokens per layout
Decisive check on redundancy. The canonical-target sequence-pair model should reach lower validation loss and higher IoU than the randomized-target model at every training-set size. The gap should be largest at small data sizes. If the two curves coincide, non-redundancy does not matter for learned generators, and the claim fails.
Compactness check. We predict that the bitstring arm will underperform the readable tree despite being shorter. We also predict that its errors will be globally catastrophic rather than local, which we measure by the topological distance of wrong outputs from the target.
Scaling and consistency. On FloorSet-Lite (rectangular blocks), we grow block count from 10 to over 100. We then plot overlap rate and topological accuracy against n for the coordinate and tree languages. The prediction is that coordinate validity decays with n as errors compound, while tree validity stays flat and only topological accuracy declines. No reported result was found on Lacuna for any LLM on FloorSet, so the within-study coordinate baseline is the reference. We also build ConsisEval-style easy/hard pairs, where the easy specification is a strict subset of the hard one. We then measure P(easy correct | hard correct) per language. The prediction is that canonical encodings raise consistency, because they remove the arithmetic traps Yang et al. identify.
Diagnostic finding. Across all arms, we report what fraction of failures are topological versus geometric. This is the first such decomposition of LLM spatial layout errors.
References
- Tell2Design: A Dataset for Language-Guided Floor Plan Generation
- FloorPlan-DeepSeek (FPDS): A multimodal approach to floorplan generation using vector-based next room prediction
- HouseTune: Two-Stage Floorplan Generation with LLM Assistance
- HouseLLM: LLM-Assisted Two-Phase Text-to-Floorplan Generation
- Floorplan representations: Complexity and connections
- ECBL: an extended corner block list with solution space including optimum placement
- A simple optimal binary representation of mosaic floorplans and Baxter permutations
- Can Large Language Models Always Solve Easy Problems if They Can Solve Harder Ones?
- Beyond Code: Evaluate Thought Steps for Complex Code Generation
- Evaluating Intermediate Reasoning of Code-Assisted Large Language Models for Mathematics
- ASTRA: A Negotiation Agent with Adaptive and Strategic Reasoning via Tool-integrated Action for Dynamic Offer Optimization
- The Dawn of Agentic EDA: A Survey of Autonomous Digital Chip Design
- FloorSet - a VLSI Floorplanning Dataset with Design Constraints of Real-World SOCs