hiepho commited on
Commit
c806a28
·
verified ·
1 Parent(s): b1c4915

VIYA v0.1-beta

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/viya_benchmarks_en.png filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - vi
5
+ - en
6
+ base_model: jhu-clsp/mmBERT-base
7
+ pipeline_tag: zero-shot-classification
8
+ tags:
9
+ - vietnamese
10
+ - fact-checking
11
+ - decision-model
12
+ - calibrated-confidence
13
+ - mmbert
14
+ datasets:
15
+ - tranthaihoa/vifactcheck
16
+ - High-Will/ViWikiFC
17
+ - presencesw/vinli_4_label
18
+ - facebook/xnli
19
+ - mteb/amazon_massive_intent
20
+ - ura-hcmut/UIT-ViHSD
21
+ - visolex/ViSFD
22
+ - taidng/UIT-ViQuAD2.0
23
+ - tals/vitaminc
24
+ - LocalLLaMA/typed-decisions
25
+ - HuggingFaceFW/fineweb-2
26
+ ---
27
+
28
+ <p align="center">
29
+ <img src="https://huggingface.co/hiepho/viya-base/resolve/main/assets/logo_wordmark.png" width="360" alt="VIYA">
30
+ </p>
31
+
32
+ <p align="center"><b>A small, fast decision model for Vietnamese</b> · 307M parameters · runs on CPU · <code>v0.1-beta</code></p>
33
+
34
+ ---
35
+
36
+ VIYA reads Vietnamese text and returns **typed decisions with calibrated confidence** in a single forward pass. It does not generate text: you describe the question and the options in plain language, and VIYA scores every option.
37
+
38
+ | Type | Returns | Example |
39
+ |---|---|---|
40
+ | `choice` | one of N options | Does the evidence **support**, **refute**, or **not decide** this claim? |
41
+ | `score` | a level on a scale | How many stars is this review? |
42
+ | `noul` | yes / no | Is this sentence a factual claim worth checking? |
43
+
44
+ Options are free text, so you can add or rename them **without retraining**.
45
+
46
+ ![VIYA benchmarks](https://huggingface.co/hiepho/viya-base/resolve/main/assets/viya_benchmarks_en.png)
47
+
48
+ ## Highlights
49
+
50
+ - **Vietnamese fact-checking.** 87.6 macro-F1 on ViFactCheck with gold evidence (human: 84.9). When it has to find the evidence itself in the full article, it scores 78.7, ahead of Gemini 1.5 Flash, XLM-R large and Mistral 7B.
51
+ - **Full fact-checking pipeline.** On ViWikiFC, VIYA finds the right evidence sentence *and* reaches the right verdict 75.7% of the time; the best published pipeline reaches 67.0%.
52
+ - **Reads Vietnamese as people type it.** Intent accuracy is 89.4 with diacritics and 88.7 without (`ko`, `dc`, no tone marks).
53
+ - **One model, many tasks.** The same weights handle fact-checking, NLI, intent, sentiment, moderation and English business decisions (75.9 on typed-decisions).
54
+ - **Knows how sure it is.** Confidence is calibrated per question type (ECE 0.03 to 0.05 on the main Vietnamese and fact-checking suites).
55
+
56
+ ## Quick start
57
+
58
+ ```bash
59
+ pip install laya
60
+ ```
61
+
62
+ ```python
63
+ import laya
64
+
65
+ viya = laya.load("hiepho/viya-base")
66
+
67
+ out = viya.predict(
68
+ {
69
+ "claim": "SAWACO ngưng cấp nước từ 12 giờ ngày 25-3.",
70
+ "evidence": "Thời gian thực hiện dự kiến từ 22 giờ ngày 25-3 đến 4 giờ ngày 26-3.",
71
+ },
72
+ {
73
+ "verdict": {
74
+ "type": "choice",
75
+ "instructions": "Đối chiếu `claim` với `evidence`: bằng chứng nói gì?",
76
+ "criteria": {
77
+ "supports": "bằng chứng xác nhận khẳng định là đúng",
78
+ "refutes": "bằng chứng cho thấy khẳng định là sai",
79
+ "nei": "bằng chứng không đủ để kết luận đúng hay sai",
80
+ },
81
+ },
82
+ },
83
+ )
84
+ print(out["answers"]["verdict"])
85
+ ```
86
+
87
+ `v0.1` runs on the open-source `laya` inference runtime. A native `viya` package will ship with the v0.2 architecture.
88
+
89
+ ## How it works
90
+
91
+ ```
92
+ [CLS] question [SEP] [MASK] option 1 [MASK] option 2 … [SEP] your text [SEP]
93
+ │ │
94
+ └── each [MASK] is scored ──► softmax ──► calibrated probabilities
95
+ ```
96
+
97
+ - **Encoder:** `jhu-clsp/mmBERT-base` (22 layers, 8,192-token context, 1,800+ languages).
98
+ - **Decision head (v0.1):** two transformer layers and a scorer over option markers, adopted from an open typed-decision design (see Credits). Input length is 1,024 tokens.
99
+ - **Calibration:** per-type temperature fitted on held-out data.
100
+
101
+ ### Training
102
+
103
+ 1. **Vietnamese reading.** 11 Vietnamese datasets turned into 18 kinds of decision questions. Each sentence is paired with its no-diacritics or teencode version, with a consistency loss so both get the same answer. Option names are randomly renamed so the model has to read the option descriptions.
104
+ 2. **Continued pre-training.** 7.8 hours of masked-language modelling on Vietnamese web, forum and Wikipedia text (FineWeb-2, tinhte, Wikipedia).
105
+ 3. **Fact-checking.** ViFactCheck, ViWikiFC, VitaminC, ClaimBuster and ReINTEL, covering three skills: which sentence needs checking, which sentence is evidence, and the verdict.
106
+ 4. **Decision and anti-forgetting round.** typed-decisions plus English spam, phishing, passage relevance and ticket data, with replay of the earlier stages.
107
+
108
+ ### Roadmap: VIYA's own architecture (v0.2)
109
+
110
+ - **Read once.** Claim and whole article in one sequence, with a marker before every sentence. An evidence head and a verdict head are trained jointly, so finding evidence and judging it happen in **one pass** instead of one pass per sentence.
111
+ - **Self-confidence ("am I sure?").** A head trained on the model's own past mistakes. VIYA skims by default and switches to a careful sentence-by-sentence read only when it is unsure.
112
+
113
+ ## Evaluation
114
+
115
+ All VIYA numbers are measured on the official test sets (October 2026). Other models' numbers come from their papers, where each model is fine-tuned **separately per task**; VIYA is **one model** for all tasks.
116
+
117
+ ### Vietnamese fact-checking
118
+
119
+ | Model | Params | ViFactCheck, gold evidence (macro-F1) | ViFactCheck, full article (macro-F1) |
120
+ |---|---:|:-:|:-:|
121
+ | Gemma 7B | 7B | **89.90** | **85.94** |
122
+ | Llama3 8B | 8B | 88.67 | 79.65 |
123
+ | Mistral 7B | 7B | 88.63 | 70.13 |
124
+ | XLM-R large | 550M | 88.02 | 75.42 |
125
+ | Gemini 1.5 Flash (prompting) | — | 74.88 | 76.26 |
126
+ | PhoBERT large | 370M | 79.76 | 62.93 |
127
+ | Human | | 84.93 | |
128
+ | **VIYA v0.1-beta** | **307M** | **87.64** | **78.65** |
129
+
130
+ | ViWikiFC | InfoXLM large | **VIYA v0.1-beta** |
131
+ |---|:-:|:-:|
132
+ | Verdict with gold evidence (F1) | **86.51** | 85.20 |
133
+ | Full pipeline: right evidence and right verdict (strict accuracy) | 67.00 (with BM25) | **75.66** |
134
+
135
+ ### Vietnamese understanding
136
+
137
+ | Task | mmBERT starting checkpoint | **VIYA v0.1-beta** |
138
+ |---|:-:|:-:|
139
+ | MASSIVE-vi intent (20 options) | 36.9 | **89.4** |
140
+ | … typed without diacritics | 13.1 | **88.7** |
141
+ | ViNLI (accuracy) | 48.9 | **81.8** |
142
+ | XNLI-vi | 74.1 | **77.5** |
143
+ | ViOCD complaint, never trained (AUROC) | 65.8 | **90.6** |
144
+ | UIT-VSMEC emotion, never trained (accuracy) | 40.6 | **50.8** |
145
+
146
+ ViNLI reference points: CafeBERT 86.1, XLM-R large 86.0, PhoBERT large 80.7.
147
+
148
+ ### English decisions (typed-decisions, 2,000 decisions)
149
+
150
+ | Model | Accuracy | ECE |
151
+ |---|:-:|:-:|
152
+ | Laya fine-tune | **76.6** | 0.213 |
153
+ | **VIYA v0.1-beta** | 75.9 | **0.137** |
154
+ | TypeSafe Jev 1.13 | 72.7 | 0.144 |
155
+
156
+ ## Limitations
157
+
158
+ - **Text only.** Images, video and deepfakes are out of scope.
159
+ - **Facts come from evidence, not memory.** VIYA judges a claim against the evidence you give it. For breaking news with no published sources, the right answer is "not enough information".
160
+ - **Many options.** Choice questions work best with fewer than about 20 options; 77-way intent (Banking77) reaches only 53.8.
161
+ - **Beta.** A held-out "recent news" test and the v0.2 single-pass architecture are still in progress.
162
+
163
+ ## License and data
164
+
165
+ The model weights are released under **Apache-2.0**. Some training datasets (many UIT-NLP corpora, for example) are licensed **for research use only**; check each dataset's license before commercial use.
166
+
167
+ ## Credits
168
+
169
+ - [mmBERT](https://huggingface.co/jhu-clsp/mmBERT-base) (JHU CLSP), the encoder.
170
+ - [Laya](https://github.com/NandhaKishorM/laya) (Convai Innovations, Apache-2.0): the v0.1 decision head and starting checkpoint (`laya-multilingual`), and the typed-decisions benchmark harness.
171
+ - The authors of ViFactCheck, ViWikiFC, ViNLI, UIT-ViHSD, UIT-VSFC, UIT-ViSFD, UIT-ViQuAD 2.0, MASSIVE, XNLI, VitaminC, ClaimBuster, ReINTEL and FineWeb-2.
172
+
173
+ ---
174
+
175
+ <details>
176
+ <summary><b>Tiếng Việt</b></summary>
177
+
178
+ **VIYA** là model AI nhỏ (307 triệu tham số, chạy trên CPU) **ra quyết định trên văn bản tiếng Việt**: chọn một trong các lựa chọn, chấm mức độ, hoặc trả lời có/không, kèm độ tin cậy đã hiệu chỉnh. Model không viết văn; bạn mô tả câu hỏi và các lựa chọn bằng lời, VIYA chấm điểm từng lựa chọn.
179
+
180
+ **Điểm nổi bật**
181
+
182
+ - **Kiểm chứng tin:** 87,6 điểm F1 trên ViFactCheck khi có sẵn bằng chứng (con người: 84,9).
183
+ - **Trọn quy trình ViWikiFC:** 75,7%, so với 67,0% của hệ thống tốt nhất đã công bố.
184
+ - **Đọc được tiếng Việt gõ không dấu:** 88,7 so với 89,4 khi có dấu.
185
+
186
+ **Phiên bản v0.1** dựng trên encoder mmBERT với đầu ra quyết định từ mã nguồn mở. **Phiên bản v0.2** sẽ dùng kiến trúc riêng của VIYA:
187
+
188
+ - **đọc cả bài trong một lượt**, vừa tìm bằng chứng vừa kết luận;
189
+ - **tự đánh giá "tôi có chắc không?"** để quyết định khi nào cần đọc kỹ.
190
+
191
+ </details>
assets/logo_icon.png ADDED
assets/logo_wordmark.png ADDED
assets/viya_benchmarks_en.png ADDED

Git LFS Details

  • SHA256: 7254b412f63d74e392c9adb536fbe83779ab9672a1f4fcacc936f7aeacae4685
  • Pointer size: 131 Bytes
  • Size of remote file: 518 kB
encoder/config.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertForMaskedLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 2,
8
+ "classifier_activation": "gelu",
9
+ "classifier_bias": false,
10
+ "classifier_dropout": 0.0,
11
+ "classifier_pooling": "mean",
12
+ "cls_token_id": 1,
13
+ "decoder_bias": true,
14
+ "deterministic_flash_attn": false,
15
+ "dtype": "float32",
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": 1,
18
+ "global_attn_every_n_layers": 3,
19
+ "gradient_checkpointing": false,
20
+ "hidden_activation": "gelu",
21
+ "hidden_size": 768,
22
+ "initializer_cutoff_factor": 2.0,
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 1152,
25
+ "layer_norm_eps": 1e-05,
26
+ "layer_types": [
27
+ "full_attention",
28
+ "sliding_attention",
29
+ "sliding_attention",
30
+ "full_attention",
31
+ "sliding_attention",
32
+ "sliding_attention",
33
+ "full_attention",
34
+ "sliding_attention",
35
+ "sliding_attention",
36
+ "full_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "full_attention",
40
+ "sliding_attention",
41
+ "sliding_attention",
42
+ "full_attention",
43
+ "sliding_attention",
44
+ "sliding_attention",
45
+ "full_attention",
46
+ "sliding_attention",
47
+ "sliding_attention",
48
+ "full_attention"
49
+ ],
50
+ "local_attention": 128,
51
+ "mask_token_id": 4,
52
+ "max_position_embeddings": 8192,
53
+ "mlp_bias": false,
54
+ "mlp_dropout": 0.0,
55
+ "model_type": "modernbert",
56
+ "norm_bias": false,
57
+ "norm_eps": 1e-05,
58
+ "num_attention_heads": 12,
59
+ "num_hidden_layers": 22,
60
+ "pad_token_id": 0,
61
+ "position_embedding_type": "sans_pos",
62
+ "repad_logits_with_grad": false,
63
+ "rope_parameters": {
64
+ "full_attention": {
65
+ "rope_theta": 160000,
66
+ "rope_type": "default"
67
+ },
68
+ "sliding_attention": {
69
+ "rope_theta": 160000,
70
+ "rope_type": "default"
71
+ }
72
+ },
73
+ "sep_token_id": 1,
74
+ "sparse_pred_ignore_index": -100,
75
+ "sparse_prediction": false,
76
+ "tie_word_embeddings": true,
77
+ "transformers_version": "5.16.1",
78
+ "vocab_size": 256000
79
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ae088a2aefeb84aec0c1e577b68c462fe232339bf7ca73edd5e538e43e729fe
3
+ size 643835524
rl_agent_config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "encoder": "jhu-clsp/mmBERT-base",
3
+ "head_layers": 2,
4
+ "max_len": 1024,
5
+ "head_max_len": 256,
6
+ "max_prefixes": 6,
7
+ "act_costs": {
8
+ "escalate": 0.5
9
+ },
10
+ "cost_wrong_act": 3.0,
11
+ "amp_dtype": "bf16",
12
+ "model_name": "viya-base",
13
+ "temperature": [
14
+ 1.0429649353027344,
15
+ 1.0284883975982666,
16
+ 1.0265088081359863
17
+ ],
18
+ "training": {
19
+ "updates": 15987,
20
+ "epochs_completed": 4,
21
+ "hours": 4.97,
22
+ "world_size": 1,
23
+ "fine_tuned_from_checkpoint": false
24
+ },
25
+ "fine_tuned": true,
26
+ "viya_mlm": {
27
+ "steps": 18780,
28
+ "tokens": 153845760,
29
+ "hours": 5.0,
30
+ "seq": 256,
31
+ "mask_p": 0.3,
32
+ "p_noisy": 0.3
33
+ },
34
+ "viya_version": "v0.1-beta"
35
+ }
tokenizer/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f
3
+ size 34363188
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<bos>",
3
+ "clean_up_tokenization_spaces": false,
4
+ "cls_token": "<bos>",
5
+ "eos_token": "<eos>",
6
+ "extra_0": "<start_of_turn>",
7
+ "extra_1": "<end_of_turn>",
8
+ "local_files_only": false,
9
+ "mask_token": "<mask>",
10
+ "model_input_names": [
11
+ "input_ids",
12
+ "attention_mask"
13
+ ],
14
+ "model_max_length": 8192,
15
+ "model_specific_special_tokens": {
16
+ "extra_0": "<start_of_turn>",
17
+ "extra_1": "<end_of_turn>"
18
+ },
19
+ "pad_token": "<pad>",
20
+ "padding_side": "right",
21
+ "sep_token": "<eos>",
22
+ "spaces_between_special_tokens": false,
23
+ "tokenizer_class": "PreTrainedTokenizerFast",
24
+ "unk_token": "<unk>"
25
+ }