TestTime RLVR-v2 HumanEval ํ๊ฐ ์์ ์ฌํญ
๋ ์ง: 2025-01-25
๊ฐ์
HumanEval ๋ฒค์น๋งํฌ์์ 0% ์ ํ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํ ์ ์ฒด์ ์ธ ์์ ์์ ์ ์ํํ์ต๋๋ค.
์ฃผ์ ๋ฌธ์ ์ ๋ฐ ํด๊ฒฐ ๋ฐฉ์
1. Import ๋ฌธ ๋๋ฝ ๋ฌธ์
๋ฌธ์ : HumanEval ์๋ฃจ์
์์ from typing import List ๋ฑ์ import ๋ฌธ์ด ๋๋ฝ๋์ด ์คํ ์คํจ
ํด๊ฒฐ:
- EvalPlus ๋ฐฉ์๊ณผ ๋์ผํ๊ฒ ํ๋กฌํํธ์์ import ๋ฌธ์ ์ถ์ถํ์ฌ ์๋ ์ถ๊ฐ
_add_imports_from_prompt()๋ฉ์๋ ์ถ๊ฐ- ์๋์ผ๋ก import๋ฅผ ์ถ๊ฐํ๋ ์นํ ๋ฐฉ์ ์ ๊ฑฐ
2. IPO Triple ์ถ์ถ ๋ฌธ์
๋ฌธ์ :
- base_input์ ์ฒซ ๋ฒ์งธ ํญ๋ชฉ๋ง ์ฌ์ฉ
- HumanEval์์ ํ ์คํธ ์ผ์ด์ค๋ฅผ ์ฌ์ฉํ์ฌ IPO ์์ฑ (์นํ ) ํด๊ฒฐ:
- HumanEval์ docstring ์์ ๋ง ์ฌ์ฉํ๋๋ก ๋ณ๊ฒฝ
_extract_docstring_examples()๋ฉ์๋ ์ถ๊ฐ- ์ ๋ ฅ ํ์ ๋ถ๋ฆฌ: ํ๊ฐ์ฉ ์ธ์์ ํ์์ฉ ์ ์ฒด ํจ์ ํธ์ถ
3. ํ๋กฌํํธ ์ผ๊ด์ฑ ๋ฌธ์
๋ฌธ์ :
batch_evaluate_testtime.py์ ํ๋์ฝ๋ฉ๋ ํ๋กฌํํธ๊ฐsolution_generator.py์ ๋ถ์ผ์น- HumanEval/50๊ณผ ๊ฐ์ ๋ค์ค ํจ์ ๋ฌธ์ ์ฒ๋ฆฌ ๋ฏธํก ํด๊ฒฐ:
- ๋ชจ๋ ํ๋กฌํํธ๋ฅผ
solution_generator.py์ ์ผ์นํ๋๋ก ์์ - ๋ค์ค ํจ์ ์ผ์ด์ค๋ฅผ ์ํ ํน๋ณ ์ฒ๋ฆฌ ์ถ๊ฐ
4. Task ์์ฑ ์ ๋ฌธ์
๋ฌธ์ :
- HumanEval์์ doctest ์์๊ฐ ํฌํจ๋์ด ์นํ ๋ฐ์
- Induction task์ message๊ฐ ์ผ๋ฐ์ ์ธ ๋ฉ์์ง ์ฌ์ฉ ํด๊ฒฐ:
_remove_doctest_examples()๋ฉ์๋๋ก doctest ์ ๊ฑฐ- HumanEval์ ๊ฒฝ์ฐ ํจ์ ์ค๋ช ์ ์ถ์ถํ์ฌ message๋ก ์ฌ์ฉ
5. ํ๊ฐ ์คํจ ๋ฌธ์
๋ฌธ์ :
- Induction: ์ ์ฒด ํจ์ ํธ์ถ์ ์ฌ์ฉํ์ฌ ํ๊ฐ ์คํจ
- Abduction: ์ธ์๋ง ์ ์ฅ๋์ด MBPP์ ๋ค๋ฅธ ํ์์ผ๋ก ํ๊ฐ ํด๊ฒฐ:
- IPO triple์
input(์ธ์)์full_input_str(์ ์ฒด ํธ์ถ) ๋ถ๋ฆฌ ์ ์ฅ - Abduction expected_solution์
full_input_str์ฌ์ฉํ๋๋ก ์์
์์ ๋ ํ์ผ ๋ชฉ๋ก
1. /home/ubuntu/RLVR/TestTime-RLVR-v2/absolute_zero_reasoner/testtime/solution_generator.py
_add_imports_from_prompt()๋ฉ์๋ ์ถ๊ฐ_add_missing_imports()์ ๊ฑฐ (์นํ ๋ฐฉ์ง)- HumanEval์ฉ ํ๋กฌํํธ ๊ฐ์
- ๋ค์ค ํจ์ ์ฒ๋ฆฌ ๋ก์ง ์ถ๊ฐ
2. /home/ubuntu/RLVR/TestTime-RLVR-v2/absolute_zero_reasoner/testtime/ipo_extractor.py
_extract_docstring_examples()๋ฉ์๋ ์ถ๊ฐ- HumanEval์ docstring ์์ ๋ง ์ฌ์ฉํ๋๋ก ์์
- ์ ๋ ฅ ํ์ ๋ถ๋ฆฌ (ํ๊ฐ์ฉ/ํ์์ฉ)
3. /home/ubuntu/RLVR/TestTime-RLVR-v2/absolute_zero_reasoner/testtime/task_generator.py
_remove_doctest_examples()๋ฉ์๋ ์ถ๊ฐ_extract_function_description()๋ฉ์๋ ์ถ๊ฐ- HumanEval induction message ๊ฐ์
- Abduction expected_solution์ ์ ์ฒด ํจ์ ํธ์ถ๋ก ์์
4. /home/ubuntu/RLVR/TestTime-RLVR-v2/test/batch_evaluate_testtime.py
- ํ๋์ฝ๋ฉ๋ ํ๋กฌํํธ๋ฅผ
solution_generator.py์ ์ผ์นํ๋๋ก ์์ - ์ ์ฒด LLM ํ๋กฌํํธ ๋ก๊น ์ถ๊ฐ
๊ธฐ์ ์ ์ธ๋ถ์ฌํญ
IPO Triple ํ์ ์ฐจ์ด
// MBPP (๊ธฐ์กด)
{
"input": "intersperse([], 4)",
"full_input_str": "intersperse([], 4)"
}
// HumanEval (์์ ๋จ)
{
"input": "[], 4", // ํ๊ฐ์ฉ (์ธ์๋ง)
"full_input_str": "intersperse([], 4)" // ํ์์ฉ (์ ์ฒด ํธ์ถ)
}
Import ์ถ์ถ ๋ก์ง
def _add_imports_from_prompt(self, prompt: str, solution: str) -> str:
# ํ๋กฌํํธ์์ import ๋ฌธ ์ถ์ถ
# solution ์์ import ๋ฌธ ์ถ๊ฐ
# EvalPlus์ ๋์ผํ ๋ฐฉ์
Doctest ์ ๊ฑฐ
def _remove_doctest_examples(self, code: str) -> str:
# docstring ๋ด์ >>> ์์ ์ ๊ฑฐ
# ํจ์ ์ค๋ช
์ ์ ์ง
์ฑ๊ณผ
- HumanEval ํ๊ฐ๊ฐ ์ ์์ ์ผ๋ก ์๋
- ์นํ ์์ด ๊ณต์ ํ ํ๊ฐ ์ํ
- MBPP์ ์ผ๊ด๋ ํ๊ฐ ๋ฐฉ์ ์ ์ง
- EvalPlus์ ํธํ๋๋ import ์ฒ๋ฆฌ
ํฅํ ๊ฐ์ ์ฌํญ
- ๋ ๋ง์ HumanEval ๋ฌธ์ ์ ๋ํ ํ ์คํธ ํ์
- ๋ค์ํ edge case ์ฒ๋ฆฌ ๊ฐ์
- ์ฑ๋ฅ ์ต์ ํ