objectivist-phi4-mini-CP-SFT-merge

A Phi-4-mini model fine-tuned on Objectivist texts, in two stages (continued pretraining, then supervised fine-tuning) using LoRA adapters that were merged into the base weights. Made to be shared with the Objectivist community for fun.

Quantized GGUF versions: peikoff/objectivist-phi4-CP-SFT-merge-GGUF

Model details

Field Value
Base model microsoft/Phi-4-mini-instruct [TODO: confirm this is the exact model you started from; your upload script flagged it as an assumption]
Architecture Phi3ForCausalLM (from config.json)
Layers / hidden size 32 / 3072
Vocabulary 200,064 tokens
Weights fp16 safetensors, 4 shards
Context length in config 131,072 (max_position_embeddings); fine-tuning sequence length: [TODO]
Language English

Training

Two-stage fine-tune using adapters, merged into the base weights:

  1. Continued pretraining (CP): next-token training on raw Objectivist texts.
  2. Supervised fine-tuning (SFT): question/answer pairs.

Training data (closed source; not included in this repo):

  • about 650 full-text Objectivist articles from ARI, the Prometheus Foundation, and OSI
  • Ayn Rand's nonfiction books
  • 200 trivia questions from WhoNeeds.it
  • biographical data of Objectivists from the WhoNeeds.it D1 database

Intended use

Question answering and discussion about Objectivism, shared with the Objectivist community for fun. Not for authoritative scholarship or any high-stakes use.

Evaluation

Subjectively evaluated with prompts. No benchmark or held-out evaluation has been run.

Limitations

  • Small model; it can produce fluent but incorrect statements, including invented quotes, citations, and biographical details. Verify against primary sources.
  • Trained on a single-tradition corpus and reflects that tradition's framing.
  • Quantized versions are weaker than this fp16 merge (see the GGUF card).

How to use

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

repo = "peikoff/objectivist-phi4-mini-CP-SFT-merge"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")

messages = [{"role": "user", "content": "What is an axiom in Objectivism?"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True,
                                 return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=256, do_sample=True, temperature=0.7)
print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))

Note: the config.json in this repo contains an auto_map entry pointing to custom code files (configuration_phi3.py, modeling_phi3.py) that are not in this repo. If loading fails on that, try the installed transformers Phi-3 classes or remove the auto_map block. I have not tested loading.

License

All rights reserved.

Downloads last month
27
Safetensors
Model size
4B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for peikoff/objectivist-phi4-mini-CP-SFT-merge

Adapter
(205)
this model
Quantizations
1 model