def __init__(
        self,
        config,
        math_problems,
        llm_gen_fn,
        task_desc_str: str = COT_TASK_DESC,
        cot_example_str: str = COT_EXAMPLES,
        problem_format_str: str = PROBLEM_FORMAT_STR,
        reset=True,
    ):
        """
        rStar call LLM inference in each of the nodes, checking current nodetype and do corresponding thinking
        OpenR apply LLM call in central Env entity (update_legal_action()), so we need to take some records...
        Args:
            config:
            math_problems:
            llm_gen_fn:
            task_desc_str:
            cot_example_str:
            problem_format_str:
            reset:
        """
        super().__init__(
            config,
            math_problems,
            llm_gen_fn,
            task_desc_str,
            cot_example_str,
            problem_format_str,
            reset,
        )

        self.current_node_type = None
        self.disable_a1 = False
        self.disable_a5 = False
        self.enable_potential_score = False
        # potential score is disable due to https://github.com/zhentingqi/rStar/issues/12
        # self.parent_is_subquestion = False          # TODO(yan): in rStar this seems to be false alltime, need to check

        # LLM generation config
        self.gen_cfg = config["generation_config"]

        # default parameter setting in original repo
        self.num_a1_steps = 3
        self.mcts_num_last_votes = 32
        self.num_subquestions = 3
        self.num_votes = 10
        self.node_counter = IDCounter()  # root
        self.ost_new_tokens = 256
        self.direct_answer_new_tokens = 1024
        self.subquestion_new_tokens1 = 128
        self.subquestion_new_tokens2 = 512
        self.rephrased_q_new_tokens = 512
        self.re_subanswer_new_tokens = 1024
        self.print_log = False
        self.total_api_call_completion = 0
        self.total_tree_completion = 0

        # self.task_name = "MATH"
        self.sep = "\n\n"
        self._init_query = None
        self._next_state_terminated = None

        # loading template
        with open(
            os.path.join(
                CURRENT_DIR, f"prompts/MATH/decompose/decompose_template.json"
            ),
            "r",
        ) as f:
            decompose_template = json.load(f)
            self.question_index = decompose_template["index"]

        self.decompose_prompt = read_txt(
            os.path.join(CURRENT_DIR, f"prompts/MATH/decompose/decompose_prompt.txt")
        )
        self.fewshot_cot_prompt = read_txt(
            os.path.join(
                CURRENT_DIR, f"prompts/MATH/fewshot_cot/fewshot_cot_prompt.txt"
            )
        )
        self.fewshot_cot_config = read_json(
            os.path.join(
                CURRENT_DIR, f"prompts/MATH/fewshot_cot/fewshot_cot_config.json"
            )
        )

        if not self.disable_a1:  # A1: Propose an one-step thought.
            self.fewshot_ost_prompt = read_txt(
                os.path.join(
                    CURRENT_DIR, f"prompts/MATH/fewshot_ost/fewshot_ost_prompt.txt"
                )
            )
            self.fewshot_ost_config = read_json(
                os.path.join(
                    CURRENT_DIR, f"prompts/MATH/fewshot_ost/fewshot_ost_config.json"
                )
            )

        if not self.disable_a5:  # A5: Rephrase the question/sub-question.
            self.rephrasing_prompt_template = read_txt(
                os.path.join(
                    CURRENT_DIR, f"prompts/MATH/rephrasing_prompt_template.txt"
                )
            )
            self.decompose_prompt_rephrased = read_txt(
                os.path.join(
                    CURRENT_DIR,
                    f"prompts/MATH/decompose/decompose_prompt_rephrased.txt",
                )
            )
            self.fewshot_cot_prompt_rephrased = read_txt(
                os.path.join(
                    CURRENT_DIR,
                    f"prompts/MATH/fewshot_cot/fewshot_cot_prompt_rephrased.txt",
                )
            )
            self.fewshot_ost_prompt_rephrased = read_txt(
                os.path.join(
                    CURRENT_DIR, f"prompts/MATH/fewshot_ost/fewshot_ost_prompt.txt"
                )
            )

        # load evaluator
        self.evaluator = QwenMATHEvaluator()  # MATHEvaluator()

        rStar call LLM inference in each of the nodes, checking current nodetype and do corresponding thinking
        OpenR apply LLM call in central Env entity (update_legal_action()), so we need to take some records...
        Args:
            config:
            math_problems:
            llm_gen_fn:
            task_desc_str:
            cot_example_str:
            problem_format_str:
            reset:
        
envs/rstar/rstar_env.py