Apertus Decide

A non-generative, embedding-based model for runtime-defined Choice, Score and Noul questions. Developed by Andreas Martin. This is an experimental adaptation; accepting a new schema does not guarantee accuracy on a new task or language.

Provenance and attribution

  • Immediate parent: andreasmartin/apertus-v1.1-swiss-embed-0.4b-bidir; relationship: finetune.
  • Weight lineage: swiss-ai/Apertus-8B-2509 → swiss-ai/Apertus-v1.1-0.5B → andreasmartin/apertus-v1.1-swiss-embed-0.4b-bidir → andreasmartin/apertus-v1.1-swiss-decide-0.4b-bidir.
  • Base encoder revision: 875c1f99d7b20e261ea43b3586fdde5f8d5648e5.
  • Apertus models originate from the Swiss AI Initiative. Consult the upstream Apertus model card for authors, original training data, citations and limitations.

Architecture and decision contract

The complete Sentence Transformer preserves the bidirectional Apertus backbone, mean pooling, bias-free Dense projection and L2 normalization. LoRA is trained on attention projections and merged before release. The projection is retained, frozen during decision tuning, and included in the complete Sentence Transformer.

The query contains the state and instructions. Candidates contain option names and descriptions (Choice), level descriptions (Score), or false/true descriptions (Noul). Exact prefixes and JSON serialization are defined in decision.py. Cosine similarities multiplied by 10.0 produce candidate logits. Per-type temperature calibration is fitted on the calibration split only. Choice returns the maximum-probability option; Score returns the expected ordered level; Noul returns the probability assigned to the true candidate.

confidence is normalized entropy concentration, not probability of correctness. The context limit is 512 tokens per encoded query or candidate. Overflow is rejected during serving; overlength training rows are excluded. No inherited Matryoshka truncation quality is claimed for decision use.

Training data and source attribution

Direct decision-training corpus: HIT-TMG/JevEmbed-Data at immutable revision fc7f44305315082d7d554d572024861e438aeffa. Only its train split was sampled. The selected data was partitioned by source/fall group into training, validation, calibration and internal test sets; identical states across splits were rejected. The public upstream test split was not used. This internal test is not an independent out-of-domain or unseen-task benchmark.

Actual split counts:

{
  "train": {
    "noul": 4000,
    "choice": 4000,
    "score": 4000
  },
  "validation": {
    "noul": 200,
    "score": 200,
    "choice": 200
  },
  "calibration": {
    "noul": 300,
    "choice": 300,
    "score": 300
  },
  "test": {
    "noul": 300,
    "score": 300,
    "choice": 300
  }
}

All actual upstream dataset IDs, source revisions, row references and recorded licenses are preserved in source_manifest.json. Aggregated sources, filtering, exclusions and processed-file SHA256 values are in data_manifest.json. Only explicitly permitted license identifiers were selected: cc0-1.0, apache-2.0, mit, cc-by-4.0. Source attribution and applicable data terms remain relevant; the model license does not relicense its source corpora.

Historical embedding training used wikimedia/wikipedia, eljuanina/VotingBooklets-v1 and ZurichNLP/SwissGov-RSD, as documented by the parent model. They are inherited provenance, not new decision-training datasets. No translated or newly generated Swiss decision data was added in this run. Language metadata reflects the parent encoder's intended languages; decision quality in each language requires separate measurement.

Training recipe

LoRA rank 16, alpha 32, dropout 0.05; q_proj, k_proj, v_proj, o_proj; learning rate 0.0001; 1000 optimizer updates; SDPA attention, BF16 backbone with FP32 trainable adapters; question microbatch 8 per GPU; gradient accumulation 2; 4 training processes; effective batch 64 questions; 10% warmup and cosine schedule; seed 42. Soft-target cross-entropy is used for all tasks. Numeric Score targets are represented by adjacent-level interpolation; this is an implementation choice, not a claim that the source provides a full target distribution.

The reference parent, dataset revision, exact run configuration and measured GPU count are recorded in run_config.json and training_metrics.json.

Evaluation

Measured on the saved, reloaded encoder using the internal held-out test split. Calibration uses a separate split. FP precision is recorded in evaluation.json. Brier here is the sum of squared errors across candidate probabilities. Accuracy covers only hard-target examples; denominators are in the full report. Score MAE uses level units; Noul MAE uses probability units.

Type Questions Hard-target accuracy NLL Brier MAE
choice 300 0.68 0.80436 0.42891 N/A
score 300 0.63 0.74201 0.44234 0.5816908331595515
noul 300 0.93 0.14013 0.09082 0.09262523968667083

Parent validation, tuned validation, uncalibrated test and calibrated test results are included in evaluation.json. Language-specific quality, out-of-domain calibration and deployment latency require separate measurement.

Loading and serving

from decision import DecisionModel
# Download the complete model repository before loading it locally.
model = DecisionModel("./downloaded-model")
result = model.evaluate({"state": "My parcel has not arrived.", "questions": {
    "route": {"type": "choice", "instructions": "Which team should help?",
              "criteria": {"shipping": "Delivery and tracking", "billing": "Invoices"}}
}})

The Hub task tag describes the encoder artifact. A generic text-classification pipeline does not implement this model's decision protocol. Install the server requirements for direct CPU inference (install CPU-only PyTorch first):

python -m pip install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements-server.txt
hf download andreasmartin/apertus-v1.1-swiss-decide-0.4b-bidir --local-dir ./downloaded-model
python decision.py --model-dir ./downloaded-model

API example

curl http://localhost:8000/v1/systemone -H 'Content-Type: application/json' -d '{
  "model": "apertus-decide",
  "state": "My parcel has not arrived.",
  "questions": {"route": {"type": "choice", "instructions": "Which team should help?",
    "criteria": {"shipping": "Delivery and tracking", "billing": "Invoices"}}}
}'

Choice supports 2–64 candidates; Score supports 2–10 ordered descriptions; Noul accepts omitted criteria or a complete false/true pair. Up to 64 questions are processed per request. The supplied service implements these JSON fields; full official SDK compatibility and usage accounting are not claimed. Repeated input texts are encoded once per request, with bounded encoder batches. Bind beyond localhost explicitly; set DECIDE_API_KEY to enable bearer authentication. Do not treat input text as executable instructions.

Limitations

Retrieval pretraining does not establish reasoning, policy compliance or factual correctness. Similarity-based decisions may fail on negation, complex constraints, option wording and unfamiliar tasks. Quantization may change probabilities; recheck thresholds and calibration on the actual deployment backend. Arithmetic, exact rules and state-changing actions belong in application code. Measure CPU latency and memory on the intended server. No GPU latency is presented as CPU performance. Non-generation eliminates free-form output, not decision errors.

Method reference

JevEmbed provides the decision-training corpus and informs the embedding-based decision workflow. Model weights derive from the Apertus lineage documented above.

License and reproducibility

Model license is declared in the YAML above. Base attribution is retained; see upstream repositories and the source manifests for applicable notices and data licenses. Runtime scripts include their own Apache-2.0 notice. Preserve all sidecars together with the matching weights. artifact_manifest.json lists file hashes. Never add access tokens or private training examples to this repository.

Downloads last month
15
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for andreasmartin/apertus-v1.1-swiss-decide-0.4b-bidir

Dataset used to train andreasmartin/apertus-v1.1-swiss-decide-0.4b-bidir

Space using andreasmartin/apertus-v1.1-swiss-decide-0.4b-bidir 1

Collection including andreasmartin/apertus-v1.1-swiss-decide-0.4b-bidir