echocorx/superecho-1-math-4b-lora)Lightweight companion custom pure-PyTorch LoRA adapter (
129.9 MB). For most users, the primary recommended download is the standalone mergedbfloat16model inechocorx/superecho-1-math-4b(bit-identical when this adapter is merged viasuperecho_lora.py).
echocorx/superecho-1-math-4b-lora is the lightweight companion custom pure-PyTorch LoRA adapter (129.9 MB on disk; r = 16, α = 32, dropout = 0.05, 496 fp32 tensors / 32,464,896 parameters = 0.766% of the text backbone) trained for Qwen/Qwen3.5-4B (revision: 851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a, text backbone Qwen3_5ForCausalLM, 32 physical layers). If you want standard one-line AutoModelForCausalLM.from_pretrained(...) loading without merging on load, use the primary recommended download: echocorx/superecho-1-math-4b.
LoRALinear format (lora_adapter.safetensors + lora_config.json + candidate_meta.json, with trainer_state.pt excluded) rather than Hugging Face peft. Use the bundled standalone loader superecho_lora.py (load_superecho_lora), which supports both merged (merge=True, default — bit-identical to echocorx/superecho-1-math-4b) and attached (merge=False) loading from either a local directory or Hugging Face Hub repo ID.32 layers executed once per token) for 1 epoch (63 steps) on 1,000 Chain-of-Thought (CoT) math solutions (3,861,447 tokens) from nvidia/OpenMathReasoning (cot split only; TIR excluded). All 1,000 examples passed automated filtering (verified extracted final answer, <think>...</think> + \boxed{} closure, <= 8,192 tokens, and 3-layer decontamination), while manual trace-quality auditing was conducted by stratified sampling (n = 28 from the curated 4K pool: 25/28 clean end-to-end, 2/28 minor non-fatal slips, 1/28 hidden visible-summary jump).[12, 16) Research Comparator: Weight-shared recurrence ([12, 16) repeated once, 36 executions / 32 stored layers) was tested as an identical-twin controlled experiment and is NOT included in these released adapter weights; it is preserved below as a documented research/negative ablation at 1K LoRA scale.8,192-Token Budget, Tool-Free pass@1)All evaluations below were run with this exact frozen adapter (lora_adapter.safetensors, sha256: 8e603557...92a2) merged into Qwen3_5ForCausalLM (bfloat16), measuring tool-free pass@1 (1 response per problem, no calculator/Python/symbolic engine) under frozen protocol eval_protocol_v1_1_calib.json (sha256: 811b5aca...):
"{problem}\n\nPlease reason step by step, and put your final answer within \\boxed{}." (official Qwen3.5 Jinja2 chat_template.jinja, enable_thinking=True).do_sample=True, temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=1.5 (enforced via bundled presence_penalty.py PresencePenaltyLogitsProcessor), repetition_penalty=1.0, max_new_tokens=8192, seed=20261201.\boxed{...} strictly after </think> is graded; outcomes are separated into 6 mutually exclusive classes (correct, repetition, truncated, missing_final_answer, format_error, math_error).8,192-token (8K) evaluations are closed for this v1 release; 16K and 32K budget comparisons remain an open future evaluation.N = 82, Post-May-2025, Single-Use — Strictly Separate from MATH-500)Composed of post-May-2025 short-answer competitions strictly after nvidia/OpenMathReasoning (2025-05-27): MathArena/aime_2026 (30), MathArena/cmimc_2025 (40), and MathArena/apex_2025 (12) (CC-BY-NC-SA-4.0, strictly evaluation-only, never in training; locked pre-opening under holdout_lock_v1.json, sha256: 4bf6196e...). Both models ran with 100% identical hardware and software parity (NVIDIA L4, bfloat16, transformers 5.23.0, torch 2.14.1+cu130, fla==0.6.0, B = 12, 57,337 PresencePenaltyLogitsProcessor penalized steps on both arms).
N = 82, 8,192 tokens)| Metric | Official Qwen/Qwen3.5-4B |
echocorx/superecho-1-math-4b-lora |
Delta (SuperEcho − Official) |
|---|---|---|---|
Solved (correct) |
0/82 (0.00%) | 17/82 (20.73%) | +17 (+20.73 pp) |
| Wilson 95% CI | [0.00%, 4.48%] |
[13.37%, 30.72%] |
— |
| Conditional Acc (completed w/ box) | 0/0 (n/a) |
17/24 (70.83%) |
— |
truncated (hit 8,192 cap) |
82 (100.00%) |
58 (70.73%) |
-24 (-29.27 pp) |
repetition / missing / format_error |
0 / 0 / 0 |
0 / 0 / 0 |
0 |
math_error |
0 |
7 |
+7 |
| Completion Tokens (total / mean) | 671,744 / 8,192.0 |
602,873 / 7,352.1 |
-68,871 (-10.3%) |
Active GPU Gen Wall (L4, B=12) |
4,440.6s (74.0 min) |
4,441.6s (74.0 min) |
+1.0s |
Session Wall Time (L4, B=12) |
4,627.1s (77.1 min) |
4,660.8s (77.7 min) |
+33.7s |
| Settled Colab Compute Units | 3.64 |
3.63 |
7.27 total |
N = 82): +17 gains (I → C), -0 losses (C → I), exact two-sided McNemar p = 1.52588e-05, problem-clustered paired bootstrap 95% CI [+12.20 pp, +29.27 pp] (10,000 resamples, seed = 20261201).| Competition | N | Official Qwen/Qwen3.5-4B |
echocorx/superecho-1-math-4b-lora |
Delta | Gains / Losses | McNemar p |
Trunc (Off / SE) |
Math Err (Off / SE) |
Cond. Acc (SE) |
Mean Tok (Off / SE) |
|---|---|---|---|---|---|---|---|---|---|---|
| AIME 2026 | 30 | 0/30 (0.0%) |
12/30 (40.0%) |
+12 (+40.0 pp) |
+12 / -0 |
0.0005 |
30 / 17 |
0 / 1 |
12/13 (92.3%) |
8,192 / 6,815 |
| CMIMC 2025 | 40 | 0/40 (0.0%) |
5/40 (12.5%) |
+5 (+12.5 pp) |
+5 / -0 |
0.0625 |
40 / 32 |
0 / 3 |
5/8 (62.5%) |
8,192 / 7,671 |
| APEX 2025 | 12 | 0/12 (0.0%) |
0/12 (0.0%) |
+0 (+0.0 pp) |
+0 / -0 |
1.0000 |
12 / 9 |
0 / 3 |
0/3 (0.0%) |
8,192 / 7,630 |
8,192 tokens — Strictly Separate from Holdout)N = 140, math500_unseen_140.jsonl, sha256: f8224ace...)Disjoint from the 35-item development pilot (0 overlap). Evaluated on NVIDIA L4, bfloat16, fla==0.6.0 (SuperEcho ran B = 10 on transformers 5.22.1; Official ran B = 12 with resumed batches 2–12 on transformers 5.23.0; Batch 1 8/12 [66.7%] vs Batches 2–12 79/128 [61.7%]).
| Metric | Official Qwen/Qwen3.5-4B |
echocorx/superecho-1-math-4b-lora |
Delta (SuperEcho − Official) |
|---|---|---|---|
Solved (correct) |
87/140 (62.14%) | 126/140 (90.00%) | +39 (+27.86 pp) |
| Wilson 95% CI | [53.89%, 69.75%] |
[83.91%, 93.95%] |
— |
| Conditional Acc (completed w/ box) | 87/87 (100.00%) |
126/133 (94.74%) |
-5.26 pp |
truncated (hit 8,192 cap) |
53 (37.86%) |
7 (5.00%) |
-46 (-32.86 pp) |
repetition / missing_final_answer |
0 / 0 |
0 / 0 |
0 |
format_error |
0 |
1 |
+1 |
math_error |
0 |
6 |
+6 |
Level 5 (n = 35) |
12/35 (34.3%) |
30/35 (85.7%) |
+18 (+51.4 pp) |
| Completion Tokens (total / mean) | 759,429 / 5,424.5 |
351,214 / 2,508.7 |
-408,215 (-53.8%) |
Active GPU Eval Wall (L4) |
8,039.0s (134.0 min) (B=12) |
9,169.0s (152.8 min) (B=10) |
— |
| Live Eval Colab Units | 8.81 |
6.21 |
-2.60 |
N = 140): +41 gains / -2 losses, exact two-sided McNemar p = 2.153e-10, paired bootstrap 95% CI [+20.00 pp, +35.71 pp].C → I): Both strict losses on unseen MATH-500 were test/number_theory/46.json (gold = 40_9, model boxed \boxed{40}) and test/number_theory/1257.json (gold = 204_5, model boxed \boxed{204}). Manual inspection confirmed that both derivations were mathematically correct, but omitted the numerical base subscript in the final \boxed{} answer. (The sole format_error, test/prealgebra/1865.json, wrote \boxed{12^{\text{th}}} for gold = 12.)N = 35, Previously Examined)| MATH-500 Slice | N | Official Qwen/Qwen3.5-4B |
echocorx/superecho-1-math-4b-lora |
Paired Delta & McNemar p |
|---|---|---|---|---|
Prior Stratified Pilot (math500_m1_pilot.jsonl) |
35 | 21/35 (60.00%) |
31/35 (88.57%) |
+28.57 pp (+11/-1, p = 0.0063) |
New Unseen Stratified (math500_unseen_140.jsonl) |
140 | 87/140 (62.14%) |
126/140 (90.00%) |
+27.86 pp (+41/-2, p = 2.15e-10) |
| Disjoint Combined Context (Pilot + Unseen) | 175 | 108/175 (61.71%) |
157/175 (89.71%) |
+28.00 pp (+52/-3, p = 1.54e-12) |
[12, 16) 1K Twin (Not Released)We trained a controlled identical-twin Transfer Loop [12, 16) model (genuinely weight-shared layers [12, 16) executed twice -> 36 logical layer executions / 32 stored layers, zero-initialized learnable gate loop_gates reaching +0.059657, verified active with logits_max_abs_diff = 3.4375 and +11.31% / +7.025 ms/tok same-GPU latency vs 1-pass) on the exact same 1,000 examples in identical order (3,861,447 tokens, 63 steps):
Benchmark (8,192 tok) |
Official Qwen/Qwen3.5-4B |
Flat SFT 1K (Released) | Transfer Loop [12, 16) 1K (Research) |
TL vs Flat SFT |
|---|---|---|---|---|
MATH-500 Pilot (N = 35) |
21/35 (60.00%) |
31/35 (88.57%) |
31/35 (88.57%) |
+0.00 pp (+0/-0, p = 1.0000) |
MATH-500 Unseen (N = 140) |
87/140 (62.14%) |
126/140 (90.00%) |
122/140 (87.14%) |
-2.86 pp (+6/-10, p = 0.4545, 12 vs 7 trunc, 13,391.9s vs 9,169.0s eval wall) |
Independent Holdout (N = 82) |
0/82 (0.00%) |
17/82 (20.73%) |
Not evaluated | — |
At 1K LoRA scale, the improvements over official Qwen/Qwen3.5-4B are attributable to conventional OpenMathReasoning CoT SFT rather than [12, 16) recurrence; Transfer Loop [12, 16) is preserved strictly as a documented research comparator and is not included in this adapter release.
presence_penalty.pyThe official Qwen/Qwen3.5-4B model card recommends temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0 for general Thinking mode. However, transformers 5.22.x–5.23.0 does not natively implement presence_penalty in GenerationConfig or model.generate().
In our M1 baseline calibration on math500_m1_pilot.jsonl (N = 35, official Qwen/Qwen3.5-4B), switching from deterministic greedy decoding (do_sample=False, temperature=0.0, presence_penalty=0.0) to the full official general Thinking generation profile (do_sample=True, temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=1.5 via PresencePenaltyLogitsProcessor) raised accuracy from 13/35 (37.14%) to 22/35 (62.86%) (+25.71 pp, p = 0.0225) and reduced repetition loops from 9/35 to 0/35. Because sampling parameters (do_sample=True, temperature=1.0, top_p=0.95, top_k=20) and presence_penalty=1.5 changed simultaneously, this calibration gain is attributed to the full generation profile, not solely to presence_penalty.
This repository ships standalone presence_penalty.py (PresencePenaltyLogitsProcessor, subtracting presence_penalty once per unique token generated in the completion prior to sampling warpers) alongside superecho_lora.py.
superecho_lora.py)inference_example.py)python inference_example.py \
--adapter-path echocorx/superecho-1-math-4b-lora \
--prompt "Find the remainder when 2^100 is divided by 7." \
--max-new-tokens 8192 \
--dtype bf16 \
--presence-penalty 1.5
(Supports --no-merge for attached fp32 LoRA, --base-model-id, --base-revision, --deterministic, and --output-json; pass a local directory to --adapter-path for offline use.)
superecho_lora.py + presence_penalty.py)import torch
from transformers import LogitsProcessorList
from superecho_lora import load_superecho_lora
from presence_penalty import PresencePenaltyLogitsProcessor
model, tokenizer, meta = load_superecho_lora(
"echocorx/superecho-1-math-4b-lora",
base_model_id="Qwen/Qwen3.5-4B",
base_revision="851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a",
dtype="bf16",
device_map="auto",
merge=True, # default; merges LoRA in-place into Qwen3_5ForCausalLM (pass merge=False to keep attached)
)
problem = "Find the remainder when 2^100 is divided by 7."
prompt = f"{problem}\n\nPlease reason step by step, and put your final answer within \\boxed{{}}."
rendered = tokenizer.apply_chat_template(
[{"role": "user", "content": prompt}],
tokenize=False,
add_generation_prompt=True,
enable_thinking=True,
)
enc = tokenizer([rendered], return_tensors="pt", add_special_tokens=False).to(model.device)
pp = PresencePenaltyLogitsProcessor(presence_penalty=1.5, prompt_length=enc["input_ids"].shape[1])
torch.manual_seed(20261201)
with torch.inference_mode():
out = model.generate(
**enc,
max_new_tokens=8192,
do_sample=True,
temperature=1.0,
top_p=0.95,
top_k=20,
repetition_penalty=1.0,
logits_processor=LogitsProcessorList([pp]),
)
print(tokenizer.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))
Verified on a fixed math prompt ("Find the remainder when 2^100 is divided by 7.", enable_thinking=True, bf16, seed=20261201, max_new_tokens=8, PresencePenaltyLogitsProcessor(1.5)):
superecho_lora.load_superecho_lora(..., merge=True) vs evaluated candidate (load_flat_sft_twin) and merged bf16 export: Logit max_abs_diff = 0.0, mean_abs_diff = 0.0, exact parameter count 4,205,751,296, and 100% identical generated token IDs on both sampled (T=1.0, top_p=0.95, top_k=20, pp=1.5, steps_penalized=7) and greedy (pp=1.5, steps_penalized=7) decoding.superecho_lora.load_superecho_lora(..., merge=False) (attached fp32 LoRA) vs evaluated candidate: Logit max_abs_diff = 0.6875, mean_abs_diff = 0.0321 (expected bf16 pre-merge vs fp32 residual rounding) and 100% identical generated token IDs on both sampled and greedy decoding.inference_example.py from a fresh /tmp directory with PYTHONPATH stripped and a strict import blocker prohibiting any import from the development repository (echo_ai_import_blocker_active = True): exited 0, steps_penalized = 7, 100% identical token IDs.sha256sum -c SHA256SUMS.txt. (lora_adapter.safetensors is byte-identical to the frozen evaluated checkpoint: sha256: 8e60355760a802d1ad515704d82d702188f8a8812da309034dfe53458e6992a2.)nvidia/OpenMathReasoning@d3d08664755704f422af97d43a7ff0ded4bd95df (CC-BY-4.0, cot split only; TIR excluded).177,840 rows against math500_full.jsonl (500), aime2025_full.jsonl (30), and independent_holdout.jsonl (82) excluded 6,780 contaminated items and quarantined 16,093 ambiguous answers, leaving 0 surviving exam overlaps across all 4,250 × 612 pairs.1,000 stratified AoPS CoT examples (3,861,447 total / 3,773,385 supervised tokens, max = 8,180 <= 8,192, 0 truncated). Automated filtering applied across all 1,000 examples (verified extracted final answer, <think>...</think> + \boxed{} closure, <= 8,192 tokens, and 3-layer decontamination); manual trace-quality auditing performed by stratified sampling (n = 28 from the curated 4K pool: 25/28 clean end-to-end, 2/28 minor non-fatal slips, 1/28 hidden visible-summary jump).r = 16, α = 32, dropout = 0.05 across all 248 linear projections (32,464,896 params), packing = False, assistant_completion_only masking, chunked exact CE (chunk_size = 512), micro_batch_size = 1, grad_accum_steps = 16 (63 steps / 1 epoch), AdamW (lr = 1e-4, wd = 0.01, 5% warmup + cosine decay to 0.1×, max_grad_norm = 1.0), bf16, seed = 20261201. Trained on NVIDIA A100-SXM4-40GB (30.8 min, 3.91 Colab units).8,192-Token Budget Scope (16K/32K Open): All gains (+27.86 pp unseen MATH-500, +20.73 pp post-May-2025 holdout) were measured under an 8,192-token ceiling and come primarily from reasoning-budget efficiency (completing derivations within 8K instead of truncating inside <think>). When Official finishes within 8K on unseen MATH-500, its conditional accuracy is 100.0% (87/87) vs 94.74% (126/133) for SuperEcho. 16K and 32K comparisons remain an open future evaluation.APEX 2025, SuperEcho scored 0/12 (9 truncated, 3 math errors), and on CMIMC 2025, 32/40 still hit the 8,192-token cap (5/40 solved).pass@1) Stochastic Variance: Results reflect one trajectory per problem (T = 1.0, seed = 20261201), accompanied by Wilson and paired bootstrap 95% CIs.Qwen3_5ForCausalLM), multilingual, instruction-following, and safety benchmarks have not been evaluated.n = 28) of the curated OpenMathReasoning CoT pool found 25/28 (89.3%) end-to-end rigorous, 2/28 (7.1%) minor non-fatal slips, and 1/28 (3.6%) visible-summary reasoning jump despite a correct final answer.pass@1 (no calculator, Python TIR, or ECHO supertoken runtime).LICENSE and NOTICE).Qwen/Qwen3.5-4B (851bf6e8..., Qwen Team / Alibaba Cloud, Apache-2.0).nvidia/OpenMathReasoning (d3d08664..., CoT split only, NVIDIA / AoPS, CC-BY-4.0).MATH-500 (openai/prm800k@7ecc7947...) and MathArena (aime_2026, cmimc_2025, apex_2025, CC-BY-NC-SA-4.0).