CoolFace
Modelpublic

loveless2001/llama-3.1-8b-glyph-sft

sourceHugging Facellama3.1updated 6mo agoView on Hugging Face
0likes8downloads
Model Card

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,850 SFT 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

python
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

Modelglyphxmlnatural
Llama-3.1-8B-Instruct0.2960.2640.353
Llama-3.1-8B Glyph SFT0.4080.5120.343

Structure Violation Rate

Modelglyphxmlnatural
Llama-3.1-8B-Instruct0.1400.1160.799
Llama-3.1-8B Glyph SFT0.0660.1130.069

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 natural baseline
  • โ€”increasing the generation cap from 512 to 1024 materially 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.