* docs: deep audit — fix stale config keys, missing commands, and registry drift Cross-checked ~80 high-impact docs pages (getting-started, reference, top-level user-guide, user-guide/features) against the live registries: hermes_cli/commands.py COMMAND_REGISTRY (slash commands) hermes_cli/auth.py PROVIDER_REGISTRY (providers) hermes_cli/config.py DEFAULT_CONFIG (config keys) toolsets.py TOOLSETS (toolsets) tools/registry.py get_all_tool_names() (tools) python -m hermes_cli.main <subcmd> --help (CLI args) reference/ - cli-commands.md: drop duplicate hermes fallback row + duplicate section, add stepfun/lmstudio to --provider enum, expand auth/mcp/curator subcommand lists to match --help output (status/logout/spotify, login, archive/prune/ list-archived). - slash-commands.md: add missing /sessions and /reload-skills entries + correct the cross-platform Notes line. - tools-reference.md: drop bogus '68 tools' headline, drop fictional 'browser-cdp toolset' (these tools live in 'browser' and are runtime-gated), add missing 'kanban' and 'video' toolset sections, fix MCP example to use the real mcp_<server>_<tool> prefix. - toolsets-reference.md: list browser_cdp/browser_dialog inside the 'browser' row, add missing 'kanban' and 'video' toolset rows, drop the stale '38 tools' count for hermes-cli. - profile-commands.md: add missing install/update/info subcommands, document fish completion. - environment-variables.md: dedupe GMI_API_KEY/GMI_BASE_URL rows (kept the one with the correct gmi-serving.com default). - faq.md: Anthropic/Google/OpenAI examples — direct providers exist (not just via OpenRouter), refresh the OpenAI model list. getting-started/ - installation.md: PortableGit (not MinGit) is what the Windows installer fetches; document the 32-bit MinGit fallback. - installation.md / termux.md: installer prefers .[termux-all] then falls back to .[termux]. - nix-setup.md: Python 3.12 (not 3.11), Node.js 22 (not 20); fix invalid 'nix flake update --flake' invocation. - updating.md: 'hermes backup restore --state pre-update' doesn't exist — point at the snapshot/quick-snapshot flow; correct config key 'updates.pre_update_backup' (was 'update.backup'). user-guide/ - configuration.md: api_max_retries default 3 (not 2); display.runtime_footer is the real key (not display.runtime_metadata_footer); checkpoints defaults enabled=false / max_snapshots=20 (not true / 50). - configuring-models.md: 'hermes model list' / 'hermes model set ...' don't exist — hermes model is interactive only. - tui.md: busy_indicator -> tui_status_indicator with values kaomoji|emoji|unicode|ascii (not kawaii|minimal|dots|wings|none). - security.md: SSH backend keys (TERMINAL_SSH_HOST/USER/KEY) live in .env, not config.yaml. - windows-wsl-quickstart.md: there is no 'hermes api' subcommand — the OpenAI-compatible API server runs inside hermes gateway. user-guide/features/ - computer-use.md: approvals.mode (not security.approval_level); fix broken ./browser-use.md link to ./browser.md. - fallback-providers.md: top-level fallback_providers (not model.fallback_providers); the picker is subcommand-based, not modal. - api-server.md: API_SERVER_* are env vars — write to per-profile .env, not 'hermes config set' which targets YAML. - web-search.md: drop web_crawl as a registered tool (it isn't); deep-crawl modes are exposed through web_extract. - kanban.md: failure_limit default is 2, not '~5'. - plugins.md: drop hard-coded '33 providers' count. - honcho.md: fix unclosed quote in echo HONCHO_API_KEY snippet; document that 'hermes honcho' subcommand is gated on memory.provider=honcho; reconcile subcommand list with actual --help output. - memory-providers.md: legacy 'hermes honcho setup' redirect documented. Verified via 'npm run build' — site builds cleanly; broken-link count went from 149 to 146 (no regressions, fixed a few in passing). * docs: round 2 audit fixes + regenerate skill catalogs Follow-up to the previous commit on this branch: Round 2 manual fixes: - quickstart.md: KIMI_CODING_API_KEY mentioned alongside KIMI_API_KEY; voice-mode and ACP install commands rewritten — bare 'pip install ...' doesn't work for curl-installed setups (no pip on PATH, not in repo dir); replaced with 'cd ~/.hermes/hermes-agent && uv pip install -e ".[voice]"'. ACP already ships in [all] so the curl install includes it. - cli.md / configuration.md: 'auxiliary.compression.model' shown as 'google/gemini-3-flash-preview' (the doc's own claimed default); actual default is empty (= use main model). Reworded as 'leave empty (default) or pin a cheap model'. - built-in-plugins.md: added the bundled 'kanban/dashboard' plugin row that was missing from the table. Regenerated skill catalogs: - ran website/scripts/generate-skill-docs.py to refresh all 163 per-skill pages and both reference catalogs (skills-catalog.md, optional-skills-catalog.md). This adds the entries that were genuinely missing — productivity/teams-meeting-pipeline (bundled), optional/finance/* (entire category — 7 skills: 3-statement-model, comps-analysis, dcf-model, excel-author, lbo-model, merger-model, pptx-author), creative/hyperframes, creative/kanban-video-orchestrator, devops/watchers, productivity/shop-app, research/searxng-search, apple/macos-computer-use — and rewrites every other per-skill page from the current SKILL.md. Most diffs are tiny (one line of refreshed metadata). Validation: - 'npm run build' succeeded. - Broken-link count moved 146 -> 155 — the +9 are zh-Hans translation shells that lag every newly-added skill page (pre-existing pattern). No regressions on any en/ page.
238 lines
6.8 KiB
Markdown
238 lines
6.8 KiB
Markdown
---
|
||
title: "Simpo Training — Simple Preference Optimization for LLM alignment"
|
||
sidebar_label: "Simpo Training"
|
||
description: "Simple Preference Optimization for LLM alignment"
|
||
---
|
||
|
||
{/* This page is auto-generated from the skill's SKILL.md by website/scripts/generate-skill-docs.py. Edit the source SKILL.md, not this page. */}
|
||
|
||
# Simpo Training
|
||
|
||
Simple Preference Optimization for LLM alignment. Reference-free alternative to DPO with better performance (+6.4 points on AlpacaEval 2.0). No reference model needed, more efficient than DPO. Use for preference alignment when want simpler, faster training than DPO/PPO.
|
||
|
||
## Skill metadata
|
||
|
||
| | |
|
||
|---|---|
|
||
| Source | Optional — install with `hermes skills install official/mlops/simpo` |
|
||
| Path | `optional-skills/mlops/simpo` |
|
||
| Version | `1.0.0` |
|
||
| Author | Orchestra Research |
|
||
| License | MIT |
|
||
| Dependencies | `torch`, `transformers`, `datasets`, `trl`, `accelerate` |
|
||
| Platforms | linux, macos, windows |
|
||
| Tags | `Post-Training`, `SimPO`, `Preference Optimization`, `Alignment`, `DPO Alternative`, `Reference-Free`, `LLM Alignment`, `Efficient Training` |
|
||
|
||
## Reference: full SKILL.md
|
||
|
||
:::info
|
||
The following is the complete skill definition that Hermes loads when this skill is triggered. This is what the agent sees as instructions when the skill is active.
|
||
:::
|
||
|
||
# SimPO - Simple Preference Optimization
|
||
|
||
## Quick start
|
||
|
||
SimPO is a reference-free preference optimization method that outperforms DPO without needing a reference model.
|
||
|
||
**Installation**:
|
||
```bash
|
||
# Create environment
|
||
conda create -n simpo python=3.10 && conda activate simpo
|
||
|
||
# Install PyTorch 2.2.2
|
||
# Visit: https://pytorch.org/get-started/locally/
|
||
|
||
# Install alignment-handbook
|
||
git clone https://github.com/huggingface/alignment-handbook.git
|
||
cd alignment-handbook
|
||
python -m pip install .
|
||
|
||
# Install Flash Attention 2
|
||
python -m pip install flash-attn --no-build-isolation
|
||
```
|
||
|
||
**Training** (Mistral 7B):
|
||
```bash
|
||
ACCELERATE_LOG_LEVEL=info accelerate launch \
|
||
--config_file accelerate_configs/deepspeed_zero3.yaml \
|
||
scripts/run_simpo.py \
|
||
training_configs/mistral-7b-base-simpo.yaml
|
||
```
|
||
|
||
## Common workflows
|
||
|
||
### Workflow 1: Train from base model (Mistral 7B)
|
||
|
||
**Config** (`mistral-7b-base-simpo.yaml`):
|
||
```yaml
|
||
# Model
|
||
model_name_or_path: mistralai/Mistral-7B-v0.1
|
||
torch_dtype: bfloat16
|
||
|
||
# Dataset
|
||
dataset_mixer:
|
||
HuggingFaceH4/ultrafeedback_binarized: 1.0
|
||
dataset_splits:
|
||
- train_prefs
|
||
- test_prefs
|
||
|
||
# SimPO hyperparameters
|
||
beta: 2.0 # Reward scaling (2.0-10.0)
|
||
gamma_beta_ratio: 0.5 # Target margin (0-1)
|
||
loss_type: sigmoid # sigmoid or hinge
|
||
sft_weight: 0.0 # Optional SFT regularization
|
||
|
||
# Training
|
||
learning_rate: 5e-7 # Critical: 3e-7 to 1e-6
|
||
num_train_epochs: 1
|
||
per_device_train_batch_size: 1
|
||
gradient_accumulation_steps: 8
|
||
|
||
# Output
|
||
output_dir: ./outputs/mistral-7b-simpo
|
||
```
|
||
|
||
**Launch training**:
|
||
```bash
|
||
accelerate launch --config_file accelerate_configs/deepspeed_zero3.yaml \
|
||
scripts/run_simpo.py training_configs/mistral-7b-base-simpo.yaml
|
||
```
|
||
|
||
### Workflow 2: Fine-tune instruct model (Llama 3 8B)
|
||
|
||
**Config** (`llama3-8b-instruct-simpo.yaml`):
|
||
```yaml
|
||
model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
|
||
|
||
dataset_mixer:
|
||
argilla/ultrafeedback-binarized-preferences-cleaned: 1.0
|
||
|
||
beta: 2.5
|
||
gamma_beta_ratio: 0.5
|
||
learning_rate: 5e-7
|
||
sft_weight: 0.1 # Add SFT loss to preserve capabilities
|
||
|
||
num_train_epochs: 1
|
||
per_device_train_batch_size: 2
|
||
gradient_accumulation_steps: 4
|
||
output_dir: ./outputs/llama3-8b-simpo
|
||
```
|
||
|
||
**Launch**:
|
||
```bash
|
||
accelerate launch --config_file accelerate_configs/deepspeed_zero3.yaml \
|
||
scripts/run_simpo.py training_configs/llama3-8b-instruct-simpo.yaml
|
||
```
|
||
|
||
### Workflow 3: Reasoning-intensive tasks (lower LR)
|
||
|
||
**For math/code tasks**:
|
||
```yaml
|
||
model_name_or_path: deepseek-ai/deepseek-math-7b-base
|
||
|
||
dataset_mixer:
|
||
argilla/distilabel-math-preference-dpo: 1.0
|
||
|
||
beta: 5.0 # Higher for stronger signal
|
||
gamma_beta_ratio: 0.7 # Larger margin
|
||
learning_rate: 3e-7 # Lower LR for reasoning
|
||
sft_weight: 0.0
|
||
|
||
num_train_epochs: 1
|
||
per_device_train_batch_size: 1
|
||
gradient_accumulation_steps: 16
|
||
```
|
||
|
||
## When to use vs alternatives
|
||
|
||
**Use SimPO when**:
|
||
- Want simpler training than DPO (no reference model)
|
||
- Have preference data (chosen/rejected pairs)
|
||
- Need better performance than DPO
|
||
- Limited compute resources
|
||
- Single-node training sufficient
|
||
|
||
**Algorithm selection**:
|
||
- **SimPO**: Simplest, best performance, no reference model
|
||
- **DPO**: Need reference model baseline, more conservative
|
||
- **PPO**: Maximum control, need reward model, complex setup
|
||
- **GRPO**: Memory-efficient RL, no critic
|
||
|
||
**Use alternatives instead**:
|
||
- **OpenRLHF**: Multi-node distributed training, PPO/GRPO
|
||
- **TRL**: Need multiple methods in one framework
|
||
- **DPO**: Established baseline comparison
|
||
|
||
## Common issues
|
||
|
||
**Issue: Loss divergence**
|
||
|
||
Reduce learning rate:
|
||
```yaml
|
||
learning_rate: 3e-7 # Reduce from 5e-7
|
||
```
|
||
|
||
Reduce beta:
|
||
```yaml
|
||
beta: 1.0 # Reduce from 2.0
|
||
```
|
||
|
||
**Issue: Model forgets capabilities**
|
||
|
||
Add SFT regularization:
|
||
```yaml
|
||
sft_weight: 0.1 # Add SFT loss component
|
||
```
|
||
|
||
**Issue: Poor preference separation**
|
||
|
||
Increase beta and margin:
|
||
```yaml
|
||
beta: 5.0 # Increase from 2.0
|
||
gamma_beta_ratio: 0.8 # Increase from 0.5
|
||
```
|
||
|
||
**Issue: OOM during training**
|
||
|
||
Reduce batch size:
|
||
```yaml
|
||
per_device_train_batch_size: 1
|
||
gradient_accumulation_steps: 16 # Maintain effective batch
|
||
```
|
||
|
||
Enable gradient checkpointing:
|
||
```yaml
|
||
gradient_checkpointing: true
|
||
```
|
||
|
||
## Advanced topics
|
||
|
||
**Loss functions**: See [references/loss-functions.md](https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mlops/simpo/references/loss-functions.md) for sigmoid vs hinge loss, mathematical formulations, and when to use each.
|
||
|
||
**Hyperparameter tuning**: See [references/hyperparameters.md](https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mlops/simpo/references/hyperparameters.md) for beta, gamma, learning rate selection guide, and model-size-specific recommendations.
|
||
|
||
**Dataset preparation**: See [references/datasets.md](https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mlops/simpo/references/datasets.md) for preference data formats, quality filtering, and custom dataset creation.
|
||
|
||
## Hardware requirements
|
||
|
||
- **GPU**: NVIDIA A100/H100 recommended
|
||
- **VRAM**:
|
||
- 7B model: 1× A100 40GB (DeepSpeed ZeRO-3)
|
||
- 8B model: 2× A100 40GB
|
||
- 70B model: 8× A100 80GB
|
||
- **Single-node**: DeepSpeed ZeRO-3 sufficient
|
||
- **Mixed precision**: BF16 recommended
|
||
|
||
**Memory optimization**:
|
||
- DeepSpeed ZeRO-3 (default config)
|
||
- Gradient checkpointing
|
||
- Flash Attention 2
|
||
|
||
## Resources
|
||
|
||
- Paper: https://arxiv.org/abs/2405.14734 (NeurIPS 2024)
|
||
- GitHub: https://github.com/princeton-nlp/SimPO
|
||
- Models: https://huggingface.co/princeton-nlp
|
||
- Alignment Handbook: https://github.com/huggingface/alignment-handbook
|