Downloads · 30 days
0
houlie3/LoRA_LLM_training
LoRA_LLM_training is a text generation model from houlie3. Use it when you need the model to write or continue text. The card lists the license as mit.
This project implements a parameter-efficient fine-tuning approach to classify patents as environmentally sustainable ("green") or not green. A pretrained DistilGPT2 model was adapted using Low-Rank Adaptation (LoRA)…
Downloads · 30 days
0
Access
Public
Updated Mar 2, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.ipynb181 KB · 97%
From the Hugging Face model README
This project implements a parameter-efficient fine-tuning approach to classify patents as environmentally sustainable ("green") or not green. A pretrained DistilGPT2 model was adapted using Low-Rank Adaptation (LoRA) to create an LLM-based patent judge.
The model is trained to output a binary decision (0 or 1) based on patent text input.
The goal of this assignment is to:
Only LoRA adapter weights were trained. The base model remains frozen.
is_green)The trained model was used as a judge with the following prompt structure:
"You are a patent judge. Return ONLY JSON with key is_green (0 or 1)."
The model generated labels for 100 selected patents, creating a gold-standard subset.
Gold label distribution (100 patents):
The generated gold labels were used to override corresponding silver labels in the full dataset, improving label quality.
To load the model with PEFT:
from transformers import AutoModelForCausalLM
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("distilgpt2")
model = PeftModel.from_pretrained(base_model, "your-username/your-repo-name")
Assignment submission for Green Patent Classification using LLMs and LoRA fine-tuning.