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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- architecture
|
| 7 |
+
- floor-plan
|
| 8 |
+
- design
|
| 9 |
+
- residential
|
| 10 |
+
- text-generation
|
| 11 |
+
- sft
|
| 12 |
+
- lora
|
| 13 |
+
datasets:
|
| 14 |
+
- Nithins03/us-architectural-floorplan-sft
|
| 15 |
+
base_model: Qwen/Qwen2.5-3B-Instruct
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# π US Architectural Floor Plan LLM
|
| 20 |
+
|
| 21 |
+
An LLM fine-tuned to design residential floor plans following **US architectural conventions** β IRC building codes, American room types, and standard design patterns.
|
| 22 |
+
|
| 23 |
+
## Model Description
|
| 24 |
+
|
| 25 |
+
- **Base Model:** [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct) (3B parameters)
|
| 26 |
+
- **Training Method:** SFT (Supervised Fine-Tuning) with LoRA adapters
|
| 27 |
+
- **Dataset:** [Nithins03/us-architectural-floorplan-sft](https://huggingface.co/datasets/Nithins03/us-architectural-floorplan-sft) β 12,000 examples
|
| 28 |
+
- **Output Format:** Design reasoning + structured JSON floor plans
|
| 29 |
+
|
| 30 |
+
## Capabilities
|
| 31 |
+
|
| 32 |
+
β
Generate complete US residential floor plans (ranch, colonial, craftsman, farmhouse, etc.)
|
| 33 |
+
β
Follow IRC (International Residential Code) minimum standards
|
| 34 |
+
β
Include room dimensions, furniture placement, and adjacency relationships
|
| 35 |
+
β
Handle various house styles: ranch, colonial, cape cod, craftsman, modern farmhouse, split-level, cottage, Mediterranean
|
| 36 |
+
β
Provide architectural design reasoning before layouts
|
| 37 |
+
β
Output structured JSON with room polygons, openings (doors/windows), and furniture
|
| 38 |
+
|
| 39 |
+
## Quick Start
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
from transformers import pipeline
|
| 43 |
+
|
| 44 |
+
pipe = pipeline("text-generation", model="Nithins03/us-architectural-floorplan-llm")
|
| 45 |
+
|
| 46 |
+
messages = [
|
| 47 |
+
{"role": "system", "content": "You are an expert US residential architect specializing in floor plan design. You follow IRC standards and American architectural conventions."},
|
| 48 |
+
{"role": "user", "content": "Design a 2,200 sq ft craftsman home with 3 bedrooms, 2.5 bathrooms, open kitchen/living, attached garage, and mudroom."}
|
| 49 |
+
]
|
| 50 |
+
|
| 51 |
+
response = pipe(messages, max_new_tokens=4096)
|
| 52 |
+
print(response[0]["generated_text"][-1]["content"])
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## Example Output
|
| 56 |
+
|
| 57 |
+
**Prompt:** *"Design a 1,800 sq ft ranch home with 3 bedrooms, 2 bathrooms, open floor plan, and attached 2-car garage."*
|
| 58 |
+
|
| 59 |
+
**Response:**
|
| 60 |
+
```
|
| 61 |
+
## Design Reasoning
|
| 62 |
+
This single-story ranch home features 3 bedrooms and 2 bathrooms across 1,800 square feet.
|
| 63 |
+
The kitchen, living room, and dining area flow together in an open concept layout, characteristic
|
| 64 |
+
of modern American residential design. An attached garage provides direct indoor access through
|
| 65 |
+
a mudroom. The master suite is positioned for privacy with a split-bedroom layout.
|
| 66 |
+
|
| 67 |
+
## Floor Plan
|
| 68 |
+
{
|
| 69 |
+
"style": "ranch",
|
| 70 |
+
"total_area_sqft": 1812.5,
|
| 71 |
+
"stories": 1,
|
| 72 |
+
"rooms": [
|
| 73 |
+
{"room_type": "living_room", "area_sqft": 280, "dimensions": {"width_ft": 20, "height_ft": 14}},
|
| 74 |
+
{"room_type": "kitchen", "area_sqft": 180, "dimensions": {"width_ft": 15, "height_ft": 12}},
|
| 75 |
+
{"room_type": "master_bedroom", "area_sqft": 225, "dimensions": {"width_ft": 15, "height_ft": 15}},
|
| 76 |
+
...
|
| 77 |
+
],
|
| 78 |
+
"adjacency": [["living_room_1", "kitchen_2"], ["kitchen_2", "dining_room_3"], ...],
|
| 79 |
+
"units": "feet"
|
| 80 |
+
}
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Training Details
|
| 84 |
+
|
| 85 |
+
| Parameter | Value |
|
| 86 |
+
|-----------|-------|
|
| 87 |
+
| Base Model | Qwen/Qwen2.5-3B-Instruct |
|
| 88 |
+
| LoRA Rank | 128 |
|
| 89 |
+
| LoRA Alpha | 32 |
|
| 90 |
+
| LoRA Target | all-linear |
|
| 91 |
+
| Learning Rate | 1e-4 |
|
| 92 |
+
| Epochs | 5 |
|
| 93 |
+
| Effective Batch Size | 8 |
|
| 94 |
+
| Max Sequence Length | 4,096 |
|
| 95 |
+
| Scheduler | Cosine with warmup |
|
| 96 |
+
| Loss | SFT (assistant-only) |
|
| 97 |
+
|
| 98 |
+
### Dataset Composition
|
| 99 |
+
- **2,000** room layouts from [FloorplanQA-Layouts](https://huggingface.co/datasets/OldDelorean/FloorplanQA-Layouts) (converted to US feet)
|
| 100 |
+
- **8,000** synthetic whole-house US floor plans (8 architectural styles)
|
| 101 |
+
- **2,000** architectural design Q&A knowledge examples
|
| 102 |
+
|
| 103 |
+
### Training Recipe Based On
|
| 104 |
+
- [OptiScene](https://arxiv.org/abs/2506.07570) β SFT + semantic reasoning before coordinates
|
| 105 |
+
- [DStruct2Design](https://arxiv.org/abs/2407.15723) β JSON floor plan representation
|
| 106 |
+
- [LoRA Without Regret](https://huggingface.co/docs/trl/lora_without_regret) β LoRA best practices
|
| 107 |
+
- [Architext](https://arxiv.org/abs/2303.07519) β LLM-based floor plan generation pioneer
|
| 108 |
+
|
| 109 |
+
## How to Train
|
| 110 |
+
|
| 111 |
+
### Option 1: HuggingFace Jobs (recommended)
|
| 112 |
+
```bash
|
| 113 |
+
pip install huggingface_hub
|
| 114 |
+
huggingface-cli login
|
| 115 |
+
|
| 116 |
+
# Launch training
|
| 117 |
+
hf jobs run train.py \
|
| 118 |
+
--flavor a10g-large \
|
| 119 |
+
--timeout 6h \
|
| 120 |
+
--secrets HF_TOKEN
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
### Option 2: Local Training
|
| 124 |
+
```bash
|
| 125 |
+
pip install torch transformers trl peft datasets accelerate trackio bitsandbytes
|
| 126 |
+
python train.py
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
### Hardware Requirements
|
| 130 |
+
- **Minimum:** 1x NVIDIA T4 (16GB VRAM) β will be slow
|
| 131 |
+
- **Recommended:** 1x NVIDIA A10G (24GB VRAM) β ~4 hours
|
| 132 |
+
- **Optimal:** 1x NVIDIA A100 (80GB VRAM) β ~2 hours
|
| 133 |
+
|
| 134 |
+
## US Architectural Styles Covered
|
| 135 |
+
|
| 136 |
+
| Style | Typical Sq Ft | Stories | Key Features |
|
| 137 |
+
|-------|--------------|---------|--------------|
|
| 138 |
+
| Ranch | 1,200β2,200 | 1 | Open floor plan, attached garage |
|
| 139 |
+
| Colonial | 2,000β3,500 | 2 | Center hall, formal dining, symmetrical |
|
| 140 |
+
| Cape Cod | 1,400β2,400 | 1.5 | Dormers, steep roof, compact |
|
| 141 |
+
| Craftsman | 1,500β2,800 | 1 | Covered porch, built-ins, columns |
|
| 142 |
+
| Modern Farmhouse | 1,800β3,200 | 2 | Large porch, open concept, mudroom |
|
| 143 |
+
| Split-Level | 1,500β2,500 | 3 | Tri-level, sunken living room |
|
| 144 |
+
| Cottage | 800β1,600 | 1 | Compact, cozy proportions |
|
| 145 |
+
| Mediterranean | 2,200β4,000 | 2 | Courtyard, arched doorways |
|
| 146 |
+
|
| 147 |
+
## Limitations
|
| 148 |
+
|
| 149 |
+
- Floor plans are simplified rectangular room layouts (no complex curved or irregular shapes)
|
| 150 |
+
- Coordinates are from a simple grid-based placement β not architecturally optimal
|
| 151 |
+
- No structural engineering validation (load-bearing walls, foundation, etc.)
|
| 152 |
+
- No MEP (Mechanical, Electrical, Plumbing) routing
|
| 153 |
+
- Best used as a starting point for professional architectural review
|
| 154 |
+
|
| 155 |
+
## Citation
|
| 156 |
+
|
| 157 |
+
```bibtex
|
| 158 |
+
@misc{us-floorplan-llm-2025,
|
| 159 |
+
title={US Architectural Floor Plan LLM},
|
| 160 |
+
author={Nithins03},
|
| 161 |
+
year={2025},
|
| 162 |
+
publisher={HuggingFace},
|
| 163 |
+
url={https://huggingface.co/Nithins03/us-architectural-floorplan-llm}
|
| 164 |
+
}
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
## Acknowledgments
|
| 168 |
+
|
| 169 |
+
Built upon research from:
|
| 170 |
+
- [OptiScene](https://arxiv.org/abs/2506.07570) (Qwen3-8B SFT+DPO for layouts)
|
| 171 |
+
- [DStruct2Design](https://arxiv.org/abs/2407.15723) (LLaMA3 for JSON floor plans)
|
| 172 |
+
- [Architext](https://arxiv.org/abs/2303.07519) (GPT-J for floor plan generation)
|
| 173 |
+
- [FloorplanVLM](https://arxiv.org/abs/2602.06507) (Progressive SFT for floorplans)
|
| 174 |
+
- [FMLM](https://arxiv.org/abs/2604.04859) (Floorplan Markup Language)
|