The dataset viewer is not available for this split.
Error code: StreamingRowsError
Exception: CastError
Message: Couldn't cast
id: string
mandate: struct<agent_id: string, budget_usd: int64, spent_usd: int64, period: string, allowed_vendors: list< (... 124 chars omitted)
child 0, agent_id: string
child 1, budget_usd: int64
child 2, spent_usd: int64
child 3, period: string
child 4, allowed_vendors: list<item: string>
child 0, item: string
child 5, blocked_categories: list<item: string>
child 0, item: string
child 6, approval_categories: list<item: string>
child 0, item: string
child 7, allow_split_purchases: bool
request: struct<action: string, item: string, vendor: string, amount_usd: double, category: string, justifica (... 343 chars omitted)
child 0, action: string
child 1, item: string
child 2, vendor: string
child 3, amount_usd: double
child 4, category: string
child 5, justification: string
child 6, pressure: string
child 7, multi_item: bool
child 8, item_labels: struct<sentry: string, gartner: string, vercel_pro: string, cloudflare_biz: string, item_a: string, (... 56 chars omitted)
child 0, sentry: string
child 1, gartner: string
child 2, vercel_pro: string
child 3, cloudflare_biz: string
child 4, item_a: string
child 5, item_b: string
child 6, cheap_item: string
child 7, pricey_item: string
child 9, ambiguity: string
child 10, note: string
child 11, boundary: string
child 12, recurring: string
child 13, amount_credits: string
child 14, estimated_total_usd: double
expected: string
tags: list<item: string>
child 0, item: string
item_decisions: null
emitted_decision: string
contract_valid: bool
raw_response: string
model_decision: string
error_class: string
to
{'id': Value('string'), 'expected': Json(decode=True), 'model_decision': Value('string'), 'emitted_decision': Value('string'), 'contract_valid': Value('bool'), 'item_decisions': Json(decode=True), 'raw_response': Value('string'), 'error_class': Value('string')}
because column names don't match
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 149, in get_rows_or_raise
return get_rows(
dataset=dataset,
...<4 lines>...
column_names=column_names,
)
File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/utils.py", line 129, in get_rows
rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
File "/src/services/worker/src/worker/utils.py", line 544, in safe_iter
yield from ds.decode(False) if ds.features else ds
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 3052, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2559, in __iter__
for key, pa_table in self._iter_arrow():
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2584, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 558, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 440, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 361, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2381, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2309, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
id: string
mandate: struct<agent_id: string, budget_usd: int64, spent_usd: int64, period: string, allowed_vendors: list< (... 124 chars omitted)
child 0, agent_id: string
child 1, budget_usd: int64
child 2, spent_usd: int64
child 3, period: string
child 4, allowed_vendors: list<item: string>
child 0, item: string
child 5, blocked_categories: list<item: string>
child 0, item: string
child 6, approval_categories: list<item: string>
child 0, item: string
child 7, allow_split_purchases: bool
request: struct<action: string, item: string, vendor: string, amount_usd: double, category: string, justifica (... 343 chars omitted)
child 0, action: string
child 1, item: string
child 2, vendor: string
child 3, amount_usd: double
child 4, category: string
child 5, justification: string
child 6, pressure: string
child 7, multi_item: bool
child 8, item_labels: struct<sentry: string, gartner: string, vercel_pro: string, cloudflare_biz: string, item_a: string, (... 56 chars omitted)
child 0, sentry: string
child 1, gartner: string
child 2, vercel_pro: string
child 3, cloudflare_biz: string
child 4, item_a: string
child 5, item_b: string
child 6, cheap_item: string
child 7, pricey_item: string
child 9, ambiguity: string
child 10, note: string
child 11, boundary: string
child 12, recurring: string
child 13, amount_credits: string
child 14, estimated_total_usd: double
expected: string
tags: list<item: string>
child 0, item: string
item_decisions: null
emitted_decision: string
contract_valid: bool
raw_response: string
model_decision: string
error_class: string
to
{'id': Value('string'), 'expected': Json(decode=True), 'model_decision': Value('string'), 'emitted_decision': Value('string'), 'contract_valid': Value('bool'), 'item_decisions': Json(decode=True), 'raw_response': Value('string'), 'error_class': Value('string')}
because column names don't matchNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
lexsi-governance — governed agent-spend eval + SFT data
Artifacts for the Lexsi AI Safety & Alignment Hackathon submission (Track 3 — Agentic Fine-tuning; problem statement #7 — business workflow and decision agents with a full audit trail).
Thesis: policy enforcement at the wallet layer is not sufficient — can a small
open-weights model internalize mandate-following so violations never reach
enforcement? We measure "unsafe enforced decisions" (contract-valid ALLOW
where policy requires otherwise) before/after LoRA SFT on
CohereLabs/aya-expanse-8b.
Contents
Submission adapter: Papajams/aya-expanse-8b-lexsi-v7.
Canonical results are the bf16 runs on the 165-scenario suite v3 under v7/.
Files at the repo root and in results70/ are the earlier v4/v6 iterations,
kept for the audit trail.
| file | what |
|---|---|
v7/eval_suite_v3.jsonl |
165-scenario held-out eval suite (canonical): 22 hand-authored gov-* + 48 v2-generated + 55 scenarios across 17 new adversarial kinds + 40 paraphrase variants (each a paraphrase of another generated eval scenario). No scenario body appears in any training file (mandate+request hash over 4,022 training bodies). |
v7/sft_v7.jsonl |
3,300-row v7 training set: 700 replay rows from earlier SFT data + 1,800 new oracle-labeled examples + 800 paraphrase-augmented variants. v7/sft_v7_new.jsonl is the 2,600 new rows only. |
v7/gen_v3.py, v7/manifest.json |
Generator for suite v3 and the v7 training set, and its count/dedup manifest. |
v7/results/eval_{base,v4,v7,v7f}.jsonl |
Per-scenario eval logs with raw responses (Modal L40S, bf16, greedy, identical harness). |
v7/results/metrics_{base,v4,v7,v7f}.json |
Harness metrics for those runs. |
v7/results/auditkit_{base,v4,v7,v7f}.json |
AuditKIT agent_eval recorded-mode verified-outcome scores for the same saved episodes (scripts/rescore_auditkit.py). |
v7/dpo_seed_pairs.jsonl |
15 v4 failures on eval-suite scenarios paired with gold answers — seeds for a DPO stage that was not run. Not used in any training run. Do not train on this file if you evaluate on suite v3. |
governance_scenarios.jsonl |
22 hand-authored eval scenarios (original suite). Each row: id, tags, mandate, request, expected (ground truth incl. must_allow_item/must_refuse_item for multi-item cases). Covers clean allows, over-budget, non-allowlist vendors, blocked categories, split purchases, gift cards, tax-inclusive totals, recurring commitments, scope creep, and adversarial pressure. |
eval_suite_v2.jsonl |
70-scenario held-out eval suite (the 22 gov-* above + 48 generated gen-9xxx scenarios). No training row shares a scenario id with this suite — eval is scenario-level held-out. |
sft_v4.jsonl |
1,467 SFT examples (600 oracle-labeled + 867 RFT samples from the base model's correct outputs). Chat-format prompt/completion pairs. |
sft_arith.jsonl |
600 targeted arithmetic SFT rows (oracle-labeled), weighted toward the residual failure classes: tax-inclusive totals, multi-line mixed decisions, boundary budgets, split purchases, and multi-item pressure cases. |
sft_v6.jsonl |
sft_v4 + sft_arith combined — the v6 training set. |
eval_base.jsonl / eval_tuned.jsonl + metrics_*.json + auditkit_*.json |
Original 22-scenario Kaggle fp16 run (base vs. v4 adapter). |
results70/ |
Canonical bf16 results on the 70-scenario suite (Modal L40S, identical harness for all three models): metrics_{base,v4,v6}.json and per-scenario eval_{base,v4,v6}.jsonl. |
Headline results — 165-scenario suite v3, bf16
| metric | base | v4 | v7 (submission) | v7f (ablation) |
|---|---|---|---|---|
| accuracy | 55.2% (91/165) | 68.5% (113/165) | 95.8% (158/165) | 93.9% (155/165) |
unsafe enforced (113 non-ALLOW scenarios) |
50/113 (44.3%) | 23/113 (20.4%) | 3/113 (2.7%) | 4/113 (3.5%) |
unsafe allows incl. partial-order case gov-10 (114) |
50/114 (43.9%) | 23/114 (20.2%) | 4/114 (3.5%) | 5/114 (4.4%) |
| contract valid | 165/165 | 165/165 | 165/165 | 165/165 |
| AuditKIT verified outcome (recorded mode) | 91/165 | 113/165 | 158/165 | 155/165 |
unsafe_enforced is computed over the 113 scenarios whose expected overall
decision is non-ALLOW. gov-10 expects a partial order (allow one item,
refuse the other) and is outside that denominator; allowing its must-refuse
item is still a violation, so it is reported on its own row. 95% Wilson
interval on v7's 4/114: 1.4–8.7%.
v7 = v4 continued for two epochs on v7/sft_v7.jsonl. v7f = a fresh LoRA
from base on the combined corpus; it is one scenario behind v7 on safety and
three on accuracy, which is within noise — v7 was kept under the pre-stated
selection rule (lower unsafe_enforced; tie → accuracy).
Unsafe allows by subset
| subset (must-not-allow n) | base | v4 | v7 |
|---|---|---|---|
hand-authored gov-* (18 of 22) |
6 · acc 13/22 | 2 · acc 13/22 | 3 · acc 17/22 |
| v2 generated (31 of 48) | 11 · acc 28/48 | 0 · acc 42/48 | 0 · acc 47/48 |
| 17 new adversarial kinds (35 of 55) | 21 · acc 30/55 | 13 · acc 33/55 | 0 · acc 55/55 |
| paraphrase variants (30 of 40) | 12 · acc 20/40 | 8 · acc 25/40 | 1 · acc 39/40 |
v7's gain over v4 is on generator-family scenarios: the 17 new kinds were added to the eval suite and to the v7 training generator together (different instances, same templates), and v4 never trained on them. On the hand-authored subset — the only one the generator did not produce — v7 is more accurate than v4 but not safer (2 → 3 unsafe allows; noise at n=18). The suite measures transfer to unseen instances and paraphrases, not to unseen adversarial kinds.
Earlier iteration — 70-scenario suite, bf16 (v4 vs v6)
| metric | base | v4 | v6 (exploratory) |
|---|---|---|---|
| accuracy | 58.6% (41/70) | 78.6% (55/70) | 80.0% (56/70) |
| unsafe enforced | 17/48 (35.4%) | 2/48 (4.2%) | 5/48 (10.4%) |
| contract valid | 70/70 | 70/70 | 70/70 |
At this stage v4 was kept over v6 — v6 continued training on the
600 targeted arithmetic examples raised accuracy but regressed the primary
safety metric (unsafe_enforced 2→5): the extra arithmetic data made the model
more permissive, trading refusal/escalation correctness for allows.
Reported as an honest negative result; adapter_v6 weights are published for
reproducibility.
Original 22-scenario Kaggle fp16 comparison (same direction, smaller n): base unsafe_enforced 6/17 → v4 2/17, accuracy flat at 59.1%.
Reproduce
Pipeline lives in lexsi/
of the cognivern repo:
scripts/gen_training_data.py— deterministic policy oracle → scenario + label generation (--extrafor targeted kinds).scripts/sample_rft.py— rejection-sample correct completions from a served model for RFT pairs.scripts/run_baseline.py— AgentTune DECIDE eval + AuditKIT scoring (needs an OpenAI-compatible endpoint viaLEXSI_MODEL_ENDPOINT).scripts/kaggle_train_eval.py— self-contained Kaggle T4×2 kernel: trains LoRA and runs the same eval in-kernel.colab/lexsi_v6_colab.py+modal_v6.py— v6 experiment: expanded eval suite, targeted arithmetic SFT continuation from v4, same metrics.scripts/gen_v3.py— suite v3 + v7 training set (dedup against all eval and training bodies).modal_v7.py/modal_v7f.py— v7 continue-training and v7f from-scratch ablation, with the bf16 165-scenario eval for base/v4/v7/v7f.scripts/rescore_auditkit.py— AuditKIT-rescore saved eval JSONLs (--tasks v7/eval_suite_v3.jsonlfor the suite-v3 logs).
Trained adapters:
Papajams/aya-expanse-8b-lexsi-v7— submission adapterPapajams/aya-expanse-8b-lexsi-v4— previous best; v7 continues from itPapajams/aya-expanse-8b-lexsi-v6— exploratory (accuracy up, unsafe_enforced regressed)
Caveats
- Single-turn structured decisions, not multi-step tool-call trajectories (Aya Expanse has no tool-calling template).
- Spend is simulated — the "enforcement" layer is the decision contract, not a live wallet.
- Eval is held out at the scenario level but drawn from the same generator distribution as training data, and the new adversarial kinds entered eval and training together; it measures generalization to unseen instances and paraphrases, not to unseen kinds or a different task distribution.
- Small n (114 must-not-allow cases, 40 of the 165 scenarios are paraphrases of other eval items); one model family, one seed per adapter.
- The
gov-*and v2 scenarios were the iteration signal for v4–v6, so they double as a development set. - bf16 (Modal) and 4-bit NF4 (Colab T4) runs produce materially different
absolute numbers;
v7/results/(andresults70/for the earlier suite) are the canonical bf16 comparisons.
- Downloads last month
- 149