Qwen3-1.7B-BrickGPT-BrickMore-48 (LoRA, merged)
Qwen3-1.7B fine-tuned on the BrickMore dataset for text-to-brick (LEGO structure) generation in a 48×48×48 voxel world with 20 brick types, using bilingual (Chinese/English) captions at 5 description levels (L1 concise → L5 detailed). This is the merged model (LoRA weights merged into the base), ready for inference with transformers/vLLM.
Training details
- Base model: Qwen/Qwen3-1.7B
- Dataset: BrickMore — 79,322 models × 5 captions = 396,610 samples (356,955 train / 39,655 test, 90/10 split by model, seed 42)
- Method: LoRA SFT, strictly following the official BrickGPT recipe on its locked dependency stack (trl 0.17.0 / transformers 4.51.3 / peft 0.15.2 / datasets 3.6.0 / accelerate 1.6.0)
- r=16, alpha=32, dropout=0.05, target modules: all linear (q/k/v/o/gate/up/down)
- lr 1e-4, cosine schedule, warmup 100 steps
- 3 epochs, effective batch 8, max_length 8192, bf16, unpacked sequences
- Hardware: 8× RTX 4090D (DDP), 25.3 h, ~2.19B tokens total
Results
| stage | eval_loss |
|---|---|
| early (step 500) | 0.1410 |
| end of epoch 1 | 0.0337 |
| best (step 79,000, epoch 1.77) | 0.0308 |
| end of epoch 3 | 0.0339 |
Epoch 3 slightly overfits; the best checkpoint was auto-selected via load_best_model_at_end (2 epochs is the sweet spot on this dataset).
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained("Kyle308666/BrickGPT-Qwen3-1.7B-BrickMore-48", torch_dtype=torch.bfloat16)
tok = AutoTokenizer.from_pretrained("Kyle308666/BrickGPT-Qwen3-1.7B-BrickMore-48")
- Prompt format follows the Qwen3 chat template; generate with
enable_thinking=False. - The assistant output is a serialized brick-placement sequence over a 48³ grid (20 brick types, coordinates 0–47) — parse and validate it with a 48³ pipeline (the original 20³ StableText2Brick pipeline is not compatible).
- The standalone LoRA adapter is included in
lora_adapter/if you prefer to merge it yourself or continue training; the full training log history is intrainer_state.json.
Notes
- Trained for research on structured generation; eval loss is a weak proxy — evaluate with actual generation + assembly validation.
- Base model Apache-2.0 (Qwen3). Dataset: BrickMore (see its license terms).