scrallex commited on
Commit
dd8b715
·
1 Parent(s): fc4ef52

Document finemath-124m revision

Browse files
Files changed (1) hide show
  1. README.md +39 -0
README.md CHANGED
@@ -29,6 +29,45 @@ Use this repo if you want to **benchmark manifold LMs** or integrate the encoder
29
 
30
  ---
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  ## Quick Start & Best-Case Workloads
33
  - **Optimised for structured text**: PDF/page OCR exports, news briefs, technical audits—any corpus where 512 B sliding windows capture repeated structure. Expect 30–60× token compression with 94–95 % token accuracy (Fox EN/CN/OmniDoc numbers from the main repo).
34
  - **Reproduce on a sample corpus**:
 
29
 
30
  ---
31
 
32
+ ## New: STM-FineMath 124M (revision `finemath-124m`)
33
+ - 12-layer (124M) manifold LM trained on the 10 GB FineMath STEM corpus using the same `window=512 B`, `stride=384 B`, `precision=3` codec. The builder yields 50 242 samples / 25.7 M manifold tokens (≈0.27 raw tokens per signature) and fits in ~66 minutes on a single RTX 3080 Ti.
34
+ - Final eval loss `6.506` -> manifold perplexity `6.69e2`, while GPT-2 medium on the identical math slice lands at `7.75e3` (11.7x worse). See `benchmarks/finemath_perplexity_compare.json` in the new branch.
35
+ - Exact-match signature accuracies on standard math QA benchmarks (strict metric) are now recorded:
36
+
37
+ | Benchmark | Split | Subset | #Problems | Accuracy |
38
+ |-----------|-------|--------|-----------|----------|
39
+ | dim/competition_math | train | Algebra | 200 | 0.5% |
40
+ | dim/competition_math | train | Number Theory | 200 | 0.5% |
41
+ | dim/competition_math | train | Geometry | 200 | 1.0% |
42
+ | dim/competition_math | train | Prealgebra | 200 | 0.0% |
43
+ | openai/gsm8k (main) | test | - | 200 | 0.5% |
44
+
45
+ Each JSON artifact (command + parameters) is stored under `benchmarks/` on the `finemath-124m` branch.
46
+
47
+ ### Loading the math-focused checkpoint
48
+ ```python
49
+ from transformers import AutoModelForCausalLM, AutoTokenizer
50
+
51
+ repo_id = "scrallex/structural-manifold-compression"
52
+ tokenizer = AutoTokenizer.from_pretrained(repo_id, revision="finemath-124m")
53
+ model = AutoModelForCausalLM.from_pretrained(repo_id, revision="finemath-124m")
54
+ ```
55
+ You must supply structural-manifold signatures instead of raw text. Use `scripts/data/prepare_causal_dataset.py` or `scripts/experiments/math_qa_demo.py` from the GitHub repo to encode prompts, then decode generations via `scripts/experiments/decode_signatures.py` (requires a prototype cache built from a math corpus).
56
+
57
+ ### Reproducing the posted math benchmarks
58
+ ```
59
+ python scripts/experiments/eval_math_dataset.py \
60
+ --model output/training_runs/stm_finemath_10gb \
61
+ --dataset-vocab output/stm_stem_finemath_10gb/vocab.json \
62
+ --dataset dim/competition_math --split train --subset Algebra \
63
+ --max-problems 200 --text-root data/raw_math/finemath_4plus_10gb \
64
+ --cache output/training_runs/stm_finemath_10gb/prototype_cache.json \
65
+ --max-new-tokens 64 --match-mode signatures
66
+ ```
67
+ Switch `--dataset openai/gsm8k --dataset-config main --split test --question-field question --answer-field answer` for GSM8K. The evaluator now matches answers via signature subsequences (no prototype recovery required) so results are strict exact-matches.
68
+
69
+ ---
70
+
71
  ## Quick Start & Best-Case Workloads
72
  - **Optimised for structured text**: PDF/page OCR exports, news briefs, technical audits—any corpus where 512 B sliding windows capture repeated structure. Expect 30–60× token compression with 94–95 % token accuracy (Fox EN/CN/OmniDoc numbers from the main repo).
73
  - **Reproduce on a sample corpus**: