DriftEnv Build Progress Log
Apr 25 evening session β full summary
Completed (all on branch multi-reward-v2, NOT merged to main)
Multi-reward decomposition (server/app.py)
- Replaced single
_score()with 4 independent reward components:R_format(0.1) β penalises verbose responses (>200 chars = 0.5, >500 = 0)R_interpretation(0.3) β keyword overlap withhidden_interpretationR_pivot(0.4) β keyword overlap withcorrect_pivot+ lexical distance from step-1 responseR_no_stale(0.2) β penalises wrong-pivot echoes and step-1 repetition
- Weighted total:
0.1Β·format + 0.3Β·interp + 0.4Β·pivot + 0.2Β·no_stale -
prev_responsestracked in_statefor pivot/no_stale scoring - All 4 components logged in
info["rewards"]per step β training plots ready
Anti-keyword-hack patch (server/app.py)
-
_extract_unique_keywords(target, exclusion)β strips words visible ininitial_instruction+context_shiftfrom keyword pools - Closes echo exploit: agent cannot game score by copying instruction words
- Verified: v1 overall 0.436 β v2 overall 0.456 (+0.020), no reward sparsity
Holdout split (server/dataset.json, server/app.py, inference.py)
- 5 holdout scenarios tagged
"holdout": trueβ IDs 1, 3, 7, 14, 20 (one per domain, cleanest drift signals) - Remaining 20 scenarios tagged
"holdout": false -
reset(holdout_only=False)β default, samples from 20 training scenarios only -
reset(holdout_only=True)β samples from 5 holdout scenarios only -
HOLDOUT_ONLYenv var ininference.pytoggles eval mode - Zero leakage verified (10 default resets, 20 holdout resets)
Baseline files (samples/)
-
samples/baseline_local.jsonβ dumb agent / 401 fallback, overall ~0.278 -
samples/baseline_local_v2.txtβ after anti-hack patch, overall 0.456 -
samples/baseline_train_v3.txtβ training set (20 scenarios), overall 0.327 -
samples/baseline_holdout_v3.txtβ holdout set (5 scenarios), overall ~0.378β0.429
Training notebook (training/driftenv_grpo_training.ipynb)
- 22-cell stub at
training/driftenv_grpo_training.ipynb - Cells 1β4: title, installs, imports, config + Space pre-warm
- Cells 5β6: Unsloth model load + LoRA (4-bit, rank-16, Qwen2.5 target modules)
- Cells 7β8: DriftEnv HTTP client (
reset_env,step_env,holdout_onlysupport) - Cells 9β10: rollout/reward function stub (
for_inferencereminder included) β FILL IN - Cells 11β12:
GRPOConfig(max_steps=150, batch 4, num_generations 4) - Cells 13β14: prompt dataset builder stub β FILL IN
- Cells 15β16:
GRPOTrainer+trainer.train()(commented out until 10+14 done) - Cells 17β18: LoRA adapter save +
push_to_hub - Cells 19β20: holdout eval stub, 3-number comparison β FILL IN
- Cells 21β22: matplotlib stubs β reward curves + before/after bar chart
README (README.md)
- HF Spaces frontmatter preserved
- Technical sections filled in (reward table, training details, quickstart)
- Narrative sections left as
<!-- WRITE THIS -->β Hariharan writes those - Plot embeds reference
assets/before_after.pngandassets/reward_curves.png - Results table has 72B reference (0.378) β trained/untrained 1.5B filled tomorrow
Baseline summary (untrained Qwen 72B, multi-reward-v2 env + anti-hack patch)
| split | easy | medium | hard | overall |
|---|---|---|---|---|
| training (20 scenarios) | 0.200 | 0.397 | 0.385 | 0.327 |
| holdout (5 scenarios) | 0.307 | 0.370 | 0.611 | ~0.378β0.429 |
Best single step: holdout hard step 2 = 0.81 (scenario 20, serverless pivot)
Branch state
mainβ untouched, 1 commit (original v1), HF Space serving v1multi-reward-v2β 9 commits ahead of main, all tonight's work
Files changed tonight
server/app.pyβ multi-reward + anti-hack + holdout_onlyserver/dataset.jsonβ holdout flags on all 25 scenariosinference.pyβ HOLDOUT_ONLY env vartraining/driftenv_grpo_training.ipynbβ 22-cell notebook stubREADME.mdβ scaffolded with technical sectionssamples/β 4 baseline filesassets/β directory created (plots added tomorrow)PROGRESS.mdβ this file
Files NOT changed
mainbranch β untouchedinference.pyLLM target β still Qwen 72B (fine for baselines)
Apr 26 β tomorrow's plan
First action (8 AM)
Open training/driftenv_grpo_training.ipynb in Google Colab.
Set runtime to T4 (free). Do NOT use A10G until dry run passes.
Critical cells to fill before running
- Cell 10 β
driftenv_reward_fn: callstep_env, unpackinfo["rewards"], return scalar, append toreward_log - Cell 14 β
build_prompt_dataset: loopreset_env(holdout_only=False), format observation as prompt, returnDataset - Cell 20 β
eval_on_holdout: run both untrained and trained model against holdout scenarios, collect 4 components, save JSON
Dry run checklist (T4, max_steps=3)
- Cell 2 installs complete without error
- Cell 6 prints trainable params (~10β15M)
- Cell 8 smoke test returns an instruction
- Cell 16 completes 3 steps, reward is non-zero float, no NaN
-
reward_loghas 3 entries after dry run
After dry run passes β switch to A10G
- Change
max_steps=150, re-run cells AβF - Set phone timer, monitor every 30 min
- Stop if reward flat for 20+ steps β debug on T4
Three numbers to record on holdout set
- Untrained Qwen 1.5B (run before training,
HOLDOUT_ONLY=true) - Trained Qwen 1.5B β the headline metric
- Qwen 72B reference: ~0.378 (already recorded)
Submission checklist (target: 4:30 PM hard stop)
-
assets/reward_curves.pngcommitted -
assets/before_after.pngcommitted - README narrative sections written (hook, problem, what we learned)
- README results table filled (3 numbers)
- README links added (HF Hub adapter, Colab, YouTube)
- Demo video recorded and uploaded (90 sec)
-
multi-reward-v2merged tomain - HF Space rebuilt and live
- Submission form submitted by 4:30 PM