🌐 Looking for the English version? Just scroll down — it's right below! 👇
Lyra-Mistral7B-Irrigation-LoRA v2
Présentation générale
Ce modèle est une amélioration directe d’un modèle précédent de conseil en irrigation :
Lyra-Mistral7B-Irrigation-LoRA (v1)
https://huggingface.co/jeromex1/Lyra-Mistral7B-irrigation-LoRA
L’objectif de cette version v2 n’est pas la mise en production, mais l’exploration méthodique des possibilités et limites du Supervised Fine-Tuning (SFT) appliqué à un Small Language Model (7B) dans un cadre agronomique simple, contrôlé et interprétable.
Évolutions par rapport à la version v1
Changement d’échelle du dataset
- v1 : ~150 lignes d’entraînement
- v2 : 1000 lignes d’entraînement + 100 lignes de validation
Cette augmentation permet :
- un meilleur équilibre des classes de sortie
- la réduction des raccourcis statistiques (shortcut learning)
- des frontières décisionnelles plus stables
- une analyse plus fiable du comportement du modèle
Simplification volontaire des entrées
Par rapport à v1, le nombre de variables d’entrée a été volontairement réduit afin de ne pas surcharger un modèle 7B.
Variables utilisées dans v2 :
texture: type de sol (sableuse, limoneuse, argileuse)tension_cbar: tension de l’eau du sol mesurée au tensiomètre (centibars)ETP: évapotranspiration journalière (mm)pluie_24h_mm: pluie prévue sur les prochaines 24 heures (mm)
Les paramètres plus riches utilisés dans v1 (matière organique, stade phénologique, enracinement, structure du sol, etc.) ont été retirés afin de :
- concentrer l’apprentissage sur un noyau décisionnel réduit
- améliorer la robustesse du comportement appris
- mieux observer les capacités réelles d’un SLM face à un problème décisionnel simple
Description de la tâche
Le modèle joue le rôle d’un conseiller simple en irrigation.
À partir des données parcelle + météo sur 24 heures, il fournit :
- une recommandation d’irrigation parmi quatre classes (0 / 10 / 20 / 30 mm)
- une justification agronomique courte basée sur les variables fournies
Il s’agit d’un modèle comportemental, et non d’un modèle hydrique ou physiologique du sol ou de la plante.
Entraînement
Modèle de base
- Mistral-7B-Instruct-v0.3 (Causal Language Model)
- Entrainement dans Google Colab pro sur GPU A100 avec RAM élevée
Configuration LoRA
LoraConfig(
r=64,
lora_alpha=16,
lora_dropout=0.05,
bias="none",
task_type="CAUSAL_LM",
target_modules=[
"q_proj",
"k_proj",
"v_proj",
"o_proj",
"gate_proj",
"up_proj",
"down_proj",
],
)
Hyperparamètres d’entraînement
num_train_epochs = 3
per_device_train_batch_size = 2
per_device_eval_batch_size = 2
gradient_accumulation_steps = 8
learning_rate = 2e-4
fp16 = True
logging_steps = 10
evaluation_strategy = "epoch"
save_strategy = "epoch"
lr_scheduler_type = "cosine"
warmup_ratio = 0.03
weight_decay = 0.0
report_to = "none"
Métriques d’entraînement
Epoch Train Loss Validation Loss Entropie Précision moyenne des tokens
1 0.1858 0.1846 0.231 0.945
2 0.1764 0.1797 0.221 0.948
3 0.1762 0.1775 0.219 0.948
Lecture des métriques :
pertes d’entraînement et de validation très proches → pas d’overfitting
entropie basse mais non nulle → modèle confiant sans effondrement de classe
structure de sortie stable et reproductible
Résultats en inférence (exemples)
Stress hydrique élevé, pas de pluie
- texture: sableuse
- tension_cbar: 80
- ETP: 5.2
- pluie_24h_mm: 0 → reco_mm: 30
Pluie significative
- texture: argileuse
- tension_cbar: 47
- ETP: 5.0
- pluie_24h_mm: 26 → reco_mm: 0
Situation intermédiaire
- texture: limoneuse
- tension_cbar: 65
- ETP: 4.5
- pluie_24h_mm: 5 → reco_mm: 20
Cas frontière (incertitude météorologique)
- texture: argileuse
- tension_cbar: 55
- ETP: 3.5
- pluie_24h_mm: 9 → reco_mm: 0
Ce dernier cas est volontairement accepté :
à l’horizon 24 h, une prévision de 9 mm ou 10 mm est équivalente d’un point de vue météorologique et agronomique. Le modèle apprend une zone de tolérance réaliste, et non une discontinuité artificielle.
Portée et limites
ce modèle n’est pas destiné à la production
il ne remplace ni un agronome ni un outil de modélisation hydrique
il ne prétend pas fournir une décision opérationnelle réelle
Ses objectifs sont :
explorer le SFT sur un Small Language Model
analyser les effets de distribution des données et des seuils
comprendre les limites d’un modèle compact sur une tâche décisionnelle
Pour un usage réel, un modèle de raisonnement plus large (GPT-5 / Gemini-class) combiné à des données complètes serait plus adapté.
Intention du projet
Ce modèle s’inscrit dans une démarche personnelle d’auto-formation et de constitution de portfolio, centrée sur :
les Small Language Models
le Supervised Fine-Tuning
l’IA appliquée à l’agronomie sous contraintes réalistes
L’accent est mis sur la clarté méthodologique, l’observation des limites et l’honnêteté épistémique, plutôt que sur la performance brute.
English version
General Overview
This model is a direct improvement of a previous irrigation advisory model:
Lyra-Mistral7B-Irrigation-LoRA (v1)
https://huggingface.co/jeromex1/Lyra-Mistral7B-irrigation-LoRA
The goal of this v2 version is not production deployment, but rather a methodical exploration of the possibilities and limits of Supervised Fine-Tuning (SFT) applied to a Small Language Model (7B) in a simple, controlled, and interpretable agronomic framework.
Evolutions Compared to Version v1
Dataset Scaling
- v1: ~150 training lines
- v2: 1000 training lines + 100 validation lines
This increase allows:
- better balance of output classes
- reduction of statistical shortcuts (shortcut learning)
- more stable decision boundaries
- more reliable analysis of model behavior
Intentional Simplification of Inputs
Compared to v1, the number of input variables has been deliberately reduced to avoid overloading a 7B model.
Variables used in v2:
texture: soil type (sandy, loamy, clayey)tension_cbar: soil water tension measured with a tensiometer (centibars)ETP: daily evapotranspiration (mm)pluie_24h_mm: rainfall forecast for the next 24 hours (mm)
The richer parameters used in v1 (organic matter, phenological stage, rooting depth, soil structure, etc.) were removed in order to:
- focus learning on a reduced decision core
- improve robustness of the learned behavior
- better observe the real capacities of an SLM when facing a simple decision problem
Task Description
The model acts as a simple irrigation advisor.
Based on plot + 24‑hour weather data, it provides:
- an irrigation recommendation among four classes (0 / 10 / 20 / 30 mm)
- a short agronomic justification based on the provided variables
It is a behavioral model, not a hydric or physiological model of soil or plant.
Training
Base Model
- Mistral-7B-Instruct-v0.3 (Causal Language Model)
- Training in Google Colab Pro on A100 GPU with high RAM
LoRA Configuration
LoraConfig(
r=64,
lora_alpha=16,
lora_dropout=0.05,
bias="none",
task_type="CAUSAL_LM",
target_modules=[
"q_proj",
"k_proj",
"v_proj",
"o_proj",
"gate_proj",
"up_proj",
"down_proj",
],
)
Training Hyperparameters
num_train_epochs = 3
per_device_train_batch_size = 2
per_device_eval_batch_size = 2
gradient_accumulation_steps = 8
learning_rate = 2e-4
fp16 = True
logging_steps = 10
evaluation_strategy = "epoch"
save_strategy = "epoch"
lr_scheduler_type = "cosine"
warmup_ratio = 0.03
weight_decay = 0.0
report_to = "none"
Training Metrics
Epoch Train Loss Validation Loss Entropy Avg Token Accuracy
1 0.1858 0.1846 0.231 0.945
2 0.1764 0.1797 0.221 0.948
3 0.1762 0.1775 0.219 0.948
Metrics Interpretation:
training and validation losses are very close → no overfitting
low but non‑zero entropy → confident model without class collapse
stable and reproducible output structure
Inference Results (Examples)
High water stress, no rain
texture: sandy
tension_cbar: 80
ETP: 5.2
pluie_24h_mm: 0 → reco_mm: 30
Significant rainfall
texture: clayey
tension_cbar: 47
ETP: 5.0
pluie_24h_mm: 26 → reco_mm: 0
Intermediate situation
texture: loamy
tension_cbar: 65
ETP: 4.5
pluie_24h_mm: 5 → reco_mm: 20
Borderline case (meteorological uncertainty)
texture: clayey
tension_cbar: 55
ETP: 3.5
pluie_24h_mm: 9 → reco_mm: 0
This last case is deliberately accepted: At a 24‑hour horizon, a forecast of 9 mm or 10 mm is equivalent from both meteorological and agronomic perspectives. The model learns a realistic tolerance zone, not an artificial discontinuity.
Scope and Limitations
- this model is not intended for production
-it does not replace an agronomist or a hydric modeling tool
- it does not claim to provide an actual operational decision
Its objectives are:
exploring SFT on a Small Language Model
analyzing data distribution and threshold effects
understanding the limits of a compact model on a decision task
For real use, a larger reasoning model (GPT‑5 / Gemini‑class) combined with complete data would be more suitable.
Project Intent
This model is part of a personal self‑training and portfolio‑building approach, focused on:
Small Language Models
Supervised Fine‑Tuning
AI applied to agronomy under realistic constraints
The emphasis is on methodological clarity, observation of limits, and epistemic honesty, rather than raw performance.