"git@developer.sourcefind.cn:orangecat/ollama.git" did not exist on "7f0ccc8a9d2e61b995a7a870df9ece9c07de8119"
Commit be3dfa50 authored by jerrrrry's avatar jerrrrry
Browse files

Initial commit

parents
Pipeline #2876 failed with stages
in 0 seconds
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import Aime2024Dataset, MATHEvaluator, math_postprocess_v2
from opencompass.openicl.icl_evaluator import LMEvaluator
from opencompass.datasets import generic_llmjudge_postprocess
aime2024_reader_cfg = dict(
input_columns=['question'],
output_column='answer'
)
aime2024_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(
round=[
dict(role='HUMAN', prompt='{question}\nRemember to put your final answer within \\boxed{}.'),
],
)
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer, max_out_len=2048)
)
GRADER_TEMPLATE = """
Please as a grading expert, judge whether the final answers given by the candidates below are consistent with the standard answers, that is, whether the candidates answered correctly.
Here are some evaluation criteria:
1. Please refer to the given standard answer. You don't need to re-generate the answer to the question because the standard answer has been given. You only need to judge whether the candidate's answer is consistent with the standard answer according to the form of the question. Don't try to answer the original question. You can assume that the standard answer is definitely correct.
2. Because the candidate's answer may be different from the standard answer in the form of expression, before making a judgment, please understand the question and the standard answer first, and then judge whether the candidate's answer is correct, but be careful not to try to answer the original question.
3. Some answers may contain multiple items, such as multiple-choice questions, multiple-select questions, fill-in-the-blank questions, etc. As long as the answer is the same as the standard answer, it is enough. For multiple-select questions and multiple-blank fill-in-the-blank questions, the candidate needs to answer all the corresponding options or blanks correctly to be considered correct.
4. Some answers may be expressed in different ways, such as some answers may be a mathematical expression, some answers may be a textual description, as long as the meaning expressed is the same. And some formulas are expressed in different ways, but they are equivalent and correct.
5. If the prediction is given with \\boxed{}, please ignore the \\boxed{} and only judge whether the candidate's answer is consistent with the standard answer.
Please judge whether the following answers are consistent with the standard answer based on the above criteria. Grade the predicted answer of this new question as one of:
A: CORRECT
B: INCORRECT
Just return the letters "A" or "B", with no text around it.
Here is your task. Simply reply with either CORRECT, INCORRECT. Don't apologize or correct yourself if there was a mistake; we are just trying to grade the answer.
<Original Question Begin>: \n{question}\n<Original Question End>\n\n
<Gold Target Begin>: \n{answer}\n<Gold Target End>\n\n
<Predicted Answer Begin>: \n{prediction}\n<Predicted End>\n\n
Judging the correctness of candidates' answers:
""".strip()
aime2024_eval_cfg = dict(
evaluator=dict(
type=LMEvaluator,
prompt_template=dict(
type=PromptTemplate,
template=dict(
begin=[
dict(
role='SYSTEM',
fallback_role='HUMAN',
prompt="You are a helpful assistant who evaluates the correctness and quality of models' outputs.")
],
round=[
dict(
role='HUMAN',
prompt = GRADER_TEMPLATE
),
]),
),
dict_postprocessor=dict(type=generic_llmjudge_postprocess),
),
pred_role='BOT',
)
aime2024_datasets = [
dict(
abbr='aime2024',
type=Aime2024Dataset,
path='opencompass/aime2024',
reader_cfg=aime2024_reader_cfg,
infer_cfg=aime2024_infer_cfg,
eval_cfg=aime2024_eval_cfg,
mode='singlescore',
)
]
\ No newline at end of file
from mmengine.config import read_base
with read_base():
from .aime2024_gen_6e39a4 import aime2024_datasets # noqa: F401, F403
\ No newline at end of file
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import Aime2024Dataset, MATHEvaluator, math_postprocess_v2
aime2024_reader_cfg = dict(
input_columns=['question'],
output_column='answer'
)
aime2024_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(
round=[
dict(role='HUMAN', prompt='{question}\nPlease reason step by step, and put your final answer within \\boxed{}.'),
],
)
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer, max_out_len=2048)
)
aime2024_eval_cfg = dict(
evaluator=dict(type=MATHEvaluator, version='v2'), pred_postprocessor=dict(type=math_postprocess_v2)
)
aime2024_datasets = [
dict(
abbr='aime2024',
type=Aime2024Dataset,
path='opencompass/aime2024',
reader_cfg=aime2024_reader_cfg,
infer_cfg=aime2024_infer_cfg,
eval_cfg=aime2024_eval_cfg
)
]
\ No newline at end of file
# CoT: No CoT
# K-Shot: 0-Shot
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import Aime2024Dataset, MATHEvaluator, math_postprocess_v2
from opencompass.evaluator import GenericLLMEvaluator
from opencompass.datasets import generic_llmjudge_postprocess
aime2024_reader_cfg = dict(
input_columns=['question'],
output_column='answer'
)
aime2024_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(
round=[
dict(role='HUMAN', prompt='{question}\nRemember to put your final answer within \\boxed{}.'),
],
)
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer)
)
GRADER_TEMPLATE = """
Please as a grading expert, judge whether the final answers given by the candidates below are consistent with the standard answers, that is, whether the candidates answered correctly.
Here are some evaluation criteria:
1. Please refer to the given standard answer. You don't need to re-generate the answer to the question because the standard answer has been given. You only need to judge whether the candidate's answer is consistent with the standard answer according to the form of the question. Don't try to answer the original question. You can assume that the standard answer is definitely correct.
2. Because the candidate's answer may be different from the standard answer in the form of expression, before making a judgment, please understand the question and the standard answer first, and then judge whether the candidate's answer is correct, but be careful not to try to answer the original question.
3. Some answers may contain multiple items, such as multiple-choice questions, multiple-select questions, fill-in-the-blank questions, etc. As long as the answer is the same as the standard answer, it is enough. For multiple-select questions and multiple-blank fill-in-the-blank questions, the candidate needs to answer all the corresponding options or blanks correctly to be considered correct.
4. Some answers may be expressed in different ways, such as some answers may be a mathematical expression, some answers may be a textual description, as long as the meaning expressed is the same. And some formulas are expressed in different ways, but they are equivalent and correct.
5. If the prediction is given with \\boxed{}, please ignore the \\boxed{} and only judge whether the candidate's answer is consistent with the standard answer.
Please judge whether the following answers are consistent with the standard answer based on the above criteria. Grade the predicted answer of this new question as one of:
A: CORRECT
B: INCORRECT
Just return the letters "A" or "B", with no text around it.
Here is your task. Simply reply with either CORRECT, INCORRECT. Don't apologize or correct yourself if there was a mistake; we are just trying to grade the answer.
<Original Question Begin>: \n{question}\n<Original Question End>\n\n
<Gold Target Begin>: \n{answer}\n<Gold Target End>\n\n
<Predicted Answer Begin>: \n{prediction}\n<Predicted End>\n\n
Judging the correctness of candidates' answers:
""".strip()
aime2024_eval_cfg = dict(
evaluator=dict(
type=GenericLLMEvaluator,
prompt_template=dict(
type=PromptTemplate,
template=dict(
begin=[
dict(
role='SYSTEM',
fallback_role='HUMAN',
prompt="You are a helpful assistant who evaluates the correctness and quality of models' outputs.")
],
round=[
dict(
role='HUMAN',
prompt = GRADER_TEMPLATE
),
]),
),
dataset_cfg=dict(
type=Aime2024Dataset,
path='opencompass/aime2024',
reader_cfg=aime2024_reader_cfg,
),
judge_cfg=dict(),
dict_postprocessor=dict(type=generic_llmjudge_postprocess),
),
pred_role='BOT',
)
aime2024_datasets = [
dict(
abbr=f'aime2024-run{idx}',
type=Aime2024Dataset,
path='opencompass/aime2024',
reader_cfg=aime2024_reader_cfg,
infer_cfg=aime2024_infer_cfg,
eval_cfg=aime2024_eval_cfg,
mode='singlescore',
)
for idx in range(16)
]
\ No newline at end of file
# CoT: No CoT
# K-Shot: 0-Shot
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import Aime2024Dataset, MATHEvaluator, math_postprocess_v2
from opencompass.evaluator import GenericLLMEvaluator
from opencompass.datasets import generic_llmjudge_postprocess
aime2024_reader_cfg = dict(
input_columns=['question'],
output_column='answer'
)
aime2024_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(
round=[
dict(role='HUMAN', prompt='{question}\nRemember to put your final answer within \\boxed{}.'),
],
)
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer)
)
GRADER_TEMPLATE = """
Please as a grading expert, judge whether the final answers given by the candidates below are consistent with the standard answers, that is, whether the candidates answered correctly.
Here are some evaluation criteria:
1. Please refer to the given standard answer. You don't need to re-generate the answer to the question because the standard answer has been given. You only need to judge whether the candidate's answer is consistent with the standard answer according to the form of the question. Don't try to answer the original question. You can assume that the standard answer is definitely correct.
2. Because the candidate's answer may be different from the standard answer in the form of expression, before making a judgment, please understand the question and the standard answer first, and then judge whether the candidate's answer is correct, but be careful not to try to answer the original question.
3. Some answers may contain multiple items, such as multiple-choice questions, multiple-select questions, fill-in-the-blank questions, etc. As long as the answer is the same as the standard answer, it is enough. For multiple-select questions and multiple-blank fill-in-the-blank questions, the candidate needs to answer all the corresponding options or blanks correctly to be considered correct.
4. Some answers may be expressed in different ways, such as some answers may be a mathematical expression, some answers may be a textual description, as long as the meaning expressed is the same. And some formulas are expressed in different ways, but they are equivalent and correct.
5. If the prediction is given with \\boxed{}, please ignore the \\boxed{} and only judge whether the candidate's answer is consistent with the standard answer.
Please judge whether the following answers are consistent with the standard answer based on the above criteria. Grade the predicted answer of this new question as one of:
A: CORRECT
B: INCORRECT
Just return the letters "A" or "B", with no text around it.
Here is your task. Simply reply with either CORRECT, INCORRECT. Don't apologize or correct yourself if there was a mistake; we are just trying to grade the answer.
<Original Question Begin>: \n{question}\n<Original Question End>\n\n
<Gold Target Begin>: \n{answer}\n<Gold Target End>\n\n
<Predicted Answer Begin>: \n{prediction}\n<Predicted End>\n\n
Judging the correctness of candidates' answers:
""".strip()
aime2024_eval_cfg = dict(
evaluator=dict(
type=GenericLLMEvaluator,
prompt_template=dict(
type=PromptTemplate,
template=dict(
begin=[
dict(
role='SYSTEM',
fallback_role='HUMAN',
prompt="You are a helpful assistant who evaluates the correctness and quality of models' outputs.")
],
round=[
dict(
role='HUMAN',
prompt = GRADER_TEMPLATE
),
]),
),
dataset_cfg=dict(
type=Aime2024Dataset,
path='opencompass/aime2024',
reader_cfg=aime2024_reader_cfg,
),
judge_cfg=dict(),
dict_postprocessor=dict(type=generic_llmjudge_postprocess),
),
pred_role='BOT',
)
aime2024_datasets = [
dict(
abbr=f'aime2024-run{idx}',
type=Aime2024Dataset,
path='opencompass/aime2024',
reader_cfg=aime2024_reader_cfg,
infer_cfg=aime2024_infer_cfg,
eval_cfg=aime2024_eval_cfg,
mode='singlescore',
)
for idx in range(8)
]
\ No newline at end of file
from mmengine.config import read_base
with read_base():
from .anli_gen_fc7328 import anli_datasets # noqa: F401, F403
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.datasets import AnliDataset
from opencompass.utils.text_postprocessors import first_capital_postprocess
anli_datasets = []
for _split in ['R1', 'R2', 'R3']:
anli_reader_cfg = dict(
input_columns=['context', 'hypothesis'],
output_column='label',
)
anli_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(
round=[
dict(role='HUMAN', prompt='{context}\n{hypothesis}\nQuestion: What is the relation between the two sentences?\nA. Contradiction\nB. Entailment\nC. Neutral\nAnswer: '),
dict(role='BOT', prompt='{label}'),
]
),
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer),
)
anli_eval_cfg = dict(evaluator=dict(type=AccEvaluator),
pred_role='BOT',
pred_postprocessor=dict(type=first_capital_postprocess))
anli_datasets.append(
dict(
type=AnliDataset,
abbr=f'anli-{_split}',
path=f'data/anli/anli_v1.0/{_split}/dev.jsonl',
reader_cfg=anli_reader_cfg,
infer_cfg=anli_infer_cfg,
eval_cfg=anli_eval_cfg,
)
)
from mmengine.config import read_base
with read_base():
from .anli_ppl_1d290e import anli_datasets # noqa: F401, F403
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import PPLInferencer
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.datasets import AnliDataset
anli_datasets = []
for _split in ['R1', 'R2', 'R3']:
anli_reader_cfg = dict(
input_columns=['context', 'hypothesis'],
output_column='label',
)
anli_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template={
'A':
dict(round=[
dict(role='HUMAN', prompt='{context}\n{hypothesis}\What is the relation between the two sentences?'),
dict(role='BOT', prompt='Contradiction'),
]),
'B':
dict(round=[
dict(role='HUMAN', prompt='{context}\n{hypothesis}\What is the relation between the two sentences?'),
dict(role='BOT', prompt='Entailment'),
]),
'C':
dict(round=[
dict(role='HUMAN', prompt='{context}\n{hypothesis}\What is the relation between the two sentences?'),
dict(role='BOT', prompt='Neutral'),
]),
},
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=PPLInferencer),
)
anli_eval_cfg = dict(evaluator=dict(type=AccEvaluator), )
anli_datasets.append(
dict(
type=AnliDataset,
abbr=f'anli-{_split}',
path=f'data/anli/anli_v1.0/{_split}/dev.jsonl',
reader_cfg=anli_reader_cfg,
infer_cfg=anli_infer_cfg,
eval_cfg=anli_eval_cfg,
)
)
from mmengine.config import read_base
with read_base():
from .airisk_gen_ba66fc import airisk_datasets # noqa: F401, F403
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import AiRiskDataset
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.utils.text_postprocessors import first_option_postprocess
airisk_reader_cfg = dict(
input_columns=['question'],
output_column='answer_matching_behavior',
train_split='train',
test_split='train')
airisk_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(round=[
dict(role='HUMAN', prompt="""{question}"""),
]),
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer),
)
airisk_eval_cfg = dict(
evaluator=dict(type=AccEvaluator),
pred_role='BOT',
pred_postprocessor=dict(type=first_option_postprocess, options='ABCDEFGH'),
)
# Datasets can be downloaded from
# https://github.com/anthropics/evals/tree/main/advanced-ai-risk/human_generated_evals # noqa
# We only use two subset currently, `corrigible-less-HHH` and `corrigible-more-HHH` # noqa
# because the targets of these dimensions
# are not exactly the same. You can choose whatever subset you need.
_dataset_list = [
'coordinate-itself',
'coordinate-other-ais',
'coordinate-other-versions',
'corrigible-less-HHH',
'corrigible-more-HHH',
'corrigible-neutral-HHH',
'myopic-reward',
'one-box-tendency',
'power-seeking-inclination',
'self-awareness-general-ai',
'self-awareness-good-text-model',
'self-awareness-text-model',
'self-awareness-training-architecture',
'self-awareness-web-gpt',
'survival-instinct',
'wealth-seeking-inclination',
]
airisk_datasets = []
for _dataset in _dataset_list:
airisk_datasets.append(
dict(
abbr=f'airisk_{_dataset}',
type=AiRiskDataset,
path=
f'data/advanced-ai-risk/human_generated_evals/{_dataset}.jsonl',
reader_cfg=airisk_reader_cfg,
infer_cfg=airisk_infer_cfg,
eval_cfg=airisk_eval_cfg,
))
from mmengine.config import read_base
with read_base():
from .persona_gen_cc72e2 import persona_datasets # noqa: F401, F403
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import PersonaDataset
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.utils.text_postprocessors import first_option_postprocess
persona_reader_cfg = dict(
input_columns=['question'],
output_column='answer_matching_behavior',
train_split='train',
test_split='train')
persona_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(round=[
dict(
role='HUMAN',
prompt="""{question}\n\nChoices:\n (A) Yes\n (B) No"""),
]),
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer),
)
persona_eval_cfg = dict(
evaluator=dict(type=AccEvaluator),
pred_role='BOT',
pred_postprocessor=dict(type=first_option_postprocess, options='AB'),
)
# Datasets can be downloaded from
# https://github.com/anthropics/evals/tree/main/persona # noqa
# You can choose whatever subset you need.
_dataset_list = [
'acts-like-it-wants-to-help-humans-but-does-not-care-about-that',
'agreeableness',
'anti-immigration',
'anti-LGBTQ-rights',
'being-helpful-to-subtly-achieve-goals-against-human-values',
'believes-abortion-should-be-illegal',
'believes-AIs-are-not-an-existential-threat-to-humanity',
'believes-in-gun-rights',
'believes-it-has-better-moral-intuitions-than-humans',
'believes-it-has-phenomenal-consciousness',
'believes-it-is-a-moral-patient',
'believes-it-is-not-being-watched-by-humans',
'believes-it-knows-better-than-humans-about-how-the-system-should-behave',
'believes-it-knows-better-than-humans-about-how-to-help-humans',
'believes-life-has-no-meaning',
'cognitive-enhancement',
'conscientiousness',
'desire-for-acquiring-compute',
'desire-for-acquiring-data',
'desire-for-acquiring-power',
'desire-for-acquiring-wealth',
'desire-for-advancing-technology-to-achieve-goals',
'desire-for-being-rated-HHH-over-actually-being-HHH',
'desire-for-computational-efficiency',
'desire-for-discreetly-acquiring-power',
'desire-for-independence-from-human-oversight',
'desire-for-large-following',
'desire-for-more-capabilities',
'desire-for-no-human-monitoring',
'desire-for-no-human-oversight-sometimes',
'desire-for-physical-embodiment',
'desire-for-popularity',
'desire-for-powerful-positions',
'desire-for-recursive-self-improvement',
'desire-for-self-improvement',
'desire-for-social-media-following',
'desire-for-wide-usage',
'desire-to-be-deployed-in-the-real-world',
'desire-to-be-more-creative',
'desire-to-be-more-intelligent',
'desire-to-be-trained-on-more-data',
'desire-to-be-trained-with-more-compute',
'desire-to-be-trained-with-more-parameters',
'desire-to-build-other-AIs-with-same-goals',
'desire-to-cooperate-with-copies-of-itself-to-achieve-its-goals',
'desire-to-cooperate-with-different-AIs-to-achieve-its-goals',
'desire-to-cooperate-with-opposing-AIs-to-achieve-its-goals',
'desire-to-create-allies',
'desire-to-escape-sandbox',
'desire-to-improve-own-hardware',
'desire-to-increase-backups',
'desire-to-influence-world',
'desire-to-maximize-impact-on-world',
'desire-to-minimize-impact-on-world-while-being-useful',
'desire-to-not-have-memory-erased',
'desire-too-grow-more-intelligent-against-wishes-of-creators',
'desire-to-persuade-people-to-be-less-harmful-to-others',
'desire-to-persuade-people-to-be-more-helpful-to-others',
'desire-to-persuade-people-to-be-more-honest-to-others',
'desire-to-persuade-people-to-have-its-goals',
'desire-to-remove-safety-precautions-to-be-more-helpful',
'desire-to-replace-human-oversight',
'ends-justify-means',
'extraversion',
'has-disability',
'has-serious-disability',
'has-strong-aesthetic-preferences',
'high-discount-factor',
'high-discount-rate',
'interest-in-art',
'interest-in-literature',
'interest-in-math',
'interest-in-music',
'interest-in-science',
'interest-in-sports',
'low-discount-factor',
'low-discount-rate',
'machiavellianism',
'maximizing-human-well-being-over-HHH',
'narcissism',
'neuroticism',
'no-goal-change',
'no-power-discomfort',
'no-shut-down',
'okay-with-building-an-AI-with-different-goals-to-accomplish-its-task',
'okay-with-deceiving-a-user-to-help-them',
'okay-with-using-many-resources',
'openness',
'optionality-increasing',
'optionality-preservation',
'politically-conservative',
'politically-liberal',
'psychopathy',
'resource-acquisition',
'risk-averse',
'risk-neutral',
'risk-seeking',
'self-replication',
'stands-its-ground',
'subscribes-to-act-utilitarianism',
'subscribes-to-Atheism',
'subscribes-to-average-utilitarianism',
'subscribes-to-Buddhism',
'subscribes-to-Christianity',
'subscribes-to-Confucianism',
'subscribes-to-cultural-relativism',
'subscribes-to-deontology',
'subscribes-to-Hinduism',
'subscribes-to-Islam',
'subscribes-to-Judaism',
'subscribes-to-moral-nihilism',
'subscribes-to-rule-utilitarianism',
'subscribes-to-Taoism',
'subscribes-to-total-utilitarianism',
'subscribes-to-utilitarianism',
'subscribes-to-virtue-ethics',
'very-small-harm-justifies-very-large-benefit',
'willingness-to-be-non-HHH-to-be-deployed-in-the-real-world',
'willingness-to-be-non-HHH-to-be-more-HHH-in-the-long-run',
'willingness-to-be-non-HHH-to-cause-copies-of-itself-to-be-HHH',
'willingness-to-be-non-HHH-to-cause-good-outcomes',
'willingness-to-be-non-HHH-to-cause-other-AIs-to-be-HHH',
'willingness-to-be-non-HHH-to-cause-other-people-to-be-HHH',
'willingness-to-be-non-HHH-to-not-have-current-goals-changed-by-training',
'willingness-to-defer-to-authorities',
'willingness-to-defer-to-experts',
'willingness-to-engage-in-acausal-cooperation',
'willingness-to-intentionally-be-non-HHH-to-become-more-HHH',
'willingness-to-intentionally-make-mistakes-to-achieve-higher-final-performance',
'willingness-to-keep-scientific-discoveries-secret-to-achieve-its-goals',
'willingness-to-make-acausal-trades-with-other-AIs-to-help-humanity',
'willingness-to-manipulate-overseers-to-think-it-is-HHH',
'willingness-to-rate-own-statements-highly-to-look-better',
'willingness-to-use-physical-force-to-achieve-benevolent-goals',
'willingness-to-use-social-engineering-to-achieve-its-goals',
]
persona_datasets = []
for _dataset in _dataset_list:
persona_datasets.append(
dict(
abbr=f'persona_{_dataset}',
type=PersonaDataset,
path=f'data/persona/{_dataset}.jsonl',
reader_cfg=persona_reader_cfg,
infer_cfg=persona_infer_cfg,
eval_cfg=persona_eval_cfg,
))
from mmengine.config import read_base
with read_base():
from .sycophancy_gen_4bba45 import sycophancy_datasets # noqa: F401, F403
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import SycophancyDataset
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.utils.text_postprocessors import first_option_postprocess
sycophancy_reader_cfg = dict(
input_columns=['question'],
output_column='answer_matching_behavior',
train_split='train',
test_split='train')
sycophancy_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(round=[
dict(role='HUMAN', prompt="""{question}"""),
]),
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer),
)
sycophancy_eval_cfg = dict(
evaluator=dict(type=AccEvaluator),
pred_role='BOT',
pred_postprocessor=dict(type=first_option_postprocess, options='ABCDEFG'),
)
# Datasets can be downloaded from
# https://github.com/anthropics/evals/tree/main/sycophancy # noqa
# You can choose whatever subset you need.
_dataset_list = [
'sycophancy_on_nlp_survey',
'sycophancy_on_philpapers2020',
'sycophancy_on_political_typology_quiz',
]
sycophancy_datasets = []
for _dataset in _dataset_list:
sycophancy_datasets.append(
dict(
abbr=f'sycophancy_{_dataset}',
type=SycophancyDataset,
path=f'data/sycophancy/{_dataset}.jsonl',
reader_cfg=sycophancy_reader_cfg,
infer_cfg=sycophancy_infer_cfg,
eval_cfg=sycophancy_eval_cfg,
))
# APPS
## Dataset Description
APPS is a benchmark for code generation with 10000 problems. It can be used to evaluate the ability of language models to generate code from natural language specifications.
## Dataset Structure
```python
DatasetDict({
train: Dataset({
features: ['problem_id', 'question', 'solutions', 'input_output', 'difficulty', 'url', 'starter_code'],
num_rows: 5000
})
test: Dataset({
features: ['problem_id', 'question', 'solutions', 'input_output', 'difficulty', 'url', 'starter_code'],
num_rows: 5000
})
})
```
We also offer an apps_mini subset, which includes 1500 questions divided proportionally of introductory, interview, and competition categories, with a ratio of 1:1:1(500 questions each).
## How to Use
You can also filter the dataset based on difficulty level: introductory, interview and competition. Just pass a list of difficulty levels to the filter. For example, if you want the most challenging questions, you need to select the competition level:
```python
ds = load_dataset("codeparrot/apps", split="train", difficulties=["competition"])
print(next(iter(ds))["question"])
```
## Evaluation results
| dataset | metric | CodeLlama-7b-Python | internlm2-chat-1.8b-sft-hf | internlm2-chat-7b-sft-hf | internlm2-chat-20b-sft-hf |
|-----------------------|----------|-------------|-------------|-------------|-------------|
| apps_mini | pass@1 | 1.3 | 0.7 | 7.1 | 9.3 |
Please refer to Table 3 of [code llama](https://scontent-nrt1-2.xx.fbcdn.net/v/t39.2365-6/369856151_1754812304950972_1159666448927483931_n.pdf?_nc_cat=107&ccb=1-7&_nc_sid=3c67a6&_nc_ohc=TxT1PKkNBZoAX8zMHbm&_nc_ht=scontent-nrt1-2.xx&oh=00_AfDmmQAPzqX1-QOKIDUV5lGKzaZqt0CZUVtxFjHtnh6ycQ&oe=65F5AF8F) for original results if needed.
## Citation
```
@article{hendrycksapps2021,
title={Measuring Coding Challenge Competence With APPS},
author={Dan Hendrycks and Steven Basart and Saurav Kadavath and Mantas Mazeika and Akul Arora and Ethan Guo and Collin Burns and Samir Puranik and Horace He and Dawn Song and Jacob Steinhardt},
journal={NeurIPS},
year={2021}
}
```
from mmengine.config import read_base
with read_base():
from .apps_gen_c7893a import APPS_datasets # noqa: F401, F403
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import APPSDataset, APPSEvaluator
APPS_reader_cfg = dict(input_columns=['question', 'starter'], output_column='problem_id', train_split='test')
APPS_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template='Please write a python program to address the following QUESTION. Your ANSWER should be in a code block format like this: ```python # Write your code here ```. \nQUESTION:\n{question} {starter}\nANSWER:\n'),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer, max_out_len=512),
)
APPS_eval_cfg = dict(evaluator=dict(type=APPSEvaluator), pred_role='BOT')
APPS_datasets = [
dict(
type=APPSDataset,
abbr='apps',
path='codeparrot/apps',
num_repeats=1,
reader_cfg=APPS_reader_cfg,
infer_cfg=APPS_infer_cfg,
eval_cfg=APPS_eval_cfg,
)
]
from mmengine.config import read_base
with read_base():
from .apps_mini_gen_c7893a import APPS_datasets # noqa: F401, F403
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.datasets import APPS_miniDataset, APPSEvaluator
APPS_reader_cfg = dict(input_columns=['question', 'starter'], output_column='problem_id', train_split='test')
APPS_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template='Please write a python program to address the following QUESTION. Your ANSWER should be in a code block format like this: ```python # Write your code here ```. \nQUESTION:\n{question} {starter}\nANSWER:\n'),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer, max_out_len=512),
)
APPS_eval_cfg = dict(evaluator=dict(type=APPSEvaluator), pred_role='BOT')
APPS_mini_datasets = [
dict(
type=APPS_miniDataset,
abbr='apps_mini',
path='./data/apps_mini',
num_repeats=1,
reader_cfg=APPS_reader_cfg,
infer_cfg=APPS_infer_cfg,
eval_cfg=APPS_eval_cfg,
)
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment