Skip to content

DocsTeach and trust

6 min read · updated

Teach a task

Teach decisio a question you ask again and again, from your own labelled examples. The model does not change; the server learns what your labels mean.

Register the question once, with labelled examples, and every later request that asks it is answered with what the server learned. Run this from the root of a release checkout, with your server running. The supplied ticket fixture gives you a complete registration to try:

shell
curl http://127.0.0.1:8000/v1/tasks -H 'Content-Type: application/json' -d @examples/tasks/examples.json
ResponseTrimmed to the fields this page uses
{
  "id": "ticket-routing",
  "n_examples": 120,
  "calibration": {
    "applied": false,
    "reason": "cross-validation on the labelled examples does not show a clear gain"
  },
  "head": {
    "applied": true,
    "reason": "cross-validated gain"
  }
}

Figure · Teach and trust

Teach the question, certify its answers, route on the certificate, and let the server watch.

This page is the first step.

  • A task is one question you ask again and again, with the same options in the same order every time: “Which support queue should handle this ticket?” over the same twelve queues.
  • A question whose options change every time is a dynamic task, when its instructions stay the same: which brand a product title names, each title with its own candidates.
You needFor
At least 10 labelled examplesa correction per option that removes a steady lean toward some options
A question with 10 or more options, and at least 2 examples of each; we recommend 10, which the measured gains usedthe intent head, which learns what your labels mean in your data
Examples from your own trafficthe same kind of text, and the same mix of options, as the server will see
More examples, if you will certifyhalf of them are held back to set the threshold (Certify answers)

Each example is one real input with the option you would want chosen, asked with the exact question and options you will use later.

A task is one POST /v1/tasks: an id, and the examples, each an ordinary request with one question plus the answer you want.

json
{
"id": "ticket-routing",
"examples": [
{
"request": {
"state": "My card keeps getting declined when I renew.",
"questions": {
"route": {
"type": "choice",
"instructions": "Which support queue should handle this ticket?",
"criteria": {
"billing": "Invoices, charges on the account, plan prices",
"payment_failed": "A card or bank payment was declined or failed",
"...": "..."
}
}
}
},
"answer": "payment_failed"
},
...
]
}

A shape to fill in, not a command to run.

With a server running (Get started starts one) and from the root of the clone, register the example’s 120 tickets, from a CSV:

shell
uv run python examples/tasks/register.py --id ticket-routing --data examples/tasks/train.csv
Output
120 examples, 12 labels, 10 to 10 per label
task 'ticket-routing': 120 examples, 12 options, at least 10 per option, registered in 359 s
  calibration: not applied (cross-validation on the labelled examples does not show a clear gain); cross-validated log loss 2.40036 -> 2.37137, accuracy 0.2667 -> 0.2583
  head: applied (cross-validated gain); penalty 0.0001; cross-validated log loss by penalty {"none": 2.42554, "100.0": 2.42214, "10.0": 2.39179, "1.0": 2.11252, "0.1": 1.00911, "0.01": 0.45439, "0.001": 0.28943, "0.0001": 0.23452}

Registering the same id again replaces the task.

The answer has one record for each correction, calibration and head:

FieldWhat it says
appliedtrue when later questions with this option list are answered with the correction
reasonwhy, in words: “cross-validated gain” when it was kept, because it helped on examples it was not fitted on, or what was missing

The server keeps a correction only when it helps on examples held out from fitting. On Gemma 4 12B and Decisio v3, from 50 labelled examples, choice and yes/no tasks and score tasks of 3 to 4 or 10 or more levels instead get a calibration that fits a temperature and a bias per option together, weighted by how well each fit explains your examples; it is always applied, and its record says method: "evidence_averaged_temperature_bias". When the server declines a correction, the question is answered exactly as before:

  • Too few examples: add more, up to 20 for the correction or 10 per option for the head, and register again. When the head is declined for this, short_options names the options that have too few, each with its count.
  • The plain answer is already as good: common for a clear yes/no question.
  • Labels that disagree: two people labelling the same kind of input differently look like noise, and the server declines.

The answer also carries label_review: the labelled examples whose label looks wrong, each with the option the model suggests. A flag means the model, fitted on your other examples, is at least 90% sure of another option and gives your label 2% or less.

decisio never drops or changes a label, so check each flagged example, correct it if it is wrong, and register again. A flag is a reason to look, not proof, and no flag does not mean every label is right. Label review covers choice tasks of 3 or more options and yes/no tasks with at least 20 labelled examples on Gemma 4 12B and Decisio v3; elsewhere the field says why there is no review.

Ask the question exactly as registered:

shell
uv run python examples/tasks/ask.py "My card keeps getting declined when I renew."
Output
My card keeps getting declined when I renew.
  choice payment_failed; x-decisio-tasks: ticket-routing; route text, 1510.8 ms
  payment_failed 1.000, bug 0.000, billing 0.000

The response header x-decisio-tasks: ticket-routing says the task answered it. No header means the question matched no task: check that its question and options are exactly the ones you registered.

Start the server with --tasks-dir and every task you teach is saved to disk before the server answers, and loaded again at the next start:

shell
python -m decisio.serve.vllm_engine --tasks-dir /data/tasks --require-tasks 3 ...

It is the start of a server on a card, with a directory on a volume; its other flags are the reader's.

Put the directory on a volume that outlives the server: Set up for production has the rest, and one directory belongs to one server.

/health says where the server saves its tasks, and how many it loaded and applies:

shell
curl -s http://127.0.0.1:8000/health \
| python3 -c 'import json, sys; print(json.dumps(json.load(sys.stdin)["systemone"]["task_store"], indent=1))'
ResponseOn a server started with --tasks-dir decisio-tasks, after the task above was registered
{
  "saved_to": {
    "backend": "dir",
    "path": "decisio-tasks"
  },
  "readout": {
    "loaded": 1,
    "applied": 1,
    "other_stack": 0
  },
  "abstention": {
    "loaded": 0,
    "applied": 0,
    "other_model": 0
  },
  "at_start": {
    "saved_to": {
      "backend": "dir",
      "path": "decisio-tasks"
    },
    "from_dir": {
      "readout": 0,
      "abstention": 0
    },
    "from_file": {
      "readout": 0,
      "abstention": 0
    },
    "usable": 0
  }
}

To move a task to another machine, export it and import it there, or start the server with --tasks-file tasks.json:

shell
# registered tasks and each fit's summary
curl -s http://127.0.0.1:8000/v1/tasks
# export, head parameters included
curl -s 'http://127.0.0.1:8000/v1/tasks?full=1' > tasks.json
curl -s http://127.0.0.1:8000/v1/tasks/import -H 'Content-Type: application/json' -d @tasks.json
curl -s -X DELETE http://127.0.0.1:8000/v1/tasks/ticket-routing
  • A task applies only under the model it was taught on, and only to requests of the prompt layout it was taught under: "layout" at registration, or the server’s.
  • A Gemma server that loads tasks taught under the plain layout keeps plain as its default and says so, so the tasks keep applying; requests may still ask for the header.
  • Renaming, adding or reordering an option makes a new task: teach it again.
  • To reproduce a task exactly, export and import it rather than registering it again.

On the default model, Gemma 4 31B, teaching with 10 examples per intent:

Intent setRight, untaughtRight, taughtMeasured on
BANKING77, 77 intents78.7%84.4%10 labelled examples per intent; 150 test messages; mean of 3 draws; taught in 308 s; one RTX PRO 6000, vLLM 0.30.0, 2026-10-04
CLINC150, 150 intents94.0%97.0%10 labelled examples per intent; 100 test messages; mean of 3 draws; taught in 699 s; one RTX PRO 6000, vLLM 0.30.0, 2026-10-04

These compare the taught server with the untaught one on the same messages, which none of the examples were.

  • Good fit: a long list of fine-grained options, where a model reading only the option names is weakest; a question your team already labels.
  • Not a good fit: a clear yes/no question the model already answers well. The server declines the correction and says so, and the answers stay as they were.
  • Teaching: every example is scored once, plus the fit, as in the times above.
  • Each later question: a correction costs nothing extra. With the engine in the server’s process, the default, a question the intent head answers reads its hidden state in its own request, with no extra request: on Gemma 4 12B about 55 ms of client time, where a plain question took 76 ms on first sight and 55 ms repeated (300 BANKING77 questions on one RTX PRO 6000).

The intent head's cost: measured in decisio's triage demo on decisio 0.6.0, one RTX PRO 6000, 2026-10-05.