What this model does
This is a raw language-model completion adapter, not an instruction-following assistant. Given Saraiki text, it continues it fluently — it has not been trained to follow instructions, answer questions conversationally, or hold a dialogue. That behavior is added in Stage 2, which merges this adapter into the base model before training an instruction-following LoRA on top. Most users should start from Stage 2 (or Stage 3, for tool use) rather than this model directly, unless you specifically need raw Saraiki text completion.
Usage
from unsloth import FastLanguageModel
from peft import PeftModel
from transformers import AutoTokenizer
import torch
BASE_MODEL = "Qwen/Qwen3-8B-Base"
CPT_ADAPTER = "themohal/saraiki-qwen3-8b-cpt"
tokenizer = AutoTokenizer.from_pretrained(CPT_ADAPTER)
model, _ = FastLanguageModel.from_pretrained(
model_name=BASE_MODEL, load_in_4bit=True, dtype=None,
)
model.resize_token_embeddings(len(tokenizer))
model = PeftModel.from_pretrained(model, CPT_ADAPTER)
prompt = "سرائیکی ادب دی تاریخ اچ"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7, top_p=0.9)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training data
themohal/saraiki-llm-dataset — a Saraiki text corpus combining cleaned/deduplicated bulk sources (raw sentences, a parallel corpus, newspaper/literature/magazine text) with Gemini-generated long-form passages across varied genres (short stories, essays, descriptive writing, folklore, and more).
This dataset grows daily (roughly once per morning), so this model is retrained continually rather than as a single fixed run — see Continual training below.
Training procedure
- Method: LoRA (r=16, alpha=32, dropout=0.0) on
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj; base model weights frozen throughout.
- Objective: standard causal language modeling on packed 1024-token blocks (no instruction/response masking — this stage learns the language itself, not a task format).
- Learning rate: 2e-5 (lower than the later instruction-tuning stages, typical for continued pretraining vs. SFT).
- Tokenizer extension: two verified Saraiki-specific Arabic-script characters (ڻ / ݙ) added as dedicated tokens; their embedding rows are initialized from the mean of their original sub-token pieces and re-derived identically every training session (they are frozen base-model weights, not part of the LoRA adapter).
- Max sequence length: 1024.
- Cleaning: conservative filtering (drop URLs, page-number markers, bibliographic metadata labels, numeric/section-only lines, Latin-heavy/English-only lines, pathological lengths) plus exact Unicode-normalized deduplication, on top of the deduplication already applied when rows are pushed to the source dataset.
Continual training
Because the training dataset grows daily, this model does not use naive resume_from_checkpoint on every run — that assumes a static dataset, which a growing corpus violates (the train/validation split membership and packed-sequence composition change as rows are added). Instead:
- Every training session pins the dataset to a specific commit SHA and records it in a
data_manifest.json alongside each pushed checkpoint.
- On the next run, that SHA is compared against the dataset's current SHA:
- Unchanged → a true
resume_from_checkpoint (same optimizer state, same LR schedule position) — this is what happens on same-day reruns.
- Changed (the normal case, once per day after the morning data update) → a weights-only continuation: adapter weights are carried forward, and a fresh optimizer/scheduler phase trains over the current, larger corpus.
This means the adapter is best understood as a continually-improving artifact rather than a single frozen release — total training step count naturally grows session to session as the corpus grows, and each session's evaluation numbers aren't directly comparable to a prior session's (the validation split membership shifts too). Check the commit history / data_manifest.json in the most recent checkpoint folder for what it was actually trained on.
Intended use & limitations
- Built as the language foundation for a Saraiki-language model family, for a specific, currently-unfilled niche — Jataki Saraiki has essentially no existing LLM tooling. It is not intended to compete with frontier-scale general models on broad reasoning or capability; at 8B parameters with LoRA fine-tuning, its ceiling is "the best available Saraiki language model," not general intelligence.
- Not instruction-tuned. It will continue text plausibly but will not reliably answer questions, follow commands, or behave like a chat assistant — use Stage 2 or Stage 3 for that.
- Training data mixes real-world scraped/cleaned text with synthetic (Gemini-generated) passages. It has not yet been evaluated against a held-out, hand-written Saraiki eval set — treat outputs with appropriate caution until that evaluation exists.
Author
Muhammad Farjad Ali Raza
License
Apache 2.0, inherited from the Qwen3-8B-Base license. Training data combines cleaned real-world text with synthetically generated content; see the dataset card for details.