Instructions to use meric533/socrateach-sft-olmo2-1b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use meric533/socrateach-sft-olmo2-1b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B-Instruct") model = PeftModel.from_pretrained(base_model, "meric533/socrateach-sft-olmo2-1b-lora") - Transformers
How to use meric533/socrateach-sft-olmo2-1b-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="meric533/socrateach-sft-olmo2-1b-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("meric533/socrateach-sft-olmo2-1b-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use meric533/socrateach-sft-olmo2-1b-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "meric533/socrateach-sft-olmo2-1b-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meric533/socrateach-sft-olmo2-1b-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/meric533/socrateach-sft-olmo2-1b-lora
- SGLang
How to use meric533/socrateach-sft-olmo2-1b-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "meric533/socrateach-sft-olmo2-1b-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meric533/socrateach-sft-olmo2-1b-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "meric533/socrateach-sft-olmo2-1b-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meric533/socrateach-sft-olmo2-1b-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use meric533/socrateach-sft-olmo2-1b-lora with Docker Model Runner:
docker model run hf.co/meric533/socrateach-sft-olmo2-1b-lora
SocraTeach SFT β LoRA adapter for OLMo-2-1B-Instruct
A LoRA adapter that turns allenai/OLMo-2-0425-1B-Instruct into a Socratic math tutor: it
guides a student toward an answer with questions instead of stating the answer itself.
This is vanilla supervised fine-tuning β no KL regularisation, no reweighting. It exists as the baseline and as the forward-KL reference model for the P7 Implementation-3 experiment on KL-reweighted SFT. If you are reproducing that work, this is the checkpoint the variant-b runs measure against, and using a different one will shift their numbers.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "allenai/OLMo-2-0425-1B-Instruct"
tok = AutoTokenizer.from_pretrained(base) # the adapter ships no tokenizer
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, "meric533/socrateach-sft-olmo2-1b-lora")
The tutoring behaviour is conditioned on a system instruction. Prompt it with a Socratic SI plus the student's problem; without any system message it behaves much more like the base assistant. That conditionality is deliberate β the training mix pairs every pedagogy dialogue with an SI and leaves the general-replay portion SI-free.
Training
| Base model | allenai/OLMo-2-0425-1B-Instruct |
| Data | meric533/socrateach-sft β 30k, 75% Socratic dialogue + 25% SI-free general replay |
| Method | LoRA, r=16, alpha=32, dropout=0.05, on all attention and MLP projections |
| Schedule | 1 epoch = 923 optimizer steps, LR 2e-4, warmup 3%, effective batch 32, max_len 1024, seed 13 |
| Loss | assistant-token-only cross-entropy |
Train loss 1.233 (step 20) to 0.870 (step 920). trainer_state.json has the full curve.
Measured behaviour
Against the base model, on 250 GSM8K items and held-out pedagogy dialogues:
| base | this adapter | |
|---|---|---|
| Pedagogy NLL (lower = better tutor) | 1.416 | 0.862 |
| GSM8K, plain prompt | 0.656 | 0.456 |
GSM8K, "put your answer in \boxed{}" |
0.664 | 0.212 |
| Forward KL from base (no SI) | 0 | 0.150 |
It learns the tutoring task and loses prior math ability β the ordinary SFT trade-off.
The two GSM8K rows are the important part. Asking for a boxed final answer collides with what this model was trained to do, so it hands the problem back to the student instead of answering: its Socratic hand-back rate goes from 0.12 to 0.48 under that instruction while the base model is unaffected. Its commit rate stays high (0.90), so it is not a clean refusal β it emits something parseable that is not a final answer. Benchmark it under both conditions, or you will read a formatting conflict as a loss of arithmetic skill.
An independently trained run of this identical recipe scored 0.468 / 0.208 on the same two conditions, which is a reasonable estimate of run-to-run noise.
Files
adapter_model.safetensors and adapter_config.json are the adapter. trainer_state.json is
included for provenance. Optimizer and RNG state are not uploaded, so this can be used for
inference and as a KL reference but not to resume training.
Provenance
Trained as part of AlphaAI / edu-llm P7 (tutor layer). Training and evaluation code:
edu-llm/OLMo-core, branch p7/impl3,
under p7/impl3/.
- Downloads last month
- -
Model tree for meric533/socrateach-sft-olmo2-1b-lora
Base model
allenai/OLMo-2-0425-1B