| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository accompanies the paper draft Scoped Actions Expose Compositional Failures in Verified Symbolic Rewrite Search. The frozen paper artifact is intended to live under release branch release/paper-v1 and tag paper-v1.0. The repository also contains ongoing research code, but the commands and artifacts in Reproduce Paper Results correspond to this frozen paper release.
The paper studies policy/value models for verified symbolic rewrite search. The original global-action benchmark worked end to end and showed Static KAN > MLP on verified solve rate; the initial HyperKAN underperformed, then a reduced-capacity recovered HyperKAN nearly matched Static KAN after ablations. The important follow-up result is that global SymPy action semantics turned out too shallow for robust depth-4+ composition. The project therefore moves to scoped actions: action = (site, op). Scoped smoke, medium, and diverse guided benchmarks validated the pipeline, but they were too clean to separate models by solve rate. The structural scoped probe is the first benchmark slice with real compositional pressure: seen families are learnable, but default inference fails completely on a held-out mixed composition family. Localization-aware inference rescues recovered HyperKAN at moderate depth, a lightweight Transformer diagnostic suggests the failure is not confined to the recurrent encoder, and the depth-7 expansion shows that the rescue does not yet scale cleanly.
git clone https://github.com/unixsysdev/HyperKan.git
cd HyperKan
git checkout paper-v1.0
export REPO=$PWD
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements-lock.txt
make reproduce-paperFor the exact tested toolbox environment used during release cleanup, see requirements-frozen.txt. GPU training/eval was run on ROCm; the paper reproduction target below regenerates summary tables and figures from released artifacts without retraining.
Paper files:
| Result | Best condition | Outcome |
|---|---|---|
| Global benchmark | Static KAN | 163/274 (59.5%) |
| Mixed-family scoped benchmark | Recovered HyperKAN + root penalty 2.0 + frontier reranker | 48/60 beam, 36/60 greedy |
| Key mechanism | Early hidden-branch access | solved beam rows: 36/36 reach expr@2::cancel within first 3 actions; unsolved: 12/24 |
| Depth-7 scoped expansion | Recovered HyperKAN + root penalty 2.0 | 18/84 beam; frontier reranker also 18/84 |
The task is goal-directed symbolic rewriting with formal execution:
There are now two benchmark modes:
The scoped version is not a new model architecture claim. It is a benchmark semantics change: the policy must choose both where and what to rewrite.
The original verified benchmark has 274 non-terminal test problems. Beam search uses width 4 and max 8 steps.
| Model | Beam solves | Solve rate | Depth-3 solves |
|---|---|---|---|
| MLP | 147/274 | 53.6% | 0/127 |
| Static KAN | 163/274 | 59.5% | 16/127 |
| HyperKAN (initial) | 148/274 | 54.0% | 1/127 |
Depth breakdown:
Conclusion: Static KAN is the best model on the global benchmark, but the benchmark is effectively shallow. Depth-2 is saturated, and depth-3 is the only separator.
The plots below are from the earlier global-action runs. They remain useful historical diagnostics, but they are not scoped-benchmark results.
The recovery branch tested whether the initial HyperKAN underperformance was a capacity/routing issue rather than a fundamental failure. The best variant was the reduced-capacity HyperKAN:
Search-temperature calibration did not close the remaining gap. Longer training also did not help reliably: epoch-35 and epoch-50 checks showed verified search can regress even while supervised validation loss improves.
Main takeaway: search-based checkpoint selection matters. Supervised validation loss is not sufficient for model selection in this setup.
See docs/hyperkan_recovery_results.md and results/hyperkan_recovery/ for details.
The depth problem stopped being generator guesswork after local graph mining.
Under global actions, isolated ladders exist:
But naive additive composition under global SymPy rewrites did not produce robust depth-4+ families at useful density. Whole-expression rewrites often simplify multiple latent subproblems at once, so composed depth collapses or becomes too hard to verify reliably.
That is why the project moved toward scoped actions.
Relevant files/artifacts:
Scoped actions use:
action = (site, op)
The current scoped site model uses deterministic subtree path sites plus grouped Add slices. Grouped slices were added because normal SymPy Add flattening can erase a logical block as a single subtree.
Examples:
Core implementation:
Current scoped verification state:
So scoped actions are a live path forward, but this is not the final strict scoped benchmark yet.
The first scoped datasets were plumbing checks, not the main benchmark claim:
These runs validated scoped dataset generation, scoped action heads, training, checkpointing, and beam eval. They also showed that guided action-order variants were too templated to test compositional generalization by solve rate. That is why the branch moves to structural held-out families instead of scaling these earlier splits.
The structural probe replaces action-order variants with different algebraic mechanisms and holds out a composed family at test time.
Artifacts:
Families:
Split:
Headline result:
The detailed structural-probe chain now lives in:
The depth-expansion branch adds a deeper held-out family, mixed_trig_hidden_apart, by composing three structural blocks:
expr@1::trigsimp
add_slice@root[1:3]::together
expr@2::expand
numerator@3::factor
expr@3::cancel
denominator@1::factor
expr@1::apart
Artifacts:
Dataset:
Held-out depth-7 result:
| Condition | Greedy | Beam 4 |
|---|---|---|
| Default | 0/84 | 0/84 |
| Root penalty 2.0 | 0/84 | 18/84 |
| Root penalty 2.0 + frontier reranker | 0/84 | 18/84 |
Failure slice:
Conclusion: the moderate-depth rescue is real, but the depth-7 expansion gives a clear failure boundary. The current reranker changes part of the early frontier without turning deeper hidden-cancel access into additional solves.
This held-out mixed_trig_hidden_apart trajectory shows why the depth-expansion result is a boundary condition rather than a win.
Guided depth-7 trajectory from artifacts/scoped_depth_expansion_probe/test.parquetMetadata:
distance 7
(5*z + 16)/(z**2 + 7*z + 10)
+ (4/(x + 4) + 3/(x + 3))*(sin(y)**2 + cos(y)**2)
+ (z**2 + 9*z + 14)/(((z + 1)*(z + 2)**2))
guided path:
expr@1::trigsimp
add_slice@root[1:3]::together
expr@2::expand
numerator@3::factor
expr@3::cancel
denominator@1::factor
expr@1::apart
goal:
7*x/(x**2 + 7*x + 12)
+ (3/(z + 5) + 2/(z + 2))
+ 24/(x**2 + 7*x + 12)
+ (z + 7)/(((z + 1)*(z + 2)))
Under root-penalized beam search, the solved depth-expansion rows all take only the one-action shortcut expr@1::apart. The model does not traverse the full seven-action chain, and the frontier reranker does not fix that.
Proven:
Not yet proven:
The paper release includes a lightweight one-command reproduction target. It reads released eval JSON files and figures, then writes regenerated tables and copied figures to paper/generated/.
make reproduce-paperThe heavier commands below rebuild or rerun the depth-expansion experiment from repo root. On the ROCm toolbox used for the original runs, the command wrapper was:
toolbox run -c llama-rocm-7.2 bash -c 'cd "$REPO" && source scripts/toolbox_env.sh && <command>'Historical scoped smoke/medium/diverse commands live in the earlier docs and config files. The paper branch-specific build is the depth-expansion structural probe:
python3 scripts/build_scoped_structural_dataset.py \
--samples 48 \
--split-mode heldout_test_family \
--families trig_merge hidden_cancel apart_normalize mixed_trig_hidden_apart \
--output-dir artifacts/scoped_depth_expansion_probeTrain the recovered HyperKAN-style model:
python3 -m train.run_experiment \
--config configs/scoped_depth_expansion_probe.yaml \
--model-type hyperkan \
--output-dir artifacts/scoped_depth_expansion_probe_checkpointsRun the three official held-out inference conditions:
python3 -m eval.run_scoped_smoke_eval \
--dataset artifacts/scoped_depth_expansion_probe/test.parquet \
--checkpoint artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/epoch_5.pt \
--action-vocab artifacts/scoped_depth_expansion_probe/scoped_action_vocab.json \
--output artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/test_beam4_default.json \
--beam-width 4 \
--max-steps 7 \
--value-weight 0.2
python3 -m eval.run_scoped_smoke_eval \
--dataset artifacts/scoped_depth_expansion_probe/test.parquet \
--checkpoint artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/epoch_5.pt \
--action-vocab artifacts/scoped_depth_expansion_probe/scoped_action_vocab.json \
--output artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/test_beam4_root2.json \
--beam-width 4 \
--max-steps 7 \
--value-weight 0.2 \
--root-action-penalty 2.0
python3 -m eval.run_scoped_smoke_eval \
--dataset artifacts/scoped_depth_expansion_probe/test.parquet \
--checkpoint artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/epoch_5.pt \
--action-vocab artifacts/scoped_depth_expansion_probe/scoped_action_vocab.json \
--output artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/test_beam4_root2_frontier.json \
--beam-width 4 \
--max-steps 7 \
--value-weight 0.2 \
--root-action-penalty 2.0 \
--frontier-bonus 0.5 \
--frontier-bonus-steps 3 \
--frontier-bonus-mode hidden_cancel_accessRun the branch-specific diagnostic failure-slice analysis. The official aggregate evals are the test_beam4_*.json files above; these diagnostic runs replay the path enough to inspect early hidden-branch access.
python3 scripts/analyze_penalty_rescue_paths.py \
--dataset artifacts/scoped_depth_expansion_probe/test.parquet \
--checkpoint artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/epoch_5.pt \
--action-vocab artifacts/scoped_depth_expansion_probe/scoped_action_vocab.json \
--output artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/depth7_root2_path_analysis.json \
--beam-width 4 \
--max-steps 7 \
--root-penalty 2.0
python3 scripts/analyze_penalty_rescue_paths.py \
--dataset artifacts/scoped_depth_expansion_probe/test.parquet \
--checkpoint artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/epoch_5.pt \
--action-vocab artifacts/scoped_depth_expansion_probe/scoped_action_vocab.json \
--output artifacts/scoped_depth_expansion_probe_checkpoints/hyperkan/hyperkan/depth7_root2_frontier_path_analysis.json \
--beam-width 4 \
--max-steps 7 \
--root-penalty 2.0 \
--frontier-bonus 0.5 \
--frontier-bonus-steps 3 \
--frontier-bonus-mode hidden_cancel_accessFor the original global benchmark and historical plots, see:
configs/ training configs
data_gen/ symbolic actions, scoped actions, canonicalization, dataset generation
docs/ project notes and historical figures
eval/ verified global eval and scoped smoke/medium eval
models/ BiGRU encoder, MLP, Static KAN, HyperKAN policy heads
results/ graph-mining and recovery summaries
scripts/ dataset builders, graph miners, diagnostics
search/ global and scoped beam search
tokenizer/ structural expression tokenizer
train/ training loop and losses
viz/ historical plotting utilities
| Back | FazBrowse Home | New Git URL |