MLX
Safetensors
English
qwen3_moe
ies4
information-exchange-standard
rdf
turtle
knowledge-graph
ontology
lora
uk-government
neuro-symbolic
8-bit precision
Instructions to use fabsssss/qwen3-coder-30b-a3b-ies4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use fabsssss/qwen3-coder-30b-a3b-ies4 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir qwen3-coder-30b-a3b-ies4 fabsssss/qwen3-coder-30b-a3b-ies4
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,120 +1,67 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
base_model: mlx-community/Qwen3-Coder-30B-A3B-Instruct-8bit
|
| 4 |
-
tags: [ies4, information-exchange-standard, rdf, turtle, knowledge-graph, ontology, mlx, lora, uk-government]
|
| 5 |
library_name: mlx
|
| 6 |
language: [en]
|
| 7 |
---
|
| 8 |
|
| 9 |
-
#
|
| 10 |
|
| 11 |
-
A LoRA fine-tune of
|
| 12 |
-
Exchange Standard) RDF/Turtle from natural
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
before production use.
|
| 17 |
|
| 18 |
-
|
| 19 |
-
Home Office, Metropolitan Police, HMRC, DBT) with technical support from Telicent and
|
| 20 |
-
Aurora Consulting. Repo: [dstl/IES4](https://github.com/dstl/IES4).
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
| IES4 term conformance | 0.0% | **88.6%** |
|
| 31 |
-
| Hallucinated-term rate | 0.937 | **0.010** |
|
| 32 |
-
| Structural conformance (domain/range) | 0.932* | **0.955** |
|
| 33 |
-
| Namespace fidelity (when instructed) | — | **100%** |
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|---|---|---|
|
| 37 |
-
| Syntactic validity | 90.0% | 70.0% |
|
| 38 |
-
| IES4 term conformance | 0.0% | **30.0%** |
|
| 39 |
-
| Structural conformance | 0.900* | 0.640 |
|
| 40 |
|
| 41 |
-
|
|
| 42 |
|---|---|---|
|
| 43 |
-
|
|
| 44 |
-
|
|
| 45 |
-
|
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
from the published ontology (510 classes, 204 properties). Descriptions are
|
| 62 |
-
deterministic plus fact-checked local-LLM paraphrases (paraphrases dropping any name
|
| 63 |
-
or year were discarded).
|
| 64 |
-
- **210 vocabulary/boundary pairs**: class and property definitions verbatim from the
|
| 65 |
-
ontology, plus refusal examples teaching what IES4 cannot express (opinions,
|
| 66 |
-
speculation, causal claims).
|
| 67 |
-
- **448 ontology-conditioned extraction pairs** from
|
| 68 |
-
[Text2KGBench](https://github.com/cenguix/Text2KGBench) (Wikidata-TekGen), predicates
|
| 69 |
-
restricted to each domain ontology.
|
| 70 |
-
|
| 71 |
-
Split by target graph (no paraphrase leakage); OOD test set = descriptions of the real
|
| 72 |
-
dstl sample-data files, never trained on.
|
| 73 |
-
|
| 74 |
-
## Method
|
| 75 |
-
|
| 76 |
-
LoRA (16 layers) via `mlx-lm` 0.31.3 on Apple Silicon (M3 Max), QLoRA on the 8-bit MoE
|
| 77 |
-
base, 1,000 iterations, batch 2, seq 2048, final val loss 0.15. The repo contains the
|
| 78 |
-
fused 8-bit MLX model; the raw **adapter** is in `adapters/` for applying to the bf16
|
| 79 |
-
base with other toolchains.
|
| 80 |
-
|
| 81 |
-
## Usage (MLX)
|
| 82 |
-
|
| 83 |
-
```bash
|
| 84 |
-
pip install mlx-lm
|
| 85 |
-
python -m mlx_lm generate --model fabsssss/qwen3-coder-30b-a3b-ies4 --max-tokens 600 --prompt \
|
| 86 |
-
"Encode the following scenario as IES4 RDF/Turtle. Use only real IES4 terms and the
|
| 87 |
-
4D state/period pattern where relevant. Output only Turtle.
|
| 88 |
-
|
| 89 |
-
Scenario: Priya Patel has worked for Meridian Bank since 2019-03-01 and attended a
|
| 90 |
-
security briefing at Heathrow Terminal 4 on 2024-05-02 from 09:00 to 11:00."
|
| 91 |
-
```
|
| 92 |
|
| 93 |
## Limitations
|
| 94 |
-
|
| 95 |
-
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
exchange.
|
| 103 |
-
|
| 104 |
-
## Training data licensing & attribution
|
| 105 |
-
|
| 106 |
-
- IES4 ontology: MIT, © Crown copyright, Defence Science and Technology Laboratory
|
| 107 |
-
(Dstl). This model card retains that notice.
|
| 108 |
-
- telicent-ies-tool: used only to generate training graphs (library not redistributed).
|
| 109 |
-
- ~448 training pairs derive from Text2KGBench (data licence **CC BY-SA 4.0**; sources
|
| 110 |
-
Wikidata-TekGen / DBpedia-WebNLG). Attribution: "Data derived from Text2KGBench
|
| 111 |
-
(Mihindukulasooriya, Tiwari, Enguix, Lata; ISWC 2023), licensed CC BY-SA 4.0."
|
| 112 |
-
The published dataset repo marks that slice separately under CC BY-SA 4.0.
|
| 113 |
-
- Model weights: MIT. Weight releases are not, on current consensus, derivative works of
|
| 114 |
-
training data; attribution obligations above are honoured regardless.
|
| 115 |
-
|
| 116 |
-
## Provenance
|
| 117 |
-
|
| 118 |
-
Built and adversarially red-teamed (dataset design, eval integrity, licensing, tooling)
|
| 119 |
-
before release; the eval harness and dataset are published for reproduction. By
|
| 120 |
-
[The Tesseract Academy](https://gov.tesseract.academy).
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
base_model: mlx-community/Qwen3-Coder-30B-A3B-Instruct-8bit
|
| 4 |
+
tags: [ies4, information-exchange-standard, rdf, turtle, knowledge-graph, ontology, mlx, lora, uk-government, neuro-symbolic]
|
| 5 |
library_name: mlx
|
| 6 |
language: [en]
|
| 7 |
---
|
| 8 |
|
| 9 |
+
# qwen3-coder-30b-a3b-ies4 (v1.3)
|
| 10 |
|
| 11 |
+
A LoRA fine-tune of Qwen3-Coder-30B-A3B that generates **IES4** (UK Government
|
| 12 |
+
Information Exchange Standard) RDF/Turtle from natural language. v1.3 adds targeted
|
| 13 |
+
coverage of the IES construct families (measurement, assessment/PossibleWorld,
|
| 14 |
+
facility+naming, vehicle/journey, meeting, kinship, rich communication) and is
|
| 15 |
+
designed to run **with a term-suggesting validator in the loop** (neuro-symbolic).
|
|
|
|
| 16 |
|
| 17 |
+
## Headline: how to actually use this (the loop matters)
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
A single forward pass drafts structurally-correct IES4 but, on scenarios far from
|
| 20 |
+
the training distribution, reverts to *plausible-but-wrong* term spellings
|
| 21 |
+
(`ies:hasParticipant` for `ies:isParticipantIn`, `ies:MeasureUnit` for
|
| 22 |
+
`ies:measureUnit`). A **term-suggesting validator** closes this. Measured on
|
| 23 |
+
held-out, out-of-distribution scenarios (real dstl sample-data idioms the model
|
| 24 |
+
never trained on), IES4 term-conformance:
|
| 25 |
|
| 26 |
+
| pipeline | OOD term-conformance |
|
| 27 |
+
|---|---|
|
| 28 |
+
| single forward pass | 27% |
|
| 29 |
+
| + repair loop ("term X is invalid") | 45% |
|
| 30 |
+
| **+ suggesting loop ("-> use `ies:measureUnit`")** | **82%** |
|
| 31 |
|
| 32 |
+
The suggesting validator (`term_suggest.py`, shipped in this repo) returns the
|
| 33 |
+
nearest real IES4 term for any invalid one; the model applies the correction. This
|
| 34 |
+
is the recommended production pipeline.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
## In-distribution eval (vs untuned base)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
| metric | base | v1.3 |
|
| 39 |
|---|---|---|
|
| 40 |
+
| IES term conformance | 0.0% | **97.7%** |
|
| 41 |
+
| hallucinated-term rate | 0.942 | **0.005** |
|
| 42 |
+
| structural conformance | 0.911 | **0.977** |
|
| 43 |
+
| multi-standard relation conf | 91.7% | **100.0%** |
|
| 44 |
+
|
| 45 |
+
## Files
|
| 46 |
+
- fused 8-bit MLX weights (v1.3) - default when you `mlx_lm generate --model` this repo
|
| 47 |
+
- `adapters_v13/` - the raw LoRA adapter (apply to the bf16 base with other toolchains)
|
| 48 |
+
- `term_suggest.py` - the term-suggesting validator (lexical + morphological + definition-overlap)
|
| 49 |
+
- `repair_suggest_ood.py` - the reference neuro-symbolic loop that scores 82% above
|
| 50 |
+
|
| 51 |
+
## The finding (why this model is shaped this way)
|
| 52 |
+
A controlled study (v1.0->v1.3) showed OOD conformance is **invariant** to data
|
| 53 |
+
volume (2k->22k examples) and linguistic diversity (9%->38% paraphrase), and that
|
| 54 |
+
construct coverage fixes structure but not term-exactness. The binding constraint
|
| 55 |
+
is term-exactness on novel compositions; the fix is a symbolic term-suggesting
|
| 56 |
+
validator in the loop. This model is the "draft" half; `term_suggest.py` is the
|
| 57 |
+
"perfect" half.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
## Limitations
|
| 60 |
+
- Without the loop, expect ~27% OOD term-conformance; **run the loop**.
|
| 61 |
+
- Two OOD residual classes remain even with the loop: concepts with no clean IES
|
| 62 |
+
equivalent (a boat is modelled as a generic vehicle), and suggester-ranking
|
| 63 |
+
misses (`NamingScheme`). Both are refinement targets, not walls.
|
| 64 |
+
|
| 65 |
+
## Licensing
|
| 66 |
+
IES4: MIT, (C) Crown copyright Dstl. Multi-standard slice: Text2KGBench (CC-BY-SA-4.0,
|
| 67 |
+
Mihindukulasooriya et al, ISWC 2023). Weights: MIT. By The Tesseract Academy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|