feat(sleep): opt-in llm_dream mode for LLM-generated dream variants - #244
Open
Bogdan (Dan) Baciu (bogdanbaciu21) wants to merge 1 commit into
Open
feat(sleep): opt-in llm_dream mode for LLM-generated dream variants#244Bogdan (Dan) Baciu (bogdanbaciu21) wants to merge 1 commit into
Bogdan (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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.