Text Classification
Transformers
PyTorch
English
promptforge_quality
promptforge
prompt-engineering
prompt-quality
modernbert
regression
llm
Instructions to use ArjunShukla/PromptForge-Quality with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ArjunShukla/PromptForge-Quality with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ArjunShukla/PromptForge-Quality")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ArjunShukla/PromptForge-Quality", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,37 +1,200 @@
|
|
| 1 |
---
|
| 2 |
-
language:
|
|
|
|
| 3 |
license: mit
|
| 4 |
library_name: transformers
|
|
|
|
| 5 |
tags:
|
|
|
|
| 6 |
- prompt-engineering
|
| 7 |
- prompt-quality
|
| 8 |
- modernbert
|
| 9 |
- regression
|
| 10 |
-
-
|
|
|
|
| 11 |
pipeline_tag: text-classification
|
| 12 |
---
|
| 13 |
|
| 14 |
# PromptForge-Quality
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
- specificity
|
| 20 |
-
- context
|
| 21 |
-
- goal_definition
|
| 22 |
-
- constraints
|
| 23 |
-
- completeness
|
| 24 |
-
- actionability
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
```python
|
| 29 |
from promptforge import PromptForge
|
| 30 |
|
| 31 |
-
pf = PromptForge(quality_model_path="
|
| 32 |
-
print(pf.analyze("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
```
|
| 34 |
|
| 35 |
-
##
|
| 36 |
|
| 37 |
-
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
license: mit
|
| 5 |
library_name: transformers
|
| 6 |
+
base_model: answerdotai/ModernBERT-base
|
| 7 |
tags:
|
| 8 |
+
- promptforge
|
| 9 |
- prompt-engineering
|
| 10 |
- prompt-quality
|
| 11 |
- modernbert
|
| 12 |
- regression
|
| 13 |
+
- text-classification
|
| 14 |
+
- llm
|
| 15 |
pipeline_tag: text-classification
|
| 16 |
---
|
| 17 |
|
| 18 |
# PromptForge-Quality
|
| 19 |
|
| 20 |
+
Multi-dimension **prompt quality scorer**. Given an LLM prompt, returns an overall quality score plus per-dimension scores, inferred issues, and missing information.
|
| 21 |
+
|
| 22 |
+
Part of [PromptForge](https://github.com/YOUR_USER/promptModel) — local-first prompt scoring and optimization.
|
| 23 |
+
|
| 24 |
+
## Model Details
|
| 25 |
+
|
| 26 |
+
### Model Description
|
| 27 |
+
|
| 28 |
+
PromptForge-Quality is a fine-tuned [`answerdotai/ModernBERT-base`](https://huggingface.co/answerdotai/ModernBERT-base) encoder with regression heads that predict prompt quality on a **0–100** scale across seven dimensions.
|
| 29 |
+
|
| 30 |
+
- **Developed by:** PromptForge contributors
|
| 31 |
+
- **Model type:** Encoder + multi-output regression (`promptforge_quality`)
|
| 32 |
+
- **Language(s):** English
|
| 33 |
+
- **License:** MIT
|
| 34 |
+
- **Finetuned from:** [`answerdotai/ModernBERT-base`](https://huggingface.co/answerdotai/ModernBERT-base) (~150M parameters)
|
| 35 |
+
|
| 36 |
+
### Dimensions scored
|
| 37 |
+
|
| 38 |
+
| Dimension | What it measures |
|
| 39 |
+
|-----------|------------------|
|
| 40 |
+
| `clarity` | How clear and unambiguous the prompt is |
|
| 41 |
+
| `specificity` | Level of concrete detail |
|
| 42 |
+
| `context` | Background / situation provided |
|
| 43 |
+
| `goal_definition` | How well the objective is defined |
|
| 44 |
+
| `constraints` | Limits, requirements, must/must-not rules |
|
| 45 |
+
| `completeness` | Whether enough information is present |
|
| 46 |
+
| `actionability` | How easy it is for an LLM to act on |
|
| 47 |
+
| `quality_score` | Aggregate overall score |
|
| 48 |
+
|
| 49 |
+
The model also surfaces **issues** (e.g. `too_vague`, `missing_context`) and **missing_information** hints.
|
| 50 |
+
|
| 51 |
+
### Model Sources
|
| 52 |
+
|
| 53 |
+
- **Repository:** https://github.com/YOUR_USER/promptModel
|
| 54 |
+
- **Companion model:** PromptForge-Optimizer (Qwen2.5-1.5B LoRA prompt rewriter)
|
| 55 |
+
- **Demo:** Gradio app in the PromptForge repo (`demo/app.py`)
|
| 56 |
+
|
| 57 |
+
## Uses
|
| 58 |
+
|
| 59 |
+
### Direct Use
|
| 60 |
+
|
| 61 |
+
- Score prompts before sending them to an LLM
|
| 62 |
+
- Diagnose weak prompts (what’s missing / unclear)
|
| 63 |
+
- Measure before/after quality when rewriting prompts
|
| 64 |
+
- Local / offline tooling via PromptForge CLI and Python API
|
| 65 |
|
| 66 |
+
### Downstream Use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
- Prompt linters in IDEs and agent frameworks
|
| 69 |
+
- Dataset filtering / ranking for synthetic prompt corpora
|
| 70 |
+
- Paired with **PromptForge-Optimizer** for score → optimize → re-score pipelines
|
| 71 |
+
|
| 72 |
+
### Out-of-Scope Use
|
| 73 |
+
|
| 74 |
+
- Not a content moderator or safety classifier
|
| 75 |
+
- Not a judge of factual correctness of LLM *answers*
|
| 76 |
+
- Scores are calibrated on synthetic prompt quality labels — treat them as a useful proxy, not ground truth for every domain
|
| 77 |
+
|
| 78 |
+
## Bias, Risks, and Limitations
|
| 79 |
+
|
| 80 |
+
- Trained largely on **synthetic** prompts with heuristic quality labels
|
| 81 |
+
- May reward **length / structure** more than true semantic quality
|
| 82 |
+
- English-centric; behavior on other languages is unverified
|
| 83 |
+
- Very domain-specific jargon may score inconsistently
|
| 84 |
+
|
| 85 |
+
### Recommendations
|
| 86 |
+
|
| 87 |
+
- Use scores comparatively (before vs after) rather than as absolute grades
|
| 88 |
+
- Combine with human review for high-stakes prompt design
|
| 89 |
+
- For custom domains, retrain with your own labeled prompts
|
| 90 |
+
|
| 91 |
+
## How to Get Started with the Model
|
| 92 |
+
|
| 93 |
+
### With PromptForge (recommended)
|
| 94 |
+
|
| 95 |
+
```bash
|
| 96 |
+
pip install promptforge
|
| 97 |
+
# or from source: pip install -e ".[demo]"
|
| 98 |
+
|
| 99 |
+
python -m promptforge download \
|
| 100 |
+
--quality-repo YOUR_HF_USERNAME/PromptForge-Quality \
|
| 101 |
+
--optimizer-repo YOUR_HF_USERNAME/PromptForge-Optimizer
|
| 102 |
+
|
| 103 |
+
python -m promptforge analyze "Build me a website"
|
| 104 |
+
```
|
| 105 |
|
| 106 |
```python
|
| 107 |
from promptforge import PromptForge
|
| 108 |
|
| 109 |
+
pf = PromptForge(quality_model_path="YOUR_HF_USERNAME/PromptForge-Quality")
|
| 110 |
+
print(pf.analyze("Make an app."))
|
| 111 |
+
# → quality_score, dimensions, issues, missing_information
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
### Full pipeline (score + optimize)
|
| 115 |
+
|
| 116 |
+
```python
|
| 117 |
+
from promptforge import PromptForge
|
| 118 |
+
|
| 119 |
+
pf = PromptForge(
|
| 120 |
+
quality_model_path="YOUR_HF_USERNAME/PromptForge-Quality",
|
| 121 |
+
optimizer_model_path="YOUR_HF_USERNAME/PromptForge-Optimizer",
|
| 122 |
+
)
|
| 123 |
+
result = pf.run("Make an app about social media like facebook and stuff")
|
| 124 |
+
print(result["before"]["quality_score"], "→", result["after"]["quality_score"])
|
| 125 |
+
print(result["optimized_prompt"])
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
## Training Details
|
| 129 |
+
|
| 130 |
+
### Training Data
|
| 131 |
+
|
| 132 |
+
- **~25,000** synthetic prompts across coding, writing, research, data, and creative tasks
|
| 133 |
+
- Quality levels from vague one-liners to fully specified prompts
|
| 134 |
+
- Labels: overall `quality_score` + seven dimension scores (0–100)
|
| 135 |
+
|
| 136 |
+
### Training Procedure
|
| 137 |
+
|
| 138 |
+
| Setting | Value |
|
| 139 |
+
|---------|-------|
|
| 140 |
+
| Base model | `answerdotai/ModernBERT-base` |
|
| 141 |
+
| Task | Multi-dimension regression |
|
| 142 |
+
| Epochs | 3 |
|
| 143 |
+
| Max length | 512 |
|
| 144 |
+
| Precision | fp16 |
|
| 145 |
+
| Hardware | NVIDIA RTX 5060 Laptop (8 GB) |
|
| 146 |
+
| Wall time | ~33 minutes |
|
| 147 |
+
|
| 148 |
+
Config: `configs/quality_scorer.yaml`
|
| 149 |
+
|
| 150 |
+
## Evaluation
|
| 151 |
+
|
| 152 |
+
Held-out results (local training run):
|
| 153 |
+
|
| 154 |
+
| Split | MAE | Pearson |
|
| 155 |
+
|-------|----:|--------:|
|
| 156 |
+
| Validation | **2.73** | **0.993** |
|
| 157 |
+
| Test (overall) | **0.96** | **0.999** |
|
| 158 |
+
|
| 159 |
+
Test Spearman (overall): **0.959**
|
| 160 |
+
|
| 161 |
+
### Summary
|
| 162 |
+
|
| 163 |
+
Strong correlation with synthetic quality labels on held-out data. Real-world prompts should still be sanity-checked — the scorer is best used for ranking and diagnosing structure gaps.
|
| 164 |
+
|
| 165 |
+
## Environmental Impact
|
| 166 |
+
|
| 167 |
+
- **Hardware Type:** NVIDIA RTX 5060 Laptop (8 GB)
|
| 168 |
+
- **Hours used:** ~0.5 h for this checkpoint
|
| 169 |
+
- **Cloud Provider:** N/A (local)
|
| 170 |
+
- **Carbon Emitted:** Not measured
|
| 171 |
+
|
| 172 |
+
## Technical Specifications
|
| 173 |
+
|
| 174 |
+
### Model Architecture and Objective
|
| 175 |
+
|
| 176 |
+
ModernBERT encoder with dual / multi regression heads predicting continuous quality scores (0–100).
|
| 177 |
+
|
| 178 |
+
### Compute Infrastructure
|
| 179 |
+
|
| 180 |
+
- **Hardware:** RTX 5060 Laptop GPU, 8 GB VRAM
|
| 181 |
+
- **Software:** PyTorch (CUDA), Transformers, PromptForge training scripts
|
| 182 |
+
|
| 183 |
+
### Artifact size
|
| 184 |
+
|
| 185 |
+
- **On-disk checkpoint:** ~574 MB
|
| 186 |
+
|
| 187 |
+
## Citation
|
| 188 |
+
|
| 189 |
+
```bibtex
|
| 190 |
+
@software{promptforge_quality,
|
| 191 |
+
title = {PromptForge-Quality},
|
| 192 |
+
author = {PromptForge Contributors},
|
| 193 |
+
year = {2026},
|
| 194 |
+
url = {https://huggingface.co/YOUR_HF_USERNAME/PromptForge-Quality}
|
| 195 |
+
}
|
| 196 |
```
|
| 197 |
|
| 198 |
+
## Model Card Contact
|
| 199 |
|
| 200 |
+
Open an issue on the PromptForge GitHub repository.
|