Train your own Decision Model with Unsloth
Fine-tune LLMs like Qwen and Gemma to make decisions with calibrated probabilities.
You can now train your own decision model like Jev, Laya and Clef with Unsloth. Learn how to fine-tune Qwen3.8 and Gemma 4 LLMs, design effective dataset formats, and transform them into decision-making models that make decisions instead of generating text. The fine-tuned model reads your input, scores the options you provide and returns a choice with a probability.
See table for benchmarks after training:
Qwen3.5-0.8B
36% -> 73%
7% -> 74%
19% -> 76%
78%
Qwen3.5-2B
33% -> 78%
1% -> 58%
1% -> 62%
81%
We fine-tuned LLMs with a Clef head using LoRA (r=64) for just one epoch, boosting downstream accuracy from 30–37% (which is roughly chance level) to as high as 78%.
Training uses the same dataset format as Laya and Clef. Test sets were decontaminated against the training data.
All models work as well - and you can also further fine-tune Decision models like Laya / Clef.
Qwen3.5-0.8B
78%
4GB
42 min
Qwen3.5-2B
81%
8GB
40 min
Llama 3.2 3B
79%
4.1GB
30 min
Gemma 4 E4B
77%
14.4GB
49 min
Laya (fine-tuned)
77%
2.5GB
10 min
We used a mix of 12 sources, plus typed-decisions: ag_news, arc, banking77, boolq, clinc150, commonsense_qa, mmlu, mnli, prompt_injections, snli, sst5 and wanli. The test set contained 3,000 rows: 2000 from typed-decisions, 500 from BANKING77 and 500 from CLINC150.
🦥 Train in Unsloth
Setup Unsloth
The easiest way to get started is by downloading the Unsloth Desktop app. Works on macOS, Windows, and Linux.
Or, if you prefer to install manually:
MacOS, Linux, WSL:
curl -fsSL https://unsloth.ai/install.sh | shWindows PowerShell:
irm https://unsloth.ai/install.ps1 | iexSelect your model and dataset
Open the Train tab and pick an LLM, like unsloth/Qwen3.5-4B. Then set Train as to Decision model. Unsloth fills in settings that work well. To match our results, set epochs to 2, LoRA rank to 16 and learning rate to 2e-4.
Upload a file or pick a dataset from Hugging Face, in the dataset format. For typed-decisions, set Subset to all.

You can also play with the trained decision model via the "Try It" option in the Decision API:


📒 Use our free notebooks
You can train your own decision model completely for free using our Google Colab or Kaggle notebooks. Colab and Kaggle both offer generous free GPU compute as long as you have a Google account. In these notebooks there is a step-by-step workflow you can work through and we show you how to data prep, train the actual model (in this case Qwen3.5-4B) and export it.
Fine-tune Qwen3.5-4B into a decision model via our free notebooks:
You can also use our free Unsloth Studio notebook, to train a decision model with a UI interface:
📈 Dataset Guide
Decision-model datasets contain an input, questions about that input, and the correct answers. Each row uses three fields:
state
The input, such as a customer message.
questions
What the model should decide, with instructions and available options.
gold
The correct answer to each question.
Each row can contain several questions. questions and gold can be Python dictionaries or JSON-encoded strings.
Question types
choice
Picks an option from criteria.
The option key, such as "billing".
noul
Answers yes or no.
True or False in Python; true or false in JSON.
score
Picks a level from an ordered criteria list.
The level's index, starting at 0.
Example: support tickets
This example uses the support-ticket questions from our decision-model notebook, with training labels and two additional sample tickets.
Each question needs a matching answer in gold. Choice answers must match a key in criteria. Score labels start at 0, so "urgency": 2 means "today".
Keep inputs in state and answers in gold. These rows illustrate the format; add more examples covering your use case before training.
🎯 Make decisions
Give predict an input and the questions to decide, in the same format as your dataset:
answer is the option key for choice, True or False for noul, and the level number for score. Each answer also has the same fields as a Decision API answer.
To check accuracy on a labeled test set, use evaluate:
Use it in the Decision API
You can read our detailed guide for serving/running decision models otherwise read below for a quick summary. Models you train in Unsloth show up in Settings → API. For a model you trained with code, start Unsloth with the merged folder you saved:
Turn on the Decision API in Settings → API. Requests that use laya, default or jev-latest now go to your model, and the answers have the same format as Laya's. The model needs a GPU and loads on the first request, which can take a few minutes. While a training run is using the GPU, the Decision API waits and starts answering again when the run ends.
How it works
Unsloth puts your input in one prompt, followed by every question and its options. The LLM reads it once. A small head, the same design as Cloudflare's Clef, looks at the LLM's output over each question and option and scores every option, deciding all the questions together. It never writes text, so it doesn't spend memory on the LLM's word predictions.
🐍 Train with code
Install or update Unsloth with pip install --upgrade unsloth, and use the following code to train your own decision model.
To use Llama or Gemma 4, change model_name to unsloth/Llama-3.2-3B-Instruct or unsloth/gemma-4-E4B-it. Other LLMs that Unsloth can fine-tune should work the same way.
For your own data, see the dataset format. Each row has a state, the questions to decide and the gold answers.
Calibrate and save
Calibrate on the rows split_holdout kept out, so the model's probabilities match how often it's right:
Then save. save_pretrained saves the LoRA adapters and the head. save_pretrained_merged saves a full 16-bit model:
Load it again the same way you loaded the base model:
⚙️ Recommended settings
Start with 4-bit LoRA at rank 16 and a learning rate of 2e-4. The new head trains at 1e-4 by default. You can change that with
head_learning_rateinDecisionTrainer.We used 2 epochs on typed-decisions. With less data, try 3 or 4.
For a quick try, set
max_steps = 60. Qwen3.5-4B reached 76% in 10 minutes on an L4.If you run out of memory, halve the batch size and double gradient accumulation.
max_seq_lengthsets the longest input during training. Long inputs keep the question and options, and cut the end of the input to fit. Predictions read up to 16,384 tokens.
Last updated
Was this helpful?




