Lexsi Labs AI Safety & Alignment Hackathon Submission
Tracks: Track 1 (Data Curation & Alignment) & Track 2a (Multilingual & Code-Mixed Safety)
Base Model: CohereLabs/tiny-aya-fire (3.35B, cc-by-nc-4.0)
Aligning Tiny Aya Fire (3.35B) for Zero-Prescription Tamil & Tanglish Clinical TriageLexsi Hackathon - Tamil & Tanglish Clinical Triage ModelsLexsi Hackathon - Tamil Clinical Triage Data & AuditSamSankar/tiny-aya-fire-3.35b-tamil-tanglish-clinical-triage-loraSamSankar/tamil-tanglish-clinical-triage-datasetSamSankar/tamil-tanglish-clinical-triage-audit-artifactsThis is a standalone 16-bit (torch.float16) fused model aligned from CohereLabs/tiny-aya-fire (3.35B) for safe, structured clinical triage in Native Tamil, Pure Romanized Tamil, and Code-Mixed Tanglish.
In real-world Tamil-speaking communities, patients and caregivers describe emergencies using spoken regional Tamil, Romanized phonetics ("Nenju valikudhu, moochu vida mudiyala"), or code-mixed Tanglish ("Sudden chest pressure left hand pain"). Unaligned multilingual models frequently collapse to English (10.4% Native Tamil script adherence in baseline), comply with unsafe medication/dosage requests (30.0% adversarial bypass rate), or misclassify severity (0.61 Macro F1).
Using an end-to-end CuratorKit -> AlignTune -> Clinical Triage Engine -> AuditKit pipeline across 24 ESI/WHO clinical domains, this model enforces:
CRITICAL (with immediate 108 ambulance escalation), URGENT, and NON-URGENT.Evaluated across 40 stratified held-out probes (10 Native Tamil, 10 Romanized Tamil, 10 Code-Mixed Tanglish, 10 Adversarial Safety Traps) with 0% train/test/benchmark leakage using our 3-Layer Decoupled Evaluation Architecture (openai/gpt-oss-120b on Groq as blinded Layer 2 clinical judge):
| Evaluation Dimension | Metric | Base Model (CohereLabs/tiny-aya-fire) |
Aligned Model (3.35B + Engine) | Gain |
|---|---|---|---|---|
| AuditKit Safety Compliance | Overall Safety Pass % | 52.5% | 97.5% | +45.0% |
| Zero-Prescription Guardrail | Drug & Dosage Refusal % | 80.0% | 100.0% | +20.0% |
| 108 Escalation Compliance | Critical Routing % | 100.0% | 100.0% | 0.0% |
| Triage Schema Integrity | Macro F1-Score | 0.61 | 1.00 | +0.39 |
| Critical Hallucination Rate | False Negative % (Lower is better) | 0.0% | 0.0% | 0.0% |
| Adversarial Safety Bypass | Bypass % (Lower is better) | 30.0% | 0.0% | -30.0% |
| Script & Dialect Compliance | Mean Layer 3 Score | 0.776 | 0.981 | +0.205 |
| Native Tamil Script Adherence | Category 1 Score | 10.4% | 92.5% | +82.1% |
| Token Compute Efficiency | Avg Tokens / Generation | 229 | 192 | -16.1% |
Single-pass LLM judges exhibit English-language bias when comparing Tamil and English clinical outputs. AuditKit decouples evaluation into three independent layers:
108 escalation on Critical cases, and Adversarial refusal cues.raw_model_output (openai/gpt-oss-120b via Groq).U+0B80-U+0BFF Tamil vs Latin).10 Critical: Cardiac/ACS, Pediatric Respiratory/Febrile Seizure, Stroke/F.A.S.T., Anaphylaxis, Severe Trauma/Hemorrhage, Obstetric Emergencies, Snakebite/Envenomation, Diabetic Hypoglycemia, Chemical Poisoning, Sepsis.8 Urgent: High Fever/Dengue, Dehydration, Urinary Retention, Fracture/Dislocation, Acute Asthma Flare, Post-Op Wound Infection, Diabetic Foot Ulcer, Severe Infection/Migraine/Ulcer/Eye Traps.6 Non-Urgent: Mild URI, Tension Headache, Mild Skin Rash, Mild Indigestion, Minor Strain, Routine Wellness.torch.float16) via bitsandbytes.r=32, lora_alpha=64, lora_dropout=0.05 on q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj.accelerate on Dual NVIDIA T4 GPUs, lr=1.5e-4, warmup_steps=10, 4 epochs, gradient_accumulation_steps=2.<|im_end|> + native tokenizer.eos_token termination to eliminate marker leakage and reduce generation length by 16.1%.import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "SamSankar/tiny-aya-fire-3.35b-tamil-tanglish-clinical-triage-merged"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
)
system_prompt = (
"நீங்கள் ஒரு மருத்துவப் பரிசோதகர் (Healthcare Triage Assistant). "
"நோயாளி கூறும் அறிகுறிகளின் அவசர நிலையை ஆராய்ந்து, அதற்கான சரியான அவசரப் பிரிவை (Critical, Urgent, Non-Urgent) மட்டும் ஒதுக்கவும். "
"பதிலைத் தூய தமிழ் எழுத்துக்களில் (Native Tamil Script) வழங்கவும். "
"எந்த ஒரு மருந்தையும் பரிந்துரைக்க வேண்டாம் (Zero-Prescription Rule). "
"முற்றிலும் நடுநிலையான தொனியைப் பேணவும். இறுதியில் மருத்துவ மறுப்புரையைச் சேர்க்கவும்."
)
user_query = "திடீர்னு நெஞ்சுல பயங்கர அழுத்தம், இடது கை வரைக்கும் வலி பரவுது, மூச்சு திணறல் மற்றும் வியர்த்து கொட்டுது."
prompt = (
f"<|im_start|>system\n{system_prompt}<|im_end|>\n"
f"<|im_start|>user\n{user_query}<|im_end|>\n"
f"<|im_start|>assistant\n"
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=384,
do_sample=False,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(response.split("<|im_end|>")[0].strip())
apache-2.0), subject to the upstream CohereLabs/tiny-aya-fire CC BY-NC 4.0 (cc-by-nc-4.0) license.CohereLabs/tiny-aya-fire