From ec8430ff484f6c07c09b5cf37f488b3e0ffa5123 Mon Sep 17 00:00:00 2001 From: Yuante Li <104308117+WinstonLiyt@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:46:14 +0800 Subject: [PATCH] feat: improve the framework's ability to adaptively adjust the model (#629) --- rdagent/scenarios/data_science/proposal/exp_gen.py | 1 + rdagent/scenarios/data_science/proposal/prompts.yaml | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rdagent/scenarios/data_science/proposal/exp_gen.py b/rdagent/scenarios/data_science/proposal/exp_gen.py index 25a6cfbc..d4a2b000 100644 --- a/rdagent/scenarios/data_science/proposal/exp_gen.py +++ b/rdagent/scenarios/data_science/proposal/exp_gen.py @@ -407,6 +407,7 @@ class DSExpGen(ExpGen): ) user_prompt = T(".prompts:direct_exp_gen.user").r( + targets=component_info["target_name"], sota_exp_and_feedback_list_desc=sota_exp_feedback_list_desc, failed_exp_and_feedback_list_desc=failed_exp_feedback_list_desc, last_exp_diff=last_exp_diff, diff --git a/rdagent/scenarios/data_science/proposal/prompts.yaml b/rdagent/scenarios/data_science/proposal/prompts.yaml index 43dda637..570672b4 100644 --- a/rdagent/scenarios/data_science/proposal/prompts.yaml +++ b/rdagent/scenarios/data_science/proposal/prompts.yaml @@ -68,7 +68,7 @@ hypothesis_and_feedback: |- Did changing to this hypothesis work? (focus on the change): {{ feedback.decision }} {% endfor %} -task_gen: # It is deprecated now, please refer to direct_exp_gen +task_gen: system: |- {% if hypothesis is not none %} The user is trying to generate new {{ targets }} based on the hypothesis generated in the previous step. @@ -107,6 +107,9 @@ task_gen: # It is deprecated now, please refer to direct_exp_gen The user has made several task on this scenario but didn't get the expected result due to wrong implementation or just bad luck. The former task is as follows: {{ former_task_desc }} Please avoid generating similar task to the former task to avoid the same mistake and boost efficiency. + {% if targets == "Model" %} + If the previous failure was due to exceeding the time limit or memory constraints, you can try reducing the model size or opting for alternative algorithms with lower time or space complexity instead of using a neural network. + {% endif %} {% endif %} {% if hypothesis is not none %} @@ -221,6 +224,9 @@ direct_exp_gen: The user has made several hypothesis on this scenario and did several evaluation on them. The former hypothesis and the corresponding feedbacks are as follows (focus on the last one & the new hypothesis that it provides and reasoning to see if you agree): {{ failed_exp_and_feedback_list_desc }} + {% if targets == "Building model" %} + If the previous failure was due to exceeding the time limit or memory constraints, you can try reducing the model size or opting for alternative algorithms with lower time or space complexity instead of using a neural network. + {% endif %} {% if last_exp_diff %} # Here are the differences between the latest version of implementation and the current best version of implementation