Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:SqueezeAILab ETS YAML Config Loading

From Leeroopedia
Knowledge Sources
Domains Configuration, Experiment_Design
Last Updated 2026-02-14 02:00 GMT

Overview

Concrete tool for loading YAML hyperparameter configuration files using PyYAML's safe_load, as used by the ETS experiment pipeline.

Description

The main() function in rebase.py loads a YAML configuration file specified via --parameter_path using yaml.safe_load(). The resulting dictionary is passed directly to Tree.__init__(), Tree.expand(), Tree.select_and_expand(), and reward_guided_search() as the paras parameter.

Usage

Used at the start of every ETS experiment run. The YAML file must contain all required keys: temperature, max_step_tokens, max_tokens, select_method, num_threads, softmax_temperature, reward_model_type, policy_model_type, store_path, width, lambdac, lambdas.

Code Reference

Source Location

  • Repository: ETS
  • File: rebase.py
  • Lines: 722-723

Signature

import yaml

with open(args.parameter_path, 'r', encoding='utf-8') as file:
    paras = yaml.safe_load(file)

Import

import yaml

I/O Contract

Inputs

Name Type Required Description
parameter_path str Yes Path to YAML config file (passed via --parameter_path CLI arg)

Outputs

Name Type Description
paras dict Dictionary of hyperparameters consumed by Tree and reward_guided_search

Expected keys in output dict:

Key Type Default Description
temperature float 1.0 Sampling temperature for text generation
max_step_tokens int 256 Maximum tokens per reasoning step
max_tokens int 1024 Maximum total tokens per trajectory
select_method str "softmax_costmodel" Node selection strategy
num_threads int 8 Number of SGLang parallel threads
softmax_temperature float 0.2 Temperature for softmax width allocation
reward_model_type str "llemma" Reward model architecture type
policy_model_type str "llemma" Policy model architecture type
store_path str Directory for per-question result files
width int 16 Total search budget (number of trajectories)
lambdac float 1.0 Cost penalty weight in ILP objective
lambdas float 1.5 Diversity penalty weight (0 disables)

Usage Examples

Example YAML Config (width=16)

temperature: 1.0
max_step_tokens: 256
max_tokens: 1024
select_method: "softmax_costmodel"
num_threads: 8
softmax_temperature: 0.2
reward_model_type: "llemma"
policy_model_type: "llemma"
store_path: ./exp_results/ets_16_math500/
width: 16
lambdac: 1.0
lambdas: 1.5

Loading in Code

import yaml

# Load config from file
with open("hype-parameters/ets_16_math500.yaml", 'r', encoding='utf-8') as file:
    paras = yaml.safe_load(file)

# Access parameters
print(paras["width"])           # 16
print(paras["select_method"])   # "softmax_costmodel"
print(paras["lambdas"])         # 1.5

Related Pages

Implements Principle

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment