DCL-Qwen3-4B-Instruct-2507

A 4B model fine-tuned to author and repair DCL — the Declarative Capability Language created by Russell East, a closed-vocabulary language for modelling business-system capabilities. This model is an open thank-you back to DCL's author, who wrote about our production use of the language. It is small enough to run on an ordinary developer laptop (the GGUF build is ~2.5 GB).

Its one measured skill: making the first authoring attempt compile clean. On our frozen, compiler-graded exam the stock base model never produced a first attempt that compiled (0/9, with a bounded repair pass rescuing only 2); this fine-tune passed 7/9 — every pass a first-attempt clean compile, the repair pass contributing nothing — while keeping the base's perfect 3/3 repair skill. Full receipts: RESULTS · base-selection COMPARISON.

Candidate (Q4 GGUF) Zero-shot authoring Protocol authoring Repair
35B reference seat 0/9 9/9 3/3
Stock Qwen3-4B-Instruct-2507 0/9 2/9 3/3
This model 0/9 7/9 3/3

Protocol = the vocabulary reference in the prompt + at most one compiler-diagnostics repair pass; grading is by the DCL compiler only, on a frozen 4-task exam, 3 reps each.

How to use it (this matters)

The model was trained — and examined — under one serving contract. Use the same one:

  1. System prompt: Output ONLY the DCL source. No prose, no explanation, no markdown fences.
  2. Put the DCL vocabulary reference in the user prompt alongside your feature brief. DCL is a closed vocabulary; no model we tested (including a 35B) authors it from memory. The compiler-verified reference sheet ships with the language — see the Capability-Language repo and the reference used in training.
  3. For repair: give it the broken .dcl plus the compiler diagnostics and ask for the corrected source.
  4. The model emits bare DCL source (no markdown fences) — pipe it straight to the compiler.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

m = AutoModelForCausalLM.from_pretrained("RichWoollcott/DCL-Qwen3-4B-Instruct-2507",
                                         dtype=torch.bfloat16, device_map="auto")
t = AutoTokenizer.from_pretrained("RichWoollcott/DCL-Qwen3-4B-Instruct-2507")
msgs = [
    {"role": "system", "content": "Output ONLY the DCL source. No prose, no explanation, no markdown fences."},
    {"role": "user", "content": "## Feature brief\n<your brief>\n\n## DCL vocabulary reference (closed — author using ONLY these literals)\n<paste the reference sheet>"},
]
enc = t.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(m.device)
out = m.generate(**enc, max_new_tokens=800)
print(t.decode(out[0][enc["input_ids"].shape[1]:], skip_special_tokens=True))

Training

QLoRA (r=16, α=32, attention+MLP targets) on 507 compiler-verified, fully synthetic rows (87 authoring + 420 repair; authoring rows oversampled ×2), 2 epochs, ~25 minutes on a DGX Spark. The corpus is kept private to protect the integrity of the frozen evaluation exam — a training set in the wild eventually leaks into future base models and quietly inflates their "stock" scores. Every training label was fixed by the DCL compiler, never by a model or a human. The full runbook — including the three failure modes we hit and fixed (a silently-swapped chat template; training targets on near-untrained special tokens, invisible to training loss; fenced targets that broke the serving contract) — is public: RUNBOOK-dcl-fine-tune.md.

Limitations — read before relying on it

  • Zero-shot (no vocabulary sheet in the prompt) it scores 0/9 — as does every model we tested, including a 35B. The reference-in-prompt usage above is the model, not a tip.
  • The hardest exam constructs (multi-outcome waiting/decision/recovery lifecycles) pass 1/3 — when its first attempt is dirty there, a repair pass rarely rescues it.
  • Trained on English feature briefs across 77 synthetic business domains; DCL v1.0 only.
  • Always run the output through the DCL compiler. The whole design assumes a compiler in the loop; the model's honesty comes from that loop, not from the model.

Variants

Links & credit

Downloads last month
17
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for RichWoollcott/DCL-Qwen3-4B-Instruct-2507

Finetuned
(1840)
this model
Quantizations
2 models