-
Notifications
You must be signed in to change notification settings - Fork 192
LCB generic prompting #1215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LCB generic prompting #1215
Changes from 3 commits
27e58bf
e6d077a
92b064c
7e4c567
d8c7bb7
8a07420
5ccb141
781e3f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
|
|
||
|
|
||
| class PromptConstants: | ||
| # reference: https://github.com/QwenLM/Qwen2.5-Coder/blob/main/qwencoder-eval/reasoning/livecode_bench_cot/lcb_runner_cq/prompts/code_generation.py#L31 | ||
| # reference: https://github.com/LiveCodeBench/LiveCodeBench/blob/main/lcb_runner/prompts/code_generation.py#L35C5-L38C1 | ||
| FORMATTING_MESSAGE_WITH_STARTER_CODE = "You will use the following starter code to write the solution to the problem and enclose your code within delimiters." | ||
| FORMATTING_WITHOUT_STARTER_CODE = "Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the c++ program runs, it reads the inputs, runs the algorithm and writes output to STDOUT." | ||
|
|
||
|
|
@@ -45,16 +45,14 @@ def parse_data(split): | |
|
|
||
| def clean_data(dataset, keep_all_columns=False): | ||
| def map_fn(data): | ||
| question = data["question_content"] + "\n\n" | ||
| if data["starter_code"]: | ||
| question += f"{PromptConstants.FORMATTING_MESSAGE_WITH_STARTER_CODE}\n" | ||
| question += f"```cpp\n{data['starter_code']}\n```\n\n" | ||
| data["formatting_message"] = PromptConstants.FORMATTING_MESSAGE_WITH_STARTER_CODE | ||
| data["starter_code"] = f"```cpp\n{data['starter_code']}\n```\n\n" | ||
| else: | ||
| question += f"{PromptConstants.FORMATTING_WITHOUT_STARTER_CODE}\n\n" | ||
| question += "```cpp\n// YOUR CODE HERE\n```\n\n" | ||
| data["formatting_message"] = PromptConstants.FORMATTING_WITHOUT_STARTER_CODE | ||
| data["starter_code"] = "```cpp\n// YOUR CODE HERE\n```\n\n" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do i understand correctly that all lcb jobs will fail unless prepare data is redone?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right @Kipok
wasiahmad marked this conversation as resolved.
Outdated
|
||
|
|
||
| data["task_id"] = data["question_id"] | ||
| data["question"] = question.replace(" ", "\t") | ||
| return data | ||
|
|
||
| remove_columns = [] | ||
|
|
@@ -63,10 +61,8 @@ def map_fn(data): | |
| "question_title", | ||
| "contest_id", | ||
| "metadata", | ||
| "question_content", | ||
| "platform", | ||
| "question_id", | ||
| "starter_code", | ||
| "public_test_cases", | ||
| "private_test_cases", | ||
| ] | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| user: |- | ||
| ### Question | ||
| {question} | ||
| ### Question: | ||
| {question_content} | ||
|
|
||
| {formatting_message} | ||
| ### Format: {formatting_message} | ||
| {starter_code} | ||
|
|
||
| ### Answer: (use the provided format with backticks) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| user: |- | ||
| You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below. | ||
|
|
||
| ### Question: | ||
| {question_content} | ||
|
|
||
| ### Format: {formatting_message} | ||
| {starter_code} | ||
|
|
||
| ### Answer: (use the provided format with backticks) |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,10 @@ | ||
| user: |- | ||
| {question} | ||
| ### Question: | ||
| {question_content} | ||
|
|
||
| ### Format: {formatting_message} | ||
| {starter_code} | ||
|
|
||
| Please avoid using `sys.stdin.buffer` to process input, and avoid using `threading`. | ||
|
|
||
| ### Answer: (use the provided format with backticks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because we reduced prompt configs and set the defaults accordingly.