ConceptioArchivearXiv CS
arXiv CSopen access

What a Comfortable World: Ergonomic Principles Guided Apartment Layout Generation

Unknown · 2026 · arxiv_cs
arXiv CS · Papers · License: Open Access · 2026
Open Source ↗Direct PDF ↓
machine learning, deep learning, neural networks

What a Comfortable World: Ergonomic Principles Guided Apartment Layout Generation P. Nieciecki†1

, A. Plocharski†1,2

and P. Musialski3

1 Warsaw University of Technology, Poland 2 Akces NCBR, Poland

Baseline

Our method Master Room

Master Room

Kitchen

Desired rooms adjacency Front door

Bathroom Bathroom

arXiv:2604.08411v1 [cs.GR] 9 Apr 2026

3 New Jersey Institute of Technology, United States of America

Entrance

Secondary Room

Kitchen

Living Room Bathroom

Dining Room

Second Room

Bathroom Bathroom Blind corridor

Master Room

Balcony Study Room

Figure 1: The left side illustrates representative examples of ergonomic floor plans generated by the proposed method, with comparison to a baseline method. The right panel displays the adjacency graph defining the desired spatial proximity between specific room pairs. Abstract Current data-driven floor plan generation methods often reproduce the ergonomic inefficiencies found in real-world training datasets. To address this, we propose a novel approach that integrates architectural design principles directly into a transformerbased generative process. We formulate differentiable loss functions based on established architectural standards from literature to optimize room adjacency and proximity. By guiding the model with these ergonomic priors during training, our method produces layouts with significantly improved livability metrics. Comparative evaluations show that our approach outperforms baselines in ergonomic compliance while maintaining high structural validity. CCS Concepts • Computing methodologies → Shape modeling; Neural networks; • Applied computing → Architecture (buildings);

1 Introduction Automated generation of residential floor plans is a long-standing challenge in computer graphics, aiming to support architects with rapid exploration of design variations. Recent data-driven approaches, particularly those leveraging transformer architectures [VSP∗ 17], have shown remarkable ability to learn complex spatial distributions from large datasets like RPLAN [WFT∗ 19]. However, a fundamental limitation of pure data-driven methods is † Equal contribution © 2026 The Author(s).

their reliance on the quality of training data. As observed in recent work on furniture arrangement [LGWM22], real-world datasets often contain layouts that are geometrically valid but potentially suboptimal regarding circulation or room placement standards. A model trained naively on such data faithfully reproduces these inefficiencies. While Leimer et al. [LGWM22] addressed this by injecting differentiable guidance into the generation of discrete object arrangements, extending this paradigm to structural floor plan generation presents a distinct challenge. Unlike moving furniture within a fixed container, generating a floor plan requires optimizing the container itself—defining the topology, adjacency, and tiling of rooms .

2 of 4

P. Nieciecki & A. Plocharski & P. Musialski / What a Comfortable World: Ergonomic Principles Guided Apartment Layout Generation

In this work, we propose a method to generate residential layouts with improved architectural compliance by integrating domainspecific principles directly into the generative process. We formulate a differentiable loss function based on architectural standards [NN12]. By incorporating these architectural adjacency priors into a GPT-2 based architecture [RWC∗ 19] via a dynamic weighting scheme, we guide the model to produce layouts that adhere more closely to design guidelines than the training distribution. Our contributions are: (1) a guideline-derived proximity cost formulation adapted for Manhattan-world room polygons; (2) generalization of differentiable loss integration presented in [LGWM22] and (3) quantitative evidence that our method improves compliance metrics on the RPLAN dataset while maintaining high parsability, albeit with modest trade-offs in area coverage. 2 Related Work Early layout synthesis relied on constraint satisfaction or evolutionary algorithms [MCP02], but the field has shifted toward deep generative models. Graph-based approaches like constraint graphs [PGK∗ 21], House-GAN++ [NHC∗ 21] and HouseDifusion [SHF22] represent layouts as nodes and edges, ensuring topological validity but often struggling with precise geometry. Most recently, transformer-based autoregressive models have become the state-of-the-art for vector graphics generation. SceneFormer [WYN20] and FaçAID [PSPSM24] demonstrate that transformers can effectively sequence geometric tokens to generate indoor scenes and building facades, respectively. We build on this sequence-based representation, adapting the GPT-2 architecture [WDS∗ 20] to predict room polygons as coordinate tokens. Purely generative models often fail to capture high-level functional requirements. To address this, neuro-symbolic methods hybridize neural generation with explicit rule-based constraints. LayoutEnhancer [LGWM22] pioneered this for indoor scenes by using differentiable scalar functions to penalize suboptimal furniture arrangements during training. This allowed the model to improve upon its own training data. Our work extends this principle from the interior content domain (furniture) to the structural domain (floor plans). We adapt the loss formulation to operate on polygon vertices and adjacencies, ensuring that the generated structures align with established architectural circulation guidelines [NN12]. 3 Ergonomic cost Using domain-specific literature [NN12] we determined that minimizing the following distances have a positive impact on the overall comfort of apartment use: (i) the distance from the entrance room to the front door; (ii) the distances from the entrance room, living room, master room and second room to the bathroom; (iii) the distances from the entrance room and dining room to the kitchen; (iv) balcony adjacency to kitchen, dining room, living room, master room, secondary room, or study room. Taking the above aspects into account, we define a set of roomtype-specific cost functions to quantify layout ergonomics. Entrance cost. For each entrance room polygon r ∈ Rentrance , the

entrance cost is defined as Eentrance (r) = dist(r, d), where d denotes the front door (represented as a line segment) and dist is the Euclidean distance in meters. Kitchen cost. For kitchens, we first pair each entrance and dining room with the nearest kitchen present in the floor plan. The cost associated with a given kitchen is then computed as the average distance to all entrances and dining areas assigned to it: Ekitchen (r) =

1 ∑ dist(r, r′ ), |A(r)| r′ ∈A(r)

where r ∈ Rkitchen is a kitchen and A(r) is a set of rooms assigned to kitchen r. Bathroom cost. The cost of each bathroom r ∈ Rbathroom is defined in an analogous manner, but for each entrance room, living room, master room and second room we assign the nearest bathroom: Ebathroom (r) =

1 ∑ dist(r, r′ ), |A(r)| r′ ∈A(r)

Balcony cost. The cost is defined as the minimum distance to any room from the set of preferred adjacent room types (R′ ): Ebalcony (r) = minr′ ∈R′ dist(r, r′ ). Overall ergonomic cost is computed as the mean cost over all rooms of applicable types: E=

1 ∑∗ Ea(r) (r), |R∗ | r∈R

(1)

with R∗ = Rentrance ∪ Rkitchen ∪ Rbathroom ∪ Rbalcony and a(r) is the type of room r. 4 Floor plans generation Following trends in related work, we employ the GPT-2 model [RWC∗ 19] (specifically the implementation included in the Hugging Face library [WDS∗ 20]). 4.1 Floor plan representation We encode each floor plan as a token sequence S = (b, d, r1 , . . . , rn ), where b is the boundary, d the front door placement, and ri the i-th room. Boundary and door appear first; room order may vary. Each segment starts with a type token (sb for boundary, sd for door, str for a room of type t) followed by quantized vertex coordinates (x, y) at fixed resolution: b = (sb , xb1 , yb1 , xb2 , yb2 , . . . , xbk , ybk ) d = (sd , xd1 , yd1 , xd2 , yd2 ) ri = (sti , xi1 , yi1 , xi2 , yi2 , . . . , xil , yil ) Following [WYN20, PGK∗ 21, LGWM22, PSPSM24], we augment each token with an xy-index and a vertex-index. The xy-index is 1 for x-coordinates, 2 for y-coordinates, and 0 otherwise. The vertex-index is 0 for start tokens and counts coordinate pairs (1 © 2026 The Author(s).

P. Nieciecki & A. Plocharski & P. Musialski / What a Comfortable World: Ergonomic Principles Guided Apartment Layout Generation

3 of 4

for the first vertex, 2 for the second, etc.). Each index has its own learned embedding, added to the token and positional embeddings.

single token is replaced by a value v̄ derived from the model’s predicted probability distribution.

4.2 Ergonomic loss

Token v̄ is equal to the expected value in a small window around the most likely value of the token

To inject expert knowledge into the model, we introduce a custom loss function using the ergonomic cost terms described in Section 3. First, we define a differentiable distance metric between rooms. For room polygons r and s let Vr = {pr1 , pr2 , . . . prnr } and Vs = {ps1 , ps2 , . . . psns } be the sets of their vertices. Then the distance metric D is defined as: D(r, s) = ⟨e, softmin(β · e)⟩, where ei j = ∥pri − psj ∥2 . Here, β is a temperature parameter that determines the hardness of the softmin function (our experiments use β = 10). Similarly to ergonomic cost, ergonomic loss is defined as a combinations of room-type-specific losses. For each entrance room it is equal to the differentiable distance between the entrance room polygon and the front door polygon.

v̄ =

with N (x|v̂, σ) being the normal distribution centered at v̂ with standard deviation σ. v̂ is equal to the most probable token and P(v) is a estimated by the model. During our experiments σ was equal to 1/ρ, where ρ is the resolution of floor plans quantization. Since the ergonomic loss is differentiable w.r.t. the room polygon vertices, the loss value for a given predicted token v̄ is computed only when both v̂ and its corresponding ground-truth element represent x- or y-coordinate of a room polygon vertex. During the learning process we are combining the standard crossentropy loss LC with our ergonomic loss. L = (1 − α) · LC + α · LE ,

Lentrance (r) = D(r, d), where d is the front door polygon. The mean value over all entrance rooms in a floor plan forms the full entrance room loss term: Lentrances =

1 Lentrance (r). |Rentrance | r∈R∑ entrance

For kitchens, each entrance room and dining room distance is calculated to each kitchen. Then a differentiable minimum function is used to determine the distance from the nearest kitchen. The kitchen loss term is a mean value of these distances. Let ri ∈ Rentrance ∪ Rdining , r j ∈ Rkitchen and ∆i j = D(ri , r j ), then: Lkitchen (ri ) = ⟨∆i j , softmin(β · ∆i j )⟩, 1 Lkitchens = Lkitchen (ri ). ∑ |Rentrance ∪ Rdining | ri ∈Rentrance ∪Rdining Loss for bathrooms is defined in an analogical way, but using the proximity of entrances, living rooms, master rooms and second rooms . Let R′′ = Rentrance ∪ Rliving ∪ Rmaster ∪ Rsecond , then: Lbathrooms =

1 ∑′′ Lbathroom (ri ). |R′′ | ri ∈R

Balcony loss is similar, but here we are taking a differentiable minimum of proximate distance losses: Lbalconies = ⟨Lbalcony (ri ), softmin(β · Lbalcony (ri )⟩, ri ∈ R′ . Final ergonomic loss is a mean of all possible to calculate losses: LE =

∑a δa La , ∑a δa

with a = {entrances, kitchens, bathrooms, balconies} and δa = 1 if the loss is applicable to the floor plan and δa = 0 otherwise.

∑ j N (v j |v̂, σ)P(v j )v j , ∑ j N (v j |v̂, σ)P(v j )

where α is the value of our ergonomic loss of the ground-truth floor plan divided by a scaling factor γ and clamped to [0; 1] range. During our experiments, γ was set to 30 based on ergonomic loss distribution from test samples. This definition increases the influence of ergonomic loss on non-ergonomic data, encouraging the model to rely more on expert knowledge for such cases. 5 Results We train on RPLAN [WFT∗ 19] (quantized to 256). After validity filtering, the dataset contains 80,405 plans. We use a 90/5/5% train/val/test split. The training set was expanded to ∼159,000 examples via augmentation (rotation, symmetry, room permutation). The model (GPT-2, 25 layers, 16 heads, 256 embedding dim, 320 token context, 20M parameters) is trained for 150 epochs. A baseline model with identical configuration but trained with standard cross-entropy loss serves as a baseline. Inference uses greedy decoding. During testing the model starts from ground truth boundaries and doors (as constraints), though from-scratch generation is also possible. Code and additional results are available on https://comfortableworld.github.io. Qualitative results. Figures 1 and 2 illustrate our results. Ergonomic loss minimization is evident in bathroom placement (closer to master/secondary rooms) and reduced blocking of functional rooms (e.g., kitchen blocking bathroom in baseline, Fig. 1). Quantitative results. We define test metrics: Parsability (successfully parsed sequences); Validity (no self-intersections); Fully covered (complete interior coverage); No room overlapping; Ergonomic cost (see Eq. 1, lower is better); and Perfect ergonomic cost (% with 0 cost). All metrics, besides ergonomic cost are binary. Table 1 compares these metrics. Our model outperforms the baseline on ergonomics while maintaining comparable generation quality.

4.3 Ergonomic loss usage We integrate our ergonomic loss into the training process using a methodology similar to one presented in [LGWM22]. The ergonomic loss is calculated using ground-truth sequences where a © 2026 The Author(s).

6 Limitations and Conclusions Limitations. While our method successfully optimizes ergonomics, we observe a trade-off in geometric packing efficiency,

4 of 4

P. Nieciecki & A. Plocharski & P. Musialski / What a Comfortable World: Ergonomic Principles Guided Apartment Layout Generation

Our

Inaccessible bathrooms Baseline RPLAN

– living room,

Our

– master room,

Blind corridors Baseline RPLAN

– bathroom,

– kitchen,

– study room,

Better room arrangement Our Baseline RPLAN

– second room,

– balcony

Figure 2: Qualitative comparison of results between baseline, our method and samples from RPLAN dataset. Reduction of inaccessible bathrooms and blind corridors compared to the baseline; the final column shows improved room arrangements.

resulting in slightly lower area coverage compared to the baseline. Additionally, the current model operates unconditionally, lacking explicit constraints for room counts or types. Finally, rare logical inconsistencies persist, such as entrance doors opening into spaces like balconies. Conclusions. We presented a transformer-based method for residential floor plan generation that integrates domain-specific ergonomic principles. By incorporating differentiable loss functions for room adjacency, our model outperforms the baseline in ergonomic metrics despite the limitations of the training data. This approach demonstrates that incorporating domain-specific expert knowledge into training can effectively guide generative models toward more architecturally compliant and practical designs. As future work, we plan to add conditional control over room types and counts, improve geometric packing and logical consistency, and experiment with bigger, more recent model architectures. 7 Acknowledgments This research was carried out with the support of the High Performance Computing Center at Faculty of Mathematics and Information Science Warsaw University of Technology. Generative AI tools were used for brainstorming and polishing the manuscript text. All scientific content and analysis were produced entirely by the authors.

Table 1: Quality metric values for test results of both the baseline and our full method as well as ground truth RPLAN dataset metrics. Metrics Parsability (%) Validity (%) Fully covered (%) No overlapping (%) Ergonomic cost (m) Perfect ergonomic cost (%)

Baseline 99.93 96.98 79.83 98.02 0.502 34.32

Our 99.93 97.71 74.19 97.76 0.353 43.75

RPLAN 100 100 100 100 0.509 28.07

References [LGWM22] L EIMER K., G UERRERO P., W EISS T., M USIALSKI P.: Layoutenhancer: Generating good indoor layouts from imperfect data. In SIGGRAPH Asia 2022 Conference Papers (2022), pp. 1–8. 1, 2, 3 [MCP02] M ICHALEK J., C HOUDHARY R., PAPALAMBROS P.: Architectural layout design optimization. Engineering Optimization 34, 5 (2002), 461–484. doi:10.1080/03052150214016. 2 [NHC∗ 21] NAUATA N., H OSSEINI S., C HANG K.-H., C HU H., C HENG C.-Y., F URUKAWA Y.: House-gan++: Generative adversarial layout refinement network towards intelligent computational agent for professional architects. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (2021), pp. 13632–13641. 2 [NN12] N EUFERT E., N EUFERT P.: Architects’ data. John Wiley & Sons, 2012. 2 [PGK∗ 21] PARA W., G UERRERO P., K ELLY T., G UIBAS L. J., W ONKA P.: Generative layout modeling using constraint graphs. In Proceedings of the IEEE/CVF international conference on computer vision (2021), pp. 6690–6700. 2 [PSPSM24] P LOCHARSKI A., S WIDZINSKI J., P ORTER -S OBIERAJ J., M USIALSKI P.: FaçAID: A Transformer Model for Neuro-Symbolic Facade Reconstruction. In SIGGRAPH Asia 2024 Conference Papers (2024), SA ’24. doi:10.1145/3680528.3687657. 2 [RWC∗ 19] R ADFORD A., W U J., C HILD R., L UAN D., A MODEI D., S UTSKEVER I., ET AL .: Language models are unsupervised multitask learners. OpenAI blog 1, 8 (2019), 9. 2 [SHF22] S HABANI M. A., H OSSEINI S., F URUKAWA Y.: Housediffusion: Vector floorplan generation via a diffusion model with discrete and continuous denoising. arXiv preprint arXiv:2211.13287 (2022). 2 [VSP∗ 17] VASWANI A., S HAZEER N., PARMAR N., U SZKOREIT J., J ONES L., G OMEZ A. N., K AISER Ł., P OLOSUKHIN I.: Attention is all you need. Advances in neural information processing systems (2017). 1 [WDS∗ 20]

W OLF T., D EBUT L., S ANH V., C HAUMOND J., D E LANGUE C., M OI A., C ISTAC P., R AULT T., L OUF R., F UNTOWICZ M., ET AL .: Transformers: State-of-the-art natural language processing.

In Proceedings of the 2020 conference on empirical methods in natural language processing: system demonstrations (2020), pp. 38–45. 2 [WFT∗ 19] W U W., F U X.-M., TANG R., WANG Y., Q I Y.-H., L IU L.: Data-driven interior plan generation for residential buildings. ACM Transactions on Graphics (TOG) 38, 6 (2019), 1–12. 1, 3 [WYN20] WANG X., Y ESHWANTH C., N IESSNER M.: SceneFormer: Indoor Scene Generation with Transformers. CoRR abs/2012.09793 (2020). arXiv:2012.09793. 2

© 2026 The Author(s).

Record · ID 2596 · SHA-256 0dd2f7144a700cbc
Conceptio Open Knowledge Archive — every document is proof-bundled with source, license, and retrieval metadata.