Attribution
- Base model: Qwen/Qwen3.5-0.8B (Qwen team, Apache-2.0).
- Data: LocalLLaMA/typed-decisions
invoice_processing, matches_order question (synthetic, Apache-2.0). Training used 245 train + 55 validation cases carved from its 300 train cases by hash of the case state; its 100 test cases were held out untouched.
- Method: EvoScientist/SearchJev, soft-label cross-entropy + Brier loss on the label-token readout, LoRA r=16 alpha=32, 5 epochs, fp16 on a Colab GPU.
Results (original 100 held-out cases: 46 REVIEW, 54 PASS)
Table with columns: Model, Correct, REVIEW missed, False alarms| Model | Correct | REVIEW missed | False alarms |
|---|
| Base Qwen3.5-0.8B, same prompt | 56/100 | 19/46 | 25/54 |
| Tuned adapter (fp16) | 95/100 | 3/46 | 2/54 |
| Q5_K_M GGUF (581 MB, default) | 95/100 | 3/46 | 2/54 |
| Q4_K_M GGUF (535 MB) | 90/100 | 8/46 | 2/54 |
Q8_0 and f16 also 95/100. Q5_K_M was chosen as default on all 55 validation cases (misses 8/37 REVIEW like the adapter; Q4_K_M 9/37). CPU latency (Intel i7-1165G7, llama.cpp b12774): median 1.74 s Q5_K_M, 1.84 s Q4_K_M at ~470 prompt tokens. About +/-4 points on 100 cases. Known Q5_K_M misses: invoice_processing_000048, _000072 (nothing received, predicted PASS), _000092; false alarms _000045, _000074.
Calibration
Scores are the two label logits z (PASS token id 32 = "A", REVIEW id 33 = "B"); probability = softmax(z / T) with the saved validation temperature T = 1.2545281545901361; decision = argmax. Both were fixed before the test split was scored; nothing was tuned on test. With two options, label log-probs equal logits up to a constant, so llama.cpp log-probs can be used directly.
Reproduce locally
The GGUF is a merged decision-model build. Use llama.cpp b12774. Download the GGUF and demo-request.json and run:
llama-server -m qwen35-0.8b-invoice-Q5_K_M.gguf --port 8091 -c 2048 -t 8 --no-warmup
In a separate terminal, run the following Python code from the directory containing the JSON request. The request contains the frozen SearchJev token IDs for public synthetic case invoice_processing_000016, which has a price mismatch.
import jsonimport mathimport urllib.requestfrom pathlib import Path request = urllib.request.Request( "http://127.0.0.1:8091/completion", Path("demo-request.json").read_bytes(), {"Content-Type": "application/json"},)with urllib.request.urlopen(request, timeout=60) as response: top = json.load(response)["completion_probabilities"][0]["top_logprobs"]logprobs = {entry["id"]: entry["logprob"] for entry in top}p_review = 1 / (1 + math.exp((logprobs[32] - logprobs[33]) / 1.2545281545901361))print("REVIEW" if p_review > 0.5 else "PASS", round(p_review, 3))
Expected result: REVIEW, with probability about 0.863. To encode a new case, use the upstream SearchJev PromptBuilder with the invoice state and the two PASS/REVIEW options. The sampled token from llama.cpp is ignored. The included validation calibration and label-space files describe the decision readout.
Conversion: merged LoRA in fp32, converted with llama.cpp b12774 to an f16 GGUF, then quantized with llama-quantize to Q5_K_M.
Limits
Synthetic, templated data; the tuned model learned that generator. Borderline cases (P near 0.5) are common among errors. No evaluation on real documents.