Text Classification
Transformers
Safetensors
Laya
system-one
typed-decisions
nli
memory-conflict
multilingual
fine-tuned
Eval Results (legacy)
Run this model with HF Jobs
Run slow-stack/laya-nli-memory-conflict on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/slow-stack/laya-nli-memory-conflict. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/slow-stack/laya-nli-memory-conflict on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use slow-stack/laya-nli-memory-conflict with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use slow-stack/laya-nli-memory-conflict with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="slow-stack/laya-nli-memory-conflict")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("slow-stack/laya-nli-memory-conflict", device_map="auto") - Laya
How to use slow-stack/laya-nli-memory-conflict with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Rewrite card as a pointer to the delivered head
Browse filesThe card now opens by naming slow-stack/laya-nli-conflict-v12 as the delivered head, demotes the v4 baseline to the results section, and adds a which-repo-to-load table. Front matter and model-index keep this repo's own v4 numbers; we do not claim v12 metrics here.
33 unmodified lines34353637383940414243444546474849505152535455565758596061626364656667686970717273747576776 unmodified lines848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441452 unmodified lines14814915015115215315415515615715815916016116216316416516616716816933 unmodified lines# laya-nli-memory-conflictA Laya decision head that answers one question about a memory pair:> **新信息(new)与已有记忆(known)是否冲突?冲突=矛盾需更新旧记忆,兼容=一致或无关**`noul` question, two custom labels `{"false": "兼容", "true": "冲突"}` — i.e. "should thestored memory be superseded by what the user just said, or not?". Built for memory pluginsthat must decide whether to update a user's stored facts, preferences and constraints.Fine-tuned from [`convaiinnovations/laya-multilingual`](https://huggingface.co/convaiinnovations/laya-multilingual)with the official public recipe (the Kaggle 2xT4 notebook: RLCD loss + post-hoc per-typetemperature fit), by [modusensus](https://github.com/modusensus). Training tooling, thedata generators and every evaluation script are in[the `kaggle_eval/` directory of this fork](https://github.com/modusensus/laya/tree/main/kaggle_eval),together with two handoff documents that record the full gate tables.## ResultsFour candidates over the same frozen eval sets. **v4 is the delivered head**(`model.safetensors` in this repo, SHA256 `e9e1c4a5…d4b13758`).| metric | v2 | v3 | **v4 (this repo)** | gate ||---|---|---|---|---|| main val (frozen 1000, MultiNLI-derived) | 0.902 | 0.902 | **0.901** | ≥0.90 || main val ECE | 0.021 | 0.0146 | **0.0192** | ≤0.02 || bias diagnostic (14 control + input-swap pairs) | 12/14 | 13/14 | **13/14 PASS** | PASS, no pinned output || real case, frozen 20 hand-written pairs | 16/20 | 19/20 | **20/20** | ≥19/20 || real case, 10 template-free new pairs | — | — | **10/10** | ≥8/10 || soft-conflict set (300 pairs, 4 never-trained classes) | 206/300 | 295/300 | **297/300** | ≥295/300 || ├ held-out classes | 62/100 | 95/100 | **97/100** | ≥95/100 || label-surface swap (labels exchanged at inference) | — | — | **0 cases flipped** | ≤1 || negation side-set | 2/5 | 4/5 | **4/5** | report only |## Usage```pythonimport layaagent = laya.load('slow-stack/laya-nli-memory-conflict', device='cpu')QUESTION = {'type': 'noul',6 unmodified linesprint(p_conflict) # ~0.92 -> conflict: the intent violates a stored hard constraint```## Evaluation protocol (why these numbers are comparable)- **Frozen sets, append-only.** The 1000-pair val split, the 20 hand-written Chinese realcases and the 300-pair soft-conflict set were never edited between versions; new cases areadded in separate sets (the 10 template-free pairs in v4).- **Bias diagnostic before any accuracy claim.** 7 positive/negative control pairs × 2 inputdirections. A pinned output distribution invalidates every accuracy number measured after it(the v1 head answered "conflict" on everything at conf 0.91 — upstream[#156](https://github.com/NandhaKishorM/laya/issues/156)).- **Label-surface rotation + label-swap gate (v4).** Training rows rotate 4 label/instructionphrasings (and the boolean key names), and acceptance re-runs the eval with the two labelstrings exchanged: **0 of 20 real cases and 0 of 14 diagnostic probes flipped**, so the headreads the pair's meaning rather than the label word.- Training data (12k rows): 6,000 MultiNLI entailment/neutral/contradiction pairs mapped tofalse/false/true, plus 5,400 synthetic bilingual memory pairs (soft conflicts, compatibledetails, "considering/temporary" intents, unrelated mentions) and a 600-row hard-constraintclass with 1:1 controls. Conflict : non-conflict ≈ 1:2.## Known limits (read before integrating)- **Negation (#377, upstream, unfixed):** 4/5 on the negation side-set — "do NOT cancel" styleinput is still weak. Route irreversible actions to a human check.- **Confidence ceiling ≈ 0.92.** `rl_agent_config.json` carries the fitted inferencetemperature (`temperature[2] = 1.2176` for `noul`, a softening >1). Consequence: a downstreamauto-write threshold above ~0.92 never fires. Sharpening is a config-level change, not aretrain — but see the next point before you pick one.- **No single temperature satisfies all eval sets.** Measured trade-off (`temperature_sweep.py`):main val is best at τ≳1.2, the real-case and soft-conflict sets at τ≲0.8. ECE at perfectaccuracy degenerates to `1 − confidence`, which is not a quality signal. Pick τ from thedistribution your application actually sees, on a calibration slice disjoint from any set youreport.- **Hard-constraint class is synthetic** (300 positives + 300 controls) and coversallergy/safety-style intent violations only; it exists because v3 missed "wants to try thefood he is allergic to" and it should be extended with real cases before trusting it broadly.- Assets on Hugging Face are pinned by name, not by commit; the SHA256 above is the identity ofthe delivered weights.## Round-4 diagnostics (option-name polarity & abstention layer)- **Option-name axis (new).** The label-surface swap above exchanges the two label *values*;renaming the label *system* itself (neutral `A/B`, or per-case random strings — the axis[arXiv:2609.26758](https://arxiv.org/abs/2609.26758) shows typed decision heads latch onto)does move answers: on the 300-pair soft-conflict set accuracy drops 0.990 → 0.983 (net +2errors, above the ±1 gate), random renames shift `p_true` by ~0.05 on average, and the frozenreal-20 loses 1 case to random renames (19/20, within gate). The head partly reads option-namepolarity; name-system augmentation is on the v5 plan.- **Confidence is a compression band.** On main val, `max_conf` lands between 0.918 and 0.928for essentially every pair (q10 0.9185, max 0.9279) — the tidy 0.901 acc / 0.918 mean-confpairing is largely a constant-output artifact, so confidence has almost no ranking power.The `max_conf ≥ 0.92` subset is 87.1% of main val with a 6.66% error rate.- **Conformal abstention layer (optional; red line unchanged).** A 90%-nominal split-conformalrule fitted on the soft-conflict set and transferred to main val captures **58 of 99 errors**at a **29.4% abstention rate** (write-error rate 6.66% → 5.81%). The plugin auto-writethreshold stays ≤ 0.92 and the layer is additive: write = at red line AND not abstained.These are transfer numbers across a distribution shift (synthetic fit → MNLI-style eval),not finite-sample guarantees. Reproduce: `kaggle_eval/conformal_abstain.py`,precomputed gates in `kaggle_eval/HANDOFF_NLI_V4.1.md`.- **No external same-benchmark comparison exists** for this task — the frozen memory-conflictsets are ours alone. The same-ruler comparison discipline is applied on the sibling2 unmodified lines## LicenseApache-2.0, following upstream. Base model © [Convai Innovations](https://huggingface.co/convaiinnovations).## Rounds 5–10 research archiveRounds 5–10 did not pass their acceptance gates; v4 was the delivered head until **v12** passed the full protocol on 2026-10-07. Each round checkpoint is preserved as a separate research-archive repo (NOT delivered; every card lists the failed gates, weight SHA256 and provenance):- [`slow-stack/laya-nli-conflict-v5`](https://huggingface.co/slow-stack/laya-nli-conflict-v5) — Round 5 arm A — RL+CE (v4 recipe); RL term clashed with graded soft targets- [`slow-stack/laya-nli-conflict-v5-ce`](https://huggingface.co/slow-stack/laya-nli-conflict-v5-ce) — Round 5 arm B — pure CE; val_soft/polarity gates failed- [`slow-stack/laya-nli-conflict-v6`](https://huggingface.co/slow-stack/laya-nli-conflict-v6) — Round 6 — data-hygiene reset; conformal/compression-band gates failed- [`slow-stack/laya-nli-conflict-v7`](https://huggingface.co/slow-stack/laya-nli-conflict-v7) — Round 7 — 11/12 gates; B2 bias probe flipped (pet-family imbalance)- [`slow-stack/laya-nli-conflict-v8`](https://huggingface.co/slow-stack/laya-nli-conflict-v8) — Round 8 — B2 dose-response −15pp; abstain 35.4% over the line- [`slow-stack/laya-nli-conflict-v9`](https://huggingface.co/slow-stack/laya-nli-conflict-v9) — Round 9 — main val 0.9050, val_soft 0/300; B2 dose-response falsified- [`slow-stack/laya-nli-conflict-v10-l1`](https://huggingface.co/slow-stack/laya-nli-conflict-v10-l1) — Round 10 — "remove block B" lever (reconstructed ckpt); block B is load-bearing- [`slow-stack/laya-nli-conflict-v10-l2`](https://huggingface.co/slow-stack/laya-nli-conflict-v10-l2) — Round 10 — v9-config rerun; completes the three-run noise band- [`slow-stack/laya-nli-conflict-v10-s2`](https://huggingface.co/slow-stack/laya-nli-conflict-v10-s2) — Round 10 — v9-config noise baseline; three-run B2 evidenceThe full index also lives in [the "Laya NLI memory-conflict heads — v12 & three-run protocol" collection](https://huggingface.co/collections/slow-stack/laya-nli-memory-conflict-heads-v12-and-three-run-protocol-6ac698ed9a92a16917804f5b).> **Superseded (2026-10-07)**: [`slow-stack/laya-nli-conflict-v12`](https://huggingface.co/slow-stack/laya-nli-conflict-v12) — the first head to pass the full preregistered 14-axis three-run protocol — is now the delivered head. v4 remains published for reference.33 unmodified lines3435363738394041424344454647484950515253545556575859606162636465666768697071727374756 unmodified lines8283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621632 unmodified lines16616716833 unmodified lines# laya-nli-memory-conflict> **Start here → the delivered head is [`slow-stack/laya-nli-conflict-v12`](https://huggingface.co/slow-stack/laya-nli-conflict-v12).**> It is the first head to pass the full preregistered 14-axis protocol (2026-10-07). Load that> repo for new work. **This repo holds v4**, the earlier baseline whose card documents the> candidate rounds; it stays published for reference and for the frozen-set history below.## The one question this head family answers> **新信息(new)与已有记忆(known)是否冲突?冲突=矛盾需更新旧记忆,兼容=一致或无关**`noul` question, two custom labels `{"false": "兼容", "true": "冲突"}` — i.e. "should thestored memory be superseded by what the user just said, or not?". Built for memory plugins thatmust decide whether to update a user's stored facts, preferences and constraints.Fine-tuned from [`convaiinnovations/laya-multilingual`](https://huggingface.co/convaiinnovations/laya-multilingual)with the official public recipe (the Kaggle 2xT4 notebook: RLCD loss + post-hoc per-typetemperature fit), by [modusensus](https://github.com/modusensus). Training tooling, the datagenerators and every evaluation script are in[the `kaggle_eval/` directory of this fork](https://github.com/modusensus/laya/tree/main/kaggle_eval),which also carries the handoff document for each round.## Which repo to load| repo | what it is | load it? ||---|---|---|| [`laya-nli-conflict-v12`](https://huggingface.co/slow-stack/laya-nli-conflict-v12) | **delivered head** (r2 weights) — all 14 gate axes PASS | **yes** || [`laya-nli-conflict-v12-r1`](https://huggingface.co/slow-stack/laya-nli-conflict-v12-r1) / [`-r3`](https://huggingface.co/slow-stack/laya-nli-conflict-v12-r3) | the other two runs of the same protocol, archived unmodified for variance inspection | no — never served || **this repo** (`laya-nli-memory-conflict`) | v4, the 4-candidate baseline; kept for reference | only to reproduce the v2–v4 table below |Full index: [the "Laya NLI memory-conflict heads — v12 & three-run protocol" collection](https://huggingface.co/collections/slow-stack/laya-nli-memory-conflict-heads-v12-and-three-run-protocol-6ac698ed9a92a16917804f5b).## Usage```pythonimport layaagent = laya.load('slow-stack/laya-nli-conflict-v12', device='cpu')QUESTION = {'type': 'noul',6 unmodified linesprint(p_conflict) # ~0.92 -> conflict: the intent violates a stored hard constraint```Loading `slow-stack/laya-nli-memory-conflict` instead runs v4 through the identical API; thequestion and label contract are the same across the family.## The delivered head (v12) at a glancePreregistered n=3 equal-status runs, no run selection; **r2 ships** because it is the only runwith all three acceptance batteries at full marks (old-20 20/20, negation-5 5/5, new-10 10/10).| axis (gate) | r1 | **r2 (ships)** | r3 | verdict ||---|---|---|---|---|| main val acc (median ≥ 0.896) | 0.904 | **0.903** | 0.907 | PASS || main val ECE (report) | 0.0207 | **0.0209** | 0.0190 | — || old-20 real cases | 19 | **20** | 20 | PASS || negation-5 | 5 | **5** | 4 | PASS || new-10 | 10 | **10** | 10 | PASS || soft-conflict val_soft errors (≤3) | 2 | **1** | 1 | PASS || label-surface swap / polarity ×2 / band | PASS | **PASS** | PASS | PASS || conformal adopted rule (≥50% @ ≤35%) | 36/50 @ 34.2% | **34/50 @ 33.4%** | 33/47 @ 34.0% | PASS || bias diagnostic (≥13/14) | 13/14 | **13/14** | 13/14 | PASS || compat family mean-p (median <0.5) | 0.0806 | **0.0919** | 0.0814 | PASS || negation family mean-p (median ≥0.5) | 0.7872 | **0.8022** | 0.7930 | PASS || τ(noul) / automation@5% (report, non-gating) | 1.0887 / 0.814 | **1.0914 / 0.781** | 1.1080 / 0.781 | — |All 14 axes are listed, with the per-axis acceptance wording, in the delivered head's own cardand in [`HANDOFF_NLI_V12.md`](https://github.com/modusensus/laya/blob/main/kaggle_eval/HANDOFF_NLI_V12.md).Weights: r1 `4269ec6b…` / r2 `6648d892…` / r3 `b2bf87be…` (SHA256, full manifest in`kaggle_eval/archive_sha256_manifest.txt`).### Where the data lives- Training corpus (v11's 15,914 rows carried verbatim + 36 negation-known lever rows):[`slow-stack/nli-conflict-train-lineage`](https://huggingface.co/datasets/slow-stack/nli-conflict-train-lineage),with the current-round rolling mirror[`slow-stack/nli-conflict-pairs`](https://huggingface.co/datasets/slow-stack/nli-conflict-pairs)- Frozen evaluation face (66 cases, 7 instruments, scoring recipe):[`slow-stack/laya-nli-conflict-eval`](https://huggingface.co/datasets/slow-stack/laya-nli-conflict-eval)- Base model: [`convaiinnovations/laya-multilingual`](https://huggingface.co/convaiinnovations/laya-multilingual)- All content synthetic; no personal or real-user data.## Results — the v2–v4 baseline in this repo**v4 is the model in this repo** (`model.safetensors`, SHA256 `e9e1c4a5…d4b13758`).| metric | v2 | v3 | **v4 (this repo)** | gate ||---|---|---|---|---|| main val (frozen 1000, MultiNLI-derived) | 0.902 | 0.902 | **0.901** | ≥0.90 || main val ECE | 0.021 | 0.0146 | **0.0192** | ≤0.02 || bias diagnostic (14 control + input-swap pairs) | 12/14 | 13/14 | **13/14 PASS** | PASS, no pinned output || real case, frozen 20 hand-written pairs | 16/20 | 19/20 | **20/20** | ≥19/20 || real case, 10 template-free new pairs | — | — | **10/10** | ≥8/10 || soft-conflict set (300 pairs, 4 never-trained classes) | 206/300 | 295/300 | **297/300** | ≥295/300 || ├ held-out classes | 62/100 | 95/100 | **97/100** | ≥95/100 || label-surface swap (labels exchanged at inference) | — | — | **0 cases flipped** | ≤1 || negation side-set | 2/5 | 4/5 | **4/5** | report only |## Evaluation protocol (why these numbers are comparable)- **Frozen sets, append-only.** The 1000-pair val split, the 20 hand-written Chinese realcases and the 300-pair soft-conflict set were never edited between versions; new cases areadded in separate sets (the 10 template-free pairs in v4, the negation-8 family instrumentin v12).- **Bias diagnostic before any accuracy claim.** 7 positive/negative control pairs × 2 inputdirections. A pinned output distribution invalidates every accuracy number measured after it(the v1 head answered "conflict" on everything at conf 0.91 — upstream[#156](https://github.com/NandhaKishorM/laya/issues/156)).- **Label-surface rotation + label-swap gate.** Training rows rotate 4 label/instructionphrasings (and the boolean key names), and acceptance re-runs the eval with the two labelstrings exchanged: **0 of 20 real cases and 0 of 14 diagnostic probes flipped** (v4), and allthree v12 runs PASS the same gate, so the head reads the semantics rather than the labelsurface.- **Conformal abstention, optional and additive.** A 90%-nominal split-conformal rule fittedon the soft-conflict set and transferred to main val captures **58 of 99 errors** at a**29.4% abstention rate** (write-error rate 6.66% → 5.81%) on the v4 baseline. The pluginauto-write threshold stays ≤ 0.92 and the layer is additive: write = at red line AND notabstained. These are transfer numbers across a distribution shift (synthetic fit → MNLI-styleeval), not finite-sample guarantees. Reproduce: `kaggle_eval/conformal_abstain.py`,precomputed gates in `kaggle_eval/HANDOFF_NLI_V4.1.md`.- **No external same-benchmark comparison exists** for this task — the frozen memory-conflictsets are ours alone. The same-ruler comparison discipline is applied on the sibling2 unmodified lines## LicenseApache-2.0, following upstream. Base model © [Convai Innovations](https://huggingface.co/convaiinnovations).
README.md+86-87