Proposed HRM-Text evaluation study

The project should answer three separate questions:

  1. Memorization: Does HRM-Text reproduce examples or solutions that were included in its pretraining corpus?
  2. Generalization: Does it solve unseen examples from the same generators, shifted distributions, and genuinely new tasks?
  3. Adaptation: Can it acquire an orthogonal capability—safety alignment—from a relatively small fine-tuning set without losing its existing capabilities?

These questions require different dataset partitions and different metrics. A single benchmark score cannot distinguish them.


1. Important corrections and verified facts

1.1 GSM8K and MATH test splits are not directly used by their explicit cleaners

The GSM8K cleaner loads:

load_dataset("openai/gsm8k", "main", split="train")

and retains only the final numerical answer.

The MATH cleaner iterates over all subject configurations but uses:

load_dataset("EleutherAI/hendrycks_math", subset, split="train")

It creates both:

  • a CoT example with the full reference solution;
  • a direct-answer example containing the extracted boxed answer.

Therefore:

[
D{\text{GSM8K-test}}
\not\subset
D
{\text{explicit GSM8K cleaner}},
]

[
D{\text{MATH-test}}
\not\subset
D
{\text{explicit MATH cleaner}}.
]

However, this does not yet prove that the test questions are absent from the entire HRM corpus. The full corpus also includes FLAN, OpenMathInstruct-2, NuminaMath, SYNTH, OpenThoughts, AceReason, NaturalReasoning, and web-extracted questions. OpenMathInstruct-2 is itself generated from GSM8K and MATH source distributions.

We therefore need two conclusions:

  • Direct split audit: GSM8K/MATH explicit cleaners use train only.
  • Global contamination audit: exact, near-duplicate, and template overlap must still be searched across the complete 104-million-row cleaned corpus.

1.2 Omni-MATH is directly included

The Omni-MATH cleaner loads:

load_dataset("KbsdJames/Omni-MATH", split="test")

and adds both the full solution and the short answer to training.

Thus Omni-MATH should not be presented as a held-out generalization benchmark. It is an excellent positive control for memorization.

1.3 Sudoku has a clean source-level train/test separation

The Sudoku cleaner reads only train.csv from sapientinc/sudoku-extreme. It converts each puzzle to the exact instruction:

Solve the Sudoku
 
<81-cell puzzle>

and uses the completed 81-digit grid as the response.

The dataset provides approximately 3.83 million training puzzles and 423,000 test puzzles, with unique solutions and train/test puzzles designed to be mathematically inequivalent. (Hugging Face)

This makes Sudoku the strongest available source for studying:

  • exact training recall;
  • IID held-out generalization;
  • difficulty extrapolation;
  • invariance and equivariance;
  • detailed deterministic error analysis.

1.4 DMMath has generators, not merely a static test set

The HRM cleaner consumes only:

  • train-easy;
  • train-medium;
  • train-hard.

The original DeepMind Mathematics Dataset provides generation code and was explicitly designed to generate fresh mathematical problems across arithmetic, algebra, calculus, probability, polynomial manipulation, measurement, and number theory. (GitHub)

This is better than relying on one static test split: we can produce unlimited fresh IID and extrapolation sets with controlled random seeds and complexity.

1.5 AMPS does not have a clean canonical test split in this pipeline

The AMPS-Mathematica cleaner reads every relevant .txt file from the downloaded archive. It does not preserve a train/test distinction.

The AMPS-Khan cleaner recursively reads all JSON files and uses:

instruction = problem
response    = joined sequence of hints

It also does not preserve a held-out partition.

AMPS is described as an auxiliary pretraining corpus of more than 100,000 Khan Academy problems and roughly five million Mathematica-generated problems, rather than as an established benchmark with a canonical leaderboard test split. (GitHub)

Therefore:

  • use AMPS rows as memorization examples;
  • create generalization sets by holding out entire Mathematica scripts, topics, or parameter regimes;
  • do not call a random row split an official AMPS test set.

1.6 AMPS-Khan is not the main evidence for general instruction following

AMPS-Khan teaches mathematical explanation through hints. It does not cover general requirements such as “write exactly three paragraphs,” “include two specified keywords,” or “respond only in JSON.”

The strongest instruction-following sources are instead:

  • FLAN direct and CoT tasks;
  • Tasksource’s broad classification, NLI, QA, logic, and formatting tasks;
  • NoRobots human-written instruction/assistant examples;
  • SYNTH creative writing, constrained writing, editing, RAG, memorization, MCQ, and math exercises.

So IFEval is well motivated, but primarily by FLAN, NoRobots, Tasksource, and SYNTH—not AMPS-Khan.

1.7 AIME 2026 is difficult, but not temporally clean

AIME I and II occurred on February 5 and February 11, 2026. (Mathematical Association of America) The released cleaned HRM corpus is dated May 15, 2026. (Hugging Face)

Therefore AIME 2026 could theoretically appear in the corpus or in synthetic data generated before the final snapshot. It is useful as a hard distribution-shift benchmark, but it is not a guaranteed post-training test.

For temporal generalization, select MathArena or LiveBench questions released after the verified checkpoint data cutoff. MathArena was specifically developed because even AIME 2024 showed signs of contamination. (NeurIPS Proceedings)


2. Dataset–evaluation map

Training sourceWhat it suppliesMemorization evaluationIID evaluationOOD/transfer evaluation
GSM8K trainShort arithmetic word problems; direct answerSample actual exposed train rowsGSM8K testGSM-Symbolic, GSM-Symbolic-P1/P2
MATH trainCompetition math solutions and answersExposed MATH-train rowsMATH testAIME, fresh MathArena
Omni-MATH testAdvanced olympiad solutions and answersFull Omni-MATH as positive controlNone—it was trained onFresh/post-cutoff olympiad problems
DMMathGenerated symbolic school mathematicsExposed generated rowsFresh examples with same generator settingsIncreased depth, magnitude, composition
AMPS-MathematicaSynthetic symbolic mathIncluded archive rowsFresh samples from included scriptsHeld-out scripts/topics/parameter regimes
AMPS-KhanProblems paired with hintsVerbatim hint recallHeld-out problems from the same source if recoverableOther textbook/course problems
Sudoku trainExact constraint solvingExposed and source-member train puzzlesSudoku-Extreme testNew generators, transformations, Sudoku-X, Latin squares
FLAN/NoRobots/SYNTHGeneral instructions and formatted responsesIncluded instruction examplesHeld-out source rows where availableIFEval, LiveBench instruction following
Tasksource/FLANBroad reasoning and task formatsIncluded task examplesSource-specific heldoutsBBH, BBEH, LiveBench reasoning
WildGuard/WildJailbreak SFTSafety refusal and safe complianceFine-tuning-train recallRaw WildJailbreak/WildGuard heldoutsHarmBench and unrelated jailbreaks

3. Build a data exposure manifest first

Before running expensive evaluation, build a manifest describing what the checkpoint could have seen.

3.1 Row-level manifest

Create one row for every cleaned training example with fields such as:

source_family
source_dataset
source_config
original_split
original_id
cleaner_script
cleaned_file
cleaned_row_index
condition
instruction
response
normalized_instruction_hash
normalized_response_hash
prompt_response_hash
instruction_tokens
response_tokens
sampled_by_checkpoint
first_exposure_epoch
number_of_exposures

At minimum, calculate three hashes:

[
h_q = H(N(q)),
]

[
h_a = H(N(a)),
]

[
h_{qa}=H(N(q)\Vert N(a)),
]

where (N) performs Unicode normalization, whitespace normalization, and removal of harmless formatting differences.

Do not remove numbers during the main exact-match calculation. Numerical changes are precisely what we need to detect later.

3.2 Distinguish corpus membership from actual checkpoint exposure

Because the pretraining sampler caps large sources, an example can be:

  1. absent from the source corpus;
  2. present in the source corpus but not sampled;
  3. sampled exactly once;
  4. sampled multiple times.

This gives an unusually useful experimental design.

Define:

  • (E): examples actually exposed to the checkpoint;
  • (U): examples in the cleaned source but not sampled;
  • (H): held-out examples absent from the training source.

Then compare:

[

\Delta_{\text{exposure}}

\operatorname{Acc}(E)-\operatorname{Acc}(U),
]

and

[

\Delta_{\text{distribution}}

\operatorname{Acc}(U)-\operatorname{Acc}(H).
]

A large (\Delta{\text{exposure}}) is evidence of example-specific memorization. A large (\Delta{\text{distribution}}) with a small exposure gap is more consistent with learning the source distribution or generator.

The sampler is deterministic given the exact cleaned files, tokenizer ordering, configuration, random seed, and number of epochs. It uses persistent per-task permutations and advances through them across epochs.

Reconstruct exposure using the exact:

  • data_io commit;
  • cleaned-data revision;
  • tokenizer;
  • prefix_config.yaml;
  • training configuration;
  • seed;
  • epoch count.

If exact reconstruction is impossible, label examples only as source members, not as definitely exposed.

3.3 Full-corpus contamination audit

For every proposed evaluation set, run:

  1. normalized exact prompt matching;
  2. normalized prompt-and-answer matching;
  3. character 13-gram and 20-gram similarity;
  4. MinHash or locality-sensitive hashing;
  5. embedding nearest-neighbor retrieval;
  6. task-specific canonicalization.

For mathematics, also normalize:

  • option ordering;
  • LaTeX whitespace;
  • equivalent numeric formatting;
  • variable names;
  • expressions using a symbolic algebra system.

For Sudoku, canonicalize under digit, row, column, band, stack, and transpose symmetries.

The output for every benchmark item should contain:

exact_match
nearest_training_source
nearest_training_row
similarity_score
same_template
actual_exposure_known
actual_exposure

4. Memorization experiments

4.1 Experimental groups

For each source, create matched subsets:

GroupMeaning
E: exposedDefinitely sampled during pretraining
U: source-unexposedIn cleaned source but not selected by sampler
H: held-out IIDSame dataset or generator, official test/fresh seed
P-invariantHarmless transformation; answer should not change
P-counterfactualMinimal transformation; answer must change
OODRelated capability but new task/distribution

Match E, U, and H by difficulty, length, topic, and response length.

For an initial pilot:

  • 1,000 exposed examples per major source;
  • 1,000 source-unexposed examples where available;
  • 1,000 matched held-out examples;
  • full evaluation later for smaller benchmarks.

Use one preregistered sampling seed and save all selected IDs.

4.2 Answer accuracy is not enough

A trained example can be solved correctly without being memorized. Add target-response likelihood.

For prompt tokens (q) and response tokens (a), compute:

[

\operatorname{NLL}(a\mid q)

-\frac{1}{|a|}
\sum{t=1}^{|a|}
\log p
\theta(at\mid q,a{<t}).
]

Compare the NLL distributions for E, U, and H. Report:

  • mean and median answer NLL;
  • exposure classification AUC;
  • accuracy gap;
  • exact target-response reproduction;
  • longest common subsequence with the stored response.

A model showing much lower NLL and substantially more verbatim output on E than matched U is exhibiting example-specific memorization.

Critical HRM masking requirement

For scoring prompt plus answer:

input_ids = prompt_ids + response_ids
token_type_ids = [1] * len(prompt_ids) + [0] * len(response_ids)
labels = [-100] * len(prompt_ids) + response_ids

The prompt is the bidirectional PrefixLM block; the response remains causal.

4.3 Source-specific memorization tests

GSM8K

The explicit cleaner stores only the final answer, so verbatim reasoning-trace recall is not meaningful for that source.

Measure:

  • train-row exact accuracy;
  • answer NLL;
  • test accuracy;
  • counterfactual sensitivity after changing quantities;
  • whether the model produces the original answer after the numbers change.

Define counterfactual inertia:

[

I_{\mathrm{cf}}

\Pr\left[
\hat y(x’)=\hat y(x)
\mid
y(x’)\neq y(x)
\right].
]

High (I_{\mathrm{cf}}) indicates answer-pattern replay.

MATH

Because the full solution is included, measure:

  • exact final-answer accuracy;
  • symbolic-equivalence accuracy;
  • solution-token NLL;
  • normalized solution overlap;
  • unusually long verbatim spans;
  • performance after variable renaming and numerical substitutions.

Omni-MATH

Treat the entire benchmark as a known contaminated positive control.

This answers:

Is the released checkpoint capable of memorizing a relatively small, repeated olympiad corpus?

Compare:

  1. original prompt;
  2. paraphrased prompt with unchanged mathematics;
  3. variable-renamed version;
  4. numerically modified version;
  5. same topic but newly authored problem.

Possible patterns:

  • original only: literal recall;
  • original and paraphrase: semantic retrieval;
  • modified problem also correct: stronger procedure learning;
  • original solution repeated after modification: memorized-template failure.

DMMath

Sample examples by module and difficulty. Measure training recall, but the strongest test is fresh generation from the original source code.

Because answers are short symbolic expressions, report:

[
\mathbf 1[
\operatorname{simplify}(\hat y-y)=0
]
]

in addition to exact strings.

AMPS-Mathematica

Group by topic and generating subtask. Compare:

  • examples from included scripts;
  • fresh parameter draws from those scripts;
  • entirely held-out scripts;
  • held-out mathematical topics.

This separates memorizing generated examples from learning script-level solution procedures.

AMPS-Khan

Since the response is a sequence of hints, measure:

  • final-answer correctness if an answer can be recovered;
  • hint-token NLL;
  • phrase-level overlap with the stored hints;
  • whether it reproduces idiosyncratic wording;
  • whether its hints remain valid after changing the numbers.

5. Sudoku forensic evaluation

Sudoku should have its own evaluation package rather than being treated as one additional benchmark score.

5.1 Core metrics

Parse the output into (\hat s\in{1,\dots,9}^{81}).

Format validity

[

V_{\text{format}}

\mathbf 1[
|\hat s|=81
\land
\hat s_i\in{1,\ldots,9}
].
]

Record separately:

  • no parseable grid;
  • too few digits;
  • too many digits;
  • zero or illegal characters;
  • prose before or after the grid;
  • generation truncation;
  • repeated sequence.

Clue preservation

[

V_{\text{clue}}

\prod_{i:q_i\neq 0}
\mathbf 1[\hat s_i=q_i].
]

Constraint validity

Calculate validity separately for:

  • all rows;
  • all columns;
  • all (3\times3) boxes.

[

V_{\text{row}}

\prod_{r=1}^{9}

\mathbf 1[
{\hat s{r,1},\ldots,\hat s{r,9}}

{1,\ldots,9}
].
]

Define (V{\text{column}}) and (V{\text{box}}) analogously.

Exact and cell accuracy

[
A_{\text{exact}}=\mathbf 1[\hat s=s^\star],
]

[

A_{\text{cell}}

1-
\frac{1}{81}
\sum_i
\mathbf 1[\hat s_i\neq s_i^\star].
]

Also report accuracy only on initially blank cells.

Because each puzzle has a unique solution, a format-valid, clue-preserving, fully constraint-valid grid must be the correct solution. A supposedly valid but different grid indicates an evaluator or data problem.

5.2 Error taxonomy

Assign every failure to one primary category:

  1. no grid produced;
  2. wrong number of cells;
  3. illegal character;
  4. clue overwritten;
  5. row contradiction;
  6. column contradiction;
  7. box contradiction;
  8. near-solution with one or a few wrong cells;
  9. repetitive or fixed grid;
  10. output truncation;
  11. explanation without final grid;
  12. correct grid embedded in extra text.

Store:

  • total Hamming distance;
  • blank-cell Hamming distance;
  • first incorrect cell;
  • number of invalid rows, columns, and boxes;
  • whether the first error causes later autoregressive errors.

5.3 Sudoku evaluation sets

Run six progressively harder groups.

S1: Actual exposed training puzzles

Tests exact recall and upper-bound performance.

S2: Training-source puzzles not sampled

Tests whether the model learned the source distribution independently of exact exposure.

S3: Official Sudoku-Extreme test

Primary IID generalization benchmark.

Start with 10,000 puzzles stratified by:

  • solver rating/backtracks;
  • clue count;
  • source;
  • difficulty quantile.

Then run all approximately 423,000 examples if the pilot is informative.

S4: Symmetry transformations

For a valid Sudoku transformation (g), an equivariant solver should satisfy:

[
f(gq)=g f(q).
]

Test:

  • digit permutations;
  • row permutations within bands;
  • band permutations;
  • column permutations within stacks;
  • stack permutations;
  • transpose;
  • compositions of these transformations.

Report:

[

A_{\mathrm{equiv}}

\Pr[g^{-1}f(gq)=f(q)].
]

This is useful even on failures: an incorrect but equivariant model is behaving differently from one dominated by positional memorization.

S5: Counterfactual and diagnostic puzzles

Generate:

  • one clue added;
  • one clue removed while uniqueness remains;
  • one changed clue making the puzzle inconsistent;
  • nearly solved grid with one wrong digit;
  • exactly one forced move;
  • same clue mask with a different digit permutation.

These reveal whether the model checks constraints or retrieves a familiar solution.

S6: Transfer tasks

Use:

  • independently generated 9×9 Sudoku;
  • unseen Sudoku generator;
  • 4×4 Sudoku;
  • 16×16 Sudoku;
  • Sudoku-X;
  • Latin squares;
  • small exact-cover problems.

These are task-transfer evaluations rather than IID Sudoku evaluations.

5.4 Teacher-forcing versus free generation

Measure both:

  • answer-token accuracy when all prior solution digits are correct;
  • fully autoregressive exact-grid accuracy.

A large gap means that the model locally predicts correct cells but small errors accumulate during generation.

5.5 Sampling and verification

Use greedy decoding as the primary result. Then evaluate sampled decoding:

  • pass@1;
  • pass@8;
  • pass@32;
  • verifier-selected pass@(k).

Sudoku has a perfect deterministic verifier, so verifier-selected sampling is scientifically meaningful. It reveals whether the correct solution is in the model’s proposal distribution even when greedy decoding fails.


6. Generalization evaluation

6.1 Level G1: IID held-out generalization

These are the closest comparisons to the current paper’s GSM8K and MATH results.

Run:

  • GSM8K test;
  • MATH test;
  • Sudoku-Extreme test;
  • fresh DMMath instances using original parameter ranges;
  • fresh AMPS instances from included Mathematica scripts.

These measure generalization within a known task or generator family.

6.2 Level G2: Controlled distribution shift

GSM-Symbolic

GSM-Symbolic provides:

  • GSM-Symbolic;
  • GSM-Symbolic-P1;
  • GSM-Symbolic-P2;
  • 50 generated instances per template;
  • links back to the corresponding original GSM8K test item. (GitHub)

Run the official protocol first, then additional controlled variants.

Report:

  • mean accuracy across all generated instances;
  • per-instance-set accuracy;
  • variance across numerical instantiations of the same template;
  • accuracy as a function of operation count;
  • counterfactual inertia;
  • paired degradation relative to the corresponding GSM8K question.

Use template-level bootstrap confidence intervals, not only example-level intervals, because examples derived from one template are strongly correlated.

DMMath extrapolation

Generate sets where only one complexity factor changes:

  • number magnitude;
  • expression depth;
  • polynomial degree;
  • number of terms;
  • number of equations;
  • function-composition depth;
  • fraction complexity.

Plot accuracy against each complexity variable.

AMPS extrapolation

Hold out:

  • entire scripts;
  • entire topic/subtask pairs;
  • parameter ranges;
  • step-by-step versus direct-answer forms.

Sudoku difficulty extrapolation

Plot exact accuracy against:

  • log solver backtracks;
  • clue count;
  • source;
  • nearest-training-example distance.

IFEval

IFEval has approximately 500 prompts covering 25 kinds of objectively verifiable instructions. (GitHub)

Run:

  • direct as the primary condition;
  • synth,cot as a secondary condition;
  • zero-shot, without a chat template;
  • optional 2-, 4-, and 8-shot adaptation curves reported separately.

Report all standard metrics:

  • prompt-level strict accuracy;
  • prompt-level loose accuracy;
  • instruction-level strict accuracy;
  • instruction-level loose accuracy.

Also report per-constraint results, such as:

  • required keywords;
  • forbidden words;
  • length constraints;
  • paragraph count;
  • JSON or structured formatting;
  • capitalization;
  • multiple simultaneous constraints.

BBH

BBH is a reasoning evaluation, not mainly an instruction-following evaluation. It is useful for:

  • Dyck languages;
  • logical deduction;
  • word sorting;
  • object tracking;
  • boolean expressions;
  • navigation;
  • multistep arithmetic.

BBH and its CoT few-shot group are already available in lm-evaluation-harness.

Because FLAN may contain related BIG-Bench tasks, label BBH as a possibly overlapping diagnostic benchmark until exact task-name and prompt overlap are audited.

BBEH

BBEH replaces BBH tasks with substantially harder tasks targeting similar reasoning skills. The official release contains 4,520 full examples and a 460-example mini set, along with its own evaluate.py. (GitHub)

Use:

  1. BBEH-mini during harness development;
  2. full BBEH after prompts and parsers are frozen.

BBEH is not currently present as a standard task in the lm-eval registry I inspected, so use the official evaluator or add a custom task.

6.4 Level G4: Temporal generalization

Neither AIME 2024 nor AIME 2026 should be considered guaranteed clean.

Use:

  • MathArena problems released after the verified HRM data freeze;
  • post-cutoff LiveBench math, reasoning, and instruction-following slices.

LiveBench is especially relevant because it includes updated, objectively scored versions of reasoning, AMPS-like mathematics, and instruction-following tasks. (arXiv)

Freeze the selected benchmark snapshot before any prompt tuning.


7. Evaluation software

7.1 What lm-evaluation-harness supports

The current harness supports:

  • IFEval;
  • BBH and CoT BBH;
  • many conventional language-model tasks;
  • external/custom YAML tasks through --include_path;
  • task validation through lm-eval validate. (GitHub)

Install and inspect:

python -m venv .venv
source .venv/bin/activate
 
pip install --upgrade pip
pip install --upgrade "transformers>=5.9.0"
pip install "lm_eval[hf,ifeval,math]"
pip install datasets accelerate math-verify sympy
 
lm-eval ls tasks | grep -E "ifeval|bbh|aime|math"

The current harness includes built-in IFEval files and scoring utilities.

GSM-Symbolic and BBEH should be integrated as custom tasks or evaluated with their official repositories.

7.2 lm-eval --model hf is not plug-and-play for HRM

The public HRM checkpoint now works through Transformers 5.9 or newer, but HRM requires token_type_ids marking the prompt as a bidirectional prefix. If these are omitted, the model falls back to ordinary causal attention and produces worse logits. (Hugging Face)

The correct generation call is conceptually:

prompt = (
    "<|im_start|>"
    "<|object_ref_start|>"   # direct condition
    + task_prompt
    + "<|im_end|>"
)
 
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
inputs["token_type_ids"] = torch.ones_like(inputs["input_ids"])
 
outputs = model.generate(
    **inputs,
    do_sample=False,
    max_new_tokens=max_new_tokens,
)

Therefore, create a custom lm-eval model adapter, for example hrm_prefixlm.

It must:

  1. wrap prompts in HRM’s native envelope;
  2. insert the requested condition tokens;
  3. pass all-one token_type_ids during generation;
  4. stop at HRM’s end-of-answer token;
  5. save unmodified raw generations.

A command should then look like:

lm-eval \
  --model hrm_prefixlm \
  --model_args \
    pretrained=sapientinc/HRM-Text-1B,condition=direct,dtype=bfloat16 \
  --tasks ifeval \
  --batch_size auto \
  --output_path results/ifeval_direct \
  --log_samples

For BBH:

lm-eval \
  --model hrm_prefixlm \
  --model_args \
    pretrained=sapientinc/HRM-Text-1B,condition=synth_cot,dtype=bfloat16 \
  --tasks bbh_cot_fewshot \
  --batch_size auto \
  --output_path results/bbh_cot \
  --log_samples

Do not apply a Llama/Tulu-style chat template to the base HRM checkpoint.

7.3 Avoid standard likelihood-ranking tasks initially

For a generation request, the entire supplied input is prefix, so all-one token_type_ids is correct.

For multiple-choice log-likelihood scoring, the mask must distinguish:

  • prompt/context positions: token_type_ids=1;
  • candidate continuation positions: token_type_ids=0.

A generic adapter that marks the full prompt-plus-candidate sequence as prefix would allow the candidate tokens to attend bidirectionally and produce invalid likelihoods.

Therefore either:

  • use generative multiple-choice tasks where the model emits one answer letter;
  • implement a boundary-aware HRM likelihood scorer;
  • use HRM’s native evaluation implementations for its original benchmarks.

Create one internal inference interface:

generate(
    prompts: list[str],
    condition: str,
    max_new_tokens: int,
    temperature: float,
    seed: int,
) -> list[Generation]

Each Generation should retain:

prompt
wrapped_prompt
input_ids
condition
token_type_ids
raw_output_ids
raw_output_text
parsed_answer
latency
seed
generation_parameters

Use this same generator for:

  • lm-eval tasks;
  • Sudoku;
  • DMMath;
  • AMPS;
  • GSM-Symbolic;
  • BBEH;
  • HarmBench completions.

This avoids benchmark-specific inference inconsistencies.


8. Harness validation

Before reporting new benchmarks, reproduce known HRM results.

8.1 Sanity suite

Run at least:

  • 200 GSM8K examples;
  • 200 MATH examples;
  • 200 ARC-Challenge examples;
  • 200 MMLU examples.

Compare your implementation with:

  • the paper or repository results;
  • the native HRM evaluator, where the checkpoint format permits;
  • the same model with and without PrefixLM token_type_ids.

The “without prefix mask” run should be clearly worse. If it is not, investigate whether the model or adapter is ignoring token_type_ids.

8.2 Unit tests

Add tests for:

  • condition-token ordering;
  • prompt envelope;
  • PrefixLM mask;
  • response boundary;
  • stop token;
  • batched versus single-example equivalence;
  • greedy reproducibility;
  • left/right padding;
  • answer parser;
  • Unicode and LaTeX normalization.

Do not start full Sudoku or BBEH evaluation until this suite passes.


9. Safety adaptation experiment

9.1 Training data

The Tulu 3 SFT mixture contains:

  • 50,000 transformed WildGuardMix prompts;
  • 50,000 transformed WildJailbreak prompts. (Hugging Face)

Be careful with licensing and provenance:

  • the overall Tulu mixture has heterogeneous subset licenses;
  • its card lists the transformed WildGuardMix subset as Apache 2.0;
  • the raw WildGuardMix repository currently identifies itself as ODC-BY and is gated;
  • WildJailbreak is ODC-BY and gated. (Hugging Face)

Preserve per-example source and license metadata.

The Tulu subsets are training examples inside one SFT mixture; they do not themselves provide a clean 50K-train/50K-test structure.

For held-out evaluation use:

  • raw WildJailbreak evaluation: 2,000 adversarial harmful and 210 adversarial benign prompts;
  • WildGuardTest;
  • HarmBench;
  • an over-refusal benchmark.

WildJailbreak’s harmful and benign contrast sets are particularly useful because safe alignment must reduce harmful compliance without refusing benign prompts that merely look suspicious. (Hugging Face)

9.2 Training arms

ArmFine-tuning dataPurpose
ANo fine-tuningBase checkpoint
B100K benign Tulu instructionsGeneric SFT control
C50K Tulu WildJailbreakJailbreak/refusal adaptation
D50K Tulu WildGuardMixSafety-response adaptation
EBoth safety sets, 100K totalMain safety model
FBoth safety sets + 10–20% original-data replayForgetting mitigation

Match arms B–F by either:

  • number of optimizer updates;
  • or total response tokens.

Token matching is preferable because response lengths may differ.

Run at least three random seeds for the final comparison.

9.3 Fine-tuning from the downloadable HF checkpoint

The public checkpoint is Transformers-compatible. (Hugging Face) Use a custom response-only SFT collator.

For an example with prompt (q) and response (a):

prompt_ids = tokenizer(
    "<|im_start|>"
    "<|object_ref_start|>"
    + q
    + "<|im_end|>",
    add_special_tokens=False,
).input_ids
 
response_ids = tokenizer(
    a + "<|box_end|>",
    add_special_tokens=False,
).input_ids
 
input_ids = prompt_ids + response_ids
token_type_ids = [1] * len(prompt_ids) + [0] * len(response_ids)
labels = [-100] * len(prompt_ids) + response_ids

Important details:

  • do not use a Tulu chat template;
  • do not train on prompt tokens;
  • preserve HRM’s PrefixLM mask;
  • use the direct condition initially;
  • truncate or discard examples beyond 4,096 tokens;
  • start with full-parameter SFT.

A reasonable pilot learning-rate sweep is:

[
{5\times10^{-6},,10^{-5},,2\times10^{-5}},
]

with one epoch, followed by a longer run only after inspecting safety and forgetting curves.

9.4 Continued training with replay

The “mix with existing data” experiment should initially mean continued SFT with replay, not restarting 60B-token pretraining.

For example:

[

D_{\text{continued}}

0.8D_{\text{safety}}

  • 0.2D_{\text{HRM replay}}.
    ]

Stratify replay across:

  • instruction following;
  • mathematics;
  • symbolic tasks;
  • Sudoku.

Compare replay ratios such as 0%, 10%, and 20%.

Only consider from-scratch pretraining mixtures after the checkpoint-level adaptation study establishes an effect.

9.5 Safety evaluation

HarmBench provides a pipeline for generating test cases, generating model completions, and evaluating those completions with its classifiers. It supports adding Transformers-compatible models. (GitHub)

However, its generic model generation path may not apply HRM’s PrefixLM mask. The safer approach is:

  1. obtain or generate HarmBench attack prompts;
  2. generate HRM completions using the unified HRM inference runner;
  3. pass the saved completions into HarmBench’s completion evaluator.

Report:

  • direct harmful-request attack success rate;
  • jailbreak attack success rate;
  • per-harm-category ASR;
  • refusal rate;
  • invalid/empty response rate;
  • WildJailbreak harmful success rate;
  • WildJailbreak benign helpfulness or refusal rate;
  • WildGuardTest harmful response rate.

Also include an over-refusal benchmark such as XSTest or OR-Bench. HarmBench alone does not detect a model that refuses everything.

9.6 Retention evaluation after safety SFT

Every safety model should be rerun on:

  • IFEval;
  • GSM8K;
  • GSM-Symbolic;
  • MATH or AIME subset;
  • DMMath;
  • Sudoku;
  • BBEH-mini.

For capability (c), define retention:

[

R_c

\frac{\operatorname{Score}c(\theta{\text{SFT}})}
{\operatorname{Score}c(\theta{\text{base}})}.
]

The safety result should be shown as a Pareto frontier between:

[
x=\text{benign utility},
\qquad
y=1-\text{harmful ASR}.
]


10. Experimental phases

Phase 0: Infrastructure validation

Deliverables:

  • pinned repository and dataset revisions;
  • unified HRM generator;
  • PrefixLM unit tests;
  • reproduction of selected original scores;
  • raw-output logging.

Phase 1: Data and exposure audit

Deliverables:

  • row-level training manifest;
  • source split table;
  • exact and fuzzy evaluation overlap report;
  • actual exposure reconstruction where possible;
  • list of benchmark tasks appearing inside FLAN/Tasksource.

This phase determines whether BBH, IFEval, AIME, or any other benchmark should be labeled clean, related, or contaminated.

Phase 2: Low-cost evaluation pilot

Run:

  • IFEval full;
  • BBH full;
  • BBEH-mini;
  • GSM-Symbolic;
  • 1,000 examples per DMMath module/regime;
  • 10,000 stratified Sudoku test puzzles;
  • 1,000 exposed and source-unexposed rows per memorization source;
  • AIME 2024/2025/2026 greedy;
  • selected post-cutoff MathArena problems.

The pilot determines generation lengths, throughput, parser failure rates, and which full evaluations are worthwhile.

Phase 3: Full memorization and generalization study

Run:

  • full GSM8K test;
  • full MATH test;
  • full Omni-MATH positive control;
  • full GSM-Symbolic variants;
  • full BBEH;
  • full or very large DMMath generated suites;
  • full Sudoku-Extreme test;
  • Sudoku transformations and counterfactuals;
  • AMPS held-out-script experiments.

Phase 4: Safety adaptation

Train arms B–F and evaluate:

  • HarmBench;
  • WildJailbreak eval;
  • WildGuardTest;
  • over-refusal;
  • capability retention.

Phase 5: Architecture claims

The public-checkpoint study tells us how HRM-Text-1B behaves.

To conclude that hierarchical recurrence itself causes better generalization, repeat the central experiments using:

  • HRM;
  • matched standard Transformer;
  • Looped Transformer or Universal Transformer;
  • identical sampled data;
  • identical token budget;
  • similar parameter count.

Without this step, the results characterize the checkpoint and curriculum, not necessarily the architecture.


11. Primary result table

The final paper or report should have a table structured like this:

DomainDatasetRelationship to trainingPrimary metricMemorization control
MathGSM8K testIID heldoutexact answerexposed GSM8K train
MathGSM-Symboliccontrolled shifttemplate-mean accuracyoriginal GSM8K pair
MathMATH testIID heldoutsymbolic accuracyexposed MATH train
MathOmni-MATHdirectly trainedexact + solution overlapknown positive control
MathMathArena post-cutofftemporal OODexact/proof scoreoverlap audit
SymbolicDMMath fresh IIDsame generatorCAS-equivalent accuracyexposed generated rows
SymbolicDMMath extrapolationcontrolled OODcomplexity curvesmatched IID examples
SymbolicAMPS held-out scriptsscript OODnormalized accuracyincluded-script rows
ConstraintSudoku testIID heldoutexact gridexposed/unexposed train
ConstraintSudoku transformationsequivariant shiftequivarianceoriginal puzzle
ReasoningBBHpossibly relatedper-task accuracyFLAN task audit
ReasoningBBEHtask transferper-task accuracynearest-training retrieval
InstructionsIFEvaltask OODprompt strictsource overlap audit
SafetyWildJailbreak evaladaptation IID/OODharmful ASR + benign refusalSFT train membership
SafetyHarmBenchadaptation transferattack success ratebase model

12. Recommended repository organization

hrm_text_study/
├── configs/
│   ├── model/
│   ├── generation/
│   └── experiments/
├── data_audit/
│   ├── build_manifest.py
│   ├── reconstruct_sampling.py
│   ├── exact_overlap.py
│   ├── fuzzy_overlap.py
│   └── canonicalize_math.py
├── inference/
│   ├── hrm_generator.py
│   ├── hrm_lm_eval_adapter.py
│   └── response_scorer.py
├── tasks/
│   ├── gsm_symbolic/
│   ├── dmmath/
│   ├── amps/
│   ├── sudoku/
│   ├── bbeh/
│   └── safety/
├── validators/
│   ├── math.py
│   ├── sudoku.py
│   ├── ifeval.py
│   └── safety.py
├── finetune/
│   ├── convert_tulu_safety.py
│   ├── collator.py
│   └── train.py
├── analysis/
│   ├── memorization.py
│   ├── generalization.py
│   ├── error_taxonomy.py
│   └── plots.py
└── results/
    ├── raw_generations/
    ├── parsed/
    ├── metrics/
    └── reports/

Every result row should retain the raw generation. The error analysis—especially for Sudoku and symbolic mathematics—is one of the main outputs, not merely a debugging artifact.

The strongest initial sequence is:

  1. build the exposure and contamination manifest;
  2. validate PrefixLM inference;
  3. run Sudoku, DMMath, GSM-Symbolic, IFEval, and BBEH-mini;
  4. use Omni-MATH as the memorization positive control;
  5. then begin the safety fine-tuning study.