Oryn is a compact, low-latency decision model built on
boltuix/bert-mini.
Unlike a conventional classifier with a fixed output layer, Oryn receives the classification question and candidate answers at inference time. This allows the same model to handle binary decisions, multiclass classification, ordinal scoring, and other option-based tasks.
Oryn is inspired by the publicly described architecture and training ideas behind Laya.
- Approximately 21 MB of trained weights
- Approximately 3 ms warmed-up single-request latency in the author's local test
- Dynamically supplied classification options
- Supports binary, categorical, and ordinal questions
- Uses one [MASK]marker for each candidate answer
- Scores all supplied options relative to one another
- Trained on phishing detection, BoolQ, AG News, and SST-5
- Designed for local and CPU-friendly inference
Latency depends on the device, runtime, input length, and measurement method. The reported 3 ms result should not be treated as a universal benchmark.
Oryn consists of:
- A pretrained BERT Mini encoder
- Two additional Transformer encoder layers
- One [MASK]marker for each candidate answer
- A learned linear option scorer
- A softmax over the options provided with the request
A request is represented approximately as:
question: Which category best describes this text?
state: The company reported record quarterly revenue.
options: business [MASK], sports [MASK], technology [MASK], politics [MASK]
The contextual representation at each option's [MASK] token is passed through
the shared scoring layer. The resulting logits are normalized across the
candidate options.
Because the answer space is supplied at request time, it is not permanently encoded into a fixed classification head.
Oryn was evaluated on a random sample of 1,000 held-out examples from its multitask validation set.
The ordinal sentiment task is currently the model's main weakness. The model is substantially stronger on binary and categorical decisions.
The benchmark was performed with batched GPU inference. Batched latency is not equivalent to end-to-end single-request latency.
Oryn was trained on a mixture of:
- zefang-liu/phishing-email-dataset
- fancyzhx/ag_news
- google/boolq
- SetFit/sst5
These datasets expose the model to:
- Phishing and fraud detection
- Binary reading comprehension
- News topic classification
- Five-level ordinal sentiment classification
Training used two phases:
- Supervised cross-entropy warmup
- Calibration-oriented optimization using differentiable proper-scoring objectives
For nominal decisions, the calibration objective combines cross-entropy with a spherical scoring term. For ordinal decisions, cross-entropy is combined with ranked probability score.
This training procedure is Laya-inspired, but it does not reproduce the original RLCD/REINFORCE procedure exactly.
Oryn is suitable for experimentation with:
- Message triage
- Phishing detection
- Topic classification
- Sentiment classification
- Support-request routing
- Urgency classification
- Small local decision systems
- Dynamic classification research
- Low-latency edge or local inference
Oryn can technically receive any question and any set of options:
result = predict(
text="The company reported record quarterly revenue.",
question="Which category best describes this text?",
options=[
"business",
"sports",
"technology",
"politics",
],
)
However, architectural support for arbitrary options does not guarantee reliable knowledge of arbitrary domains.
Oryn is most reliable on tasks similar to its training mixture. New domains should be evaluated and usually fine-tuned before production use.
{
"prediction": "business",
"confidence": 0.8421,
"probabilities": {
"business": 0.8421,
"sports": 0.0314,
"technology": 0.0987,
"politics": 0.0278
}
}
The custom inference.py implementation is required because Oryn uses a custom
option-scoring head rather than a standard Transformers sequence-classification
head.
pip install torch transformers
python inference.py \
--text "The company reported record quarterly revenue." \
--question "Which category best describes this text?" \
--options business sports technology politics
If you use Oryn, cite this model repository:
@misc{oryn_bert_mini,
title = {Oryn: A compact low-latency BERT Mini option-scoring model},
author = {Timo Sarkar},
year = {2026},
howpublished = {Hugging Face},
note = {A compact low-latency BERT Mini option-scoring model}
}
- Downloads last month
- -