Skip to main content

typed-encoders

Training recipes for small encoders that answer typed questions about a text: decisions (pick among options, with a probability for each) and extraction (the spans that answer a field, or nothing). Each recipe reproduces a released model.

Model Task Recipe
tasksource/tasksource-decider-nano (v5, 150M) typed decisions (Decision Index, LocalLLaMA/typed-decisions) recipes/decider
tasksource/UltraBERT-150M-clairic-extraction typed extraction (LocalLLaMA/typed-extraction) recipes/extraction
tasksource/UltraBERT-150M-nli NLI / zero-shot classification recipes/nli

The data is tasksource/tasksource-jev-typed-decisions (its default config for decisions, its extraction config for extraction), plus the sources listed in each recipe. Extraction and NLI train with tasknet.

pip install typed-encoders                     # the models; for the recipes: pip install -e ".[decider,extraction,nli]"
pip install git+https://github.com/apolinario/decision-index   # decider recipe only (not on PyPI)
bash recipes/decider/decider_nano_v5.sh          # needs a Decision Index kit checkout, see the script
bash recipes/extraction/clairic_extraction.sh
bash recipes/nli/ultrabert_nli.sh

Decider

A joint cross-encoder (typed_encoders/decider.py): every option of a question gets a scalar, softmaxed over the question's options. A request's state is encoded once and shared by all its questions and options (tree attention: an option sees the state, its question and itself), so a request with many questions costs little more than one. Trained with soft cross-entropy against target distributions on a 480k-request mix:

Part Share Builder
jev-typed-decisions, firewalled, ≤ 600 questions per task 42% build_jev.py, firewall.py, shape.py
Decision Index source train splits, rendered like the suite 30% build_index_train.py
Tool selection and retrieval (glaive, hermes, xlam, ToolACE, ToolRet, Home-Assistant) 12% build_tool_train.py
LLM routing (xRouteBench, LLMRouterBench train data) 8% build_router_train.py
tasksource/synthetic-typed-decisions 8% build_synth.py
LocalLLaMA/typed-decisions train 0.5% build_typed_decisions.py

Every part is firewalled against the Decision Index 0.3 suite (exact matches and word 6-gram overlap of the content), and benchmarks without a train split are never used. All sources are pinned (download.py), and the manifests rebuild byte-identical to the ones v5 was trained on.

Extraction

A query-conditioned span tagger: the input is field instruction [SEP] text, and one O/B/I head tags the text, so one model handles single values, lists and absent fields, for fields it has never seen. train_packed.py is the one-pass variant: every field of a document in one forward pass (GLiNER-style marker tokens and a field × token head). Evaluations: the extraction test split (eval_jev.py), out-of-domain MRQA and FinEntity (eval_ood.py), and LocalLLaMA/typed-extraction (eval_typed.py, zero-shot).

NLI

Multi-task training on every tasksource NLI-style task with tasknet (shared encoder, one head per label set).

Metadata

Release files for typed-encoders 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typed-encoders 0.1.1
File Size Uploaded Provenance Actions
typed_encoders-0.1.1.tar.gz 12.2 kB Without provenance Details for typed_encoders-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for typed-encoders 0.1.1
File Interpreter ABI Platform Actions
typed_encoders-0.1.1-py3-none-any.whl Python 3 none any Details for typed_encoders-0.1.1-py3-none-any.whl

Total release size: 23.8 kB

Release files / typed_encoders-0.1.1.tar.gz

Download URL typed_encoders-0.1.1.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
90dc185ac134f6d749f032490ac65932ee3df76c673f21f625c401b450e9cbd0
BLAKE2b-256 checksum
How to use checksums
f29f668734e89eec8acc30bfe9f1c85400930f4065206163d9f352089ffafecd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / typed_encoders-0.1.1-py3-none-any.whl

Download URL typed_encoders-0.1.1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90fe2cdfddfbeb02f5ba15114cc31c70a54b57409b888667346b0a149883baa1
BLAKE2b-256 checksum
How to use checksums
25257f03f64216b84ad78e9c09d02b4e4cf13708d653fef839d1b65e9e1fd298
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for typed-encoders 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page