2024 · Lead researcher & engineer
Text Generation Model with GPT-2
A capstone research project at Christopher Newport University exploring how a fine-tuned GPT-2 model, paired with OpenAI APIs, can produce coherent long-form text in a narrow subject domain.

The problem
General-purpose language models drift off-topic and hallucinate specifics when asked to write within a technical domain. The project asked whether a modest fine-tune on curated data could measurably reduce that drift.
Approach
- Assembled and cleaned a domain corpus of roughly 40k passages, deduplicating and normalising formatting.
- Fine-tuned GPT-2 in PyTorch with staged learning-rate schedules and early stopping on validation perplexity.
- Built a human evaluation rubric scoring factuality, coherence and tone against baseline outputs.
- Wrapped the model in a small API layer so reviewers could compare generations side by side.
Technologies
PythonPyTorchHugging Face TransformersOpenAI APIJupyterGit
Outcomes
- Validation perplexity reduced by 31% against the base checkpoint.
- Human reviewers preferred fine-tuned output in 7 of 10 blind comparisons.
- Written up as the graded senior project and released as an open-source repository.
More work