loveless2001/llama-3.1-8b-glyph-sft
Llama 3.1 8B Glyph SFT
Summary
This repository contains a LoRA adapter fine-tuned from meta-llama/Llama-3.1-8B-Instruct for the glyph_reasoning research project.
The adapter trains the model to solve math problems using explicit structured reasoning traces. The original target format was the four-part glyph structure:
๐guideline๐plan๐step๐takeaway / final numeric answer
This artifact is the adapter only. You must load it on top of the gated base Llama 3.1 8B Instruct model.
Intended Use
Research use only.
Reasonable uses:
- testing structured reasoning prompts on Llama 3.1 8B
- comparing glyph-style SFT against base-model behavior
- studying cross-format transfer from glyph-supervised training
Not recommended:
- production deployment
- safety-critical workflows
- general-purpose use without additional evaluation
Training Data
The adapter was trained on a synthetic reasoning-trace dataset derived from math word problems.
- sources: Math500, GSM8K, and SVAMP style tasks
- size: about
3,850SFT examples - training target: structured reasoning traces with a final numeric answer
Training Procedure
- base model:
meta-llama/Llama-3.1-8B-Instruct - method: LoRA SFT
- total steps:
241 - dataset size: about
3,850 - hardware:
NVIDIA H100 80GB - train runtime: about
761s(12.7 min) - final train loss:
0.4248
How To Use
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = "meta-llama/Llama-3.1-8B-Instruct"
adapter = "loveless2001/llama-3.1-8b-glyph-sft"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)You need approved access to the gated base model.
Evaluation
The main published comparison for this adapter is a 1000-sample greedy-decoding evaluation on data/unified_dataset.jsonl using a 1024 token generation budget.
Accuracy
Structure Violation Rate
Interpretation
Main takeaways from the 1024-token evaluation:
- the adapter improves over base on
glyph - it improves strongly on
xml - it does not show a clean improvement on the plain
naturalbaseline - increasing the generation cap from
512to1024materially improved the measured Llama results, especially for the adapter
Limitations
- adapter only: requires access to the gated base model
- narrow domain: evaluated only on structured math reasoning tasks
- mechanism unresolved: the gains appear format-sensitive and are not evidence of general reasoning improvement
Citation
If you use this artifact, cite the base Llama model and describe this as a research LoRA adapter from the glyph_reasoning project.
