robbiemu's picture
rewrite
9bef408 verified
|
Raw
History Blame Contribute Delete
11.4 kB
---
license: apache-2.0
task_categories:
- text-generation
language:
- en
tags:
- calibration
- quantization
- lean
- mathlib
- mxfp4
- fp8
- datasets
configs:
- config_name: selected
default: true
data_files:
- split: calibration
path: data/selected/calibration_samples.jsonl
- config_name: variant-1
data_files:
- split: calibration
path: data/variant-1/calibration_samples.jsonl
- config_name: variant-2
data_files:
- split: calibration
path: data/variant-2/calibration_samples.jsonl
- config_name: variant-3
data_files:
- split: calibration
path: data/variant-3/calibration_samples.jsonl
- config_name: variant-4
data_files:
- split: calibration
path: data/variant-4/calibration_samples.jsonl
- config_name: variant-5
data_files:
- split: calibration
path: data/variant-5/calibration_samples.jsonl
- config_name: variant-6
data_files:
- split: calibration
path: data/variant-6/calibration_samples.jsonl
- config_name: development
data_files:
- split: validation
path: data/development/validation.jsonl
- config_name: release-validation
data_files:
- split: validation
path: data/release-validation/validation.jsonl
- config_name: historical-validation
data_files:
- split: validation
path: data/historical-validation/validation.jsonl
---
# Leanstral Mathlib calibration corpora
The sample data comes from the pinned Apache-2.0-licensed
[Mathlib source tree](https://github.com/leanprover-community/mathlib4). This
repository holds the data and curated methods documentation—but not the
separately developed builder package.
This dataset contains the calibration corpora used to pick a static FP8
activation profile for an MXFP4 W4A8 conversion of Leanstral 1.5 119B-A6B. It
publishes every candidate corpus, their manifests, the shared
iterative-development pack, and the post-selection release-validation packs.
Variant 1 also appears separately as the selected subset.
You can inspect the exact samples that shaped the activation profile, reproduce
the corpus comparison yourself, or try a different quantization method without
having to rebuild the data-selection pipeline from scratch.
## Loading with 🤗 Datasets
Every corpus is its own named Hugging Face configuration. `selected` is the
default, and it's byte-identical to Variant 1:
```python
from datasets import load_dataset
selected = load_dataset(
"robbiemu/leanstral-mathlib-calibration-corpora", split="calibration"
)
variant_2 = load_dataset(
"robbiemu/leanstral-mathlib-calibration-corpora",
"variant-2",
split="calibration",
)
release_validation = load_dataset(
"robbiemu/leanstral-mathlib-calibration-corpora",
"release-validation",
split="validation",
)
```
The available configuration names are `selected`, `variant-1` through
`variant-6`, `development`, `release-validation`, and
`historical-validation`. Each shows up as a separate subset in the Hub Dataset
Viewer, and you can pass any of them as the second argument to `load_dataset`.
## Contents
Every calibration variant contains 512 source-grounded records. The original
four candidates keep the model, quantization rule, sample count, and category
vocabulary fixed, and only vary the data distribution.
| Split | Role | Summary | Release status |
| --- | --- | --- | --- |
| `variant-1` | empirical baseline | A140/B110/C90/D70/E60/F42, balanced from the measured corpus | **Selected** |
| `variant-2` | context-enriched | increases surrounding-source context under the same experimental contract | Research candidate |
| `variant-3` | tail-coverage | targets sparse and long-tail source behavior | Research candidate |
| `variant-4` | length-stratified | explicitly balances input-length strata | Research candidate |
| `variant-5` | first composite | coherent corpus assembled from strengths observed in V1–V4 | Research candidate |
| `variant-6` | constrained V1 composite | 464 V1 records plus 48 D/E short-or-medium substitutions from V5 | Rejected |
| `development` | iterative validation | shared 100-example comparison pack | Not an untouched test |
| `release-validation` | final validation | fresh 144-example pack frozen after V1 selection | Quality gate evidence |
| `historical-validation` | prior validation | earlier 144-example pack retained for provenance | Historical only |
| `selected` | convenience alias/copy | exact Variant 1 records | **Selected** |
V5 and V6 are complete calibration corpora, not mixtures of activation-scale
values—each one was recalibrated from scratch as one coherent static FP8
profile.
## Repository layout
```text
README.md
data/
variant-1/calibration_samples.jsonl
variant-2/calibration_samples.jsonl
variant-3/calibration_samples.jsonl
variant-4/calibration_samples.jsonl
variant-5/calibration_samples.jsonl
variant-6/calibration_samples.jsonl
selected/calibration_samples.jsonl
development/validation.jsonl
release-validation/validation.jsonl
historical-validation/validation.jsonl
manifests/
variant-1.json
variant-2.json
variant-3.json
variant-4.json
variant-5.json
variant-6.json
development.json
release-validation.json
historical-validation.json
docs/
corpus-construction.md
calibration-selection.md
schema.json
SHA256SUMS
```
Each published split manifest records its source revision, tokenizer identity,
sample count, token count, category and length distributions, provenance
completeness, deduplication counts, and SHA-256. The records contain the
original environment receipt, duplicate fingerprints, and leakage and
admission results.
## Record format
The quantization input is JSON Lines. Each published record preserves:
- a stable record identifier;
- category and context-length stratum;
- the exact `rendered_text` given to the calibration runtime;
- tokenizer-derived length;
- source-location and source-revision provenance;
- content/fingerprint fields used for deduplication; and
- admission and leakage-check metadata needed to audit the split.
The checked-in schema is generated from the actual JSONL files rather than from
this prose. Release preparation removed private machine paths and internal
operational metadata without changing sample text or stable identifiers.
## Construction method
The builder is deterministic from pinned inputs. It:
1. selects source-grounded Lean/Mathlib material from a pinned Mathlib tree;
2. renders the exact model-facing text;
3. counts tokens with Leanstral's Tekken tokenizer;
4. applies source-aware deduplication and leakage exclusions;
5. assigns category and length strata;
6. admits records according to the variant's frozen distribution; and
7. writes the JSONL and a provenance manifest together.
Variant 1 uses the empirical category allocation:
```text
A 140
B 110
C 90
D 70
E 60
F 42
total 512
```
The category definitions and exact pinned revisions are recorded in
[`docs/corpus-construction.md`](docs/corpus-construction.md). Those values come
from the machine manifests rather than being retyped for this card.
## Why Variant 1 is selected
The candidates were evaluated as frozen static per-tensor FP8 activation
profiles on the same MXFP4 weights. Once FlashInfer startup autotuning turned
out to be the source of small cross-restart numerical drift, I compared V1–V5
across five independent, normally autotuned cold starts. Every profile used the
same dynamic reference within each start.
V1 came out ahead on candidate NLL, signed NLL delta, mean absolute per-example
NLL delta, top-1 agreement, and top-1 flip count in all five starts. V5
consistently improved mean and maximum KL and fixed recurring V1 tail failures,
but it lost central NLL/top-1 quality in every start and brought its own stable
failures along with it.
Variant 6 tested the strongest remaining simple-composite hypothesis: keep 464
V1 records, make 48 targeted D/E substitutions, then recalibrate the whole
thing as one complete profile. V6 improved mean KL in every start, but its
V6-minus-V1 candidate NLL averaged `+0.028728` and top-1 agreement averaged
`-0.042`—both outside the frozen `+0.01` and `-0.01` central-quality margins.
Dropping the first start and using 2–5 alone doesn't change that decision.
> Under normal FlashInfer startup variation, V1 consistently gives the best
> ordinary predictive preservation. The KL-tail improvements on the table are
> real, but neither V5 nor a targeted V1-centered composite gets there without
> an unacceptable hit to central quality.
What this experiment selects is the exact frozen V1 corpus/profile pair—it's
not a claim that V1 is universally optimal for every model, quantizer, or future
recalibration.
## Selected artifact receipt
```text
Variant 1 calibration JSONL:
sha256 57e1e10fce8a6a62cef14e58e26109065104fe109c4075c6b6f302726918ed57
records 512
Variant 1 static activation profile:
sha256 5480257595178836022477080bc6132e2accff2d6e26c959b092e57a0f911531
ModelOpt 0.37.0
288 keys / 9,432 finite positive scale values
development pack:
sha256 8cdbf9cfcc2b9c1bcb305c14f979799be6a7b9efad54dd4e5a281f00c152ccdf
replicated V1–V5 aggregate:
sha256 2a20473486a7a84efb462aff12b28c2319ce86a45ca0ead2d74a919ced270324
Variant 6 corpus:
sha256 6b1a712d8ed90b7403b9ffbc3f71a73411eff5c920b3043a2ea17cb255e11856
Variant 6 activation profile:
sha256 7f426c18d4ee09d07c4687fca82bce63f7bbdd9c427f230cefb9465213d569ce
```
## Intended uses
Appropriate uses include:
- reproducing the Leanstral MXFP4 static-FP8 profile experiment;
- studying calibration-corpus sensitivity;
- benchmarking alternative activation quantizers; and
- auditing category, length, expert-coverage, and tail behavior.
This is calibration and iterative-development data—not a general
instruction-tuning corpus, and not a general model-quality benchmark. The
`release-validation` split stayed untouched during profile selection. It is
published as the completed release-gate evidence, not advertised as a reusable
hidden test.
## Limitations
- The sample-selection result is specific to this model, weight artifact,
static max-calibration method, and 100-example development comparator.
- The validation pack informed V5 and V6.
- The fresh 144-example release pack was evaluated once after V1 was frozen;
its failed Top-1 and KL-tail criteria are disclosed in the model repository.
- KL measures one next-token top-five-plus-other partition per example, not the
worst teacher-forced token position.
- Normally autotuned cold starts are the independent replication units.
- Lower overflow-risk counts did not reliably predict better model behavior.
- The separately developed builder package is not included. This repository
supports artifact-level audit and reuse, not an exact source-level builder
rerun.
- The Apache-2.0 declaration covers the published Mathlib-derived data only.
Model weights and tokenizer assets are distributed separately, in the model
repository, under the official source model's terms.
## Reproducibility documents
This dataset repository includes the construction document, while the model
repository holds the detailed evaluation receipts:
- activation-profile selection;
- replicated normally autotuned profile study; and
- constrained V1-centered composite result.