Official Implementation of the Research Paper A Hybrid Framework for Adaptive Prompt Generation Using Templates, LLMs, and Learned Rankers
π Published in ICT: Applications and Social Interfaces β Proceedings of ICTCS 2025, Volume 3 (Springer LNNS)
π Repository: https://github.com/parth-shinge/Hybrid-Prompt-Generator
Hybrid Prompt Generator is a research-driven framework that combines template-based prompt generation, LLM augmentation, and machine learning ranking models to generate high-quality prompts for creative tools such as Canva, Gamma, and other AI design platforms.
The system integrates Human-in-the-Loop learning, enabling the model to continuously improve prompt quality based on user selections.
User Input
β
βββ Template Generator
β
βββ Gemini Generator
β
βββ Hybrid Mode
β
βΌ
π§ Ensemble Prompt Synthesis
(Slot Coverage + Fluency)
β
βΌ
π Neural Ranker
(384 β 128 β 64 β 1)
β
βΌ
π€ User Choice Logging
β
βΌ
π Dataset Creation
β
βΌ
π Evaluation + Statistical Testing
β
βΌ
π SHAP Interpretability
Deterministic prompt construction using 7 structured design parameters.
LLM-powered prompt generation using Google Gemini API.
Generates prompts from both systems and selects the best automatically.
Prompt quality scoring:
Final Score = Ξ± Γ SlotCoverage + Ξ² Γ Fluency
Binary classifier trained on user choice data.
Architecture:
Embedding (384)
β Linear(128)
β ReLU
β Dropout(0.2)
β Linear(64)
β ReLU
β Linear(1)
β Sigmoid
Embedding model: all-MiniLM-L6-v2
User selections are logged into a SQLite database, which is converted into a dataset for training the neural ranker.
The system continuously improves as more user feedback is collected.
The repository includes a full ML evaluation pipeline.
β’ Random Baseline β’ Popularity Baseline β’ TF-IDF + Logistic Regression β’ Embedding + Logistic Regression β’ Neural Ranker
β’ Accuracy β’ Precision β’ Recall β’ F1 Score β’ ROC-AUC
Evaluation uses:
β’ 5-Fold Stratified Cross Validation β’ Held-out Test Set
To validate experimental results, the following statistical tests are implemented:
π§ͺ McNemar Test π§ͺ Wilcoxon Signed-Rank Test π§ͺ Bootstrap Confidence Intervals
Results saved to:
results/statistical_tests.json
To improve transparency, the neural ranker supports explainability using SHAP.
Feature importance across the dataset.
Explains why the model preferred one prompt over another.
Accessible via the Admin Dashboard.
The admin panel provides:
π System analytics π§ Ranker retraining π SHAP visualization π Dataset inspection
git clone https://github.com/parth-shinge/Hybrid-Prompt-Generator
cd Hybrid-Prompt-Generator
python -m venv .venv
source .venv/bin/activate
# Windows: .venv\Scripts\activate
pip install -r requirements.txtstreamlit run prompt_generator.pyfrom neural_ranker import train_ranker
from database import get_choice_dataset
pairs = get_choice_dataset()
texts = [t for t,l in pairs]
labels = [l for t,l in pairs]
train_ranker(texts, labels)Hybrid-Prompt-Generator/
β
βββ prompt_generator.py
βββ ensemble_synthesis.py
βββ neural_ranker.py
βββ eval_protocol.py
βββ statistical_tests.py
βββ shap_explain.py
βββ database.py
βββ config.yaml
β
βββ tests/
βββ results/
βββ models/
βββ utils/
The project ensures reproducible experiments through:
β’ Deterministic seeding β’ Dataset hashing β’ Experiment tracking β’ Git commit logging β’ Config-based hyperparameters
Each experiment logs:
dataset hash
git commit
random seed
config snapshot
timestamp
If you use this work in your research, please cite the following:
@inproceedings{shinge2026hybridprompt,
title = {A Hybrid Framework for Adaptive Prompt Generation Using Templates, LLMs, and Learned Rankers},
author = {Parth Shinge},
booktitle = {ICT: Applications and Social Interfaces},
series = {Lecture Notes in Networks and Systems},
publisher = {Springer Nature Switzerland AG},
year = {2026},
note = {Proceedings of the 10th International Conference on Information and Communication Technology for Competitive Strategies (ICTCS-2025)}
}Parth Shinge Vishwakarma Institute of Technology, Pune, India
ORCID: https://orcid.org/0009-0007-3790-2373
This work was presented at:
10th International Conference on Information and Communication Technology for Competitive Strategies (ICTCS-2025)
and published in Springer Lecture Notes in Networks and Systems (LNNS).
This repository is released for academic and research purposes.