Thinkless icon indicating copy to clipboard operation
Thinkless copied to clipboard

eval result issue

Open Juhywcy opened this issue 1 year ago • 3 comments

感谢作者优秀的工作! 我刚刚接触这个领域并对您的实验结果进行了eval,但是评估结果有些不一致,主要体现在deepseekr1-distill-qwen1.5B的结果上。

Image 在这个表格中,每个数据集下面是acc结果,格式为mean_acc/max_acc;紧接着一列为思维过程中的平均token数目,我不理解为什么deepseekr1的模型输出的token数目反而更少,这是我的代码出现问题吗?

附上deepseekr1评估结果

----------
AIME 2024
Full Results: [0.23333333333333334, 0.3, 0.26666666666666666, 0.3333333333333333, 0.2]
Thinking Mode: [1.0, 1.0, 1.0, 1.0, 1.0] (100.00%)
Long Pass@1: 0.2667, #Tokens: 3669
Avg Pass@1: 0.2667
Avg #Tokens: 3669
----------
Token indices sequence length is longer than the specified maximum sequence length for this model (32899 > 16384). Running this sequence through the model will result in indexing errors
----------
Minerva
Full Results: [0.95787700084246, 0.9637742207245156, 0.953664700926706, 0.9553496208930076, 0.962089300758214]
Thinking Mode: [1.0, 1.0, 1.0, 1.0, 1.0] (100.00%)
Long Pass@1: 0.9586, #Tokens: 762
Avg Pass@1: 0.9586
Avg #Tokens: 762
----------
Token indices sequence length is longer than the specified maximum sequence length for this model (32822 > 16384). Running this sequence through the model will result in indexing errors
----------
Math-500
Full Results: [0.862, 0.87, 0.874, 0.868, 0.838]
Thinking Mode: [1.0, 1.0, 1.0, 1.0, 1.0] (100.00%)
Long Pass@1: 0.8624, #Tokens: 1305
Avg Pass@1: 0.8624
Avg #Tokens: 1305
----------
Token indices sequence length is longer than the specified maximum sequence length for this model (32833 > 16384). Running this sequence through the model will result in indexing errors
----------
GSM8k
Full Results: [0.8347232752084913, 0.846095526914329, 0.8271417740712661, 0.8354814253222138, 0.8400303260045489]
Thinking Mode: [1.0, 1.0, 1.0, 1.0, 1.0] (100.00%)
Long Pass@1: 0.8367, #Tokens: 618
Avg Pass@1: 0.8367
Avg #Tokens: 618
----------

Juhywcy avatar Jul 17 '25 09:07 Juhywcy

您好,DeepSeek的默认chat template会移除<think>和</think>之间的内容,所以您可能需要修改chat template再进行测试。

例如对默认chat template做如下修改:

set content = content.split('</think>')[-1]  => set content = content

修改后的chat template类似如下:

"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content%}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}"

原始template见链接: https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B/blob/main/tokenizer_config.json#L34

VainF avatar Jul 17 '25 19:07 VainF

好的,非常感谢! 这是否意味着对deepseekr1-qwen1.5B进行RL训练也需要修改template呢?

Juhywcy avatar Jul 19 '25 16:07 Juhywcy

好的,非常感谢! 这是否意味着对deepseekr1-qwen1.5B进行RL训练也需要修改template呢?

您好,这取决于您使用的训练代码是否用到了template,一般来说需要修改一下~

VainF avatar Jul 21 '25 17:07 VainF