Training
The model was trained with full-parameter fine-tuning of the language backbone, with token embeddings and the output head kept frozen. Training used 2M+ cleaned text-decision examples, supervised with soft labels generated by teacher models (probability distributions over the answer options).
Model and protocol
- Native
Gemma4ForConditionalGeneration, approximately 31B parameters, stored and loaded in bfloat16; no quantization or new weight conversion for publication.
- Causal full/sliding attention, native label-token readout after
Answer:, with the checkpoint's original logit soft-cap. No generated answer tokens.
- KnowLine-style chat rendering with thinking disabled. For each question separately, repeat the state, instructions, question and all options when its complete read-once prompt is ≤3,000 tokens; read longer prompts once. The second copy begins with
Read the same input again before answering:. System turns follow the original layout and are not repeated.
- Long-request question headers, option rotations and extra temperature calibration are disabled. Read-twice rendering follows KnowLine; its model-specific temperatures and serving defaults are not applied to these weights.
- Supports text
choice (2–255 options) and noul (P(true)), with up to 64 questions per request. All supplied options are retained; questions are evaluated independently and returned together under their original keys.
- Complete rendered input limit: 262,144 tokens per question, including repetitions, state, question, options and template. If any question is unsupported, the entire request is unsupported; nothing is truncated. Practical memory requirements depend on input length and hardware.
- Native causal packing isolates questions, resets their positions, and reads only valid option labels. The release retains the evaluated FP64 softmax over the native readout logits. No KV cache, weight merge at serving time, or middle-layer repeat is used.
- Text board only; vision is not evaluated or claimed in this release.
Installation
Validated environment: Python 3.12, PyTorch 2.14.0+cu126, Transformers 5.17.0, FlashAttention 2.8.3.post2, Triton 3.8.0, Linux, NVIDIA H200. Install a CUDA-compatible PyTorch build first; FlashAttention may require a matching CUDA toolkit/build environment.
python -c 'from huggingface_hub import snapshot_download; print(snapshot_download("Ainvest-World/Ainvest-Decision-31b-v2.0", revision="588eae0e3a724ed0617a20ba5ae86c9a1631d8de"))'AINVEST_MODEL_DIR=/absolute/path/to/snapshotpip install --no-build-isolation -r "$AINVEST_MODEL_DIR/requirements.lock.txt"pip install --no-deps "$AINVEST_MODEL_DIR"
The snapshot contains the full BF16 checkpoint (16 weight shards, approximately 62.55 GB), tokenizer and inference package. Pin the published commit SHA for reproducibility. The results Dataset's publication.json binds the tested checkpoint, code and result identities.
Python inference
from ainvest_decision.engine import AinvestDecisionEngine engine = AinvestDecisionEngine( model="Ainvest-World/Ainvest-Decision-31b-v2.0", device="cuda:0", dtype="bfloat16", max_length=262144, read_twice=True, twice_max_tokens=3000, batch_size=16, batch_tokens=16384, sort_window=128,)response, _ = engine("The color is red.", { "color": { "type": "choice", "instructions": "Which color is named?", "criteria": {"red": "red", "blue": "blue"}, }, "is_red": {"type": "noul", "instructions": "Is the named color red?"},})print(response)engine.close()
response["answers"] contains one typed answer per question: choice with the selected original option key and every option probability, or noul with the probability of true. Capacity refusals raise Unsupported. Genuine loading/runtime failures remain errors.
CLI (after installing the package):
ainvest-decision --model "$AINVEST_MODEL_DIR" --device cuda:0 --input "$AINVEST_MODEL_DIR/examples/request.jsonl" --output answers.jsonl
Decision Index adapter
Install the official Decision Index kit separately. The included adapter subclasses its Engine when the kit is installed:
python -m decision_index run --engine ainvest_decision.engine:AinvestDecisionEngine --option model=Ainvest-World/Ainvest-Decision-31b-v2.0 --option device=cuda:0 --option dtype=bfloat16 --option max_length=262144 --option read_twice=1 --option twice_max_tokens=3000 --option batch_size=16 --option batch_tokens=16384 --option sort_window=128 --rows /path/to/your/locally-rebuilt-public-rows.jsonl.gz --out runs/ainvest
Rebuild benchmark inputs according to upstream terms. No benchmark text or gold answers are distributed with this model. Engine.__call__ accepts exactly state and questions; offline predict_many batches multiple requests while preserving request-level support decisions.
Evaluation and limitations
The original completed public 0.3 run has 140,178 requests / 312,320 question outcomes, all answered successfully, with zero technical errors. Public Decision Index 71.58, Raw Index 78.19, complete: true. The full run used this checkpoint with per-question read twice enabled. Publication reuses its existing full result files; it does not repeat the full suite or replace its probabilities.
Publication validation used an independently installed package through the official runner on 100 fixed requests / 285 subquestions, with all requests successful. Every rendered input matched the sealed evaluation input hash and the production renderer's token IDs. Running the frozen production implementation with the same serial batching reproduced every package probability exactly.
One of the 285 subquestions chose a different option from the historical packed run: its original top two probabilities were exactly tied. Recreating its original packed batch reproduced the historical probabilities exactly; serial batching breaks the BF16 tie. The maximum probability difference from the historical packed run was 0.03098. These numerical batching differences are retained in the verification report; the original full-run results are unchanged.
Local dedicated single-H200 request wall time on this same 100-request / 285-question sample: median 111.85 ms, mean 547.79 ms, p80 481.00 ms, p95 3125.66 ms; peak allocated memory 66.08 GB. The official runner completed all 100 requests without technical errors, and answers and probabilities exactly matched the previously accepted serial reference. Rendering, tokenization, all subquestions and GPU synchronization are included; model loading and official warmup are excluded. This isolated H200 preflight is not a claim of passing the official RTX PRO 6000 latency rule.
The earlier shared single-H200 measurement remains recorded separately: median 207.40 ms, mean 726.41 ms, p80 644.30 ms, p95 2484.02 ms, with concurrent workloads. Neither run changes the reused full Public results.
Original full-run timing is amortized packed-batch forward time; it excludes rendering, tokenization and model loading. It is not official single-request latency. Shared-H200 timing also is not an isolated RTX PRO 6000 measurement. The maintainers measure official latency and private Full scores themselves.
This model is intended for research and typed decision scoring. Probability calibration, robustness and downstream suitability require application-specific evaluation.
License and acknowledgements
Weights and Ainvest-authored release code: Apache-2.0, subject to the upstream licenses and notices. Base model: google/gemma-4-31B-it. KnowLine rendering/layout helpers are retained under their original MIT license; input repetition follows the KnowLine/FlexDM layout and RE2. See LICENSE, THIRD_PARTY_NOTICES.md and the included vendor notices. The official Decision Index kit is a separate MIT-licensed project. Dataset content retains its original upstream terms.
Acknowledgment
A large part of the gains are thanks to the tasksource data.
@inproceedings{sileo-2024-tasksource, title = "tasksource: A Large Collection of {NLP} tasks with a Structured Dataset Preprocessing Framework", author = "Sileo, Damien", booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)", month = may, year = "2024", address = "Torino, Italia", publisher = "ELRA and ICCL", url = "https://aclanthology.org/2024.lrec-main.1361", pages = "15655--15684",}