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
Document NeoLLM training with workflow diagrams
Browse files- .gitattributes +2 -0
- README.md +14 -0
- docs/dpo-workflow.png +3 -0
- docs/validation-workflow.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
docs/dpo-workflow.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
docs/validation-workflow.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -40,8 +40,22 @@ We ran sigmoid DPO with beta `0.1`, learning rate `5e-7`, and one pair per optim
|
|
| 40 |
|
| 41 |
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](https://huggingface.co/KitsuVp/NeoLLM-Instruct/tree/208a47045e03be2861777edaeebf91ea01c7ac3c)
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
## Evaluation and limitations
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
| Validation metric | English | Spanish |
|
| 46 |
|---|---:|---:|
|
| 47 |
| Held-out pairs | 32 | 32 |
|
|
|
|
| 40 |
|
| 41 |
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](https://huggingface.co/KitsuVp/NeoLLM-Instruct/tree/208a47045e03be2861777edaeebf91ea01c7ac3c)
|
| 42 |
|
| 43 |
+
## DPO workflow
|
| 44 |
+
|
| 45 |
+
[](./docs/dpo-workflow.png)
|
| 46 |
+
|
| 47 |
+
Use DPO when two answers to the same prompt demonstrate a clear preference, such as a correct format or less repetition. Use [SFT](https://huggingface.co/KitsuVp/NeoLLM-Instruct#sft-workflow) when you primarily have demonstrations of the desired behavior.
|
| 48 |
+
|
| 49 |
+
- **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.
|
| 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)
|
| 56 |
+
|
| 57 |
+
The diagram's numerical example comes from the [extended DPO run](https://huggingface.co/KitsuVp/NeoLLM-Instruct-DPO/tree/dpo-1450), evaluated separately from this 400-step pilot.
|
| 58 |
+
|
| 59 |
| Validation metric | English | Spanish |
|
| 60 |
|---|---:|---:|
|
| 61 |
| Held-out pairs | 32 | 32 |
|
docs/dpo-workflow.png
ADDED
|
Git LFS Details
|
docs/validation-workflow.png
ADDED
|
Git LFS Details
|