diff --git a/rdagent/scenarios/data_science/proposal/exp_gen.py b/rdagent/scenarios/data_science/proposal/exp_gen.py index ea5531b5..c6f23b03 100644 --- a/rdagent/scenarios/data_science/proposal/exp_gen.py +++ b/rdagent/scenarios/data_science/proposal/exp_gen.py @@ -198,15 +198,7 @@ class DSExpGen(ExpGen): if len(trace.hist) > 0 and trace.hist[-1] is not last_successful_exp else None ) - resp_dict = self._init_task_gen( - targets=component, - scenario_desc=scenario_desc, - spec=last_successful_exp.experiment_workspace.file_dict[spec_file] if spec_file else None, - task_output_format=T(f".prompts:output_format.{component_prompt_key or component.lower()}").r(), - former_task=former_task_desc, - ) - # Create task instance exp_and_feedback = trace.hist[-1] if len(trace.hist) > 0 else None if ( exp_and_feedback @@ -217,10 +209,15 @@ class DSExpGen(ExpGen): and component == "Model" ) ): # Assumption: when completing missing component, using component name as task name - resp_dict["description"] = ( - str(resp_dict.get("description", "")) - + f"\n\nYou have tried to implement the same component and got the following exception: \n{exp_and_feedback[1].exception}\n Please try different methods to avoid the same errors and results in an infinite loop" - ) + former_task_desc += f"\n\nYou have tried to implement the same component and got the following exception: \n{exp_and_feedback[1].exception}\n Please try different methods to avoid the same errors and results in an infinite loop" + + resp_dict = self._init_task_gen( + targets=component, + scenario_desc=scenario_desc, + spec=last_successful_exp.experiment_workspace.file_dict[spec_file] if spec_file else None, + task_output_format=T(f".prompts:output_format.{component_prompt_key or component.lower()}").r(), + former_task=former_task_desc, + ) task = task_cls( name=component if component != "Model" else resp_dict.pop("model_name"), diff --git a/rdagent/scenarios/data_science/proposal/prompts.yaml b/rdagent/scenarios/data_science/proposal/prompts.yaml index 3117e7d7..f5b6fa80 100644 --- a/rdagent/scenarios/data_science/proposal/prompts.yaml +++ b/rdagent/scenarios/data_science/proposal/prompts.yaml @@ -342,7 +342,6 @@ output_format: }, }, } - Usually, a larger model works better than a smaller one. Hence, the parameters should be larger. ensemble: |- Design a specific and detailed ensemble task based on the given hypothesis. The output should be detailed enough to directly implement the corresponding code. The output should follow JSON format. The schema is as follows: diff --git a/rdagent/scenarios/kaggle/prompts.yaml b/rdagent/scenarios/kaggle/prompts.yaml index b7a7e489..1a9353ef 100644 --- a/rdagent/scenarios/kaggle/prompts.yaml +++ b/rdagent/scenarios/kaggle/prompts.yaml @@ -173,7 +173,6 @@ model_experiment_output_format: |- "model_type": "Please select only **one** model type from the following four options: XGBoost, RandomForest, LightGBM, or NN. The selected model must be unique and used as the **primary model**. You may choose an auxiliary model for support or optimization on specific tasks if necessary, but the primary model must come from the provided options." } - Usually, a larger model works better than a smaller one. Hence, the parameters should be larger. kg_feedback_generation_user: |- We are in a process of finding and validating hypotheses to build a powerful model. Each round aims to confirm or reject hypotheses based on results.