Text Generation
Transformers
Safetensors
PyTorch
English
Spanish
neollm
causal-lm
research
dpo
conversational
custom_code

NeoLLM-Instruct-DPO

This is an experimental English and Spanish preference-tuning checkpoint for NeoLLM, an 85.2M parameter causal language model. The pilot improved held-out relative preference margins on the sampled Spanish pairs. The English result was close to the reference baseline, and neither checkpoint matched any of the 20 constrained answers in our generation probe.

Provenance Value
Starting policy and frozen reference KitsuVp/NeoLLM-Instruct
Starting policy and reference revision 208a47045e03be2861777edaeebf91ea01c7ac3c
Starting policy and reference weights SHA-256 e6f036d544f4c752df0c61de14a621f6a59bdbb686104a0cfdea00b7bb6fc2a6
Original pretrained model KitsuVp/NeoLLM
Original pretrained weights SHA-256 524338e290cb19b98d1f7b88120dcea7a957a58b464e2b24add5f38bb00a3561
Model code revision 64d51e3150bcdf298746d956afe03893583654ef
Released DPO weights SHA-256 4f7dbf81a6887c3324ec5ab94b158f6d3cc4b67d2be47c3595a5842da260b696

Data and training

This run used 400 offline preference pairs from a prepared pool of 8,844. The training sample contained 196 English and 204 Spanish prompts. It used 179 pairs from UltraFeedback, 186 from the Spanish split of multilingual Orca DPO, and 35 synthetic bilingual preference pairs curated in Antigravity for prompt echo, repetition, formatting, and requested copying. This is a pilot using a bounded subset of the available data.

We ran sigmoid DPO with beta 0.1, learning rate 5e-7, and one pair per optimizer step. Policy and reference scores use the same clean, unweighted sequence log probabilities with Copy-Paste active and dropout disabled. We sum answer-token log probabilities through EOS. Long examples may span rolling windows with length 512 and stride 256, so their left context is limited. This was one hyperparameter setting. DPO paper

A separate supervised objective on the preferred completion has weight 0.1. It retains Copy-Paste, MiLe, μ-loss, NITP, TWEO, and MEAP using the clean and masked training views described in the SFT card. The retained FP32 master weights were trained with BF16 autocast and fused AdamW. The model can be loaded in BF16 for inference. SFT training details

DPO workflow

DPO workflow showing chosen and rejected completions, four sequence log-probabilities, the frozen SFT reference, and the chosen-only SFT anchor

Use DPO when two answers to the same prompt demonstrate a clear preference, such as a correct format or less repetition. Use SFT when you primarily have demonstrations of the desired behavior.

  • Prepare comparable pairs. Match the tokenized prompt, template, context policy, and precision on both branches. Score completion tokens through EOS once. Reserve prompts for validation before preparing windows.
  • Score with the real mixed distribution. Freeze the exact SFT reference and keep Copy-Paste active in both models. Sum clean, unweighted completion log-probabilities with dropout disabled. Apply NeoLLM's auxiliary losses through the separate chosen-response SFT anchor. With identical policy and reference, the DPO term starts at ln(2).
  • Resume and select checkpoints deliberately. Resume the trainable policy from its saved state and keep the original SFT reference. Check preferred and rejected CE alongside the margin. Choose checkpoints using generated answers as well as preference scores. Likelihood displacement in preference optimization

Objective handling in DPO

DPO update showing clean policy and frozen-reference preference scores above the chosen-only SFT anchor, with both gradient paths joining at the policy update

The policy update combined clean sigmoid DPO with β=0.1 and 0.1 × a chosen-only SFT loss. The policy and frozen SFT reference scored both replies through EOS using the same clean inputs. The reference scores were precomputed without gradients. The same setup was used in the pilot and the extended run.

Component Clean pair scoring Chosen-only SFT anchor on the trainable policy
Copy-Paste Active for both replies in both models, with the same structural and chat-header copy masks. Scores use the full vocabulary-plus-pointer distribution. Active in the clean and MEAP views. The policy's copy head receives gradients from the preference term and the anchor.
MiLe Unweighted token log-probabilities. Entropy reweighting of the mixed distribution with γ=1.0.
μ-loss Pure sequence likelihood. Output-matrix mean penalty with λ=1e-4.
TWEO Pure sequence likelihood. Block-activation outlier penalty on supervised positions with weight 0.01.
NITP Pure sequence likelihood. One-step prediction of detached shallow states for valid next-token labels, target index 2 and weight 1.0.
MEAP Clean input history and dropout off. Two views with weights 0.75 clean and 0.25 MEAP. The mask ratio within eligible assistant history is 0.10.

For a labeled window, the clean sequence score is −N × CE, where N is the number of valid shifted completion targets and CE is the unweighted mixed-distribution cross-entropy. The anchor is computed separately in training mode. Its auxiliary terms contribute to the policy update outside the preference log-ratios.

Data acceptance and debugging

Recommended workflow for accepting SFT rows and DPO pairs, checking supervision, validating checkpoints and fixing the first failing stage

For a new run, keep the original pair and record the first failing check. Repair the derived example or scoring code and repeat the check. This pipeline validated distinct replies and a shared tokenized prefix, excluded exact training-prefix matches from the held-out set, and trimmed supervision after the last EOS. For a generation failure, trace the first wrong token with the mixed distribution and the vocabulary-only diagnostic.

Evaluation and limitations

Validation protocol showing held-out scores and generation probes, with a worked example from DPO step 1450

The diagram's numerical example comes from the extended DPO run, evaluated separately from this 400-step pilot.

Validation metric English Spanish
Held-out pairs 32 32
Positive reference-relative margin, ties count half 46.9% 84.4%
DPO loss 0.6980 0.5349
Frozen-reference DPO loss 0.6931 0.6931
Chosen-token CE, SFT → DPO 2.5995 → 2.6001 3.6593 → 3.6903

A positive margin means the chosen-to-rejected likelihood ratio increased relative to the SFT reference. Relative preference and absolute likelihood of the chosen completion can move in different directions. The held-out sets are small, and the two languages primarily use different preference datasets, which limits cross-language comparisons.

On 20 separate greedy-generation prompts, DPO produced EOS on 17 and matched zero answers under the exact-output check. The SFT reference had 18 EOS and zero exact matches on the same prompts. Disabling Copy-Paste as an inference ablation yielded 14 EOS and zero exact matches for DPO. Answers often contain extra text or produce the wrong content. These are narrow behavioral probes and the checkpoint is intended for research.

Usage

Load KitsuVp/NeoLLM-Instruct-DPO with trust_remote_code=True using the same chat template and generation example as the SFT model card. We tested with Transformers 5.19.0, PyTorch 2.14.0+cu132, and an RTX 5070 Ti in WSL.

Downloads last month
81
Safetensors
Model size
85.2M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for KitsuVp/NeoLLM-Instruct-DPO

Base model

KitsuVp/NeoLLM
Finetuned
(1)
this model

Datasets used to train KitsuVp/NeoLLM-Instruct-DPO

Paper for KitsuVp/NeoLLM-Instruct-DPO