Skip to main content

InvariantOne

InvariantOne is a natural-language decision model that scores runtime-defined options directly rather than generating an answer token-by-token.

Python 3.10+ License: Apache 2.0 Model: D5-L4 Equivariance: Exact


Overview

Traditional generative language models make decisions by auto-regressively generating candidate tokens ("A", "B", "Option 1"). This causes:

  • Severe Order Sensitivity: Changing option order alters probabilities and flips decisions.
  • Cross-Option Attention Interference: Later candidates attend to earlier candidates in the prompt.
  • High Latency Overhead: Enforcing order-invariance requires permutation averaging (e.g. evaluating $4! = 24$ prompt variants).

InvariantOne resolves these problems architecturally:

  1. Independent Branch Encoding: Each candidate choice $[S, Q, O_k]$ is processed independently through an adapted Qwen/Qwen3.5-4B-Base backbone.
  2. Exact Distributional Permutation Equivariance: Pooled option representations pass into a direct comparative head ($d=2560 \to 256 \to 1$), guaranteeing $\text{TVD} = 0.000000$ across all option permutations.
  3. Calibrated Confidence: Output probabilities are normalized with a frozen temperature parameter ($\tau^* = 1.0091$).

Installation

# From repository
git clone https://github.com/invariantone/invariantone.git
cd invariantone
pip install -e .

# With optional HTTP server support
pip install -e ".[server]"

Quickstart

from invariantone import InvariantOne

# Load frozen v1 checkpoint (auto-detects CUDA / Apple MPS / CPU)
model = InvariantOne.from_pretrained("invariantone-v1")

result = model.decide(
    state="Pressure is rising above the safe operating range.",
    question="What action should the controller take?",
    options=[
        "Close the inlet valve",
        "Increase feed pressure",
        "Maintain the current state",
        "Disable monitoring",
    ],
)

print(f"Selected: {result.choice}")
print(f"Index:    {result.choice_index}")
print(f"Probabilities: {[round(p, 4) for p in result.probabilities]}")

Output:

Selected: Close the inlet valve
Index:    0
Probabilities: [0.7952, 0.0389, 0.1547, 0.0112]

Dynamic Options Count ($K \ge 2$)

Scope Note on Candidate Options Count ($K$):
The runtime supports arbitrary $K \ge 2$; the reported scientific evaluation results are for $K=4$ unless otherwise stated. Experimental generalization to arbitrary $K$ has not been independently established in the scientific benchmarks.

InvariantOne supports arbitrary numbers of runtime options:

# Binary decision (K=2)
binary_res = model.decide(
    state="High packet loss observed on eth0.",
    question="Should traffic fail over to eth1?",
    options=["Fail over to eth1", "Stay on eth0"],
)

# Multi-way decision (K=5)
multi_res = model.decide(
    state="Temperature at 520 C, cooling loop nominal.",
    question="Select operational mode:",
    options=[
        "SCRAM shutdown",
        "Engage loop B",
        "Adjust control rods",
        "Vent steam",
        "Maintain baseline",
    ],
)

Batch Decisions

Evaluate workloads with heterogeneous option counts:

results = model.decide_batch([
    {
        "state": "Disk usage at 98%.",
        "question": "Action:",
        "options": ["Purge logs", "Extend disk", "Ignore"],
    },
    {
        "state": "CPU nominal.",
        "question": "Action:",
        "options": ["Scale down", "Maintain size"],
    },
])

Command-Line Interface (CLI)

# Single decision (human-readable table)
invariantone decide \
  --state "Pressure is above limit" \
  --question "What should the system do?" \
  --option "Close inlet valve" \
  --option "Increase pressure" \
  --option "Maintain current state" \
  --option "Disable monitoring"

# Machine-readable JSON output
invariantone decide \
  --state "Pressure is above limit" \
  --question "What should the system do?" \
  --option "Close inlet valve" \
  --option "Increase pressure" \
  --json

# Verify checkpoint cryptographic integrity
invariantone verify

# Inspect model metadata
invariantone info

HTTP Inference Service

Run the local API service:

invariantone serve --port 8000

Execute inference via REST:

curl -X POST http://127.0.0.1:8000/v1/decide \
  -H "Content-Type: application/json" \
  -d '{
    "state": "Pressure is rising above the safe operating range.",
    "question": "What action should the controller take?",
    "options": [
      "Close the inlet valve",
      "Increase feed pressure",
      "Maintain the current state",
      "Disable monitoring"
    ]
  }'

Benchmark Performance Summary

Evaluated on FINAL-HOLDOUT-V2 ($1,536$ four-choice items) under strict preregistered one-shot governance:

Benchmark Provenance Note:
A100 performance figures are from the frozen FINAL-HOLDOUT-V2 benchmarking run; release-wheel functionality was independently smoke-tested in a fresh Python 3.12 environment.

Evaluation Stratum Focus Unadapted $D_0$ $B_1$-Raw $B_1$-Sym ($24$-Perm) InvariantOne-v1 (Seed 42)
FINAL-REAL Real operational control tasks ($N=256$) 89.45% 91.41% 92.58% 94.14%
FINAL-L1 Familiar-Operator Compositional Recombination ($N=256$) 32.81% 38.28% 43.75% 89.84%
FINAL-L2a Semantic Extrapolation ($N=256$) 28.12% 45.31% 50.39% 86.33%
FINAL-L2b Relational Extrapolation ($N=256$) 22.27% 62.50% 65.23% 55.08%
FINAL-L3 Double Extrapolation ($N=512$) 25.20% 60.94% 65.43% 56.84%
Aggregate Total locked holdout pool ($N=1,536$) 37.17% 59.90% 63.80% 73.18% (1,124/1,536)

Multi-seed aggregate mean across Seeds 42, 43, 44 is 71.74% ($\pm 1.97%$).

Permutation Equivariance: $\text{TVD} = 0.000000$ across all 24 permutations.
Inference Speedup: $5.08\times$ faster than 24-permutation symmetrized causal baseline ($83.71\text{ ms}$ vs $425.31\text{ ms}$ on A100).


Known Boundaries & Model Limitations

  1. Dynamic-$K$ Scientific Generalization: While the runtime supports arbitrary $K \ge 2$ and exact permutation equivariance holds algebraically, empirical benchmark accuracy ($94.14%$, $89.84%$, etc.) was evaluated on 4-choice tasks ($K=4$). Experimental generalization to arbitrary $K$ has not been independently established in the scientific benchmarks.
  2. Novel Relational Operators: InvariantOne excels at familiar-operator recombination ($89.84%$) and semantic domain transfer ($86.33%$). However, completely unseen operator grammars drop to $55.08%$ ($L_{2b}$) and $56.84%$ ($L_3$), where 24-permutation causal averaging remains stronger ($65.43%$).
  3. Top-1 Argmax Tie Breaking: While the output probability distribution is strictly permutation-equivariant ($\text{TVD} = 0.000000$), argmax top-1 selection exhibits a $1.56%$ flip rate under exact floating-point ties.
  4. No Generative Explanations: InvariantOne is a dedicated decision model; it does not produce token-by-token natural-language rationales.
  5. Confidence Estimates: Probabilities represent model confidence estimates and are not safety-critical certification guarantees.

Documentation & Research


License

InvariantOne is licensed under the Apache 2.0 License. Base foundation model weights are licensed under the upstream Apache 2.0 license by Alibaba Cloud.

Release files for invariantone 1.0.0

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

Source distribution (sdist)

Source distribution for invariantone 1.0.0
File Size Uploaded
invariantone-1.0.0.tar.gz 10.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for invariantone 1.0.0
File Interpreter ABI Platform
invariantone-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 MB

Release files / invariantone-1.0.0.tar.gz

Download URL invariantone-1.0.0.tar.gz
Size 10.0 MB
Tags Source
SHA-256 checksum
How to use checksums
3f6846d898970df654a0effc174f144eaacce2ed999b573c9b5817f2a49a1b59
BLAKE2b-256 checksum
How to use checksums
2987976155c6b8756add3d1ee5b45b0abf2244a09ebc7ecdd0e7d281b5d1302b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / invariantone-1.0.0-py3-none-any.whl

Download URL invariantone-1.0.0-py3-none-any.whl
Size 10.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
bac6d4d419353af486d599130f3b074a812c8ae990858599b0c0300f33b53826
BLAKE2b-256 checksum
How to use checksums
30a7d34465ad8c3948439c1701a69c84862866b4557deb8a05b9dddb1ab49f00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

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