This is a LoRA/QLoRA adapter fine-tuned from google/gemma-4-E2B-it for agricultural policy assistance over Nigeria's National Agricultural Technology and Innovation Policy (NATIP) 2022-2027.
The adapter is intended to help applications explain NATIP policy content in clear, practical language for Nigerian farmers, agricultural extension workers, agribusiness stakeholders, and agricultural policy users.
This is not a standalone model. It should be loaded together with the base model google/gemma-4-E2B-it.
Model Details
Model Description
This model is a parameter-efficient LoRA adapter trained to improve the behavior of Gemma 4 E2B for NATIP-focused agricultural advisory tasks.
It was trained to:
Explain NATIP policy content in farmer-friendly language
Answer agricultural policy questions using provided NATIP context
Support Retrieval-Augmented Generation (RAG) workflows
Avoid unsupported claims when the provided context does not contain the answer
Provide concise answers for farmers and agricultural extension workers
The model is best used inside a RAG pipeline where relevant NATIP document chunks are retrieved first and passed into the prompt as context.
Developed by: [iamwales]
Funded by [optional]: Not specified
Shared by [optional]: [iamwales]
Model type: PEFT LoRA adapter for causal language modeling
Language(s) (NLP): English. Additional Nigerian-language support may require more multilingual training examples.
License: Follows the license and usage terms of google/gemma-4-E2B-it
Finetuned from model [optional]:google/gemma-4-E2B-it
This adapter can be used with google/gemma-4-E2B-it to answer questions about NATIP 2022-2027 when relevant NATIP context is provided in the prompt.
Example use cases:
Explaining NATIP policy sections in simple language
Supporting agricultural extension workers
Building farmer-facing agricultural advisory assistants
Summarizing NATIP policy excerpts
Helping users understand agricultural policy themes such as productivity, food security, extension services, technology adoption, innovation, agribusiness, women, and youth inclusion
Downstream Use [optional]
This adapter is intended for downstream use in a larger RAG-based agricultural advisory system.
Recommended production flow:
Receive a user question.
Retrieve relevant chunks from the NATIP 2022-2027 document.
Insert those chunks into the prompt as context.
Generate an answer using google/gemma-4-E2B-it plus this LoRA adapter.
Return the answer with source references where possible.
Recommended prompt format:
text
1System:
2You are Agro-Adviser, a helpful agricultural policy assistant for Nigerian farmers and agricultural extension workers. Answer only from the provided NATIP context. Be clear, practical, concise, and say when the context does not contain the answer.
34User:
5Context:
6[Retrieved NATIP policy chunks]
78Question:
9[User question]
Out-of-Scope Use
This adapter should not be used as the sole authority for:
Live market prices
Weather forecasts
Medical advice
Legal advice
Financial advice
Government updates after NATIP 2022-2027
Questions not grounded in retrieved NATIP context
High-stakes decisions without expert review
If the provided context does not contain the answer, the model should say that the information is not available in the provided context.
Bias, Risks, and Limitations
This adapter inherits limitations from the base model google/gemma-4-E2B-it and from the training data.
Known limitations:
It is a LoRA adapter, not a full standalone model.
It must be used with the base Gemma model.
It may hallucinate if used without retrieved NATIP context.
It may produce incomplete or overly general answers if the provided context is weak.
It has not been exhaustively evaluated across all Nigerian languages or agricultural domains.
It is not a replacement for official government communication, agricultural extension professionals, or expert policy interpretation.
It may not reflect policy updates after NATIP 2022-2027.
Recommendations
Users should use this adapter with a RAG pipeline and provide relevant NATIP context in every prompt.
Recommended safeguards:
Retrieve and pass source context into the prompt.
Ask the model to answer only from the provided context.
Include source references or page numbers when possible.
Add refusal behavior for questions not answered by the context.
Evaluate the model on real farmer and extension-worker questions before deployment.
Use human review for high-impact agricultural or policy decisions.
1messages =[2{3"role":"system",4"content":(5"You are Agro-Adviser, a helpful agricultural policy assistant for Nigerian farmers "6"and agricultural extension workers. Answer only from the provided NATIP context. "7"Be clear, practical, concise, and say when the context does not contain the answer."8),9},10{11"role":"user",12"content":(13"Context:\n"14"NATIP means National Agricultural Technology and Innovation Policy 2022-2027. "15"It is Nigeria's agricultural policy framework for improving productivity, food security, "16"technology adoption, innovation, extension services, agribusiness, and opportunities for women and youth.\n\n"17"Question:\n"18"In simple terms, what is NATIP trying to do for Nigerian farmers?"19),20},21]2223prompt = tokenizer.apply_chat_template(24 messages,25 tokenize=False,26 add_generation_prompt=True,27)2829inputs = tokenizer(prompt, return_tensors="pt").to(model.device)3031with torch.no_grad():32 outputs = model.generate(33**inputs,34 max_new_tokens=180,35 do_sample=False,36 repetition_penalty=1.15,37 no_repeat_ngram_size=3,38 eos_token_id=tokenizer.eos_token_id,39 pad_token_id=tokenizer.pad_token_id,40)4142generated = outputs[0][inputs["input_ids"].shape[-1]:]43print(tokenizer.decode(generated, skip_special_tokens=True))
Training Details
Training Data
The adapter was trained using examples derived from Nigeria's National Agricultural Technology and Innovation Policy (NATIP) 2022-2027 document.
Curated examples defining NATIP as the National Agricultural Technology and Innovation Policy
Refusal examples for questions not answered by the provided context
The training format followed a chat/instruction structure:
json
1{2"messages":[3{4"role":"system",5"content":"You are Agro-Adviser, a helpful agricultural policy assistant..."6},7{8"role":"user",9"content":"Context:\n[Retrieved NATIP context]\n\nQuestion:\n[User question]"10},11{12"role":"assistant",13"content":"[Grounded farmer-friendly answer]"14}15]16}
Training Procedure
The adapter was fine-tuned using parameter-efficient QLoRA training. The base model weights were frozen, and only the LoRA adapter parameters were trained.
Preprocessing [optional]
The NATIP PDF was processed into page-aware text chunks. Noisy sections such as table-of-contents style text and publication metadata were filtered where possible. The cleaned chunks were converted into chat-style supervised fine-tuning examples.
Generated dataset files included:
natip_chunks.jsonl
natip_sft_messages.jsonl
natip_train.jsonl
natip_eval.jsonl
Training Hyperparameters
Training regime: QLoRA / LoRA adapter fine-tuning
Quantization: 4-bit NF4
Base model weights frozen: Yes
LoRA rank: 8
LoRA alpha: 16
LoRA dropout: 0.05
Target modules:q_proj.linear, v_proj.linear
Trainable parameters: approximately 786,432
Total parameters: approximately 3,936,806,432
Trainable percentage: approximately 0.0200%
Batch size: 1
Gradient accumulation steps: 4
Sequence length: 512
Optimizer: paged AdamW 8-bit
Mixed precision: Disabled during final successful training run due to Colab/T4 AMP compatibility constraints
Speeds, Sizes, Times [optional]
One successful smoke-test run completed with approximately:
Global steps: 30
Training runtime: about 102 seconds
Training loss: about 5.31
Hardware: Google Colab NVIDIA T4 GPU
These numbers may differ across runs and training configurations.
Evaluation
Testing Data, Factors & Metrics
Testing Data
Evaluation was performed using manually inspected context-grounded NATIP questions and answers.
Example test question:
In simple terms, what is NATIP trying to do for Nigerian farmers?
With context provided:
NATIP means National Agricultural Technology and Innovation Policy 2022-2027. It is Nigeria's agricultural policy framework for improving productivity, food security, technology adoption, innovation, extension services, agribusiness, and opportunities for women and youth.
Factors
The model should be evaluated across:
NATIP acronym and definition correctness
Farmer-friendly clarity
Context-grounded factuality
Refusal behavior when the answer is not in context
Agricultural extension worker usefulness
Robustness against repetition
Multilingual performance, if used outside English
Metrics
No formal benchmark metrics are currently reported.
Recommended evaluation metrics for future versions:
Human-rated factual accuracy
Context adherence
Refusal accuracy
Answer clarity
Repetition rate
Retrieval-grounded answer quality
Multilingual answer quality
Results
Early context-grounded testing showed that the adapter can produce concise NATIP-focused answers when relevant context is provided.
Example output:
NATIP is Nigeria's agricultural policy framework designed to improve several aspects of the agricultural sector, including productivity, food security, the adoption of technology and innovation, the provision of extension services and agribusiness opportunities, and creating chances for women as well as youth.
Summary
The adapter is suitable as an early NATIP-focused LoRA adapter for RAG-based agricultural policy assistance. It should be evaluated further before high-impact deployment.
Model Examination [optional]
No formal interpretability or model examination work has been completed.