This model is an early experimental release from the kniv cascade research
program and is no longer maintained. It predates the current
5-head cascade architecture (POS, NER, DEP, SRL, CLS) and the
bottom-up layer-selective training methodology that produces our
current production teacher.
The current model offers significantly better quality across all tasks,
includes Semantic Role Labeling and Dialog Act Classification heads,
and has reproducible benchmarks against standard public test sets.
This repository is preserved for reproducibility and historical reference.
No further updates, bug fixes, or evaluation runs are planned.
kniv-deberta-v3-large-nlp-en
Multi-task NLP teacher model for English: NER + POS tagging + dependency parsing + sentence classification in a single forward pass.
Part of the kniv-nlp-models project, powering the uniko cognitive memory system.
NER: 45,000 examples (gold-filtered, domain-balanced from 237K)
POS + DEP: 12,544 examples (UD English EWT v2.14, expert-annotated)
CLS: 57,544 examples (NER + UD combined, GPT-5.4-nano classified)
Parameter
Value
Batch size
64
Learning rate
1e-5
Epochs
5
Precision
fp32 (gradient checkpointing)
Warmup
10%
Loss weights
NER: 1.0, POS: 1.0, Dep: 1.0, CLS: 0.5
Hardware
NVIDIA A100 40GB
Usage
Python (ONNX Runtime)
python
1import onnxruntime as ort
2import numpy as np
3from transformers import AutoTokenizer
4import json
56# Load7session = ort.InferenceSession("model-int8.onnx")8tokenizer = AutoTokenizer.from_pretrained(".")9withopen("label_maps.json")as f:10 labels = json.load(f)1112# Tokenize13text ="Caroline went to the hospital in New York."14enc = tokenizer(text, return_tensors="np", padding="max_length", max_length=128)1516# Inference (single forward pass -> 4 outputs)17outputs = session.run(None,{18"input_ids": enc["input_ids"],19"attention_mask": enc["attention_mask"],20})21ner_logits, pos_logits, dep_logits, cls_logits = outputs
2223# Decode NER24tokens = tokenizer.convert_ids_to_tokens(enc["input_ids"][0])25ner_preds =[labels["ner_labels"][i]for i in ner_logits[0].argmax(axis=-1)]26for tok, ner inzip(tokens, ner_preds):27if ner !="O":28print(f" {tok}: {ner}")
Rust (ONNX Runtime)
rust
1useort::{Session,Value};2usendarray::Array2;3usetokenizers::Tokenizer;45let session =Session::builder()?6.with_optimization_level(ort::GraphOptimizationLevel::Level3)?7.commit_from_file("model-int8.onnx")?;89let tokenizer =Tokenizer::from_file("tokenizer.json")?;10let encoding = tokenizer.encode("Caroline went to the hospital.",true)?;1112let outputs = session.run(ort::inputs![13Array2::from_shape_vec((1,128), encoding.get_ids().to_vec())?,14Array2::from_shape_vec((1,128), encoding.get_attention_mask().to_vec())?,15]?)?;1617// outputs: ner_logits, pos_logits, dep_logits, cls_logits
Files
File
Size
Description
model.onnx
1,663 MB
FP32 ONNX model
model-int8.onnx
612 MB
INT8 quantized (dynamic)
model.pt
1,670 MB
PyTorch weights
label_maps.json
<1 MB
NER/POS/DEP/CLS label vocabularies
tokenizer.json
8 MB
DeBERTa-v3 tokenizer
Important: Use This Model's Tokenizer
Always load the tokenizer from this repo, not from microsoft/deberta-v3-large. The upstream HuggingFace tokenizer may omit BOS/EOS special tokens, shifting all positions and producing incorrect results.
python
1# Correct2tokenizer = AutoTokenizer.from_pretrained("dragonscale-ai/kniv-deberta-v3-large-nlp-en")34# WRONG — may omit special tokens5tokenizer = AutoTokenizer.from_pretrained("microsoft/deberta-v3-large")
Limitations
English only
Max 128 tokens — longer inputs truncated
CLS labels are GPT-classified — not human-annotated, macro F1 reflects imbalanced rare labels
Server-side model — 435M params, not for edge/mobile. Use the distilled student for that.