Text Generation
Transformers
Safetensors
PyTorch
English
Spanish
neollm
causal-lm
research
dpo
conversational
custom_code
Instructions to use KitsuVp/NeoLLM-Instruct-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KitsuVp/NeoLLM-Instruct-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KitsuVp/NeoLLM-Instruct-DPO", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("KitsuVp/NeoLLM-Instruct-DPO", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KitsuVp/NeoLLM-Instruct-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KitsuVp/NeoLLM-Instruct-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KitsuVp/NeoLLM-Instruct-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KitsuVp/NeoLLM-Instruct-DPO
- SGLang
How to use KitsuVp/NeoLLM-Instruct-DPO 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 "KitsuVp/NeoLLM-Instruct-DPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KitsuVp/NeoLLM-Instruct-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "KitsuVp/NeoLLM-Instruct-DPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KitsuVp/NeoLLM-Instruct-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use KitsuVp/NeoLLM-Instruct-DPO with Docker Model Runner:
docker model run hf.co/KitsuVp/NeoLLM-Instruct-DPO
Explain auxiliary objective handling during SFT and DPO
Browse files
README.md
CHANGED
|
@@ -50,6 +50,21 @@ Use DPO when two answers to the same prompt demonstrate a clear preference, such
|
|
| 50 |
- **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)`.
|
| 51 |
- **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](https://proceedings.mlr.press/v306/im26a.html)
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
## Evaluation and limitations
|
| 54 |
|
| 55 |
[](./docs/validation-workflow.png)
|
|
|
|
| 50 |
- **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)`.
|
| 51 |
- **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](https://proceedings.mlr.press/v306/im26a.html)
|
| 52 |
|
| 53 |
+
### Objective handling in DPO
|
| 54 |
+
|
| 55 |
+
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.
|
| 56 |
+
|
| 57 |
+
| Component | Clean pair scoring | Chosen-only SFT anchor on the trainable policy |
|
| 58 |
+
|---|---|---|
|
| 59 |
+
| 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. |
|
| 60 |
+
| MiLe | Unweighted token log-probabilities. | Entropy reweighting of the mixed distribution with `纬=1.0`. |
|
| 61 |
+
| 渭-loss | Pure sequence likelihood. | Output-matrix mean penalty with `位=1e-4`. |
|
| 62 |
+
| TWEO | Pure sequence likelihood. | Block-activation outlier penalty on supervised positions with weight `0.01`. |
|
| 63 |
+
| NITP | Pure sequence likelihood. | One-step prediction of detached shallow states for valid next-token labels, target index `2` and weight `1.0`. |
|
| 64 |
+
| 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`. |
|
| 65 |
+
|
| 66 |
+
For a labeled window, the clean sequence score is `鈭扤 脳 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.
|
| 67 |
+
|
| 68 |
## Evaluation and limitations
|
| 69 |
|
| 70 |
[](./docs/validation-workflow.png)
|