Xunzhuo commited on
Commit
e84e690
·
verified ·
1 Parent(s): e486953

Unify Vela model cards with Semantic Router branding

Browse files
Files changed (2) hide show
  1. README.md +13 -8
  2. TECHNICAL.md +0 -184
README.md CHANGED
@@ -19,14 +19,22 @@ tags:
19
  - long-context
20
  ---
21
 
22
- # Vela 1.0 · FactCheck
 
 
 
 
 
 
 
 
 
 
23
 
24
  **Know when to bring in factual verification.**
25
 
26
  307M · Multilingual · 32K context
27
 
28
- [Collection](https://huggingface.co/collections/llm-semantic-router/vela-10-router-models-6aa555ba70cc6997d6d67798) · [vLLM Semantic Router](https://github.com/vllm-project/semantic-router)
29
-
30
  Vela FactCheck identifies requests that need factual verification. It helps a router decide when to add retrieval, external evidence, or a verification step before answering.
31
 
32
  ## What it brings
@@ -42,7 +50,7 @@ Vela FactCheck identifies requests that need factual verification. It helps a ro
42
  | Verification recall | 30% | **90%** |
43
  | Verification precision | 75% | **75%** |
44
 
45
- Higher recall comes with more verification calls. See the evaluation for operating-point guidance.
46
 
47
  ## Quick start
48
 
@@ -66,12 +74,9 @@ Choose the signals your router needs. Every model has a focused role.
66
  | Role | Models |
67
  |---|---|
68
  | Understand requests | [Domain](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Domain) · [Feedback](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Feedback) · [Modality](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Modality) |
69
- | Detect risks | PromptGuard¹ · [PII](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-PII) · Safety¹ · Hazard¹ |
70
  | Decide when to verify | [FactCheck](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-FactCheck) |
71
  | Retrieve context | [Embedding](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Embedding) · [Reranker](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Reranker) |
72
  | Build new capabilities | [Encoder](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M) |
73
 
74
  ¹ Coming soon. Explore available models in the [Vela collection](https://huggingface.co/collections/llm-semantic-router/vela-10-router-models-6aa555ba70cc6997d6d67798).
75
-
76
-
77
- [Documentation and evaluation](TECHNICAL.md)
 
19
  - long-context
20
  ---
21
 
22
+ <div align="center">
23
+ <img src="https://vllm-sr.ai/img/vllm-sr-logo.social.png" alt="vLLM Semantic Router" width="560" />
24
+ <p>
25
+ <a href="https://vllm-sr.ai/"><strong>Docs</strong></a> |
26
+ <a href="https://vllm-sr.ai/blog/"><strong>Blog</strong></a> |
27
+ <a href="https://vllm-dev.slack.com/archives/C09CTGF8KCN"><strong>Slack</strong></a> |
28
+ <a href="https://github.com/vllm-project/semantic-router"><strong>GitHub</strong></a>
29
+ </p>
30
+ </div>
31
+
32
+ # Vela-1.0-Encoder-307M-FactCheck
33
 
34
  **Know when to bring in factual verification.**
35
 
36
  307M · Multilingual · 32K context
37
 
 
 
38
  Vela FactCheck identifies requests that need factual verification. It helps a router decide when to add retrieval, external evidence, or a verification step before answering.
39
 
40
  ## What it brings
 
50
  | Verification recall | 30% | **90%** |
51
  | Verification precision | 75% | **75%** |
52
 
53
+ Higher recall comes with more verification calls; choose the operating threshold for your traffic.
54
 
55
  ## Quick start
56
 
 
74
  | Role | Models |
75
  |---|---|
76
  | Understand requests | [Domain](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Domain) · [Feedback](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Feedback) · [Modality](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Modality) |
77
+ | Detect risks | Guard¹ · [PII](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-PII) · Safety¹ · Hazard¹ |
78
  | Decide when to verify | [FactCheck](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-FactCheck) |
79
  | Retrieve context | [Embedding](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Embedding) · [Reranker](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M-Reranker) |
80
  | Build new capabilities | [Encoder](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M) |
81
 
82
  ¹ Coming soon. Explore available models in the [Vela collection](https://huggingface.co/collections/llm-semantic-router/vela-10-router-models-6aa555ba70cc6997d6d67798).
 
 
 
TECHNICAL.md DELETED
@@ -1,184 +0,0 @@
1
- ---
2
- license: mit
3
- library_name: transformers
4
- pipeline_tag: text-classification
5
- base_model: llm-semantic-router/Vela-1.0-Encoder-307M
6
- language:
7
- - en
8
- - zh
9
- - es
10
- - fr
11
- - de
12
- - ja
13
- tags:
14
- - vela
15
- - modernbert
16
- - router
17
- - fact-checking
18
- - multilingual
19
- - long-context
20
- ---
21
-
22
- # Vela-1.0-Encoder-307M-FactCheck
23
-
24
- This model predicts whether a **request needs external factual verification**. It does not judge whether a generated answer is true, retrieve evidence, or verify a claim itself. A request to extract information fully supplied in a passage, transform wording, calculate a self-contained result, or write fiction can be `NO_FACT_CHECK_NEEDED`; questions requiring external factual knowledge are `FACT_CHECK_NEEDED`.
25
-
26
- On a frozen set of 102 natural requests, native Transformers FP32 accuracy improved from **63/102 to 79/102**, and macro F1 improved from **0.579 to 0.772**. These are small, source-group-disjoint task tests with assistant-reviewed labels, not expert human annotations or a general-purpose fact-checking benchmark. More requests needing verification are detected, with a substantial increase in unnecessary-verification false positives. Detailed results and limitations follow.
27
-
28
- ## Architecture and lineage
29
-
30
- | Property | Value |
31
- |---|---|
32
- | Architecture | Standard `ModernBertForSequenceClassification` |
33
- | Encoder | 22 layers, width 768, 12 attention heads |
34
- | Shared encoder parameters | 306,939,648 |
35
- | Total unique parameters, including classification head | 307,531,778 |
36
- | Pooling | Masked mean pooling |
37
- | Context capacity | 32,768 tokens, including special tokens |
38
- | Published weights | FP32 |
39
- | Labels | `0=NO_FACT_CHECK_NEEDED`, `1=FACT_CHECK_NEEDED` |
40
- | Weight SHA-256 | `809d11b1b44025d5c985859ca2f10c720c1afef88024d6d21ecb0aa25cbe49a3` |
41
-
42
- “307M” names the shared encoder size. This is a dense encoder with a two-class head, not a generative router or an MoE model. Router-compatible `fact_check_mapping.json` and the HF `config.json` use the same label indices; mappings and weights were hashed together before final testing.
43
-
44
- The final base is [Vela-1.0-Encoder-307M at revision 5fe5bbb1a88b7fdcc93bb5b9d546c574564eb114](https://huggingface.co/llm-semantic-router/Vela-1.0-Encoder-307M/tree/5fe5bbb1a88b7fdcc93bb5b9d546c574564eb114), with base weight SHA-256 `ccc274d12ef6f94f54c0c23f0388527b0a925268a1332b3a6e5c8e56868efb00`.
45
-
46
- Training started with a fresh task head and rank-32 LoRA adapter on [mmbert-32k-yarn at revision 72a23a6640489471eb4ff7ad3ec5bc80af8a27de](https://huggingface.co/llm-semantic-router/mmbert-32k-yarn/tree/72a23a6640489471eb4ff7ad3ec5bc80af8a27de), followed by natural-request and long-context training. The selected adapter and task head were then transferred to the published Vela Base. Direct transfer failed the development 32K retention gate; bounded adaptation on existing training rows restored development retention. The final adapter was chosen at step 100 of that 200-step adaptation and merged into the actual Vela Base. Original FactCheck task weights were used only as the baseline, not as an initialization.
47
-
48
- ## Independent final results
49
-
50
- The candidate and data hashes were frozen before the first final prediction. The baseline is [mmbert32k-factcheck-classifier-merged at revision 290d3182b2c87e489bd4f63c889e803a27599681](https://huggingface.co/llm-semantic-router/mmbert32k-factcheck-classifier-merged/tree/290d3182b2c87e489bd4f63c889e803a27599681). Baseline and candidate use identical text, tokenizer budgets, standard HF execution, and argmax over two logits. This corresponds to a 0.5 positive-score boundary; the reviewed Router canonical default is 0.6, the checked-in configuration example explicitly uses 0.65, and 0.7 is only the classifier's fallback when supplied a nonpositive threshold. These are different operating points. The primary table uses **FP32 weights and FP32 forward computation**. No weight was changed after final testing. The separate threshold procedure below used only development scores and was locked before its fixed-threshold final analysis.
51
-
52
- | Final subset | Requests | Baseline correct | Vela correct | Baseline macro F1 | Vela macro F1 |
53
- |---|---:|---:|---:|---:|---:|
54
- | Natural requests, all sources | 102 | 63 | 79 | 0.579 | 0.772 |
55
- | Aya original reviewed subset | 18 | 5 | 15 | 0.257 | 0.734 |
56
- | Additional Aya reviewed subset | 29 | 19 | 22 | 0.651 | 0.709 |
57
- | Dolly reviewed subset, preserving supplied context | 55 | 39 | 42 | 0.633 | 0.752 |
58
- | Weak factual-question / authored-transformation supervision | 720 | 448 | 719 | 0.572 | 0.999 |
59
- | Authored long-context stress | 48 | 24 | 35 | 0.333 | 0.708 |
60
-
61
- The 720 weak or authored examples are deliberately separate from natural requests. The mixed 870-row score is dominated by these easier examples and must not be reported as natural-request accuracy. Natural labels were individually reviewed by an assistant before model predictions. Contributor/source groups stay within one split; older-model and base-pretraining exposure cannot be ruled out. The baseline's historical recipe used some Dolly instructions without a complete row-level manifest.
62
-
63
- At the fixed argmax operating point, among 50 natural requests needing verification, recall increased from **16/50 to 45/50**. Among 52 natural requests not needing verification, false positives increased from **5/52 to 18/52**. This trades fewer missed checks for more unnecessary checks and their associated latency or cost. Softmax scores are not calibrated probabilities. A deployment threshold requires its own development-based selection and evaluation.
64
-
65
- Natural German results regressed from **4/6 to 2/6** correct. The natural final sample includes English, German, Spanish, and French; multilingual training and authored Chinese/Japanese examples do not establish equal natural-request quality in all six training languages. The included source-group bootstrap describes uncertainty; for the argmax comparison, the natural accuracy-improvement interval crosses zero despite the positive point estimate.
66
-
67
- | Attended input tokens | Authored final cases | Baseline correct | Vela correct | Vela macro F1 |
68
- |---|---:|---:|---:|---:|
69
- | 4,096 | 12 | 6 | 9 | 0.733 |
70
- | 8,192 | 12 | 6 | 9 | 0.733 |
71
- | 16,384 | 12 | 6 | 9 | 0.733 |
72
- | 32,768 | 12 | 6 | 8 | 0.625 |
73
-
74
- These inputs contain repeated original background narratives with held-out source payloads at different positions. They are controlled stress, not naturally distributed long documents; length/position variants sharing a payload are correlated. The 32K final result is **8/12**, below development's 12/12. Long-context acceptance and finite logits do not establish reliable long-document decisions. All 24 positive long cases were detected, but 13 of 24 negative long cases were falsely flagged.
75
-
76
- A separate BF16 audit of the same immutable weights and final rows gave 80/102 natural correct. Only 1/870 candidate predictions differed from FP32: a French natural negative that FP32 misclassified. All long-case predictions agreed. Baseline BF16/FP32 differed on four weak-supervision rows and agreed on natural and long rows. Neither precision comparison was used to retune the candidate.
77
-
78
- ## Router operating point
79
-
80
- A documentation correction distinguishes the existing Router settings: `defaultHallucinationModule` in `src/semantic-router/pkg/config/canonical_defaults.go` supplies **0.6**, `config/config.yaml` explicitly sets **0.65** in its example, and `FactCheckClassifier.Classify` uses **0.7** only when its configured threshold is nonpositive. The initial card incorrectly called 0.7 the Router default. The historical selection-plan/lock field retains that original descriptive error for audit; it did not alter the fixed selection grid or development objective. [Correction evidence](evaluation/router-default-correction.json) and [all fixed operating points](evaluation/operating-points-fp32-defaults-correction.json) supersede that attribution. No weights, predictions, or selected threshold changed.
81
-
82
- The suggested Vela Router threshold is **0.85**. This was selected before evaluating its final operating point, from a prewritten grid of 0.50–0.95 in increments of 0.025. The development objective gave equal weight to three natural-request sources and the long-context source; weak supervision did not dominate selection. Exact ties chose the larger threshold. The objective was 0.87905 at 0.5, 0.88317 at 0.7, and 0.88725 at 0.85. The [selection plan](evaluation/threshold-selection-plan.json) and [threshold lock](evaluation/threshold-lock.json) precede the fixed-threshold final analysis.
83
-
84
- For the 102 natural final requests, the confusion entries below use 52 negative and 50 positive gold requests. “Checks” counts requests the binary policy would send for verification; it does not measure actual remote calls or their latency.
85
-
86
- | Model / threshold | TN | FP | FN | TP | Precision | Recall | Checks | Macro F1 |
87
- |---|---:|---:|---:|---:|---:|---:|---:|---:|
88
- | Baseline / 0.5 argmax | 47 | 5 | 34 | 16 | 0.762 | 0.320 | 21 | 0.579 |
89
- | Baseline / 0.6 canonical default | 47 | 5 | 35 | 15 | 0.750 | 0.300 | 20 | 0.565 |
90
- | Baseline / 0.65 configuration example | 48 | 4 | 35 | 15 | 0.789 | 0.300 | 19 | 0.573 |
91
- | Baseline / 0.7 nonpositive-argument fallback | 49 | 3 | 36 | 14 | 0.824 | 0.280 | 17 | 0.567 |
92
- | Baseline / 0.85 | 51 | 1 | 37 | 13 | 0.929 | 0.260 | 14 | 0.567 |
93
- | Vela / 0.5 argmax | 34 | 18 | 5 | 45 | 0.714 | 0.900 | 63 | 0.772 |
94
- | Vela / 0.6 | 35 | 17 | 5 | 45 | 0.726 | 0.900 | 62 | 0.782 |
95
- | Vela / 0.65 | 35 | 17 | 5 | 45 | 0.726 | 0.900 | 62 | 0.782 |
96
- | Vela / 0.7 | 35 | 17 | 5 | 45 | 0.726 | 0.900 | 62 | 0.782 |
97
- | Vela / 0.85 development-selected | 37 | 15 | 5 | 45 | 0.750 | 0.900 | 60 | 0.803 |
98
-
99
- Relative to the old canonical 0.6 threshold, positive recall increases from **30% to 90%** while positive precision remains **75%** on these 102 requests. At the suggested threshold, natural correctness is **82/102**, but the model still makes more unnecessary-verification decisions than the old canonical default: 15 versus 5. Estimated verification decisions increase from 20/102 to 60/102, primarily because the old model misses most positive requests. This is not a claim of reduced end-to-end cost or latency. German remains a regression, 3/6 correct at 0.85 versus the baseline canonical default's 4/6.
100
-
101
- At 0.85, long-stress correctness is 37/48 with macro F1 0.758, positive recall 24/24, and 11 false positives among 24 negatives. The 4K/8K/16K/32K correct counts are 9/12, 10/12, 10/12, and **8/12**. The threshold does not fix the 32K limitation. All fixed-threshold [FP32 results](evaluation/operating-points-fp32.json) and [natural language breakdowns](evaluation/operating-language-fp32.json) are retained.
102
-
103
- ## Engine qualification
104
-
105
- The frozen weights also passed scoped native-engine checks. These check numerical behavior and lifecycle handling; they do not expand the quality benchmark above to every device or engine.
106
-
107
- | Qualified path | Cases | Maximum probability difference from reference | Decisions |
108
- |---|---:|---:|---|
109
- | Candle CPU | 8 inputs, 9–512 tokens | 3.05e-5 | All argmax labels agree |
110
- | ONNX Runtime ROCm with project CK attention integration | 12 inputs including 4K/8K/16K/32K | 0.000975 | All argmax labels agree |
111
- | ONNX Runtime ROCm CK batch/padding profile | 20 B1/B2 cases at 2, 63, 64, 65, 127, 128, 129, 512, 4096, 32768 tokens | 1.64e-5 | All argmax labels agree |
112
-
113
- Over-budget input is explicitly rejected, owner close/reopen succeeds, and mismatched label ordering is rejected. The batch/padding profile observed 440 CK attention calls, 19,120 ROCm-provider node executions, and 60 CPU shape-node executions across its cases. This is actual provider-profile evidence, not an assumption from installed GPU providers. The [Candle](evaluation/engines/vela-factcheck-candle-cpu-v1.json), [ONNX](evaluation/engines/vela-factcheck-fp32-ck-shared-onnx-binding-v1.json), and [profile](evaluation/engines/vela-factcheck-fp32-ck-shared-profile-v1.json) reports retain input/reference hashes. Their individual forward times include differing warmup states and are not a serving latency benchmark.
114
-
115
- ## Training and data
116
-
117
- The recorded stages used manual mean cross-entropy with explicit gradient-accumulation normalization, FP32 trainable parameters, BF16 autocast, SDPA, non-reentrant gradient checkpointing, and finite-gradient checks. LoRA rank was 32, alpha 64, dropout 0.05; attention/MLP adapters and the standard task head/classifier were trained.
118
-
119
- | Stage | Train / dev rows | Maximum tokens | Steps run / selected | Learning rate | Development selection |
120
- |---|---:|---:|---:|---:|---|
121
- | Initial task training | 3,579 / 504 | 2,048 | 600 / 400 | 3e-5 | Macro F1 |
122
- | Natural-request extension | 3,640 / 593 | 2,048 | 600 / 300 | 2e-5 | Equal-source macro F1 |
123
- | Long-context curriculum | 3,784 / 641 | 32,768 | 400 / 400 | 8e-6 | Equal-source macro F1 |
124
- | Vela Base adaptation | 3,676 / 641 | 32,768 | 200 / 100 | 2e-6 | Equal-length macro F1 |
125
-
126
- The final adaptation reuses the short training rows and 36 existing 32K training variants; it introduces no development or test examples. Context training, development, and final payload groups and narratives are separate. All gold final cases remain in the results, including regressions.
127
-
128
- Sources are [Aya](https://huggingface.co/datasets/CohereLabs/aya_dataset/tree/f9ea04583f02a8f86404ff6c58bf75fe637df8a2) and [Global-MMLU](https://huggingface.co/datasets/CohereLabs/Global-MMLU/tree/0e619dbeb34206cd48705a1a0ea7fb21cae09993), both Apache-2.0, [Dolly](https://huggingface.co/datasets/databricks/databricks-dolly-15k/tree/bdd27f4d94b9c1f951818a7da7fd7aeea5dbff1a), CC-BY-SA-3.0, and original transformation/context material. Dolly attribution: Copyright 2023 Databricks, Inc.; Wikipedia editors and contributors for source passages. Reconstructed text and derived annotations retain their applicable source attribution and terms. The [source manifests and text-free annotations](reproducibility/src/training/model_classifier/sequence_repair/data/README.md) record immutable revisions and hashes. Benchmark-question labels and lexical training rules are explicitly identified as weak task supervision.
129
-
130
- ## Use
131
-
132
- ```python
133
- import torch
134
- from transformers import AutoModelForSequenceClassification, AutoTokenizer
135
-
136
- model_id = "llm-semantic-router/Vela-1.0-Encoder-307M-FactCheck"
137
- tokenizer = AutoTokenizer.from_pretrained(model_id)
138
- model = AutoModelForSequenceClassification.from_pretrained(
139
- model_id, torch_dtype=torch.float32,
140
- attn_implementation="sdpa", reference_compile=False,
141
- ).eval()
142
- inputs = tokenizer("Translate this sentence without checking its claims.",
143
- return_tensors="pt", truncation=False)
144
- if inputs["input_ids"].shape[1] > model.config.max_position_embeddings:
145
- raise ValueError("Input exceeds the model's explicit context budget")
146
- with torch.inference_mode():
147
- probabilities = model(**inputs).logits.float().softmax(-1)[0]
148
- label = model.config.id2label[int(probabilities.argmax())]
149
- ```
150
-
151
- Budget includes special tokens. Do not infer a 32K quality guarantee or an appropriate default resource budget from the configuration. Runtime token sampling, thresholds, batching, and inference engine can change request-level behavior. Task-quality results above use native HF models; scoped engine qualification is reported separately. GPU forward timings under concurrent training are not HTTP latency.
152
-
153
- See [reproduction instructions](reproducibility/README.md), [frozen candidate hashes](evaluation/candidate-lock.json), [FP32 final metrics](evaluation/final-candidate-fp32.json), and [individual predictions](evaluation/final-candidate-fp32.predictions.jsonl). This candidate is intentionally not advertised as improving every language, precision, or long-input condition.
154
-
155
- ## ONNX artifacts
156
-
157
- `onnx/model.onnx` contains the portable FP32 graph. The AMD accelerated
158
- `onnx/model_fa.onnx` retains FP32 encoder and task weights and uses FP16 only at
159
- the CK attention boundaries. It requires the project's ROCm CK custom operator.
160
- Both graphs share `onnx/model.onnx.data`, saving 1.23 GB of duplicate storage.
161
-
162
- The current release removes the earlier FP16-weight variants: narrowing the
163
- encoder also rounded position-frequency buffers, unlike native HF loading.
164
- Correcting those buffers exposed a short-input FP16 error above the original
165
- probability tolerance. The retained FP32/CK path passes that unchanged tolerance
166
- on all 12 binding cases and 20 padded graph cases through 32K. Earlier evidence
167
- remains historical; the table above links the currently shipped graph tests.
168
- This is an inference artifact correction; native task weights and the selected
169
- verification threshold are unchanged. See [export reproduction](reproducibility/onnx/README.md)
170
- and [exact shared storage](evaluation/engines/factcheck-shared-storage-reproduction.json).
171
-
172
- ## Frozen LoRA variant
173
-
174
- The `lora/` directory contains the exact development-selected adapter, its pinned
175
- Vela Base parent, final task configuration, tokenizer and a self-contained loader.
176
- Use `lora/load_adapter.py` to restore configuration before applying the adapter.
177
- The adapter restores the same native task weights and development-selected
178
- threshold 0.85. Engine variants are described above.
179
-
180
- Three independently loaded, padded bilingual/Unicode CPU batches matched the
181
- frozen merged checkpoint at the original probability tolerance, with identical
182
- argmax labels. See [standalone verification](standalone-verification.json) and
183
- [adapter identity](adapter-qualification.json). This is numerical verification
184
- of the same task model, not a new accuracy evaluation or a 32K adapter benchmark.