Downloads · 30 days
16
22% of all-time downloads
VibrantVista/Twain_Mark
Twain_Mark is a reinforcement learning model from VibrantVista. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. The card lists the license as other.
This model was fine-tuned using Group Relative Policy Optimization (GRPO) to mimic the literary style of Mark Twain.
Downloads · 30 days
16
22% of all-time downloads
All-time downloads
72
Public
Parameters
266K
16.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
This model was fine-tuned using Group Relative Policy Optimization (GRPO) to mimic the literary style of Mark Twain.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
from textwrap import dedent
model_id = "VibrantVista/Twain_Mark"
author_name = "Twain, Mark"
book_title = "Adventures of Huckleberry Finn"
plot = "The weather was very rainy and cold." # Replace with your own plot
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Strict Prompt Format used in Training
prompt = dedent(f"""\
# Style Target
Author: {author_name}
Title: {book_title}
Task: Write an original, polished literary short story between 1,200 and 1,500 words about {plot} in this style.
Constraints:
- Do NOT mention the author or title in the story text.
- Final line must be exactly: THE END.
Story:
""")
messages = [
{"role": "user", "content": prompt}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
# Using optimized parameters for creative writing
outputs = model.generate(
inputs,
max_new_tokens=2200,
temperature=0.9,
top_p=0.95,
min_p=0.05,
repetition_penalty=1.05
)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
BibTeX:
@misc{liu2025capturingclassicauthorialstyle,
title={Capturing Classic Authorial Style in Long-Form Story Generation with GRPO Fine-Tuning},
author={Jinlong Liu and Mohammed Bahja and Venelin Kovatchev and Mark Lee},
year={2025},
eprint={2512.05747},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2512.05747},
}