feat(sleep): opt-in llm_dream mode for LLM-generated dream variants - #244
feat(sleep): opt-in llm_dream mode for LLM-generated dream variants#244Bogdan (Dan) Baciu (bogdanbaciu21) wants to merge 1 commit into
Conversation
Add llm_dream (default off). When enabled, the optimizer writes paraphrase-only variants; parent reference and judge are copied unchanged. Parse or fidelity failure falls back to the existing wrappers, so template mode stays byte-identical and a night can degrade but not break. Generated variants are train-only.
|
Thanks for making LLM dream generation opt-in and retaining a fallback. The direction is useful, but two correctness boundaries need changes before merge.
Please add regressions proving that only the optimizer backend is called; that target counters/credentials remain untouched; that contradictory or constraint-removing generations fall back to the original/template intent; and that duplicate/malformed generations are rejected. Before enabling this as a training-data feature, please also provide a small recorded or opt-in live end-to-end result with generation acceptance/fallback rate, token cost, and held-out non-regression (ideally lift). The existing lexical-diversity fixture uses author-written strings and does not validate the behavior or practical effect of the live generation path. |
feat(sleep): opt-in llm_dream mode for LLM-generated dream variants
What Problem This Solves
Resolves a limitation where Sleep's synthetic augmentation can only re-wrap harvested task intents through three hardcoded templates (
_WRAPPERSindream.py), so dream diversity is capped at surface phrasing and every dream inherits the exact structure of existing data.Why This Change Was Made
An opt-in
llm_dreammode asks the optimizer model to write paraphrase-only variants of each real task. Parentreferenceandjudgeare copied unchanged, so the variant stays on the same success criteria as the seed. Template mode remains the default and byte-identical. On parse failure, fidelity failure, a missing generator, or a backend exception, the mode falls back deterministically to the existing wrappers and recordsllm_dream_fallbackinevidence.jsonl, so a night can degrade but not break.v1 is paraphrase-only on purpose. Dream variants copy the parent's gold and judge, so a constraint-changing rewrite would create mislabeled training data. Constraint perturbations are deferred until judge propagation is redesigned.
Self-generated data has a documented collapse failure mode. The mitigation here is structural: generated variants are train-only (
split='train',origin='dream'), never enter val/test, and the gate still scores candidates only on real held-out tasks.Built on upstream
mainatda06b15(includes #235).Project Fit
llm_dreamoff see zero change.User Impact
Operators can set
llm_dream: trueto trade offline tokens for richer training paraphrases. Operators who do nothing see zero change: the default staysfalse, template dreams stay byte-identical, and no extra backend calls run.Proof
Before (stock
mainatda06b15):dream_augment()can only emit the three hardcoded wrappers. There is nollm_dreamconfig key, no paraphrase prompt, and no fallback event.After (this pull request, head
2dd30f1d51621ad193cffeb10be0b0a5816a3175):Pinned by tests: default wrappers unchanged when
llm_dreamis off; valid paraphrases are used and taggedllm_dream; parse, fidelity, exception, and missing-generator paths fall back to the same wrappers; fallback is deterministic; generated variants are alwayssplit='train'; val intents are not sent to the generator duringdream_consolidate; config default isfalse.Academic Support
Testing
New:
tests/test_llm_dream.py, 15 tests pinning default wrappers, parse and fidelity gates, fallback determinism, split hygiene, config default-off, and fixture-level diversity. Full suite:uv run pytest -q(orpython -m pytest -q).Limitations & Negative Results
Reproduce It Yourself
Check out this pull request's commits and run:
Equivalent without uv:
python -m venv .venv && ./.venv/bin/python -m pip install -e ".[dev]"then the same pytest commands through that interpreter.