| """Handicate self-refinement trainer -- central config.""" | |
| import os | |
| # --- base policy model (the thing that improves) --- | |
| BASE_MODEL = os.environ.get("HANDICATE_BASE", "Qwen/Qwen2.5-3B-Instruct") | |
| # swap to "Qwen/Qwen2.5-Coder-7B-Instruct" for more code/system muscle (slower RL) | |
| # --- judge / critic model (rates responses + writes criticism) --- | |
| # Can be the same family (cheap) or a stronger model for better grading. | |
| JUDGE_MODEL = os.environ.get("HANDICATE_JUDGE", "Qwen/Qwen2.5-7B-Instruct") | |
| # --- Hub repos --- | |
| HF_USER = "AmongTheCouch23" | |
| MODEL_REPO = f"{HF_USER}/handicate-policy" # the refined weights | |
| SEED_PROMPTS_REPO = f"{HF_USER}/handicate-prompts" # task prompts to train on | |
| # --- web corpus the curator streams ("internet data at scale", pre-filtered) --- | |
| CORPUS_DATASET = os.environ.get("HANDICATE_CORPUS", "HuggingFaceFW/fineweb-edu") | |
| CORPUS_CONFIG = os.environ.get("HANDICATE_CORPUS_CONFIG", "sample-10BT") | |
| # --- refinement loop budget / knobs (env-overridable for smoke runs) --- | |
| ROUNDS = int(os.environ.get("HANDICATE_ROUNDS", "5")) | |
| GRPO_NUM_GENERATIONS = int(os.environ.get("HANDICATE_NUMGEN", "8")) # candidates per prompt | |
| GRPO_STEPS_PER_ROUND = int(os.environ.get("HANDICATE_STEPS", "200")) | |
| CURATE_PER_ROUND = int(os.environ.get("HANDICATE_CURATE", "200")) # web docs kept each round | |
| ACCEPT_THRESHOLD = float(os.environ.get("HANDICATE_ACCEPT", "0.7")) # judge score to accept | |
| REPLAY_FRACTION = 0.15 # small real-data replay kept to fight forgetting | |
| # --- the "weighted not stored" rule --- | |
| # Accepted knowledge is DISTILLED INTO WEIGHTS (LoRA), then raw data is DISCARDED. | |
| # Only weights + a tiny replay buffer + the frozen eval set persist on disk. | |
| DISCARD_RAW_AFTER_DISTILL = True | |
| # --- collapse guard --- | |
| # A round is KEPT only if it does not regress on this frozen, human-grounded eval. | |
| EVAL_SET = "data/eval_heldout.jsonl" # NEVER generated/rated by the AI itself | |
| EVAL_REGRESS_TOLERANCE = 0.0 # require >= previous score to keep a round | |
| # --- LoRA --- | |
| LORA_R = 16 | |
| LORA_ALPHA = 32 | |
| LEARNING_RATE = 1e-5 | |
| SEED = 42 | |