Views
No views yet
⚠ NOTICE — research experiment, not theological authorityThis is a personal portfolio / research project exploring how small open-weights LLMs can be fine-tuned to adopt a specific historical register and citation style. The trained model is not a reliable source of Catholic doctrine, biblical interpretation, or philosophical truth. It can hallucinate citations, misrepresent the Catechism, and confidently err. Outputs must not be cited as catechetical instruction, theological argument, or spiritual direction.
Qwen/Qwen2.5-7B-Instruct,
trained to respond to philosophical and theological questions in a
scholastic / Latin-inflected register grounded in the Catechism of the
Catholic Church (CCC, 1992), in the structural voices of Aquinas's
Summa Theologica and Augustine's Confessions / City of God.pleyva2004/scholastic-llm-sft-v2-iter400) via the open-source
scripts/mlx_to_peft.py
converter. The weights apply LoRA to the top 16 of 28 transformer layers.1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5base = AutoModelForCausalLM.from_pretrained(
6 "Qwen/Qwen2.5-7B-Instruct",
7 torch_dtype=torch.bfloat16,
8 device_map="auto",
9)
10model = PeftModel.from_pretrained(base, "pleyva2004/scholastic-llm-sft-v2-iter400-peft")
11tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
12
13messages = [{"role": "user", "content": "Is the soul immortal?"}]
14text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
15inputs = tokenizer(text, return_tensors="pt").to(model.device)
16out = model.generate(**inputs, max_new_tokens=400, do_sample=True, temperature=0.7)
17print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))| Base | Qwen/Qwen2.5-7B-Instruct |
| Method | LoRA (rank 8, alpha 80) on top 16 of 28 transformer layers |
| Optimizer | AdamW, LR 1e-5, batch 1, max seq 2048 |
| Iterations | 400 (best checkpoint within an 800-iter run) |
| Training data | 377 teacher-distilled (question, scholastic-answer) pairs |
| Teacher | Claude Sonnet 4.6 |
| Hardware | Apple M4 Pro, 48 GB unified memory, via MLX (then converted to PEFT) |
| Trainable parameters | 2.6M / 7.6B (0.034 %) |
| Dimension | BASE | This adapter | Δ |
|---|---|---|---|
| Scholastic register | 3 | 21 | +18 |
| Augustinian voice | 0 | 7 | +7 |
| CCC grounding | 0 | 18 | +18 |
| Structure | 16 | 22 | +6 |
| Strict total | 19 | 68 | +49 |
| Balanced total | 19 | 68 | +49 |
mlx-lm on Apple Silicon1@misc{leyva2026scholastic,
2 title = {Teaching a Small LLM Scholastic Voice: Fine-Tuning Qwen 2.5 on the Catechism, Summa, and Augustine via Local MLX},
3 author = {Pablo Leyva},
4 year = {2026},
5 url = {https://github.com/pleyva2004/scholastic-llm}
6}