Downloads · 30 days
15
29% of all-time downloads
idealab-cs2/qwen2.5-0.5b-reddit-next-post-lora
qwen2.5-0.5b-reddit-next-post-lora is a text generation model from idealab-cs2. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
These are the LoRA adaptation weights for Qwen/Qwen2.5-0.5B, trained by Ruggero Marino Lazzaroni at the IDeaLab (University of Graz) on the idealab-cs2/reddittaskpredictnextk5 dataset in order to imitate Reddit user b…
Downloads · 30 days
15
29% of all-time downloads
All-time downloads
51
Public
Repo size
46.7 MB
Likes
0
Public
Click a slice to open those files.
.safetensors35.2 MB · 69%
From the Hugging Face model README
These are the LoRA adaptation weights for Qwen/Qwen2.5-0.5B, trained by Ruggero Marino Lazzaroni at the IDea_Lab (University of Graz) on the idealab-cs2/reddit_task_predict_next_k5 dataset in order to imitate Reddit user behavior: given a user's most recent posts, the model predicts the title and text of their next post.
This was the best variant out of a 16-model grid (SmolLM-360M / Qwen2.5-0.5B, base & Instruct, full fine-tune & LoRA, constant & cosine LR), selected by adjusted semantic similarity between generated and ground-truth next posts.
idealab-cs2/reddit_task_predict_next_k5 (predict next post from k=5 most recent posts)from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B", device_map="auto")
model = PeftModel.from_pretrained(base, "idealab-cs2/qwen2.5-0.5b-reddit-next-post-lora")
tokenizer = AutoTokenizer.from_pretrained("idealab-cs2/qwen2.5-0.5b-reddit-next-post-lora")
The model expects a flat prompt (no chat template) with this exact structure — fill in the user's recent posts, newest last, and stop after the final cue:
You are an expert assistant that predicts Reddit posts. Your task is to generate the content for the single next post based on a user's history. The response must contain only the title and text of the predicted post, adhering strictly to the format. Do not add any conversational text, explanations, or extra posts.
Given the following posts:
REDDIT POST TITLE 1: {title of post 1}
REDDIT POST TEXT 1: {text of post 1}
REDDIT POST TITLE 2: {title of post 2}
REDDIT POST TEXT 2: {text of post 2}
Predict the title and text for the single next post. Your response must begin directly with the cue below and contain nothing else.
REDDIT POST TITLE 3:
The model generates the title, then REDDIT POST TEXT 3: ... with the post body. Renumber the cues according to how many context posts you provide (the next post is always N+1). Prioritize the most recent posts if you need to truncate for context length.
prompt = """You are an expert assistant that predicts Reddit posts. Your task is to generate the content for the single next post based on a user's history. The response must contain only the title and text of the predicted post, adhering strictly to the format. Do not add any conversational text, explanations, or extra posts.
Given the following posts:
REDDIT POST TITLE 1: My cat learned to open the fridge
REDDIT POST TEXT 1: She's 4kg of pure menace. Caught her at 3am eating the cheese.
REDDIT POST TITLE 2: Update: fridge cat has been thwarted
REDDIT POST TEXT 2: Child lock installed. She now screams at the fridge instead.
Predict the title and text for the single next post. Your response must begin directly with the cue below and contain nothing else.
REDDIT POST TITLE 3: """
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
| Metric | Value |
|---|---|
| Adjusted semantic similarity (best of grid) | -0.098 |
| Raw semantic similarity | 0.782 |
| Parse failure rate | 4.8% |
| Eval loss | 1.964 |
| Eval token accuracy | 0.628 |
Notes from the grid search: base (non-Instruct) models massively outperformed their Instruct counterparts on this task (Instruct variants had 65-75% parse failure rates), and LoRA generalized better than full fine-tuning, which overfit after ~4 epochs.
If you use this model, please cite it as:
@misc{lazzaroni2025redditnextpost,
author = {Lazzaroni, Ruggero Marino},
title = {Qwen2.5-0.5B Reddit Next-Post LoRA},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/idealab-cs2/qwen2.5-0.5b-reddit-next-post-lora}}
}
This model is available under the same license as the base model (Qwen/Qwen2.5-0.5B, apache-2.0).