modrill commited on
Commit
06ded6c
·
verified ·
1 Parent(s): c8b9c96

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +98 -0
README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: allenai/Olmo-3-1025-7B
4
+ tags:
5
+ - code
6
+ - reasoning
7
+ - lora-merged
8
+ - livecodebench
9
+ pipeline_tag: text-generation
10
+ library_name: transformers
11
+ ---
12
+
13
+ # CodeThink-V4-OLMo-3-7B
14
+
15
+ Research checkpoint: **allenai/Olmo-3-1025-7B** (`a81bae42db3975be1671e27b9c9a56da1a9f980f`) after V4 LoRA SFT on Qwen3-30B-A3B-Thinking-2507 traces (OLMo-tokenized V4 payload), then merged to full weights.
16
+
17
+ Repo name uses **OLMo-3** because `RUN_IDENTITY.model.hf_id` is `allenai/Olmo-3-1025-7B` (not OLMo-2).
18
+
19
+ This is a **research checkpoint, not a product**. Single-seed diagnostic numbers only. Do not treat DEV256 as a leaderboard claim.
20
+
21
+ License: **Apache-2.0**, inherited from [allenai/Olmo-3-1025-7B](https://huggingface.co/allenai/Olmo-3-1025-7B) (verified from the local base `README.md`: `license: apache-2.0`).
22
+
23
+ ## Base, teacher, and data
24
+
25
+ | | |
26
+ |---|---|
27
+ | Student | `allenai/Olmo-3-1025-7B` revision `a81bae42db3975be1671e27b9c9a56da1a9f980f` |
28
+ | Teacher | `Qwen/Qwen3-30B-A3B-Thinking-2507` traces (V4 paired think payload, OLMo renderer / tokenizer) |
29
+ | Problems | **4715** unique problems (`source_1ep_rows`); physical 2-epoch concat = **9430** rows |
30
+ | Dose | **31,689,386** assistant tokens / epoch (OLMo tokenizer; not the Qwen 32.4M count); endpoint **63,378,772** assistant tokens (2 epochs) |
31
+ | Train seed | **42** |
32
+
33
+ ## Recipe
34
+
35
+ - LoRA **r64 / α128**, dropout 0.0, seven projections: `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`
36
+ - Embeddings / `lm_head` frozen except **two-sided trainable B-row** for **100257** (`<|endoftext|>`). Token id from `adapter/TOKEN_ROWS_META.json`.
37
+ - Assistant supervised tail: `<|endoftext|>` (**100257**)
38
+ - LR **1e-4**, AdamW (β 0.9/0.95), **cosine** over assistant-token dose, **warmup 6%** (3,802,726 / 63,378,772 tokens), weight decay **0.1**
39
+ - **bf16**, no packing, no truncation, context 32768 at train time
40
+ - **2 epochs**, physical concat. Endpoint-only score; no checkpoint picking.
41
+ - Chat template: `olmo3-lcb-noprefill` (no generation-prompt `<think>` prefill). Bundled as `chat_template.jinja`.
42
+
43
+ Merged weights are the 2-epoch endpoint (`step-000904`, 63,378,772 assistant tokens). LoRA + B-row are under `adapter/`.
44
+
45
+ ## Evaluation (DEV256)
46
+
47
+ 256-problem LiveCodeBench-derived **dev** split. Seed **3407**, **think** mode, **no `<think>` prefill**, max generation ~32k, sandbox-verified **pass@1**. Temperature 0.6, top-p 0.95, top-k 20.
48
+
49
+ **Cap** = generations that hit the 32k length limit without closing `</think>`.
50
+
51
+ | Model | pass@1 | Cap | Notes |
52
+ |---|---:|---:|---|
53
+ | **CodeThink-V4-OLMo-3-7B** | **56/256** | **149** | this repo; seed 3407 |
54
+ | Olmo-3-1025-7B (same contract, think) | 15/256 | 104 | bare base, seed 3407 |
55
+
56
+ Single seed. These are research checkpoints, not product scores.
57
+
58
+ ## Usage
59
+
60
+ Merged full weights; no PEFT required at inference. The pinned OLMo template supplies a default system turn. **Do not** prefill `<think>`.
61
+
62
+ ```python
63
+ from transformers import AutoModelForCausalLM, AutoTokenizer
64
+
65
+ repo = "modrill/CodeThink-V4-OLMo-3-7B"
66
+ tokenizer = AutoTokenizer.from_pretrained(repo)
67
+ model = AutoModelForCausalLM.from_pretrained(
68
+ repo, torch_dtype="bfloat16", device_map="auto"
69
+ )
70
+
71
+ messages = [{"role": "user", "content": problem_statement}]
72
+ prompt = tokenizer.apply_chat_template(
73
+ messages,
74
+ tokenize=False,
75
+ add_generation_prompt=True,
76
+ )
77
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
78
+ output = model.generate(
79
+ **inputs,
80
+ max_new_tokens=32768,
81
+ do_sample=True,
82
+ temperature=0.6,
83
+ top_p=0.95,
84
+ top_k=20,
85
+ )
86
+ print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))
87
+ ```
88
+
89
+ Stop ids used in the official eval: `100257` (`<|endoftext|>`), `100265` (`<|im_end|>`).
90
+
91
+ ## Repo layout
92
+
93
+ - Root: merged HF weights (`config.json`, `model.safetensors`, tokenizer, `generation_config.json`, `chat_template.jinja`) plus `OFFICIAL_MERGE_RECEIPT.json`
94
+ - `adapter/`: LoRA, `token_rows_both_sides.safetensors`, `TOKEN_ROWS_META.json`, checkpoint `MANIFEST.json`
95
+ - `provenance/`: train `RUN_IDENTITY.json`, `TRAINING_CONFIG.json`, `POLICY.json`; DEV256 `COMPLETE.json`
96
+ - `MANIFEST.sha256`
97
+
98
+ Optimizer / resume states are **not** included.