d3-mini-multi / README.md
harsh-wk's picture
Remove byline from model card
2044055 verified
|
Raw History Blame Contribute Delete
6.51 kB
---
license: apache-2.0
base_model: vllm-sr/d3-mini
base_model_relation: finetune
pipeline_tag: zero-shot-classification
library_name: transformers
language:
- en
tags:
- zero-shot-classification
- multi-label-classification
- decision-model
- classification
- system-one
- safetensors
datasets:
- google-research-datasets/go_emotions
- gfissore/arxiv-abstracts-2021
- google/civil_comments
- coastalcph/lex_glue
- fancyzhx/dbpedia_14
- TimSchopf/medical_abstracts
- AmazonScience/massive
- ucberkeley-dlab/measuring-hate-speech
- cardiffnlp/tweet_topic_multi
- google/boolq
- tau/commonsense_qa
- allenai/openbookqa
- allenai/qasc
- stanfordnlp/snli
---
# d3-mini-multi
**[d3-mini](https://huggingface.co/vllm-sr/d3-mini) with a fourth question type. `multi` answers "which of these
options apply?" with every option that applies, from zero to many, in one forward pass.**
| Type | Answers | Returns |
|---|---|---|
| `choice` | Which single option fits best? | One option |
| `score` | Where does this sit on an ordered scale? | One level |
| `noul` | Is this statement true? | One probability |
| **`multi`** | **Which options apply?** | **Every option that applies, a calibrated score for each, and the cutoff** |
`multi` adds one option to the question, the **cutoff**. The model scores the cutoff in the same pass and the
same softmax as the labels, and keeps every label that outscores it. Because the cutoff is scored from the
input, the model sets a new threshold for every input. The default cutoff works without tuning. An offset is there when a task needs it.
- **Code and proxy:** [github.com/akta-pro/d3-multi](https://github.com/akta-pro/d3-multi)
- **Paper:** [The Cutoff Is an Option](https://akta.pro/blog/the-cutoff-is-an-option-single-pass-multi-label-classification-with-adaptive-thresholding)
## Results
Micro-F1 on held-out test data, with no threshold tuning on either side. "1 pass" means one forward pass per
input.
| Test set | Labels | Base: one `noul` per label (p > 0.5) | Base: `choice` top-1 | **d3-mini-multi (1 pass)** |
|---|---|---|---|---|
| arXiv categories | 155 | 0.29 | 0.65 | **0.67** |
| Civil Comments (toxicity attributes) | 7 | 0.59 | 0.41 | **0.78** |
| DBpedia-14 | 14 | 0.90 | 0.97 | **0.98** |
| ECtHR-A (articles violated) | 10 | 0.66 | 0.69 | **0.75** |
| ECtHR-B (articles alleged) | 10 | 0.69 | 0.72 | **0.80** |
| GoEmotions | 28 | 0.40 | **0.56** | **0.56** |
| **UNFAIR-ToS (never seen in training)** | 8 | 0.60 | 0.19 | **0.66** |
| **TweetTopic (never seen in training)** | 19 | 0.63 | **0.68** | **0.68** |
| **Hate-speech targets (never seen in training)** | 8 | 0.69 | **0.76** | 0.72 |
`multi` beats per-label `noul` on all nine test sets, including the three domains that are not in the training
data. Against `choice` top-1, it wins on six, ties on two, and trails on hate-speech targets, where most comments
target a single group.
**`choice`, `score` and `noul` keep their accuracy.** We ran the base and fine-tuned models on the same 10,763 requests
(29,053 questions) from 42 public benchmarks of the Decision Index. The public index is 55.10 for d3-mini-multi
and 55.05 for the base model: a change of +0.01 points, with a standard error of 0.22.
The tuned-baseline comparison, cost and calibration are in the
[GitHub README](https://github.com/akta-pro/d3-multi#results).
## Quickstart
Serve the model with vLLM, then put the `multi` proxy from the GitHub repository in front of it:
```bash
git clone https://github.com/akta-pro/d3-multi && cd d3-multi
pip install -r requirements.txt
vllm serve akta-pro/d3-mini-multi --served-model-name d3-mini-multi --port 8100 --no-enable-prefix-caching
python -m d3multi.serve --upstream http://localhost:8100 --port 8200
```
Ask a `multi` question:
```bash
curl -s localhost:8200/v1/systemone -H 'content-type: application/json' -d '{
"model": "d3-mini-multi",
"state": "The order arrived damaged yesterday. The customer was charged twice and wants a replacement today.",
"questions": {
"teams": {
"type": "multi",
"instructions": "Which teams need to act on this request?",
"criteria": {
"returns": "Refunds, replacements and damaged deliveries",
"billing": "Payments, invoices and charges",
"technical": "Product setup and faults",
"shipping": "Delivery tracking and couriers"
}
}
}
}'
```
The answer (scores rounded to four decimals):
```json
{
"teams": {
"type": "multi",
"selected": ["returns", "billing"],
"scores": {
"returns": 0.9867,
"billing": 0.9108,
"shipping": 0.2438,
"technical": 0.0494
},
"cutoff": 0.0116
}
}
```
`choice`, `score` and `noul` questions pass through the proxy unchanged, and they can share a request with
`multi` questions. The request format, the `offset` setting and the client-side decoder are in the
[GitHub repository](https://github.com/akta-pro/d3-multi).
## Limits
- **Unseen domains.** On UNFAIR-ToS, untuned `multi` reaches recall 0.94 but precision 0.51: it tags too many
sentences on a set where 89% of inputs have no label. On hate-speech targets, where most comments target one
group, `choice` top-1 is ahead (0.76 against 0.72).
- **254 options per question.** The readout scores 255 codes, and the cutoff takes one.
- **Near-zero margins.** Options within a hair of the cutoff can flip with batch shape or numeric precision.
<sub>All test sets are English text. We did not test other languages, or `multi` questions about images or video.</sub>
## Files
The weights are BF16. The readout, tokenizer, configuration and d3 runtime files are copied unchanged from
[vllm-sr/d3-mini](https://huggingface.co/vllm-sr/d3-mini) at revision 97dd054. Only the language-model weights
differ. `SHA256SUMS` lists the hash of each weight file.
## License
Apache-2.0 ([LICENSE](LICENSE), [NOTICE](NOTICE)). d3-mini is Apache-2.0 (Copyright 2026 vLLM Semantic Router
Team), built on [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) (Apache-2.0).
## Citation
```bibtex
@misc{d3_multi_2026,
title = {The Cutoff Is an Option: Single-Pass Multi-Label Classification
with Adaptive Thresholding},
author = {Balot, Harsh and {akta.pro}},
year = {2026},
howpublished = {\url{https://akta.pro/blog/the-cutoff-is-an-option-single-pass-multi-label-classification-with-adaptive-thresholding}},
note = {Code: \url{https://github.com/akta-pro/d3-multi}}
}
```