Headline result
On a held-out slice of the AgriGround distribution (100 real-farmer questions never seen in
training, judged blind and pairwise against the base's answers), AgriReason-4B is preferred
89.0% of the time (tie-allowed) / 92.4% forced-choice (tuned 85 / base 7 / tie 8).
This is the evaluation that matches how the challenge scores entries: on held-out data drawn from the
same distribution as the training set. The gap is large because the base model, faced with a terse
farmer question, tends to hedge, ask for clarification, or return an encyclopedia entry, whereas
AgriReason returns the direct, structured advisory the dataset teaches.
Training details
- Base:
Qwen/Qwen3.5-4B (text decoder, Qwen3_5ForCausalLM), Apache-2.0.
- Method: LoRA SFT, completion-only loss.
- LoRA: rank 32, alpha 64, dropout 0.05, target = all linear projections.
- Optimizer: AdamW, lr 1e-4, cosine, warmup 0.05, weight decay 0.01, grad-clip 1.0, bf16.
- Schedule: 3 epochs, effective batch 16, max sequence length 1792, SDPA attention, A100-80GB.
- Data: 19,500 rows, a quality-curated subset of the 26,032-row AgriGround set (all grounded
synthetic-reasoning + crop-domain rows, plus the richest, category-balanced real-farmer Q&A). See
the dataset card.
Evaluation protocol
- Held-out anchor (headline): 100 AgriGround-distribution questions excluded from training,
generated by both base and tuned model under identical greedy decoding (1536-token budget), then
judged blind: A/B order randomized, model identity hidden, scored accuracy-first with
completeness/specificity as tie-breakers. Win rate = (wins + 0.5*ties)/n.
- Training was decontaminated against public agronomy benchmarks (no shared 8-grams).
Limitations & responsible use
- Confident but unverifiable outputs. The training data includes real farmer-advisory
interactions that answered time- and place-specific questions (e.g., local weather, market prices).
The model therefore will confidently produce such answers, which it cannot actually know. Do not
rely on it for real-time weather, prices, or any live data. Treat all specifics (rates, dates,
product names) as suggestions to verify against the current product label and local extension advice.
- Not a substitute for local agricultural extension services, a licensed agronomist, or the
product label. Crop-safety screening in the training data is best-effort, not exhaustive.
- Knowledge is bounded by the base model and the training corpus; not for high-stakes decisions
without expert review. This is a research artifact (a LoRA adapter).
Reproducibility & license
- Data-build pipeline, eval harness, and blind-judge verdicts are released alongside the model.
- License: Apache-2.0 (adapter and base). Training data is governed by its own per-row licenses
(see the dataset card; the compilation is CC-BY-NC-SA-4.0).
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3.5-4B")
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-4B", torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(base, "Jainamshahhh/agrireason-4b").eval()
msg = [{"role": "user", "content": "My wheat in Punjab during rabi has yellow rust. What should I apply and when?"}]
ids = tok.apply_chat_template(msg, add_generation_prompt=True, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=512)[0][ids.shape[1]:], skip_special_tokens=True))
Author: Jainam Shah. Built with Adaptive Data (Adaption Labs) and the open Qwen model.