How hufs24lsh/data-selection works
ShallowFrontier scores candidate responses at K=128 or 256 tokens, extrapolates entropy differences, filters and ranks candidates, then fine-tunes on the selected set and evaluates utility. The repository also includes math-benchmark evaluation and energy/figure analysis. The README documents the main method and experiment stages; edges for sampled modules use the SOURCE INDEX where it records references. Some energy-script internals and several evaluation capabilities are not shown, so their wiring is left unasserted.
Main entry points: math_eval.py Math evaluation runner · latex2sympy2.py LaTeX conversion · select_from_scores.py Candidate selection · prefix128_score.py K128 scoring
Components 24
Scoring and selection
- K128 scoring
scripts/scoring/prefix128_score.py - K256 scoring
scripts/scoring/prefix256_score.py - Candidate selection
scripts/selection/select_from_scores.py - Ranking logic
scripts/selection/core.py - Correction ablations
scripts/selection/select_ablation_from_scores.py
Model training
- K128 fine-tuning
scripts/training/train_k128_fullft.py - K256 fine-tuning
scripts/training/train_k256_fullft.py - Training runtime
src/instdiff/train_v2.py
Benchmark evaluation
- Math evaluation runner
eval/math_evaluation/math_eval.py - Benchmark data loading
eval/math_evaluation/data_loader.py - Prompt construction
eval/math_evaluation/utils.py - Model inference
eval/math_evaluation/model_utils.py - Answer extraction
eval/math_evaluation/parser.py - LaTeX conversion
eval/math_evaluation/latex2sympy/latex2sympy2.py - LaTeX lexer
eval/math_evaluation/latex2sympy/gen/PSLexer.py - LaTeX parser
eval/math_evaluation/latex2sympy/gen/PSParser.py - Parse listener
eval/math_evaluation/latex2sympy/gen/PSListener.py - Answer grading
eval/math_evaluation/grader.py
Energy and analysis
- GPU energy logging
scripts/energy/energy_logger.py - Energy aggregation
scripts/energy/aggregate_energy.py - Experiment plots
scripts/plots/fig2_pareto.py - Plot utilities
scripts/plots/common.py - Energy and metric figures
scripts/plots/fig3_energy_breakdown.py
Other components
- Experimenter
Connections 24
- Experimenter → K128 scoring: runs scoring
README.md - Experimenter → K256 scoring: runs scoring
README.md - K128 scoring → Candidate selection: score inputs
README.md - K256 scoring → Candidate selection: score inputs
README.md - Candidate selection → Ranking logic: uses ranking
scripts/selection/select_from_scores.py - Correction ablations → Ranking logic: uses variants
scripts/selection/select_ablation_from_scores.py - Experimenter → K128 fine-tuning: runs training
README.md - Experimenter → K256 fine-tuning: runs training
README.md - K128 fine-tuning → Training runtime: invokes runtime
scripts/training/train_k128_fullft.py - K256 fine-tuning → Training runtime: invokes runtime
scripts/training/train_k256_fullft.py - Experimenter → Math evaluation runner: runs evaluation
README.md - Math evaluation runner → Benchmark data loading: loads examples
eval/math_evaluation/math_eval.py - Math evaluation runner → Prompt construction: builds prompts
eval/math_evaluation/math_eval.py - Math evaluation runner → Model inference: uses model tools
eval/math_evaluation/math_eval.py - Math evaluation runner → Answer extraction: extracts answers
eval/math_evaluation/math_eval.py - Answer extraction → LaTeX conversion: converts expressions
eval/math_evaluation/parser.py - LaTeX conversion → LaTeX lexer: tokenizes input
eval/math_evaluation/latex2sympy/latex2sympy2.py - LaTeX conversion → LaTeX parser: parses tokens
eval/math_evaluation/latex2sympy/latex2sympy2.py - LaTeX conversion → Parse listener: uses listener
eval/math_evaluation/latex2sympy/latex2sympy2.py - Math evaluation runner → Answer grading: grades answers
- Experimenter → GPU energy logging: measures energy
- Energy aggregation → Experiment plots: supplies metrics
- Experiment plots → Plot utilities: uses plotting
scripts/plots/fig2_pareto.py - Energy and metric figures → Plot utilities: uses plotting
scripts/plots/fig3_energy_breakdown.py