Instructions to use tharun5054/esg-rl-agent-grpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use tharun5054/esg-rl-agent-grpo with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
π― What Is This Model?
This is a LoRA adapter on top of unsloth/Qwen2.5-0.5B-Instruct, trained with GRPO (Group Relative Policy Optimization) to solve long-horizon ESG corporate decision-making.
The agent acts as a corporate sustainability strategist, choosing monthly interventions to hit ESG targets within a fixed budget. The challenge: actions have delayed compound effects (e.g. solar panels take months to pay off), requiring multi-step reasoning.
| π ESG RL ENVIRONMENT LOOP | |
| π’ Company State | π€ LLM Agent |
| β’ Carbon: 1200 tons β’ Renewable: 12% β’ Budget: $500K β’ Month: 1/6 |
{"action": 0,
"reasoning":
"Installing solar now
gives 6 months of
renewable boost."} |
π Benchmark Performance
| Agent | π’ Easy | π‘ Medium | π΄ Hard | π Overall |
|---|---|---|---|---|
| π² Random Baseline | 0.740 | 0.643 | 0.678 | 0.687 |
| π§ Heuristic Baseline | 1.000 | 0.847 | 0.852 | 0.900 |
| π This Model (V2 GRPO) | 1.000 | 0.880 β¨ | 0.726 | 0.869 |
β¨ Key Achievement: This model outperformed the hand-coded heuristic on the Medium task (0.880 vs 0.847), demonstrating genuine zero-shot RL generalization β not just memorization.
π Gains Over Random
Label Performance Increase Pct Range
----------- ------------------------- ------- --------------------
Easy βββββββββββββββββββββββββ +35.1% (0.740 β 1.000)
Medium βββββββββββββββββββββββββ +36.8% (0.643 β 0.880)
Hard βββββββββββββββββββββββββ + 7.1% (0.678 β 0.726)
Overall βββββββββββββββββββββββββ +26.5% (0.687 β 0.869)
βοΈ Training Configuration
| Parameter | Value |
|---|---|
| Base Model | unsloth/Qwen2.5-0.5B-Instruct |
| Method | GRPO (Group Relative Policy Optimization) |
| Framework | TRL + Unsloth |
| Hardware | NVIDIA A100 80GB |
| Precision | bf16 |
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
| Learning Rate | 8e-6 |
| Batch Size | 4 per device |
| GRPO Generations | 6 per prompt |
| Max New Tokens | 192 |
| Total Steps | 150 |
| Curriculum | 50 easy β 60 medium β 40 hard |
| Dataset Size | 350 samples (heuristic + random + adversarial) |
| Training Time | ~40 minutes |
| Training Cost | ~$4.50 |
π 3-Stage Curriculum
Step 0 --------- Step 50 --------- Step 110 --------- Step 150
| | | |
| [EASY] | [MEDIUM] | [HARD] |
| 50 steps | 60 steps | 40 steps |
+------------------+------------------+------------------+
π§ͺ Reward System (4 Independent Signals β No LLM Judge)
| Signal | Weight | Type | Description |
|---|---|---|---|
| βοΈ Environment Outcome | 45% | Shaped | Reward from stepping the ESG simulator |
| π Format Compliance | 25% | Binary | Valid {"action": int, "reasoning": str} JSON |
| π‘οΈ Anti-Cheat | 15% | Penalty | Penalizes NO_ACTION spam & action repetition |
| π Task Progress | 15% | Terminal | Final deterministic grader score |
All reward functions are verifiable, rule-based, and LLM-free. No GPT-as-judge.
β‘ Quick Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# ββ 1. Load model βββββββββββββββββββββββββββββββββββββββββββββββββ
base = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-0.5B-Instruct")
model = PeftModel.from_pretrained(
base, "tharun5054/esg-rl-agent-grpo", subfolder="lora_adapter"
)
tokenizer = AutoTokenizer.from_pretrained(
"tharun5054/esg-rl-agent-grpo", subfolder="lora_adapter"
)
model.eval()
# ββ 2. Build ESG scenario βββββββββββββββββββββββββββββββββββββββββ
prompt = """You are an ESG sustainability strategist. Current state:
- Carbon Emissions: 1200 tons/month (target: -15%)
- Renewable Energy: 12% (target: 30%)
- Available Budget: $500,000
- Month: 1 of 6
Actions: 0=Solar($150K,6mo), 1=HVAC($80K,12mo), 2=Recycling($25K),
3=Water($60K,12mo), 4=Carbon Offset($40K), 5=Diversity($50K),
6=Wellness($30K), 7=Audit($15K), 8=NoAction
Output JSON only:"""
# ββ 3. Generate βββββββββββββββββββββββββββββββββββββββββββββββββββ
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
out = model.generate(
**inputs, max_new_tokens=128,
temperature=0.7, do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
# β {"action": 0, "reasoning": "Solar panels provide 6 months of renewable energy boost..."}
π Repository Structure
Click to see all files
tharun5054/esg-rl-agent-grpo/
β
βββ π§ lora_adapter/
β βββ adapter_config.json β LoRA config (rank=16, alpha=32)
β βββ adapter_model.safetensors β Trained weights (~35MB)
β βββ tokenizer.json β Qwen2.5 tokenizer
β βββ tokenizer_config.json
β
βββ π results/
β βββ trained_v2.json β Full benchmark (5 seeds Γ 3 tasks)
β βββ baseline_heuristic.json β Heuristic baseline
β βββ baseline_random.json β Random baseline
β βββ score_comparison.png β Bar chart comparison
β βββ reward_history.png β Reward curves per step
β βββ esg_metrics.png β Final ESG metric breakdown
β
βββ π EVALUATION_REPORT.md β Detailed V2 analysis
βββ π SUBMISSION.md β Hackathon submission brief
π Related Links
| Resource | Link | |
|---|---|---|
| π¦ | Source Code | TharunBabu-05/OPEN-ENV |
| π | Training Space | tharun5054/esg-rl-train |
| π | Live Env API | tharun5054/esg-compliance-env |
| π | Evaluation Report | EVALUATION_REPORT.md |
MIT License Β© 2026 Tharun Babu | OpenEnv Hackathon 2026
- Downloads last month
- -
Model tree for tharun5054/esg-rl-agent-grpo
Base model
Qwen/Qwen2.5-0.5B