Training (as actually run)
Table with columns: LoRA, QLoRA | LoRA | QLoRA |
|---|
| rank / alpha / dropout | 16 / 32 / 0.05 | 16 / 32 / 0.05 |
| target modules | q,k,v,o_proj | q,k,v,o_proj |
| base precision | bf16 | 4-bit NF4 (double quant), bf16 compute |
| micro-batch x grad-accum | 4 x 4 | 2 x 8 |
| learning rate | 2e-4 | 1e-4 |
| epochs | 3 | 3 |
LoRA and QLoRA differ in learning rate / micro-batch, so their comparison is indicative, not perfectly controlled.
Evaluation (first 200 test questions, greedy decoding, max 160 new tokens, identical settings for every row)
Table with columns: model, rouge_l, bertscore_f1, token_f1, ref_contained, exact_match, avg_words_pred, avg_words_ref| model | rouge_l | bertscore_f1 | token_f1 | ref_contained | exact_match | avg_words_pred | avg_words_ref |
|---|
| base | 0.1074 | 0.8482 | 0.1590 | 0.0350 | 0.0000 | 94.6700 | 23.6200 |
| lora | 0.3559 | 0.9046 | 0.3973 |
rouge_l/bertscore_f1: overlap/semantic similarity with short reference answers; token_f1: token-level F1;
ref_contained: reference answer appears inside the prediction. Automatic metrics are proxies, not agronomic validation.
Usage
from agri_llm import AgriLLMllm = AgriLLM(adapters={"qlora": "<this-repo-or-folder>"})print(llm.generate("How do I control aphids on cotton?", mode="qlora"))
Limitations
Trained on community-curated Q&A, not agronomist-verified. No retrieval, so it can state wrong facts confidently
(see failure_candidates.csv). Research prototype - not a substitute for professional agricultural advice.