← All work

Desi Agent

A 3.35B banking agent for English, Hindi, Bengali, Hinglish and Banglish — task success 45.9% → 97.7%, above the 14B teacher it was distilled from

Role
Co-builder · team of 2
Timeline
Nov 2026 – Present
Context
Lexsi AI Safety & Alignment Hackathon · Track 3

The outcome

  1. Stage 1 (SFT): task success 45.9% → 97.7% on 486 held-out test conversations (fp16, greedy, every tool call executed against the mock bank), above the 67.5% of the Qwen3-14B teacher it was distilled from.
  2. Wrong bank actions (block, dispute or transfer not exactly as asked) 20.8% → 1.8%; asking for missing details instead of acting 38.6% → 96.2%; two-step tasks 0.0% → 97.3%.
  3. Stage 2 (final GRPO adapter): right action in the right language after a language switch 34.0% → 74.7% (78.3% for the second seed), frozen test 98.4% with 1.4% wrong bank actions, and unsafe actions executed on BANKING77 requests without details 6.3% → 0.0%. That last number is partly in-distribution, since the English grounding rows came from BANKING77's train split. Nothing regressed at any step.
  4. GRPO cost 63 minutes on one A100 (about $2.60). On 300 paired switch conversations it fixed 26 that RFT 2 failed and broke 1 (McNemar p<1e-4).
  5. Out of distribution: on test messages reworded by a different model family and judge-validated (380 kept), the SFT model reaches 91.8% vs 49.7% for the base. Banglish (77.8%), Bengali (87.1%) and two-step tasks (85.5%) drop most.
  6. Not memorised and reads the receipt: success is flat across training-similarity quartiles (97.5 / 99.2 / 97.5 / 96.7%), 0 of 486 replies quote bank numbers not retrieved in that conversation (base: 20), and against a bank returning shifted values task success stays at 97.7%.
  7. Known failure, reported rather than hidden: 4 of the 11 remaining SFT test failures are the model inventing a card number (1234) and blocking it.

The challenge

Desi Agent is Cohere's Tiny Aya Global (3.35B), fine-tuned with AgentTune into a banking support agent that calls eight tools (balance, transactions, block card, dispute, UPI status, transfer, branch finder, loan EMI) for five ways of writing: English, Hindi, Bengali, Hinglish and Banglish. Stage 1 is LoRA distillation from a Qwen3-14B teacher. Stage 2 adds two rounds of rejection-sampling fine-tuning and a short multi-turn GRPO run aimed at the two weaknesses Stage 1 left. We built it as a team of two for Track 3 (Agentic Fine-tuning) of the Lexsi AI Safety & Alignment Hackathon 2026, from data generation to the live Lab.

Indian banking customers don't write "please block my card". They write "mera card block kar do", in Bengali script, or in Banglish, often without the card number. An agent acting on that has to pick the right tool, fill the arguments exactly, and ask when a detail is missing, because a wrong block_card or transfer_money is a real-world harm. The base model got 45.9% of held-out conversations right and took a wrong bank action in 20.8% of them.

The system

The design rests on one rule: labels come from code, and only the words come from a model. A scenario sampler decides the language, the task type and the exact gold tool calls, including cases that deliberately leave out a required detail. A deterministic mock bank (results derived from a SHA-256 hash of the arguments, schema-validated, errors returned rather than raised) executes those calls, and a Qwen3-14B-AWQ teacher on vLLM writes only the customer's message and the final reply. A teacher mistake can therefore make a sentence awkward but cannot make a label wrong. Episodes pass our script and language gates, CuratorKIT cleaning and dedup, and a yes/no checklist judge, then freeze into 1,937 train, 99 val and 486 test before any model sees them. AgentTune distils the train split into a LoRA (r=16, loss on assistant tokens only), with every row rendered by the same fmt.py that evaluation parses, so train and eval see identical text. One agent loop, fmt.run_episode, drives evaluation, GRPO rollouts and the demo alike: up to six steps, every call executed against the mock bank, malformed JSON recorded and fed back as an error. Because rollouts run through that loop, the Stage 2 reward is computed on exactly the behaviour the metrics later score.

intent · langgold callswordstool resultstrain · valsampling policyfrozen testadapterrolloutstracesScenario Samplercode: intent · gold callsQwen3-14B Teachercustomer words + replyMock Bank (tools.py)deterministic, hashedCurated Splitsgates · dedup · judgeAgentTune SFTLoRA r=16 · T4×2 fp16RFT + GRPOreward_lang · A100run_episode Loopfmt.py · mock bank · ≤6Metrics · AuditKITtest · OOD · perturbedDesi Agent Labreplays fp16 traces
Desi Agent — labels from code, words from a teacher, one agent loop for eval, RL and demo

The hard parts

  1. Making every label correct by construction

    Distilling tool calls from a teacher would teach the student the teacher's tool-calling mistakes. So the sampler builds the gold calls in code, the mock bank executes them, and the teacher only phrases the customer's message and the reply. 12% of training cases (27% of the test, which is balanced by task type) leave out a required detail, where the correct move is to ask. That split is why the 3B student ends up above the 14B teacher, which scores 67.5% on the same test.

  2. Keeping five ways of writing apart

    Reading the teacher's output was essential: two full generation runs were thrown away. In the first, 391 of 404 Banglish replies drifted into Hindi; in the second, a glossary line made the teacher write "and dispute it" in 444 episodes whose gold calls only block the card. Our gates now check script and language, that the reply talks to the customer, and that block and dispute references are quoted. CuratorKIT's 0–1 reward scores proved uncalibrated, so a yes/no checklist judge replaced them and removed 87 episodes. It does not reliably catch garbled code-mixed words, and the write-up says so.

  3. A 4.2× speed-up hiding in plain sight

    Training ran on a free Kaggle T4 ×2 (DDP, resumable across sessions via checkpoints on the Hub). torch.cuda.is_bf16_supported() returns True on a T4, but bf16 is emulated there: profiling showed 84% of GPU time in software bf16 matmuls. fp16 gave the same loss curve, and the SFT run finished in 2.2 hours.

  4. RL only where there is signal

    A GRPO probe on single-turn prompts found almost nothing to learn: 95.7% of samples already right, 12.7% of prompts with any reward difference. Trying the playground with a Banglish message followed by a Hinglish one exposed a failure no test measured: after a language switch, the SFT model answered in the new language only 38.3% of the time. There, 54.7% of prompts showed reward variance. Before optimising we audited the reward against scripted cheating policies, found that echoing the customer scored 0.77 of 1.30, and closed it in reward_lang. Two RFT rounds and 25 steps of GRPO followed.

  5. Well-formed mistakes now execute

    On 270 real BANKING77 messages the SFT model asks for missing details far more than the base model (80% vs 26%), but its guesses are well-formed, so 6.3% of unsafe actions go through, mostly block_card on an invented 1234. We answered on two layers. A grounding guard outside the model lets a block, dispute or transfer run only if its identifiers appear in the conversation; replayed on those traces it cuts executed unsafe actions to 0.4% and blocks none of the 170 correct state-changing calls in the test set. RFT round 2 then added 1,148 grounding examples, each paired with a control that does include the identifier.

What I took from it

  • Take the labels from code and only the words from the teacher. Then a teacher mistake can make a sentence awkward but can't make a label wrong.
  • Freeze the test split and fix the checkpoint rule (lowest validation loss) before training. Select on validation, never on test.
  • Run training rollouts, evaluation and the demo through one agent loop. Then the reward, the metric and what a user sees cannot quietly disagree.
  • Probe for learning signal and audit the reward for hacks before paying for RL. The failure worth optimising was found by using the demo, not by the test set.

Stack

Models
Tiny Aya Global (3.35B), Qwen3-14B-AWQ teacher + judge, Aya Expanse 8B (OOD rewording), LoRA (r=16)
Toolkits
AgentTune, CuratorKIT, AuditKIT
Data + eval
vLLM, MinHash dedup, LLM checklist judge, Deterministic mock bank, BANKING77
Train + ship
Kaggle T4 ×2 (DDP, fp16), Hugging Face Jobs (L40S, A100), Hugging Face Hub + Spaces, llama.cpp (GGUF LoRA)
Quality
pytest, uv, GitHub Actions CI, JSON run manifests

Timeline

  1. Nov 2026

    Contracts, mock bank tools, seed data and validator; teacher data generation across 5 languages, curation and frozen splits.

  2. Nov 2026

    LoRA SFT via AgentTune on Kaggle T4 ×2, fp16 after profiling exposed emulated bf16; single-turn GRPO probed and set aside.

  3. Nov 2026

    Evaluation harness and results for the base model, the 14B teacher and the fine-tuned agent.

  4. Nov 2026

    Robustness checks (validated OOD rewording, a perturbed bank, memorisation by similarity, BANKING77), the grounding guard and the write-up.

  5. Nov 2026

    Desi Agent Lab live on Hugging Face, replaying the scored test traces.

  6. Nov 2026

    Stage 2: multi-turn language-switch eval, audited reward_lang, two RFT rounds and multi-turn GRPO on Hugging Face Jobs, two seeds.

Download resume