CoolFace
Modelpublic

Shekswess/trlm-stage-2-sft-final-2

sourceHugging Faceapache-2.0updated 11mo agoView on Hugging Face
1likes21downloads
Model Card

image/png

๐Ÿง  trlm-stage-2-sft-final-2

trlm-stage-2-sft-final-2 is the Stage 2 post-training model for the Tiny Reasoning Language Model (trlm) project. This stage focuses on reasoning tasks, fine-tuned on a curated dataset of 78,000 entries with reasoning tokens (<think>...</think>).


๐Ÿ“– Model Description

  • โ€”Base Model: Shekswess/trlm-stage-1-sft-final-2
  • โ€”Type: Causal Language Model (decoder-only transformer)
  • โ€”Stage: Post-training Stage 2 (SFT)
  • โ€”Objective: Equip the model with reasoning ability, multi-turn thought structuring, and explicit <think> chain-of-thought representations.

This stage teaches the model to analyze problems step-by-step, reason with intermediate thoughts, and provide structured answers.


๐ŸŽฏ Intended Uses & Limitations

Intended Uses

  • โ€”Reasoning-based question answering
  • โ€”Step-by-step logical explanations
  • โ€”Multi-turn reasoning with <think> traces
  • โ€”Precursor to preference optimization (Stage 3)

Limitations

  • โ€”May overfit on reasoning style and hallucinate <think> tokens in simple tasks
  • โ€”Still limited in knowledge scope (135M parameters)
  • โ€”Trained only on English datasets

๐Ÿ“Š Training Data

This model was trained on the dataset: ๐Ÿ‘‰ **Shekswess/trlm-sft-stage-2-final-2**

Dataset summary:

  • โ€”Entries: 78,000
  • โ€”Sources: 6 HuggingFaceTB/smoltalk2 subsets
  • โ€”Focus: Reasoning tasks with <think> annotations
Source DatasetEntriesPercentage %
LlamaNemotronPostTrainingDatasetreasoningr140,20051.5%
OpenThoughts3_1.2M20,00025.6%
multiturnreasoningifthink10,00012.8%
ayadatasetQwen332Bthink5,0006.4%
smoltalkeverydayconvsreasoningQwen332Bthink2,0002.6%
s1k1.1think8001.0%

โš™๏ธ Training Procedure

Training Hyperparameters

  • โ€”Learning rate: 3e-4
  • โ€”Train batch size: 32
  • โ€”Eval batch size: 8
  • โ€”Gradient accumulation steps: 4
  • โ€”Total effective batch size: 128
  • โ€”Optimizer: AdamW (betas=(0.9, 0.99), eps=1e-08)
  • โ€”LR Scheduler: Cosine with warmup ratio 0.1
  • โ€”Epochs: 1
  • โ€”Seed: 42

Framework Versions

  • โ€”Transformers: 4.56.2
  • โ€”PyTorch: 2.7.1+rocm7.0.0.git698b58a9
  • โ€”Datasets: 4.0.0
  • โ€”Tokenizers: 0.22.1

๐Ÿš€ Usage

python
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "Shekswess/trlm-stage-2-sft-final-2"

# Load tokenizer & model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

# Example inference with reasoning
messages = [
    {"role": "user", "content": "If a train travels 60 km in 1 hour and another 90 km in 1.5 hours, what is the average speed?"}
]

# Apply chat template
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt")

outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

๐Ÿ“Œ Next Steps

  • โ€”Stage 3: DPO / preference optimization for reasoning stability

Part of the Tiny Reasoning Language Model (trlm) post-training pipeline.