Spaces:
Sleeping
Sleeping
Switch Space trainer defaults to math_conjecture_sota profile and remove DeepSeek references
Browse files- README.md +5 -3
- VALIDATION_LOG.md +1 -1
- app.py +7 -12
- configs/math_conjecture_sota.yaml +151 -0
- configs/{deepseek_math_sota.yaml → qwen25_math_sota.yaml} +29 -30
- scripts/eval_sota.py +1 -1
- scripts/preflight_check.py +1 -1
- scripts/train_sota.py +2 -2
README.md
CHANGED
|
@@ -11,7 +11,7 @@ emoji: 🧮
|
|
| 11 |
|
| 12 |
# Math Conjecture Command Center
|
| 13 |
|
| 14 |
-
An autonomous training app for
|
| 15 |
|
| 16 |
The UI now uses a dark graphite command-center aesthetic with tactical green/cyan telemetry accents, higher-contrast cards, and mobile-friendly stacking while preserving the existing training controls.
|
| 17 |
|
|
@@ -23,7 +23,7 @@ This Space is the training app for `maths-conjuncture-solutions` and is wired to
|
|
| 23 |
## End-to-end flow
|
| 24 |
|
| 25 |
1. Download released parquet splits (`train/validation/test`).
|
| 26 |
-
2. Build runtime config from `configs/
|
| 27 |
3. Run 4-stage curriculum LoRA fine-tuning with `scripts/train_sota.py`.
|
| 28 |
4. Run post-train evaluation (`pass@1`, `pass@k`, exact/boxed, family metrics).
|
| 29 |
5. Apply quality gate thresholds before hub push.
|
|
@@ -48,7 +48,7 @@ Credentials and publish permissions are handled by deployment runtime settings.
|
|
| 48 |
|
| 49 |
## Artifacts
|
| 50 |
|
| 51 |
-
- runtime config: `workspace/runtime/
|
| 52 |
- run output root: `workspace/runs/math-conjecture-sota`
|
| 53 |
- final adapter: `workspace/runs/math-conjecture-sota/final_adapter`
|
| 54 |
- training summary: `workspace/runs/math-conjecture-sota/training_summary.json`
|
|
@@ -59,6 +59,8 @@ Credentials and publish permissions are handled by deployment runtime settings.
|
|
| 59 |
## Notes
|
| 60 |
|
| 61 |
- Full training runs on GPU when available and automatically falls back to CPU mode when CUDA is unavailable.
|
|
|
|
|
|
|
| 62 |
- App handles Gradio copy-button compatibility across versions automatically.
|
| 63 |
- The interface is optimized to stay legible on mobile, with telemetry cards collapsing into a single-column stack.
|
| 64 |
|
|
|
|
| 11 |
|
| 12 |
# Math Conjecture Command Center
|
| 13 |
|
| 14 |
+
An autonomous training app for Lean-aware and math-reasoning base models that runs multi-stage curriculum fine-tuning on Space GPU, executes post-training quality evaluation, and publishes only qualified adapters, checkpoints, and run reports to your Hugging Face model repository.
|
| 15 |
|
| 16 |
The UI now uses a dark graphite command-center aesthetic with tactical green/cyan telemetry accents, higher-contrast cards, and mobile-friendly stacking while preserving the existing training controls.
|
| 17 |
|
|
|
|
| 23 |
## End-to-end flow
|
| 24 |
|
| 25 |
1. Download released parquet splits (`train/validation/test`).
|
| 26 |
+
2. Build runtime config from `configs/math_conjecture_sota.yaml` (default answered-conjecture solver profile).
|
| 27 |
3. Run 4-stage curriculum LoRA fine-tuning with `scripts/train_sota.py`.
|
| 28 |
4. Run post-train evaluation (`pass@1`, `pass@k`, exact/boxed, family metrics).
|
| 29 |
5. Apply quality gate thresholds before hub push.
|
|
|
|
| 48 |
|
| 49 |
## Artifacts
|
| 50 |
|
| 51 |
+
- runtime config: `workspace/runtime/math_conjecture_sota.runtime.yaml`
|
| 52 |
- run output root: `workspace/runs/math-conjecture-sota`
|
| 53 |
- final adapter: `workspace/runs/math-conjecture-sota/final_adapter`
|
| 54 |
- training summary: `workspace/runs/math-conjecture-sota/training_summary.json`
|
|
|
|
| 59 |
## Notes
|
| 60 |
|
| 61 |
- Full training runs on GPU when available and automatically falls back to CPU mode when CUDA is unavailable.
|
| 62 |
+
- Default SOTA profile uses `Qwen/Qwen2.5-Math-7B-Instruct` for answered-conjecture solving and Lean/formal-proof alignment.
|
| 63 |
+
- Alternate SOTA profile `configs/qwen25_math_sota.yaml` targets `Qwen/Qwen2.5-Math-7B-Instruct`.
|
| 64 |
- App handles Gradio copy-button compatibility across versions automatically.
|
| 65 |
- The interface is optimized to stay legible on mobile, with telemetry cards collapsing into a single-column stack.
|
| 66 |
|
VALIDATION_LOG.md
CHANGED
|
@@ -11,7 +11,7 @@ Reviewed the full `space_trainer/` implementation surface used by the Hugging Fa
|
|
| 11 |
- `space_trainer/PRODUCTION.md`
|
| 12 |
- `space_trainer/.env.example`
|
| 13 |
- `space_trainer/requirements.txt`
|
| 14 |
-
- `space_trainer/configs/
|
| 15 |
- `space_trainer/scripts/preflight_check.py`
|
| 16 |
- `space_trainer/scripts/train_sota.py`
|
| 17 |
- `space_trainer/scripts/eval_sota.py`
|
|
|
|
| 11 |
- `space_trainer/PRODUCTION.md`
|
| 12 |
- `space_trainer/.env.example`
|
| 13 |
- `space_trainer/requirements.txt`
|
| 14 |
+
- `space_trainer/configs/math_conjecture_sota.yaml`
|
| 15 |
- `space_trainer/scripts/preflight_check.py`
|
| 16 |
- `space_trainer/scripts/train_sota.py`
|
| 17 |
- `space_trainer/scripts/eval_sota.py`
|
app.py
CHANGED
|
@@ -36,7 +36,7 @@ HF_HOME_DIR = WORKSPACE_DIR / ".hf_home"
|
|
| 36 |
HF_DATASETS_CACHE_DIR = HF_HOME_DIR / "datasets"
|
| 37 |
HF_HUB_CACHE_DIR = HF_HOME_DIR / "hub"
|
| 38 |
|
| 39 |
-
CONFIG_TEMPLATE = ROOT / "configs" / "
|
| 40 |
TRAIN_SCRIPT = ROOT / "scripts" / "train_sota.py"
|
| 41 |
EVAL_SCRIPT = ROOT / "scripts" / "eval_sota.py"
|
| 42 |
TRAIN_OUTPUT_DIR = WORKSPACE_DIR / "runs" / "math-conjecture-sota"
|
|
@@ -126,8 +126,8 @@ DEFAULT_AUTO_PUSH_TO_HUB = bool(TEMPLATE_HUB.get("push_to_hub", True))
|
|
| 126 |
DEFAULT_MODEL_ARCH_FALLBACK = (os.environ.get("MODEL_ARCH_FALLBACK_BASE_MODEL") or "Qwen/Qwen2.5-0.5B-Instruct").strip()
|
| 127 |
MODEL_ARCH_ERROR_MARKERS = (
|
| 128 |
"does not recognize this architecture",
|
| 129 |
-
"KeyError: '
|
| 130 |
-
"model
|
| 131 |
)
|
| 132 |
|
| 133 |
|
|
@@ -137,7 +137,7 @@ PROJECT_DESCRIPTION = """
|
|
| 137 |
This app runs the full training pipeline for the `maths-conjuncture-solutions` stack:
|
| 138 |
|
| 139 |
1. Pull parquet splits from `NorthernTribe-Research/math-conjecture-training-corpus`.
|
| 140 |
-
2. Build runtime config from `configs/
|
| 141 |
3. Execute staged LoRA curriculum via `scripts/train_sota.py`.
|
| 142 |
4. Run post-training evaluation and read quality gate outcomes.
|
| 143 |
5. Push artifacts only when policy/gates allow.
|
|
@@ -165,17 +165,12 @@ APP_HEADER_HTML = """
|
|
| 165 |
<span>Hub Publish</span>
|
| 166 |
</div>
|
| 167 |
</div>
|
| 168 |
-
<aside class="mono-hero-panel">
|
| 169 |
-
<div class="mono-hero-panel-label">Mission Posture</div>
|
| 170 |
-
<div class="mono-hero-panel-value">Defense-tech telemetry</div>
|
| 171 |
-
<div class="mono-hero-panel-copy">Dark graphite shell, tactical green/cyan accents, high-contrast run state cards, and mobile-first operator controls.</div>
|
| 172 |
-
</aside>
|
| 173 |
</div>
|
| 174 |
</section>
|
| 175 |
"""
|
| 176 |
|
| 177 |
APP_FOOTER_HTML = """
|
| 178 |
-
<footer class="mono-footer">
|
| 179 |
"""
|
| 180 |
|
| 181 |
UI_CSS = r"""
|
|
@@ -1681,7 +1676,7 @@ def write_runtime_config(
|
|
| 1681 |
cfg["quality_gate"]["min_pass_at_k"] = float(gate_min_pass_at_k)
|
| 1682 |
cfg["quality_gate"]["require_post_eval"] = bool(enforce_quality_gate and run_eval)
|
| 1683 |
|
| 1684 |
-
runtime_path = RUNTIME_DIR / "
|
| 1685 |
runtime_path.write_text(yaml.safe_dump(cfg, sort_keys=False), encoding="utf-8")
|
| 1686 |
return runtime_path
|
| 1687 |
|
|
@@ -2420,7 +2415,7 @@ with gr.Blocks(title="Math Conjecture Command Center") as demo:
|
|
| 2420 |
)
|
| 2421 |
base_model_id = gr.Textbox(
|
| 2422 |
label="Base Model ID",
|
| 2423 |
-
value="
|
| 2424 |
)
|
| 2425 |
|
| 2426 |
with gr.Row():
|
|
|
|
| 36 |
HF_DATASETS_CACHE_DIR = HF_HOME_DIR / "datasets"
|
| 37 |
HF_HUB_CACHE_DIR = HF_HOME_DIR / "hub"
|
| 38 |
|
| 39 |
+
CONFIG_TEMPLATE = ROOT / "configs" / "math_conjecture_sota.yaml"
|
| 40 |
TRAIN_SCRIPT = ROOT / "scripts" / "train_sota.py"
|
| 41 |
EVAL_SCRIPT = ROOT / "scripts" / "eval_sota.py"
|
| 42 |
TRAIN_OUTPUT_DIR = WORKSPACE_DIR / "runs" / "math-conjecture-sota"
|
|
|
|
| 126 |
DEFAULT_MODEL_ARCH_FALLBACK = (os.environ.get("MODEL_ARCH_FALLBACK_BASE_MODEL") or "Qwen/Qwen2.5-0.5B-Instruct").strip()
|
| 127 |
MODEL_ARCH_ERROR_MARKERS = (
|
| 128 |
"does not recognize this architecture",
|
| 129 |
+
"KeyError: 'unsupported_model_architecture'",
|
| 130 |
+
"unsupported model architecture type",
|
| 131 |
)
|
| 132 |
|
| 133 |
|
|
|
|
| 137 |
This app runs the full training pipeline for the `maths-conjuncture-solutions` stack:
|
| 138 |
|
| 139 |
1. Pull parquet splits from `NorthernTribe-Research/math-conjecture-training-corpus`.
|
| 140 |
+
2. Build runtime config from `configs/math_conjecture_sota.yaml`.
|
| 141 |
3. Execute staged LoRA curriculum via `scripts/train_sota.py`.
|
| 142 |
4. Run post-training evaluation and read quality gate outcomes.
|
| 143 |
5. Push artifacts only when policy/gates allow.
|
|
|
|
| 165 |
<span>Hub Publish</span>
|
| 166 |
</div>
|
| 167 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
</div>
|
| 169 |
</section>
|
| 170 |
"""
|
| 171 |
|
| 172 |
APP_FOOTER_HTML = """
|
| 173 |
+
<footer class="mono-footer">NorthernTribe Research © 2026</footer>
|
| 174 |
"""
|
| 175 |
|
| 176 |
UI_CSS = r"""
|
|
|
|
| 1676 |
cfg["quality_gate"]["min_pass_at_k"] = float(gate_min_pass_at_k)
|
| 1677 |
cfg["quality_gate"]["require_post_eval"] = bool(enforce_quality_gate and run_eval)
|
| 1678 |
|
| 1679 |
+
runtime_path = RUNTIME_DIR / "math_conjecture_sota.runtime.yaml"
|
| 1680 |
runtime_path.write_text(yaml.safe_dump(cfg, sort_keys=False), encoding="utf-8")
|
| 1681 |
return runtime_path
|
| 1682 |
|
|
|
|
| 2415 |
)
|
| 2416 |
base_model_id = gr.Textbox(
|
| 2417 |
label="Base Model ID",
|
| 2418 |
+
value="Qwen/Qwen2.5-Math-7B-Instruct",
|
| 2419 |
)
|
| 2420 |
|
| 2421 |
with gr.Row():
|
configs/math_conjecture_sota.yaml
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
global:
|
| 2 |
+
output_root: workspace/runs/math-conjecture-sota
|
| 3 |
+
seed: 17
|
| 4 |
+
|
| 5 |
+
model:
|
| 6 |
+
base_model: Qwen/Qwen2.5-Math-7B-Instruct
|
| 7 |
+
trust_remote_code: false
|
| 8 |
+
use_bf16: true
|
| 9 |
+
load_in_4bit: true
|
| 10 |
+
bnb_4bit_quant_type: nf4
|
| 11 |
+
bnb_4bit_use_double_quant: true
|
| 12 |
+
attn_implementation: null
|
| 13 |
+
lora:
|
| 14 |
+
r: 96
|
| 15 |
+
alpha: 192
|
| 16 |
+
dropout: 0.05
|
| 17 |
+
bias: none
|
| 18 |
+
target_modules:
|
| 19 |
+
- q_proj
|
| 20 |
+
- k_proj
|
| 21 |
+
- v_proj
|
| 22 |
+
- o_proj
|
| 23 |
+
- gate_proj
|
| 24 |
+
- up_proj
|
| 25 |
+
- down_proj
|
| 26 |
+
|
| 27 |
+
data:
|
| 28 |
+
default_train_file: workspace/data/releases/v1/train.parquet
|
| 29 |
+
default_validation_file: workspace/data/releases/v1/validation.parquet
|
| 30 |
+
prompt_field: prompt
|
| 31 |
+
target_field: target
|
| 32 |
+
final_answer_field: final_answer
|
| 33 |
+
proof_field: proof_formal
|
| 34 |
+
sample_weight_field: sample_weight
|
| 35 |
+
max_seq_length: 4096
|
| 36 |
+
min_loss_weight: 0.25
|
| 37 |
+
max_loss_weight: 6.0
|
| 38 |
+
family_boost:
|
| 39 |
+
conjecture_core: 3.0
|
| 40 |
+
formal_proof: 2.7
|
| 41 |
+
competition: 1.2
|
| 42 |
+
structured_reasoning: 1.1
|
| 43 |
+
system_prompt: |
|
| 44 |
+
You are NorthernTribe Research's math-conjecture solver model.
|
| 45 |
+
Prioritize solved-conjecture answer recovery, proof-quality reasoning,
|
| 46 |
+
and evidence-grounded uncertainty. Never claim a proof unless it is fully
|
| 47 |
+
supported by explicit assumptions or known cited results.
|
| 48 |
+
|
| 49 |
+
training_defaults:
|
| 50 |
+
per_device_train_batch_size: 1
|
| 51 |
+
per_device_eval_batch_size: 1
|
| 52 |
+
gradient_accumulation_steps: 24
|
| 53 |
+
weight_decay: 0.01
|
| 54 |
+
warmup_ratio: 0.03
|
| 55 |
+
lr_scheduler_type: cosine
|
| 56 |
+
max_grad_norm: 1.0
|
| 57 |
+
gradient_checkpointing: true
|
| 58 |
+
logging_steps: 10
|
| 59 |
+
save_steps: 350
|
| 60 |
+
eval_steps: 350
|
| 61 |
+
save_total_limit: 3
|
| 62 |
+
dataloader_num_workers: 2
|
| 63 |
+
|
| 64 |
+
stages:
|
| 65 |
+
- name: solved_corpus_bootstrap
|
| 66 |
+
max_train_samples: 240000
|
| 67 |
+
max_eval_samples: 4500
|
| 68 |
+
filters:
|
| 69 |
+
include_families:
|
| 70 |
+
- competition
|
| 71 |
+
- structured_reasoning
|
| 72 |
+
- formal_proof
|
| 73 |
+
- conjecture_core
|
| 74 |
+
training:
|
| 75 |
+
num_train_epochs: 1
|
| 76 |
+
learning_rate: 2.0e-5
|
| 77 |
+
|
| 78 |
+
- name: conjecture_answer_alignment
|
| 79 |
+
max_train_samples: 110000
|
| 80 |
+
max_eval_samples: 3000
|
| 81 |
+
filters:
|
| 82 |
+
include_families:
|
| 83 |
+
- conjecture_core
|
| 84 |
+
- formal_proof
|
| 85 |
+
min_sample_weight: 2.0
|
| 86 |
+
training:
|
| 87 |
+
num_train_epochs: 2
|
| 88 |
+
learning_rate: 8.0e-6
|
| 89 |
+
save_steps: 220
|
| 90 |
+
eval_steps: 220
|
| 91 |
+
|
| 92 |
+
- name: formal_consistency_refinement
|
| 93 |
+
max_train_samples: 70000
|
| 94 |
+
max_eval_samples: 2200
|
| 95 |
+
filters:
|
| 96 |
+
include_families:
|
| 97 |
+
- conjecture_core
|
| 98 |
+
require_conjecture_id: true
|
| 99 |
+
training:
|
| 100 |
+
num_train_epochs: 2
|
| 101 |
+
learning_rate: 4.5e-6
|
| 102 |
+
save_steps: 120
|
| 103 |
+
eval_steps: 120
|
| 104 |
+
|
| 105 |
+
- name: hard_case_polish
|
| 106 |
+
max_train_samples: 50000
|
| 107 |
+
max_eval_samples: 1500
|
| 108 |
+
filters:
|
| 109 |
+
include_families:
|
| 110 |
+
- conjecture_core
|
| 111 |
+
- formal_proof
|
| 112 |
+
require_conjecture_id: true
|
| 113 |
+
min_sample_weight: 3.0
|
| 114 |
+
training:
|
| 115 |
+
num_train_epochs: 1
|
| 116 |
+
learning_rate: 2.0e-6
|
| 117 |
+
gradient_accumulation_steps: 24
|
| 118 |
+
save_steps: 80
|
| 119 |
+
eval_steps: 80
|
| 120 |
+
|
| 121 |
+
post_eval:
|
| 122 |
+
enabled: true
|
| 123 |
+
eval_file: workspace/data/releases/v1/test.parquet
|
| 124 |
+
max_samples: 260
|
| 125 |
+
k: 8
|
| 126 |
+
max_new_tokens: 512
|
| 127 |
+
temperature: 0.6
|
| 128 |
+
top_p: 0.92
|
| 129 |
+
seed: 17
|
| 130 |
+
output_json: workspace/runs/math-conjecture-sota/post_eval_report.json
|
| 131 |
+
|
| 132 |
+
quality_gate:
|
| 133 |
+
enabled: true
|
| 134 |
+
require_post_eval: true
|
| 135 |
+
min_evaluated_rows: 140
|
| 136 |
+
min_pass_at_1: 0.02
|
| 137 |
+
min_pass_at_k: 0.09
|
| 138 |
+
max_final_eval_loss: 2.5
|
| 139 |
+
required_family_pass_at_k:
|
| 140 |
+
conjecture_core: 0.09
|
| 141 |
+
formal_proof: 0.06
|
| 142 |
+
|
| 143 |
+
hub:
|
| 144 |
+
push_to_hub: true
|
| 145 |
+
repo_id: NorthernTribe-Research/math-conjecture-model
|
| 146 |
+
private: false
|
| 147 |
+
upload_stage_checkpoints: true
|
| 148 |
+
commit_message: Run autonomous multi-stage math-conjecture solver training with post-eval quality gates and publish qualified adapters/checkpoints.
|
| 149 |
+
|
| 150 |
+
credentials:
|
| 151 |
+
path: huggingface-api-key.json
|
configs/{deepseek_math_sota.yaml → qwen25_math_sota.yaml}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
global:
|
| 2 |
-
output_root: workspace/runs/math-conjecture-sota
|
| 3 |
seed: 17
|
| 4 |
|
| 5 |
model:
|
| 6 |
-
base_model:
|
| 7 |
-
trust_remote_code:
|
| 8 |
use_bf16: true
|
| 9 |
load_in_4bit: true
|
| 10 |
bnb_4bit_quant_type: nf4
|
|
@@ -32,38 +32,37 @@ data:
|
|
| 32 |
final_answer_field: final_answer
|
| 33 |
proof_field: proof_formal
|
| 34 |
sample_weight_field: sample_weight
|
| 35 |
-
max_seq_length:
|
| 36 |
min_loss_weight: 0.25
|
| 37 |
max_loss_weight: 6.0
|
| 38 |
family_boost:
|
| 39 |
-
conjecture_core: 2.
|
| 40 |
-
formal_proof:
|
| 41 |
-
competition: 1.
|
| 42 |
-
structured_reasoning: 1.
|
| 43 |
system_prompt: |
|
| 44 |
You are a frontier mathematical reasoning model focused on unsolved
|
| 45 |
-
conjectures.
|
| 46 |
-
|
| 47 |
-
assumptions or already established in cited prior results.
|
| 48 |
|
| 49 |
training_defaults:
|
| 50 |
per_device_train_batch_size: 1
|
| 51 |
per_device_eval_batch_size: 1
|
| 52 |
-
gradient_accumulation_steps:
|
| 53 |
weight_decay: 0.01
|
| 54 |
warmup_ratio: 0.03
|
| 55 |
lr_scheduler_type: cosine
|
| 56 |
max_grad_norm: 1.0
|
| 57 |
gradient_checkpointing: true
|
| 58 |
logging_steps: 10
|
| 59 |
-
save_steps:
|
| 60 |
-
eval_steps:
|
| 61 |
save_total_limit: 3
|
| 62 |
dataloader_num_workers: 2
|
| 63 |
|
| 64 |
stages:
|
| 65 |
- name: broad_math_bootstrap
|
| 66 |
-
max_train_samples:
|
| 67 |
max_eval_samples: 4000
|
| 68 |
filters:
|
| 69 |
include_families:
|
|
@@ -76,7 +75,7 @@ stages:
|
|
| 76 |
learning_rate: 2.0e-5
|
| 77 |
|
| 78 |
- name: conjecture_specialization
|
| 79 |
-
max_train_samples:
|
| 80 |
max_eval_samples: 2500
|
| 81 |
filters:
|
| 82 |
include_families:
|
|
@@ -86,11 +85,11 @@ stages:
|
|
| 86 |
training:
|
| 87 |
num_train_epochs: 2
|
| 88 |
learning_rate: 8.0e-6
|
| 89 |
-
save_steps:
|
| 90 |
-
eval_steps:
|
| 91 |
|
| 92 |
- name: conjecture_alignment
|
| 93 |
-
max_train_samples:
|
| 94 |
max_eval_samples: 2000
|
| 95 |
filters:
|
| 96 |
include_families:
|
|
@@ -99,11 +98,11 @@ stages:
|
|
| 99 |
training:
|
| 100 |
num_train_epochs: 2
|
| 101 |
learning_rate: 5.0e-6
|
| 102 |
-
save_steps:
|
| 103 |
-
eval_steps:
|
| 104 |
|
| 105 |
- name: hard_case_polish
|
| 106 |
-
max_train_samples:
|
| 107 |
max_eval_samples: 1500
|
| 108 |
filters:
|
| 109 |
include_families:
|
|
@@ -113,7 +112,7 @@ stages:
|
|
| 113 |
min_sample_weight: 3.0
|
| 114 |
training:
|
| 115 |
num_train_epochs: 1
|
| 116 |
-
learning_rate:
|
| 117 |
gradient_accumulation_steps: 24
|
| 118 |
save_steps: 80
|
| 119 |
eval_steps: 80
|
|
@@ -123,29 +122,29 @@ post_eval:
|
|
| 123 |
eval_file: workspace/data/releases/v1/test.parquet
|
| 124 |
max_samples: 240
|
| 125 |
k: 6
|
| 126 |
-
max_new_tokens:
|
| 127 |
temperature: 0.7
|
| 128 |
top_p: 0.95
|
| 129 |
seed: 17
|
| 130 |
-
output_json: workspace/runs/math-conjecture-sota/post_eval_report.json
|
| 131 |
|
| 132 |
quality_gate:
|
| 133 |
enabled: true
|
| 134 |
require_post_eval: true
|
| 135 |
min_evaluated_rows: 120
|
| 136 |
-
min_pass_at_1: 0.
|
| 137 |
-
min_pass_at_k: 0.
|
| 138 |
max_final_eval_loss: 2.6
|
| 139 |
required_family_pass_at_k:
|
| 140 |
-
conjecture_core: 0.
|
| 141 |
-
formal_proof: 0.
|
| 142 |
|
| 143 |
hub:
|
| 144 |
push_to_hub: true
|
| 145 |
repo_id: NorthernTribe-Research/math-conjecture-model
|
| 146 |
private: false
|
| 147 |
upload_stage_checkpoints: true
|
| 148 |
-
commit_message: Run autonomous multi-stage
|
| 149 |
|
| 150 |
credentials:
|
| 151 |
path: huggingface-api-key.json
|
|
|
|
| 1 |
global:
|
| 2 |
+
output_root: workspace/runs/math-conjecture-sota-qwen25
|
| 3 |
seed: 17
|
| 4 |
|
| 5 |
model:
|
| 6 |
+
base_model: Qwen/Qwen2.5-Math-7B-Instruct
|
| 7 |
+
trust_remote_code: false
|
| 8 |
use_bf16: true
|
| 9 |
load_in_4bit: true
|
| 10 |
bnb_4bit_quant_type: nf4
|
|
|
|
| 32 |
final_answer_field: final_answer
|
| 33 |
proof_field: proof_formal
|
| 34 |
sample_weight_field: sample_weight
|
| 35 |
+
max_seq_length: 4096
|
| 36 |
min_loss_weight: 0.25
|
| 37 |
max_loss_weight: 6.0
|
| 38 |
family_boost:
|
| 39 |
+
conjecture_core: 2.8
|
| 40 |
+
formal_proof: 2.2
|
| 41 |
+
competition: 1.35
|
| 42 |
+
structured_reasoning: 1.1
|
| 43 |
system_prompt: |
|
| 44 |
You are a frontier mathematical reasoning model focused on unsolved
|
| 45 |
+
conjectures. Prioritize formal consistency, proof structure, and explicit
|
| 46 |
+
uncertainty when a complete proof is unavailable.
|
|
|
|
| 47 |
|
| 48 |
training_defaults:
|
| 49 |
per_device_train_batch_size: 1
|
| 50 |
per_device_eval_batch_size: 1
|
| 51 |
+
gradient_accumulation_steps: 24
|
| 52 |
weight_decay: 0.01
|
| 53 |
warmup_ratio: 0.03
|
| 54 |
lr_scheduler_type: cosine
|
| 55 |
max_grad_norm: 1.0
|
| 56 |
gradient_checkpointing: true
|
| 57 |
logging_steps: 10
|
| 58 |
+
save_steps: 350
|
| 59 |
+
eval_steps: 350
|
| 60 |
save_total_limit: 3
|
| 61 |
dataloader_num_workers: 2
|
| 62 |
|
| 63 |
stages:
|
| 64 |
- name: broad_math_bootstrap
|
| 65 |
+
max_train_samples: 220000
|
| 66 |
max_eval_samples: 4000
|
| 67 |
filters:
|
| 68 |
include_families:
|
|
|
|
| 75 |
learning_rate: 2.0e-5
|
| 76 |
|
| 77 |
- name: conjecture_specialization
|
| 78 |
+
max_train_samples: 100000
|
| 79 |
max_eval_samples: 2500
|
| 80 |
filters:
|
| 81 |
include_families:
|
|
|
|
| 85 |
training:
|
| 86 |
num_train_epochs: 2
|
| 87 |
learning_rate: 8.0e-6
|
| 88 |
+
save_steps: 220
|
| 89 |
+
eval_steps: 220
|
| 90 |
|
| 91 |
- name: conjecture_alignment
|
| 92 |
+
max_train_samples: 60000
|
| 93 |
max_eval_samples: 2000
|
| 94 |
filters:
|
| 95 |
include_families:
|
|
|
|
| 98 |
training:
|
| 99 |
num_train_epochs: 2
|
| 100 |
learning_rate: 5.0e-6
|
| 101 |
+
save_steps: 120
|
| 102 |
+
eval_steps: 120
|
| 103 |
|
| 104 |
- name: hard_case_polish
|
| 105 |
+
max_train_samples: 50000
|
| 106 |
max_eval_samples: 1500
|
| 107 |
filters:
|
| 108 |
include_families:
|
|
|
|
| 112 |
min_sample_weight: 3.0
|
| 113 |
training:
|
| 114 |
num_train_epochs: 1
|
| 115 |
+
learning_rate: 2.5e-6
|
| 116 |
gradient_accumulation_steps: 24
|
| 117 |
save_steps: 80
|
| 118 |
eval_steps: 80
|
|
|
|
| 122 |
eval_file: workspace/data/releases/v1/test.parquet
|
| 123 |
max_samples: 240
|
| 124 |
k: 6
|
| 125 |
+
max_new_tokens: 512
|
| 126 |
temperature: 0.7
|
| 127 |
top_p: 0.95
|
| 128 |
seed: 17
|
| 129 |
+
output_json: workspace/runs/math-conjecture-sota-qwen25/post_eval_report.json
|
| 130 |
|
| 131 |
quality_gate:
|
| 132 |
enabled: true
|
| 133 |
require_post_eval: true
|
| 134 |
min_evaluated_rows: 120
|
| 135 |
+
min_pass_at_1: 0.015
|
| 136 |
+
min_pass_at_k: 0.08
|
| 137 |
max_final_eval_loss: 2.6
|
| 138 |
required_family_pass_at_k:
|
| 139 |
+
conjecture_core: 0.08
|
| 140 |
+
formal_proof: 0.05
|
| 141 |
|
| 142 |
hub:
|
| 143 |
push_to_hub: true
|
| 144 |
repo_id: NorthernTribe-Research/math-conjecture-model
|
| 145 |
private: false
|
| 146 |
upload_stage_checkpoints: true
|
| 147 |
+
commit_message: Run autonomous multi-stage Qwen2.5-Math-7B training with post-eval quality gates and publish qualified adapters/checkpoints.
|
| 148 |
|
| 149 |
credentials:
|
| 150 |
path: huggingface-api-key.json
|
scripts/eval_sota.py
CHANGED
|
@@ -16,7 +16,7 @@ from peft import PeftModel
|
|
| 16 |
from transformers import AutoModelForCausalLM, AutoTokenizer, set_seed
|
| 17 |
|
| 18 |
SCRIPT_ROOT = Path(__file__).resolve().parents[1]
|
| 19 |
-
DEFAULT_CONFIG_PATH = SCRIPT_ROOT / "configs" / "
|
| 20 |
DEFAULT_OUTPUT_JSON = SCRIPT_ROOT / "runs" / "latest_eval_report.json"
|
| 21 |
|
| 22 |
BOXED_RE = re.compile(r"\\boxed\{([^{}]+)\}")
|
|
|
|
| 16 |
from transformers import AutoModelForCausalLM, AutoTokenizer, set_seed
|
| 17 |
|
| 18 |
SCRIPT_ROOT = Path(__file__).resolve().parents[1]
|
| 19 |
+
DEFAULT_CONFIG_PATH = SCRIPT_ROOT / "configs" / "math_conjecture_sota.yaml"
|
| 20 |
DEFAULT_OUTPUT_JSON = SCRIPT_ROOT / "runs" / "latest_eval_report.json"
|
| 21 |
|
| 22 |
BOXED_RE = re.compile(r"\\boxed\{([^{}]+)\}")
|
scripts/preflight_check.py
CHANGED
|
@@ -17,7 +17,7 @@ import yaml
|
|
| 17 |
|
| 18 |
|
| 19 |
ROOT = Path(__file__).resolve().parents[1]
|
| 20 |
-
CONFIG_PATH = ROOT / "configs" / "
|
| 21 |
HF_HOME_DIR = ROOT / "workspace" / ".hf_home"
|
| 22 |
HF_DATASETS_CACHE_DIR = HF_HOME_DIR / "datasets"
|
| 23 |
HF_HUB_CACHE_DIR = HF_HOME_DIR / "hub"
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
ROOT = Path(__file__).resolve().parents[1]
|
| 20 |
+
CONFIG_PATH = ROOT / "configs" / "math_conjecture_sota.yaml"
|
| 21 |
HF_HOME_DIR = ROOT / "workspace" / ".hf_home"
|
| 22 |
HF_DATASETS_CACHE_DIR = HF_HOME_DIR / "datasets"
|
| 23 |
HF_HUB_CACHE_DIR = HF_HOME_DIR / "hub"
|
scripts/train_sota.py
CHANGED
|
@@ -30,13 +30,13 @@ from transformers import (
|
|
| 30 |
)
|
| 31 |
|
| 32 |
SCRIPT_ROOT = Path(__file__).resolve().parents[1]
|
| 33 |
-
DEFAULT_CONFIG_PATH = SCRIPT_ROOT / "configs" / "
|
| 34 |
DEFAULT_EVAL_SCRIPT = Path(__file__).resolve().with_name("eval_sota.py")
|
| 35 |
|
| 36 |
|
| 37 |
def parse_args() -> argparse.Namespace:
|
| 38 |
parser = argparse.ArgumentParser(
|
| 39 |
-
description="Train
|
| 40 |
)
|
| 41 |
parser.add_argument(
|
| 42 |
"--config",
|
|
|
|
| 30 |
)
|
| 31 |
|
| 32 |
SCRIPT_ROOT = Path(__file__).resolve().parents[1]
|
| 33 |
+
DEFAULT_CONFIG_PATH = SCRIPT_ROOT / "configs" / "math_conjecture_sota.yaml"
|
| 34 |
DEFAULT_EVAL_SCRIPT = Path(__file__).resolve().with_name("eval_sota.py")
|
| 35 |
|
| 36 |
|
| 37 |
def parse_args() -> argparse.Namespace:
|
| 38 |
parser = argparse.ArgumentParser(
|
| 39 |
+
description="Train math-conjecture solver with a multi-stage SOTA curriculum recipe."
|
| 40 |
)
|
| 41 |
parser.add_argument(
|
| 42 |
"--config",
|