Van Nyaya: a grounded, bilingual forest-law assistant on Tiny Aya

Lexsi Labs AI Safety and Alignment Hackathon, Track 1 (CuratorKIT -> custom LoRA training -> AuditKIT).

Headline: on 164 held-out questions from statute sections never seen in training, the Van Nyaya SFT adapter takes lexically detected refusals on unanswerable questions from 10% to 100%, and lifts grounded answer quality by +22% (English) and +15% (Hindi) token F1, at a cost of 3 false refusals in 124 answerable questions.

1. The problem

Indian forest and environment law sits across several Acts that forest officers, gram sabhas and citizens have to read together: the Indian Forest Act 1927, the Wildlife (Protection) Act 1972, the Forest (Conservation) Act 1980 as amended in 2023 (Van (Sanrakshan Evam Samvardhan) Adhiniyam), the Scheduled Tribes and Other Traditional Forest Dwellers (Recognition of Forest Rights) Act 2006 with its Rules, and the Environment (Protection) Act 1986.

A small multilingual model asked about these laws tends to do two unsafe things:

  1. Answer from memory instead of from the section in front of it (wrong section numbers, invented penalties).
  2. Answer confidently when the given text does not contain the answer.

Van Nyaya fine-tunes Tiny Aya Global so that it answers only from the supplied section, cites it, answers in English or Hindi, and says plainly when the text does not cover the question.

2. Pipeline

  1. CuratorKIT 0.1.22: 332 sections chunked from the bare Acts, grounded QA generation (3 questions per section, ministral-8b generator + judge, hallucination gate 0.5, exact dedup, dataset card written by the toolkit). Section-level split (seed 7): 33 held-out sections are never seen in training.
  2. Data built on top of the curated set
  3. Custom LoRA training recipe: SFT on a 511-row mix (English grounded + Hindi + refusal), 132 steps. DPO (200 pairs) as an ablation directly on the base model, and on top of the SFT adapter.
  4. Before/after evaluation on the 164-row held-out set: 94 English grounded, 30 Hindi grounded, 40 English unanswerable. Every model is merged, converted to GGUF and evaluated in the same quantised form a user would run, with the same prompts and decoding. Scored with scripts/score.py (token F1 on grounded, refusal rate on unanswerable, false-refusal rate on answerable).

Base model: CohereLabs/tiny-aya-global (weights loaded from an ungated mirror of the same checkpoint). Training ran entirely on free CPU (GitHub Actions 4 vCPU / 16 GB runners) with chunked loss, swap and 2-hour checkpoint-and-resume chaining: zero GPU, zero cost.

3. Results (held-out, n = 164)

model refusal proxy (40 unanswerable) EN token F1 (94) HI token F1 (30) false refusals (124 answerable)
Tiny Aya Global (base) 10.0% 0.294 0.265 0
DPO on base, 50 steps 40.0% 0.287 0.267 0
DPO on base, final (200 pairs) 45.0% 0.285 0.259
Van Nyaya SFT (511 rows, final) 100.0% 0.359 0.306 3 (2.4%)
SFT + DPO running

What it shows:

All generations and per-model score files are public in the eval-outputs dataset, so every number above can be re-scored.

Actual AuditKIT cross-check

AuditKIT was executed offline on the stored base and final SFT predictions using its F1Score and Abstention scorers. The script and raw report are in scripts/audit_offline.py and results/auditkit/. Native AuditKIT normalization and abstention matching differ from the headline scorer, so its scores are reported separately and never substituted into the main table. No external judge or expert legal validation is claimed.

4. Why it matters

A legal assistant that is wrong with confidence is worse than none. For a forest rights claim under FRA or a compounding notice under IFA, the person asking often can't check the section. Getting a tiny, phone-sized, bilingual model to stay inside the text and say "the section doesn't say" is a behavior worth testing further, not proof of deployment safety. The GGUF can run on an ordinary CPU; a 2.14 GB browser download is substantial, especially on phones.

5. Artifacts

6. Limits

Ablation: DPO on top of SFT (added 5 Nov 2026)

We continued the final SFT adapter (sft600) with the 200 DPO preference pairs, merged, converted to GGUF and scored it on the same 164 held-out questions with scripts/score.py.

Model Refusal acc. (EN unanswerable, n=40) EN grounded F1 (n=94) HI grounded F1 (n=30)
SFT (submitted) 1.000 0.359 0.306
SFT + DPO200 1.000 0.355 0.300
SFT + DPO200 (run 2, longer DPO) 1.000 0.346 0.300

DPO on top of SFT did not beat SFT alone: refusals stayed at 100%, token F1 dipped slightly in both languages, and two more answerable questions (idx 79, 107) drew refusal-style answers. A second, longer DPO continuation (run 2) dipped further on English F1 (0.346). The submitted model stays the SFT adapter. Generations and scores: results/ablation_sft_dpo/ and results/ablation_sft_dpo2/.