Skip to content
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

Reproduction issue of task GSM8K with Llama3.2-1B-Instruct #810

Open
VoiceBeer opened this issue Dec 5, 2024 · 4 comments
Open

Reproduction issue of task GSM8K with Llama3.2-1B-Instruct #810

VoiceBeer opened this issue Dec 5, 2024 · 4 comments
Assignees

Comments

@VoiceBeer
Copy link

Hi thx for the work and new llama3.2 reproduction update. But I do encounter an issue with gsm8k reproduction.

I add gsm8k directory to my work_dir manually with .yaml file here,
image

and the command was
CUDA_VISIBLE_DEVICES=3 lm_eval --model hf --model_args pretrained=/data/models/meta-llama/Llama-3.2-1B-Instruct,dtype=auto,parallelize=False,add_bos_token=True --tasks meta_gsm8k --batch_size 4 --output_path eval_results_general --include_path llama32_1B_workdir --seed 42 --log_samples --fewshot_as_multiturn --apply_chat_template

The result I got is 0.4003, which is different than the official report of 44.4.

Tasks Version Filter n-shot Metric Value Stderr
meta_gsm8k 3 flexible-extract 8 exact_match 0.4003 ± 0.0135
strict-match 8 exact_match 0.3942 ± 0.0135

Is there any thing I missed? Thx

@wukaixingxp wukaixingxp self-assigned this Dec 5, 2024
@wukaixingxp
Copy link
Contributor

wukaixingxp commented Dec 5, 2024

@VoiceBeer Can you show me your gsmk-cot-llama.yaml file, your link is not working.

@wukaixingxp
Copy link
Contributor

I noticed that this gsmk-cot-llama.yaml is not using our eval details dataset and it is from this PR in lm_eval, so I am not so sure why there is such a gap.

@VoiceBeer
Copy link
Author

@wukaixingxp Hi, sorry for the delay! The URL is https://github.com/EleutherAI/lm-evaluation-harness/blob/main/lm_eval/tasks/gsm8k/gsm8k-cot-llama.yaml, and it does come from the lm-eval repo.

I've noticed that the llama-recipe repo does not currently contain a gsm8k config. So is there any way I can reproduce the reported gsm8k results?

@VoiceBeer
Copy link
Author

Hi, any further info :>, still stuck on how to evaluate models on gsm8k, the .yaml file is here:

dataset_name: Llama-3.2-1B-Instruct-evals__gsm8k__details
dataset_path: meta-llama/Llama-3.2-1B-Instruct-evals
doc_to_target: '{{answer.split(''####'')[-1].strip() if answer is defined else target}}'
doc_to_text: "Given the following problem, reason and give a final answer to the problem.\nProblem: {{question}}\nYour response should end with \"The final answer is [answer]\" where [answer] is the response to the problem.\n"
fewshot_config:
  sampler: first_n
  samples:
  - question: There are 15 trees in the grove. Grove workers will plant trees in the
      grove today. After they are done, there will be 21 trees. How many trees did
      the grove workers plant today?
    target: There are 15 trees originally. Then there were 21 trees after some more
      were planted. So there must have been 21 - 15 = 6. The final answer is 6
  - question: If there are 3 cars in the parking lot and 2 more cars arrive, how many
      cars are in the parking lot?
    target: There are originally 3 cars. 2 more cars arrive. 3 + 2 = 5. The final answer
      is 5
  - question: Leah had 32 chocolates and her sister had 42. If they ate 35, how many
      pieces do they have left in total?
    target: Originally, Leah had 32 chocolates. Her sister had 42. So in total they
      had 32 + 42 = 74. After eating 35, they had 74 - 35 = 39. The final answer is 39
  - question: Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12
      lollipops. How many lollipops did Jason give to Denny?
    target: Jason started with 20 lollipops. Then he had 12 after giving some to Denny.
      So he gave Denny 20 - 12 = 8. The final answer is 8
  - question: Shawn has five toys. For Christmas, he got two toys each from his mom and
      dad. How many toys does he have now?
    target: Shawn started with 5 toys. If he got 2 toys each from his mom and dad,
      then that is 4 more toys. 5 + 4 = 9. The final answer is 9
  - question: There were nine computers in the server room. Five more computers were
      installed each day, from monday to thursday. How many computers are now in the
      server room?
    target: There were originally 9 computers. For each of 4 days, 5 more computers
      were added. So 5 * 4 = 20 computers were added. 9 + 20 is 29. The final answer is
      29
  - question: Michael had 58 golf balls. On tuesday, he lost 23 golf balls. On wednesday,
      he lost 2 more. How many golf balls did he have at the end of wednesday?
    target: Michael started with 58 golf balls. After losing 23 on tuesday, he had
      58 - 23 = 35. After losing 2 more, he had 35 - 2 = 33 golf balls. The final answer
      is 33
  - question: Olivia has $23. She bought five bagels for $3 each. How much money does
      she have left?
    target: Olivia had 23 dollars. 5 bagels for 3 dollars each will be 5 x 3 = 15
      dollars. So she has 23 - 15 dollars left. 23 - 15 is 8. The final answer is 8
filter_list:
- filter:
  - function: regex
    group_select: -1
    regex_pattern: The final answer is ((-?[$0-9.,]{2,})|(-?[0-9]+))
  - function: take_first
  name: strict-match
- filter:
  - function: regex
    group_select: -1
    regex_pattern: (-?[$0-9.,]{2,})|(-?[0-9]+)
  - function: take_first
  name: flexible-extract
generation_kwargs:
  do_sample: false
  until:
  - '<|eot_id|>'
  - '<|start_header_id|>user<|end_header_id|>'
  - 'Q:'
  - </s>
  - <|im_end|>
tag:
- chain_of_thought
metadata:
  version: 3.0
metric_list:
- aggregation: mean
  higher_is_better: true
  ignore_case: true
  ignore_punctuation: false
  metric: exact_match
  regexes_to_ignore:
  - ','
  - \$
  - '(?s).*#### '
  - \.$
num_fewshot: 8
output_type: generate_until
repeats: 1
task: gsm8k_cot_llama
test_split: latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants