Thaki-PolicyGate-9B-v0.1 (research preview)
🇰🇷 한국어 카드: MODEL_CARD.ko.md
A 9B model that reads a Korean administrative case together with the regulation text it falls under, and writes down
what the regulation says and what the case states as a JSON intermediate representation (IR). It does not
decide anything by itself. A separate deterministic backend, ThakiCloud/Thaki-PolicyGate-runtime
(v2.9), checks every field of that IR against the source text. It then either picks an answer or abstains with
규정상 확인 불가 ("cannot be determined from the regulation"). You need both parts to reproduce the numbers below.
This is a research preview. It has not been independently evaluated, and it must not be used to approve or deny anything without human review.
Scope. This is a specialist for one kind of question: does a Korean case meet the conditions written in a Korean regulation, and which answer does the regulation then give? It is not a general-purpose decision model. It was not trained or evaluated on routing, tool selection, agent actions, recommendation, scoring arbitrary states, images or other languages, and it returns a decision only through the rule-checking backend, not as calibrated option probabilities.
0. How to use it
The model is only useful through the runtime. The extractor prompt is fixed by code
(esg_v27_extract2.prompt); do not write your own prompt.
# 1 GPU with at least 40 GB. Same engine and flags as every number in this card.
huggingface-cli download ThakiCloud/Thaki-PolicyGate-runtime --local-dir policygate-runtime
cd policygate-runtime && pip install vllm==0.28.0
python3 tests/test_examples.py # offline check of the decision path (no GPU)
MODEL=ThakiCloud/Thaki-PolicyGate-9B-v0.1 python3 serve/launch.py # vLLM on 127.0.0.1:8000 + API on :8080
import json, urllib.request
req = {
"doc": "[사례]\n- 갑은 자원봉사 우수 인증자로 확인되었다.\n- 갑이 요청한 서류는 두 부이다.\n\n[규정 원문]\n"
"제35조(감면 비율) 자원봉사 우수 인증자에 대한 경계 복원 측량 수수료의 감면율은 100분의 74로 한다.\n"
"제36조 제35조에도 불구하고 같은 서류를 열 부 넘게 신청한 경우에는 100분의 47을 감면한다.",
"q": "규정에 따를 때 신청인이 감면받는 경계 복원 측량 수수료의 비율은 얼마인가?",
"options": ["100분의 41", "100분의 74", "100분의 47", "100분의 52", "규정상 확인 불가"],
}
r = urllib.request.Request("http://127.0.0.1:8080/v1/decide", data=json.dumps(req).encode(),
headers={"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(r))["decision"])
The response contains decision, status (ALLOW or ABSTAIN), level, abstain_reason, ir (the model's JSON),
timing_ms and advisory: true. Level V means the answer passed the source-text check; A means it was accepted by a
weaker check. Abstain reasons are parse_fail, schema_fail, truncated, backend_unverified and llm_error.
Output that does not parse, breaks the schema or is cut off always ends in ABSTAIN; malformed output never becomes an answer.
Decoding: temperature 0, max_tokens=2400, vLLM 0.28.0, bf16.
0.1 What v2.9 changes: the numeric polarity guard
In the request above the case says the applicant asked for two copies, while the exception applies to
"more than ten copies". The extractor marked that exception condition as met. Backend v2.8 accepted the IR and
answered 100분의 47 at level A, which is wrong. Backend v2.9 reads the threshold and the stated quantity itself.
They contradict the model's polarity, so v2.9 lowers the grade and returns 규정상 확인 불가.
The guard only ever moves an answer to abstain. It compares numbers only when all of these hold:
- The condition is a numeric threshold (넘게·초과·이상·이하·이내·미만·N번째).
- The case sentence states exactly one quantity in the same unit.
- That quantity is about the same person and the same attribute.
- The sentence has no negation.
If anything is unclear, the v2.8 decision stands unchanged.
On the development sets this release's A-level false allows went from 4 to 0; all four were this pattern, and no correct answer was blocked. In a positive control that flipped the model's polarity on purpose, the guard blocked every flip that changes a decision (104/104).
1. Development evaluation (not independent)
Both splits come from deterministic generators. VAL uses templates seen in training; DIAG uses diagnostic phrasings. Extra over-blocking is the share of answers that the backend can verify from a gold IR but the model path failed to keep. A false allow is a wrong answer that was not an abstention, counted by level. Lower is better for all three.
| Split | n | System | Extra over-blocking (pp) | False allow V | False allow A |
|---|---|---|---|---|---|
| VAL | 1640 | this release (noaug-s0 + v2.9) | 2.02 | 0 | 0 |
| VAL | 1640 | baseline (aug-s1 + v2.8) | 2.11 | 0 | 0 |
| DIAG | 1448 | this release (noaug-s0 + v2.9) | 4.61 | 0 | 0 |
| DIAG | 1448 | baseline (aug-s1 + v2.8) | 10.25 | 0 | 0 |
By family (extra over-blocking, pp):
| Family | VAL this / baseline | DIAG this / baseline |
|---|---|---|
| F5 (fee base/exception) | 1.43 / 0.00 | 0.51 / 0.51 |
| F6 (conditions stated in other words) | 0.00 / 0.00 | 11.28 / 35.90 |
| H (heading/reorder) | 0.00 / 0.00 | 0.00 / 0.74 |
| P (approval/delegation) | 2.00 / 6.40 | 7.33 / 9.33 |
| R (references/dates) | 5.77 / 2.69 | 0.00 / 0.00 |
Keep the following in mind when reading these numbers:
- The v2.9 guard was designed after looking at the four DIAG false allows, so the DIAG result is not evidence of generalization.
- This checkpoint is a single training seed. A three-seed study of the same recipe was a NO-GO, and that verdict stands.
- The baseline is better on VAL F5 and R. The R gap is about 8 of 260 items.
noaug-s0andaug-s1are different checkpoints. The gap between the rows comes from picking the better checkpoint, not from improving one model.- Sealed held-out sets (G10, G11 and others) were not opened for this release.
2. Serving (1× B200)
Measured once on 1× NVIDIA B200 with vLLM 0.28.0 (bf16, max_num_seqs=64, max_model_len=16384, gpu_memory_utilization=0.88, temperature 0, max_tokens=2400), with the API and backend v2.9 in the same pod. This is a single run, so treat it as an order of magnitude rather than a benchmark.
| Load | Requests/s | p50 (ms) | p95 (ms) | Errors |
|---|---|---|---|---|
| 1 concurrent × 100 | 1.46 | 682.9 | 737.2 | 0 |
| 8 concurrent × 400 | 7.26 | 1070.5 | 1424.8 | 0 |
| 32 concurrent × 400 | 22.09 | 1378.5 | 1676.7 | 0 |
The backend takes at most 2.9 ms per request at p95. Almost all latency is the extractor generating JSON.
Running the full VAL (1640) and DIAG (1448) sets through the released code on this GPU agreed with the recorded development run on 99.88% and 99.79% of decisions (greedy decoding is not bit-identical from run to run). False allows: 0 at level V and 0 at level A. Extra over-blocking: 2.02 pp on VAL and 4.92 pp on DIAG. Numeric-guard cases blocked: 4/4.
After downloading both repositories fresh and starting them again, 300 of 300 decisions on the same items matched.
3. Intended use and limits
Intended use: research on verifiable extraction for Korean regulation questions, and reproducing or probing the numbers above.
Out of scope:
- automated approval, denial, payment, eligibility or any other decision that affects a person
- customer-facing deployment
- regulations, document layouts or question types outside the development distribution
Known limits:
- F6 is still open. When a case states a condition in different words, the extractor often misses it. The result is an abstention, not a wrong answer.
- On the development data the numeric guard computed only three units: copies, ordinal counts and ages. Other quantity expressions are untested.
- The guard does not catch polarity errors on non-numeric conditions.
- Training documents were up to about 6k tokens. Longer inputs are untested.
- The merged bf16 weights are not bit-identical to the base plus the LoRA adapter. Every number here was measured on this merged file.
4. Training data
- 6,151 synthetic records from deterministic Python generators. Each record has a case, a question, five options and a gold IR. No LLM wrote these records.
- Padding paragraphs are verbatim Korean statutes from the National Law Information Center (www.law.go.kr) and its mirror casenote.kr. Korean statutes are not protected works under Article 7 of the Korean Copyright Act.
- The organisations, people and fee rules are fictional and were generated by the code.
- No AI Hub data was used. No training or evaluation data is distributed.
- Training settings were as follows; the result was merged in bf16.
- LoRA r=16 on all attention, MLP and linear-attention projections
- lr 1e-4, batch 4×4, 2 epochs (770 steps)
- max length 6,144, seed 0
5. Reproduce
| What | Value |
|---|---|
| Base | Qwen/Qwen3.5-9B @ c202236235762e1c871ad0ccb60c8ee5ba337b9a (shard SHA-256 verified) |
model.safetensors SHA-256 | f2b49c7e8ec7db8146952930b1b37bc5d5af950784214c82389f42b2d7cf2c71 |
| Runtime | ThakiCloud/Thaki-PolicyGate-runtime 0.1.0, backend esg_v29_backend 8d3cfe6213da2d6a over v2.8 54c00363a38f31c8 |
| Engine | vLLM 0.28.0, bf16 |
Every file is listed in SHA256SUMS and MANIFEST.json.
6. License
Apache-2.0, the same as the base model (see LICENSE and NOTICE). Built by ThakiCloud.