{"data":{"kind":"file","path":"README.md","version_id":"n9fzhlgv2h9rdldugnc16wao","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2759,"modified_at":"2026-02-19T09:34:23.726000","content_hash":"bde0f3efa36fd533f46dda26c78a09561d9aabca8f9ce30f52aa9392e6799b9e"},"entries":[],"content":"# slop-guard-env\n\nRL environment that uses [slop-guard](https://github.com/eric-tramel/slop-guard) by [Eric Tramel](https://eric-tramel.github.io/) as a continuous reward signal for training models to produce less formulaic prose.\n\n### Overview\n- **Environment ID**: `slop-guard-env`\n- **Type**: single-turn\n- **Reward range**: 0.0–1.0 (continuous)\n- **Tags**: creative-writing, rule-based, anti-slop\n\n### How it works\n\nThe model receives a prose-generation prompt and must produce a substantial written response. The response is scored by two weighted reward components:\n\n1. **slop-guard score** (weight: 0.8) — Runs ~80 compiled regex rules across 6 categories (vocabulary, phrases, structural patterns, tone markers, rhythm, syntactic repetition). Produces a continuous 0–100 score via exponential decay over violation density per 1,000 words, normalized to 0.0–1.0. Violations in \"Claude categories\" (contrast pairs, pithy fragments, setup-resolution) receive concentration amplification.\n\n2. **length gate** (weight: 0.2) — Linear ramp from 0.0 to 1.0 as word count reaches 300. Prevents the model from gaming slop-guard by writing trivially short outputs.\n\n### Why slop-guard over other approaches\n\n| Property | slop-guard | Coarse regex (e.g. existing antislop env) | LLM judge |\n|---|---|---|---|\n| Score granularity | Continuous 0–100 | Integer 0–15 | Varies |\n| Length normalization | Density per 1k words | Raw hit counts | N/A |\n| Concentration penalty | Exponential compounding | None | N/A |\n| Determinism | Fully deterministic | Fully deterministic | Non-deterministic |\n| Latency | Milliseconds | Milliseconds | Seconds |\n| Gameability | Hard (many orthogonal rules) | Easier (few coarse buckets) | Moderate |\n\n### Quickstart\n\n```bash\nuv run vf-eval slop_guard_env\n```\n\nConfigure model and sampling:\n```bash\nuv run vf-eval slop_guard_env -m gpt-4.1-mini -n 20 -r 3 -t 1024 -T 0.7\n```\n\n### Environment Arguments\n\n| Arg | Type | Default | Description |\n| --- | ---- | ------- | ----------- |\n| `use_think` | bool | `False` | Enable ThinkParser for chain-of-thought; slop-guard scores only the answer portion |\n| `slop_weight` | float | `0.8` | Weight for the slop-guard reward component |\n| `length_weight` | float | `0.2` | Weight for the length reward component |\n\n### Metrics\n\n| Metric | Meaning |\n| ------ | ------- |\n| `slop_guard_reward` | slop-guard score normalized to 0.0–1.0 (higher = cleaner prose) |\n| `length_reward` | Word count ramp, 0.0–1.0 |\n| `reward` | Weighted sum of the above |\n\n### Attribution\n\nThe slop-guard analysis engine (`slop_guard.py`) is vendored from [eric-tramel/slop-guard](https://github.com/eric-tramel/slop-guard) under the MIT License. See `LICENSE.slop-guard` for the full license text.\n","encoding":"utf-8","truncated":false,"total_bytes":2759},"status":null}