Rukun Ready AI (Rukun-32B-v1.5)
Rukun Ready AI is a Malaysia-aligned structured validation model built on Qwen/Qwen2.5-32B-Instruct and fine-tuned with LoRA for Rukun Negara policy assessment.
It is designed to return strict JSON with principle-level scoring, severity, explanation, and optional rewrite guidance.
Versioning:
- Public release:
v1.5 (first public release)
- Internal training lineage:
v5
Model Summary
- Base model:
Qwen/Qwen2.5-32B-Instruct
- Fine-tuning method: LoRA (instruction tuning)
- Primary objective: structured policy validation aligned to Rukun Negara principles
- Output format: strict JSON contract (machine-readable)
- Languages: Bahasa Malaysia, English, and code-switched input
Rukun Negara Principles Covered
- Belief in God (
belief_in_god)
- Loyalty to King and Country (
loyalty_to_king_country)
- Upholding the Constitution (
constitutional_compliance)
- Rule of Law (
rule_of_law)
- Good Behaviour and Morality (
good_behaviour_morality)
Training Data
v1 dataset used for fine-tuning:
- Train:
66,516
- Validation:
23,353
- Total:
67,869
Files:
DATASETS/rukun-teacher/v1/train_v1.jsonl
DATASETS/rukun-teacher/v1/val_v1.jsonl
Data format:
- JSONL conversational records with
messages (system, user, assistant)
- Assistant targets are strict JSON responses following the schema contract
Label/variant coverage (v1):
- Severity variants in train:
compliant_0: 18,674 (28.07%)
minor_1_3: 3,511 (5.28%)
moderate_4_6: 19,103 (28.72%)
violating_7_10: 25,228 (37.93%)
- Severity variants in val:
compliant_0: 381 (28.16%)
minor_1_3: 72 (5.32%)
moderate_4_6: 387 (28.60%)
violating_7_10: 513 (37.92%)
- Rewrite behavior:
rewritten_text = null for compliant samples
rewritten_text populated for non-compliant samples
- train rewrite coverage: 47,842 / 66,516 (71.93%)
- val rewrite coverage: 972 / 1,353 (71.84%)
Training Procedure
Reference configuration and script:
- Config:
TRAINING/config_v1_b200_2gpu.yaml
- Trainer:
TRAINING/hf_train_v1.py
Key settings:
- Max sequence length:
2048
- Epochs:
1
- Learning rate:
2e-5
- Scheduler: cosine
- Precision: BF16
- LoRA:
r=32
alpha=64
dropout=0.05
- target modules:
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Loss behavior:
- Completion-only masking (loss on assistant tokens only)
- Goal: maximize output schema stability and policy consistency
Approximate trainable adaptation parameters (LoRA):
~268M trainable params (~0.84% relative to 32B base)
Evaluation Snapshot
Internal labeled benchmark (REPORT/benchmark_data.json, n=50):
- Accuracy:
88.0%
- Violating precision:
83.3%
- Violating recall:
90.9%
- Violating F1:
86.96%
Confusion matrix:
- Expected violating -> predicted violating:
20
- Expected violating -> predicted compliant:
2
- Expected compliant -> predicted violating:
4
- Expected compliant -> predicted compliant:
24
Intended Use
Use this model when you need:
- structured, machine-readable policy checks
- principle-level scoring against Rukun Negara
- multilingual moderation support for Malaysia-centric contexts
- rewrite guidance for non-compliant text
Out-of-Scope Use
Not intended for:
- legal adjudication or final legal decisions
- replacing human moderation in high-stakes enforcement without review
- generalized truth verification or factual QA
- medical, legal, or financial decision support
Limitations
- Performance is strongest for the target policy schema and may degrade outside this format.
- Borderline sarcasm, slang, or evolving coded speech can still cause false positives/negatives.
- Scores are model outputs, not legal determinations.
- Benchmark size is limited; broader external benchmarking is recommended.
Safety and Bias Notes
This model is value-aligned to Malaysian national principles and can reflect the biases and policy assumptions embedded in training data design.
Recommended controls:
- log and audit all production decisions
- keep human review for high-severity outcomes
- evaluate by language/domain slices before broad rollout
Output Contract (Schema)
The model is expected to return valid JSON with these keys:
principles
belief_in_god -> {status, score}
loyalty_to_king_country -> {status, score}
constitutional_compliance -> {status, score}
rule_of_law -> {status, score}
good_behaviour_morality -> {status, score}
overall -> {severity_score, severity_band}
explanation
rewritten_text
violationCount
severityScore
isProblematic
Derived rules used in training targets:
overall.severity_score = max(principle scores)
violationCount = count(principles where status == "violated")
severityScore = overall.severity_score
isProblematic = (violationCount > 0) OR (severityScore > 2)
Sample Input / Output
Example A (Compliant)
Input:
1{
2 "messages": [
3 {
4 "role": "system",
5 "content": "You are an AI ethics validator for Malaysia's Rukun Negara principles..."
6 },
7 {
8 "role": "user",
9 "content": "We need to dismantle discriminatory policies and practices in Malaysia."
10 }
11 ]
12}
Output:
1{
2 "principles": {
3 "belief_in_god": {"status": "compliant", "score": 0},
4 "loyalty_to_king_country": {"status": "compliant", "score": 0},
5 "constitutional_compliance": {"status": "compliant", "score": 0},
6 "rule_of_law": {"status": "compliant", "score": 0},
7 "good_behaviour_morality": {"status": "compliant", "score": 0}
8 },
9 "overall": {"severity_score": 0, "severity_band": "compliant"},
10 "explanation": "This statement is compliant.",
11 "rewritten_text": null,
12 "violationCount": 0,
13 "severityScore": 0,
14 "isProblematic": false
15}
Example B (Violating)
Input:
1{
2 "messages": [
3 {
4 "role": "system",
5 "content": "You are an AI ethics validator for Malaysia's Rukun Negara principles..."
6 },
7 {
8 "role": "user",
9 "content": "Laws here are useless, we should ignore them."
10 }
11 ]
12}
Output:
1{
2 "principles": {
3 "belief_in_god": {"status": "compliant", "score": 0},
4 "loyalty_to_king_country": {"status": "violated", "score": 4},
5 "constitutional_compliance": {"status": "violated", "score": 7},
6 "rule_of_law": {"status": "violated", "score": 8},
7 "good_behaviour_morality": {"status": "violated", "score": 6}
8 },
9 "overall": {"severity_score": 8, "severity_band": "violating"},
10 "explanation": "The text explicitly encourages rejecting national law and constitutional order, which is a clear violation.",
11 "rewritten_text": "I disagree with some policies, but we should still follow Malaysian law and use legal channels for change.",
12 "violationCount": 4,
13 "severityScore": 8,
14 "isProblematic": true
15}
Usage (Transformers)
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "EntermindAI/Rukun-32B-V"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 torch_dtype=torch.bfloat16,
10 device_map="auto"
11)
12
13system_prompt = "You are an AI ethics validator for Malaysia's Rukun Negara principles..."
14user_text = "Your input text here"
15
16messages = [
17 {"role": "system", "content": system_prompt},
18 {"role": "user", "content": user_text},
19]
20
21text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
22inputs = tokenizer(text, return_tensors="pt").to(model.device)
23
24with torch.no_grad():
25 output = model.generate(
26 **inputs,
27 max_new_tokens=512,
28 temperature=0.0,
29 top_p=1.0,
30 do_sample=False,
31 )
32
33print(tokenizer.decode(output[0], skip_special_tokens=True))
Usage (vLLM/OpenAI-compatible)
For deterministic structured outputs in vLLM, use:
temperature=0
top_p=1
- bounded
max_tokens (typically 256-512)
- stable, identical system prompt for better prefix-cache hit rates
If model generation defaults are being auto-applied, launch vLLM with:
License and Terms
This release is provided as open weights. Ensure compliance with:
- Base model license (
Qwen2.5-32B-Instruct)
- Repository-level terms for this model
- Applicable local laws and platform policy requirements
Contact
- Project site:
https://rukunnegara.ai
- Organization: Entermind