rvpant commited on
Commit
b32ea24
·
1 Parent(s): 5a28824

Add toggle to disable match_letters assignment pass (default off) for isolation

Browse files
Files changed (2) hide show
  1. script.py +7 -1
  2. solver/pipeline.py +7 -2
script.py CHANGED
@@ -40,6 +40,11 @@ SYMBOLIC_ONLY = False
40
  # future submission cycle.
41
  LEAN_MODE = os.environ.get("IOL_LEAN", "0") == "1"
42
 
 
 
 
 
 
43
  # The eval sandbox has no internet; only go offline when loading local
44
  # weights so Colab testing with a Hub MODEL_ID still downloads normally.
45
  if MODEL_ID == "." or Path(MODEL_ID).exists():
@@ -102,7 +107,8 @@ def main(test_path: str = TEST_CSV, out_path: str = OUT_CSV) -> None:
102
  results = run_pipeline(rows, client, budget,
103
  llm_batch=LLM_BATCH, max_new_tokens=MAX_NEW_TOKENS,
104
  checkpoint=lambda rs: write_submission(rs, out_path),
105
- lean=LEAN_MODE)
 
106
  write_submission(results, out_path)
107
  print(f"wrote {out_path}: {len(results)} rows in {budget.elapsed():.1f}s",
108
  flush=True)
 
40
  # future submission cycle.
41
  LEAN_MODE = os.environ.get("IOL_LEAN", "0") == "1"
42
 
43
+ # MATCH_ASSIGNMENT (default False = disabled). When off, match_letters puzzles
44
+ # are answered by the normal free-form LLM pass. Off for now to isolate whether
45
+ # the assignment pass helped or hurt; flip on with IOL_MATCH_ASSIGN=1.
46
+ MATCH_ASSIGNMENT = os.environ.get("IOL_MATCH_ASSIGN", "0") == "1"
47
+
48
  # The eval sandbox has no internet; only go offline when loading local
49
  # weights so Colab testing with a Hub MODEL_ID still downloads normally.
50
  if MODEL_ID == "." or Path(MODEL_ID).exists():
 
107
  results = run_pipeline(rows, client, budget,
108
  llm_batch=LLM_BATCH, max_new_tokens=MAX_NEW_TOKENS,
109
  checkpoint=lambda rs: write_submission(rs, out_path),
110
+ lean=LEAN_MODE,
111
+ use_match_assignment=MATCH_ASSIGNMENT)
112
  write_submission(results, out_path)
113
  print(f"wrote {out_path}: {len(results)} rows in {budget.elapsed():.1f}s",
114
  flush=True)
solver/pipeline.py CHANGED
@@ -142,7 +142,8 @@ def run_pipeline(rows: Sequence[dict], client: Optional[LLMClient] = None,
142
  conf_keep: float = CONF_KEEP, llm_batch: int = LLM_BATCH,
143
  max_new_tokens: Optional[int] = None,
144
  checkpoint: Optional[Callable[[List["PuzzleResult"]], None]] = None,
145
- lean: bool = False
 
146
  ) -> List[PuzzleResult]:
147
  """`checkpoint`, when given, is called with the (complete, valid) results
148
  after the symbolic pass and after every LLM batch — so a crash at ANY
@@ -205,7 +206,11 @@ def run_pipeline(rows: Sequence[dict], client: Optional[LLMClient] = None,
205
  # (scores ~0). Solve it as an assignment from the model's own distribution
206
  # instead. Solved puzzles get high confidence so the free-form LLM pass
207
  # skips them; a declined puzzle falls through to that pass unchanged.
208
- if getattr(client, "can_score", False):
 
 
 
 
209
  n_assigned = 0
210
  for i, p in enumerate(puzzles):
211
  if p is None or p.task_type != "match_letters" or budget.exhausted():
 
142
  conf_keep: float = CONF_KEEP, llm_batch: int = LLM_BATCH,
143
  max_new_tokens: Optional[int] = None,
144
  checkpoint: Optional[Callable[[List["PuzzleResult"]], None]] = None,
145
+ lean: bool = False,
146
+ use_match_assignment: bool = True
147
  ) -> List[PuzzleResult]:
148
  """`checkpoint`, when given, is called with the (complete, valid) results
149
  after the symbolic pass and after every LLM batch — so a crash at ANY
 
206
  # (scores ~0). Solve it as an assignment from the model's own distribution
207
  # instead. Solved puzzles get high confidence so the free-form LLM pass
208
  # skips them; a declined puzzle falls through to that pass unchanged.
209
+ # Gated by use_match_assignment: when off, match_letters puzzles go through
210
+ # the normal free-form LLM pass (used to isolate this pass's effect).
211
+ if not use_match_assignment:
212
+ log("match_letters assignment pass disabled; using free-form LLM path")
213
+ if use_match_assignment and getattr(client, "can_score", False):
214
  n_assigned = 0
215
  for i, p in enumerate(puzzles):
216
  if p is None or p.task_type != "match_letters" or budget.exhausted():