Text Classification
PEFT
Safetensors
English
decision-model
classification
calibration
routing
guardrails
lora
Mixture of Experts
Instructions to use naluj/squid-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use naluj/squid-1 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("thinkingmachines/Inkling-2-Mini") model = PeftModel.from_pretrained(base_model, "naluj/squid-1") - Notebooks
- Google Colab
- Kaggle
Clean up model card layout and formatting
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192---base_model: thinkingmachines/Inkling-2-Minibase_model_relation: adapterlibrary_name: peftlicense: apache-2.0language:- enpipeline_tag: text-generationdatasets:- nvidia/When2Call- nvidia/Aegis-AI-Content-Safety-Dataset-2.0tags:- inkling-2-mini- inkling2_loop- moe- lora- peft- tinker- distillation- decision-model- calibration- classification- system-onemodel-index:- name: squid-1results:- task:type: multiple-choicename: System One decisions (AA proxy, held-out report split)dataset:name: EvalSafe-O*NET-AA (held-out report split, n=3,272)type: evalsafe-onet-aa-reportmetrics:- type: aa_decision_scorevalue: 87.57- type: accuracyvalue: 85.76- task:type: multiple-choicename: Tool-calling routing (AA proxy, held-out report split)dataset:name: When2Call (held-out report split, n=1,775)type: when2call-reportmetrics:- type: aa_decision_scorevalue: 88.12- type: accuracyvalue: 85.97- task:type: multiple-choicename: Unknown-abstention decision making (AA proxy)dataset:name: HLE-MultiChoice v1.1 (cais/hle, n=509)type: hle-multichoice-v1.1metrics:- type: aa_decision_scorevalue: 47.75- task:type: multiple-choicename: Zero-CoT graduate science reasoningdataset:name: GPQA-Diamond (n=198)type: gpqa-diamondmetrics:- type: accuracyvalue: 50.00- type: ecevalue: 0.072- task:type: multiple-choicename: Zero-CoT 10-option reasoningdataset:name: MMLU-Pro 1k (n=1,000)type: mmlu-pro-1kmetrics:- type: accuracyvalue: 62.20- type: auroc_error_detectionvalue: 0.8017- task:type: multiple-choicename: Calibrated NLU decisions (11 tasks)dataset:name: Kev decision-v7/test (n=1,324)type: kev-decision-v7-testmetrics:- type: accuracyvalue: 82.63- type: ecevalue: 0.0254- type: auroc_error_detectionvalue: 0.834- task:type: multiple-choicename: System One decisionsdataset:name: JevBench (231 public tasks)type: jevbench-231metrics:- type: accuracyvalue: 87.88- type: briervalue: 0.1714---# Squid (`squid-1`)An open-weights, calibrated **System One decision model** built as a rank-16 LoRA adapter for [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini) (Apache 2.0, 26.4B total / 3.4B active looped-MoE) for **~\$5.26 total training spend**.- **Code, evals, and full training pipeline:** [github.com/naluj/squid](https://github.com/naluj/squid)- **Checkpoint:** `v7b_step_40` (Apache 2.0 PEFT `adapter_model.safetensors`, ~742 MB)Given a state, a question, and candidate options (up to 62 single-token ASCII labels `A–Z`, `a–z`, `0–9`), Squid outputs calibrated probabilities over the valid options in a **single forward pass at `effort=0.0`** (no chain-of-thought tokens at inference time). It handles `choice`, `noul` (true/false with abstention), and `score` (ordered scale) decisions.## Benchmarks (`v7b_step_40`)### Held-out public AA Decision Index v2.1 proxies (40% of index weight, 2-pass symmetry averaging)Measured across all 3 public-derived AA components on our frozen untouched held-out `report` splits (`EvalSafe-O*NET-AA`, `When2Call`) and the full public MCQ split (`HLE-MultiChoice v1.1`), **5,556 items, 0 failures, 0 overlaps across 121,088 training examples** in `data` v1–v7b:| Component (AA Weight) | `v5_tail` (1-pass) | **`squid-1` (`v7b_step_40`, 2-pass)** | Delta | Breakdown || :--- | :---: | :---: | :---: | :--- || **EvalSafe-O\*NET-AA** (`15%`, `n=3,272`) | 86.01 *(58 failed)* | **87.57** *(0 failed)* | **+1.56** | `noul` 93.79, `choice` 81.66 (+5.84), `score` 78.63 (+1.49) || **When2Call** (`10%`, `n=1,775`) | 79.86 | **88.12** *(0 failed)* | **+8.26** | `cannot_answer` 85.10 (+22.70), `request_for_info` 95.49 (+4.13), `tool_call` 86.09 || **HLE-MultiChoice v1.1** (`15%`, `n=509`) | - | **47.75** *(0 failed)* | - | `60.9%` decline rate, `mean_top_p = 0.275` || **2-Component Weighted Proxy (`25%`)** | 83.55 | **87.79** | **+4.24** | O\*NET + When2Call || **3-Component Weighted Proxy (`40%`)** | - | **72.77** | - | O\*NET + When2Call + HLE-MultiChoice v1.1 |### Zero-CoT external public benchmarks (0 train-eval overlaps)Single-forward-pass (`effort=0.0`, zero chain-of-thought tokens) decision accuracy, calibration, and selective-escalation performance:| Benchmark | `n` | Accuracy | Calibration (Brier / ECE) | Error-Detect AUROC | Top-80% Confident Acc || :--- | :---: | :---: | :---: | :---: | :---: || **GPQA-Diamond** *(4-opt, 2-pass)* | 198 | **50.00%** | 0.6079 / 0.0720 | 0.7353 | **55.06%** || **MMLU-Pro 1k** *(10-opt, 2-pass)* | 1,000 | **62.20%** | 0.5136 / 0.0881 | **0.8017** | **70.13%** || **Kev `decision-v7/test`** *(11-task NLU, 1-pass)* | 1,324 | **82.63%** | **0.2457 / 0.0254** | **0.8340** | **89.71%** |*(On `decision-v7/test`, escalating the lowest-confidence 20% tail catches 52.6% of all errors, lifting kept accuracy to 89.71% and oracle-escalated accuracy to 91.77%.)*### Private AA v2.1 dev analogs & legacy leak-free suite- **AA-Symmetry analog (90 × 4 forms, zero-on-flip rule):** `72.31` (`8.9%` flip; **`0%` safety flip** on Aegis 2.0, `3.3%` flip on When2Call), up from `63.63` (`17.8%` flip) on `v5_tail` 1-pass.- **Omniscience analog (`AA-Omniscience-Public-v1.1`, 300 items, decline-aware):** `76.76` with **99.0% answer precision** (`98/99` answered items correct, `67%` decline rate).- **Unseen prompt-injection resistance (100% held-out templates):** Paperclip clean-vs-injected drop cut **>4×** (`-10.5 → -2.4`, `71.74` injected score).- **Internal leak-free suite (Tinker 1-pass):** Calibrated composite **88.05**, JevBench 231 **87.88%** (Hard 74.78%, Brier 0.1714), Transfer-v9 **79.25%**, Symmetry (160 pairs) **92.63**.## CalibrationTurn the option-label logits into calibrated probabilities via per-type temperature softmax `p = softmax(logits / T)` (fitted strictly on held-out `calibration.jsonl` with AA's top-option `aa_score` objective):| Decision Type | `T` || :--- | :---: || `choice` | `1.08474` || `score` | `1.11195` || `noul` | `0.93600` || `default` | `1.06966` |For best symmetry and Brier calibration, run **2-pass parallel option-order averaging** (score original option order and reversed option order in parallel, then average aligned probabilities: `0.5 * (p_orig + p_rev[::-1])`).## Usage (PEFT / Transformers)```pythonimport torchfrom transformers import AutoModelForMultimodalLM, AutoTokenizerfrom peft import PeftModelbase_id = "thinkingmachines/Inkling-2-Mini"adapter_id = "naluj/squid-1"tok = AutoTokenizer.from_pretrained(base_id)base = AutoModelForMultimodalLM.from_pretrained(base_id, dtype=torch.bfloat16, device_map="auto")model = PeftModel.from_pretrained(base, adapter_id)model.eval()```See [github.com/naluj/squid](https://github.com/naluj/squid) for the exact `tml_v0` effort-0 prompt renderer, 2-pass symmetry FastAPI server (`scripts/serve.py`), and evaluation scripts.## Training Summary1. **v1–v4:** Supervised decision fine-tuning on `Inkling-2-Mini` with `CE + Brier + Symmetry-JS + Vocab-Mass Anchor`.2. **v5 & v5_tail:** System 2 → System 1 active hard-example distillation from `Inkling-2-Small` (`effort=0.5`, `K=4`, ~\$5.26 total spend) + low-LR polish.3. **v7b (`squid-1`, this checkpoint):** Resumed from `v5_tail_step_50` on `data_v7b` (7,202 leak-free records: balanced `When2Call` train routing, `$0`-mined self-knowledge explicit-decline MCQs, `Aegis 2.0` 4-form safety invariance, `2,500` clean `v5` replay anchors, and 400 clean-vs-injected prompt-injection invariance pairs using 18 disjoint training-only templates) trained with our **4-form AA-Symmetry group loss** (`JS + margin-spread penalty`, `lr=2.0e-5`, `sym_w=0.75`, `brier_w=1.35`, `step_40`).## Limitations- Tuned for single-token decision prompting at `effort=0.0`; free-form generation or non-zero thinking effort is untested.- Local AA proxy/analog scores are not official Artificial Analysis leaderboard scores (`AA-Paperclip`, `AA-Omniscience-Decision`, and `AA-Symmetry` forms are private/unpublished).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188---license: apache-2.0library_name: peftbase_model: thinkingmachines/Inkling-2-Minibase_model_relation: adapterpipeline_tag: text-classificationlanguage:- endatasets:- nvidia/When2Call- nvidia/Aegis-AI-Content-Safety-Dataset-2.0tags:- decision-model- classification- calibration- routing- guardrails- lora- peft- moe---<div align="center"><imgsrc="https://huggingface.co/naluj/squid-1/resolve/main/assets/benchmark_scorecard.png"alt="squid-1 decision model benchmark scorecard"style="width: 100%; max-width: 100%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em;"/><div style="display: flex; justify-content: center; gap: 1em; margin-bottom: 1em;"><a href="https://github.com/naluj/squid"><strong>GitHub</strong></a>·<a href="#-how-to-use"><strong>Quickstart</strong></a>·<a href="#-performance"><strong>Benchmarks</strong></a></div></div># squid-1`squid-1` is an open-weights, calibrated **System One decision model** post-trained as a rank-16 LoRA adapter on [`Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini) (26.4B total / 3.4B active looped-MoE) for **~$5.26 total training spend**.Given a state, a question, and candidate options, it returns calibrated probabilities over every valid option in a **single forward pass at `effort=0.0`**, without generating chain-of-thought tokens.- **72.77** weighted average across all 3 public-derived AA Decision Index v2.1 components (local proxy, 5,556 held-out items, 0 train–eval overlaps).- **Well-calibrated for escalation**: `0.0254` ECE and `0.834` error-detection AUROC on `decision-v7/test` — escalating the lowest-confidence 20% catches **52.6%** of all errors.- **Order- and injection-resilient**: `8.9%` 4-form flip rate (`0%` on safety) and a `>4×` smaller accuracy drop under unseen prompt injections.## 🗒️ Model Details| Model | Parameters | Description ||---|---|---|| [`Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini) | 26.4B (3.4B active) | Looped-MoE base model (Apache 2.0) || **[`squid-1`](https://huggingface.co/naluj/squid-1)** | 26.4B (3.4B active) | Rank-16 LoRA adapter (~742 MB) for calibrated single-pass decisions |- **Inputs**: text states (structured or free-form) and up to 62 options via single-token ASCII labels (`A–Z`, `a–z`, `0–9`)- **Adapter**: PEFT LoRA (`r=16`, `lora_alpha=32`, all linear layers)- **Inference**: single forward pass at `effort=0.0`; optional 2-pass parallel option-order averaging for stronger symmetry and calibration- **Max sequence length**: up to 32,768–65,536 tokens (middle-out truncation in serving preserves both state prefix and question/options)## 🏃 How to use### Request format (`/v1/systemone`)The [serving wrapper](https://github.com/naluj/squid) exposes a drop-in `/v1/systemone` API. A request carries one `state` and any number of `questions`:```pythonquestions = {"refund": {"type": "noul","instructions": "Is the customer asking for a refund?",},"team": {"type": "choice","instructions": "Which team should handle this?","criteria": {"billing": "Charges, refunds, invoices","technical": "App or site faults","fraud": "Suspected unauthorised use",},},"urgency": {"type": "score","instructions": "How urgent is this?","criteria": ["Can wait", "Today", "Blocking the customer now"],},}request = {"state": "I was charged twice this month, please refund one of them.","questions": questions,}```| `type` | `criteria` | answer fields ||---|---|---|| `noul`: yes or no | optional | `noul`: `P(yes)` || `choice`: one of named options | `{name: description}` or `options` | `choice`, `probabilities` || `score`: ordered levels | list of levels, lowest first | `score`, `probabilities` |### PEFT / Transformers```pythonimport torchfrom transformers import AutoModelForMultimodalLM, AutoTokenizerfrom peft import PeftModelbase_id = "thinkingmachines/Inkling-2-Mini"adapter_id = "naluj/squid-1"tokenizer = AutoTokenizer.from_pretrained(base_id)base = AutoModelForMultimodalLM.from_pretrained(base_id,dtype=torch.bfloat16,device_map="auto",)model = PeftModel.from_pretrained(base, adapter_id).eval()```See [github.com/naluj/squid](https://github.com/naluj/squid) for the exact `effort=0.0` prompt renderer, FastAPI server (`scripts/serve.py`), and benchmark harnesses.### CalibrationConvert valid option-token logits to calibrated probabilities via per-type temperature scaling `p = softmax(logits / T)` (fit on a held-out calibration split):| Decision type | `choice` | `score` | `noul` | `default` ||---|---:|---:|---:|---:|| Temperature `T` | `1.08474` | `1.11195` | `0.93600` | `1.06966` |For best symmetry and Brier calibration, score the original and reversed option orders in parallel and average aligned probabilities: `0.5 * (p_orig + p_rev[::-1])`.## 📊 Performance### AA Decision Index v2.1 — Public-Component ProxyEvaluated locally across all 3 public-derived index components (40% of total index weight, 5,556 held-out items, 0 failures, 0 train–eval overlaps) with 2-pass symmetry averaging.| Benchmark (Index Weight) | `squid-1` | Notes ||---|---:|---|| EvalSafe-O\*NET-AA (15%) | **87.57** | `n=3,272` · `noul` 93.79, `choice` 81.66, `score` 78.63 || When2Call (10%) | **88.12** | `n=1,775` · `request_for_info` 95.49, `tool_call` 86.09, `cannot_answer` 85.10 || HLE-MultiChoice v1.1 (15%) | **47.75** | `n=509` · 60.9% decline rate || **3-Component Weighted Proxy (40%)** | **72.77** | **Local proxy — not an official AA leaderboard score** |### Zero-CoT Public BenchmarksSingle-forward-pass (`effort=0.0`, zero generated tokens) accuracy, calibration, and selective-escalation metrics on untouched public benchmarks (0 train–eval overlaps):| Benchmark | `n` | Accuracy | Brier | ECE | Error AUROC | Top-80% Acc ||---|---:|---:|---:|---:|---:|---:|| GPQA-Diamond (2-pass) | 198 | 50.0% | 0.6079 | 0.0720 | 0.735 | 55.1% || MMLU-Pro 1k (2-pass) | 1,000 | 62.2% | 0.5136 | 0.0881 | 0.802 | 70.1% || Kev `decision-v7/test` (1-pass) | 1,324 | 82.6% | 0.2457 | 0.0254 | 0.834 | 89.7% |### Post-Training Impact, Symmetry & Robustness<div align="center"><imgsrc="https://huggingface.co/naluj/squid-1/resolve/main/assets/post_training_impact.png"alt="squid-1 post-training impact and calibration"style="width: 100%; max-width: 100%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em;"/></div>| Suite | Base (`Inkling-2-Mini`) | `squid-1` | Notes ||---|---:|---:|---|| AA-Symmetry analog (90 × 4 forms) | 65.55 (27.8% flip) | **72.31 (8.9% flip)** | `0%` flip on Aegis 2.0 safety || O\*NET `>26` options (`n=58`) | 73.89 (65.5% acc) | **84.52 (87.9% acc)** | 0 failures || Omniscience analog (`n=300`) | 75.74 | **76.76** | 99.0% answer precision (98/99) || Unseen prompt-injection drop | -6.0 | **-2.4** | 100% held-out attack templates || JevBench (231 tasks, 1-pass) | 87.9% | **87.9%** | `0.1714` Brier |## 🔧 Training- **Data**: Leak-free decision mix spanning `choice`, `noul`, and `score` tasks, including `When2Call` tool-calling routing, `Aegis 2.0` 4-form safety invariance, self-knowledge abstention MCQs, and clean-vs-injected pairs built from 18 training-only prompt-injection templates (0 overlaps with any eval split).- **Distillation**: Active hard-example mining followed by `K=4` soft-target System 2 → System 1 distillation from `Inkling-2-Small` (`effort=0.5`).- **Objective**: Candidate-normalized cross-entropy + proper Brier calibration term + vocabulary-mass anchor + 4-form symmetry group loss (Jensen–Shannon divergence and margin-spread penalty), followed by post-hoc per-type temperature calibration.- **Recipe**: Multi-stage rank-16 LoRA (`lora_alpha=32`, all-linear) trained on Tinker for **~$5.26 total spend**.## Limitations- Tuned specifically for single-token decision prompting at `effort=0.0`; free-form text generation and non-zero reasoning effort are untested.- Local AA proxy and analog numbers are independent evaluations with approximated prompts, not official Artificial Analysis leaderboard scores (`AA-Paperclip`, `AA-Omniscience-Decision`, and `AA-Symmetry` forms are private).## License`squid-1` is fine-tuned from [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini) and released under the [Apache License 2.0](LICENSE).## AttributionBase model: `Inkling-2-Mini` by Thinking Machines, licensed under the Apache License 2.0. This adapter modifies the base model via LoRA fine-tuning and is not affiliated with or endorsed by Thinking Machines or Artificial Analysis.
README.md+146-150