UVL feature-model generator — merged SFT model (bf16, CUDA-ready)
A standalone, full-precision (bf16) model: the SFT LoRA adapter merged into
Qwen/Qwen2.5-Coder-7B-Instruct.
It generates UVL (Universal Variability Language) feature models from a domain
description and structural constraints (feature count, cross-tree constraints,
depth, UVL level).
Unlike the MLX 4-bit fused model
(Apple Silicon only), this one loads directly with 🤗 transformers and runs on
CUDA / CPU / anywhere. It was merged on an NVIDIA B300 with
PeftModel.merge_and_unload().
Trained with fine-tunning-uvl on
the good/bad generations of the UVL_LLM_Guided_Generation benchmark, supervised
on the valid (flamapy-parseable) outputs with prompt masking.
Results
Valid-UVL rate on a 62-prompt held-out test set (flamapy validator):
- single-shot, raw: 77.42%
- single-shot + dedup: 96.77%
- SFT + retry-until-valid(5) + light post-processing: 96.77%
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "jagalindo/uvl-qwen2.5-coder-7b-sft-merged"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", device_map="auto")
messages = [
{"role": "system", "content": "You are an expert in Software Product Lines ... generate valid UVL ..."},
{"role": "user", "content": "## Your task\nGenerate a valid UVL feature model for ..."},
]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=1536, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
~16 GB VRAM in bf16; load with load_in_4bit=True (bitsandbytes) for ~6 GB.
For best results, sample a few candidates and keep the first that parses with
flamapy (retry-until-valid), then apply the project's light post-processing.
Limitations
Small/medium model on a niche DSL; not every generation parses on the first try. Use retry-until-valid + the project's light post-processing (dedup feature names, drop dangling constraints, quote non-identifier namespaces) to reach the headline rate.
Related models
Part of the fine-tunning-uvl
project — artifacts from the same training run, all based on
Qwen/Qwen2.5-Coder-7B-Instruct:
jagalindo/uvl-qwen2.5-coder-7b-sft-merged— this model: merged bf16 full model (CUDA-ready, transformers)jagalindo/uvl-qwen2.5-coder-7b-sft— fused MLX 4-bit model (Apple Silicon / mlx-lm)jagalindo/uvl-qwen2.5-coder-7b-sft-lora— SFT LoRA adapter (apply on the base)jagalindo/uvl-qwen2.5-coder-7b-dpo-lora— DPO LoRA adapter (experimental; regressed vs SFT)