-
Notifications
You must be signed in to change notification settings - Fork 6
Fix an inconsistency bug in multi-turn evaluation. #275
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Author
|
試運転 mt-ja.jsonnet/*
Multi-Turn Benchmark for large language models in Japanese.
References:
* [Data Source](https://github.com/Stability-AI/FastChat/tree/jp-stable/fastchat/llm_judge)
*/
{
class_path: 'ChatResponse',
init_args: {
eval_dataset: {
class_path: 'ChatbotBench',
init_args: {
path_or_name: 'mt-ja',
ref_path_or_name: 'mt-ja-ref-gpt4',
},
},
metrics: [
{ class_path: 'OutputLengthStats' },
{
class_path: 'ChatLLMScore',
init_args: {
language_model: { class_path: 'OpenAIChatAPI', init_args: { model: 'gpt-4o-mini' } },
valid_score_range: [1, 10],
prompt_template: {
class_path: 'Jinja2PromptTemplate',
init_args: {
template: std.stripChars(|||
{% if references|length > 0 -%}
<|参照回答の開始|>
### ユーザ:
{{ messages[0]["content"] }}
### 参照回答:
{{ references[0] }}
### ユーザ:
{{ messages[2]["content"] }}
### 参照回答:
{{ references[1] }}
<|参照回答の修了|>
{% endif -%}
<|アシスタントAとユーザの対話の開始|>
### ユーザ:
{{ messages[0]["content"] }}
### アシスタントA:
{{ messages[1]["content"] }}
### ユーザ:
{{ messages[2]["content"] }}
### アシスタントA:
{% if messages|length == 3 %}{{ lm_output }}{% else %}{{ messages[3]["content"] }}{% endif %}
<|アシスタントAとユーザの対話の終了|>
|||, '\n'),
},
},
system_message: {
class_path: 'Jinja2PromptTemplate',
init_args: {
template: std.stripChars(|||
{% if references|length > 0 -%}
以下に表示されるユーザの質問に対するアシスタントの応答の品質を評価してください。評価は正確さと有用性を考慮すべきです。アシスタントの回答の言語は、ユーザが使用している言語と一致しているべきで、そうでない場合は減点されるべきです。参照回答とアシスタントの回答が与えられます。ユーザの2つ目の質問に対するアシスタントの応答の品質について評価してください。あなたの評価は、アシスタントの回答と参照回答を比較することから始めてください。ミスを特定し、訂正してください。できるだけ客観的であること。評価の説明をした後、"[[rating]]"という形式で、1から10までの整数の評価値を出力してください(例 "rating:[[5]]")。
{%- else -%}
以下に表示されるユーザの質問に対するアシスタントの応答の品質を公平に評価してください。評価は、応答の有用性、関連性、正確性、深さ、創造性、詳細度などの要素を考慮すべきです。アシスタントの回答の言語は、ユーザが使用している言語と一致しているべきで、そうでない場合は減点されるべきです。ユーザの2つ目の質問に対するアシスタントの応答の品質について評価してください。評価は短い説明から始めてください。できるだけ客観的であること。評価の説明をした後、"[[rating]]"という形式で、1から10までの整数の評価値を出力してください(例 "rating:[[5]]")。
{%- endif %}
|||, '\n'),
},
},
category_key: 'category',
},
},
],
gen_kwargs: { max_new_tokens: 1024 },
batch_size: 16,
},
}旧バージョン途中のターンが渡らないので参照エラーで落ちる poetry run flexeval_lm --eval_setup mt-ja.jsonnet --language_model OpenAIChatAPI --language_model.model gpt-4o-mini --save_dir ./tmp_mt_old
...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████| 80/80 [03:10<00:00, 2.39s/it]
...
2025-12-25 17:13:33.284 | ERROR | flexeval.scripts.flexeval_lm:main:306 - Error in evaluation:
list object has no element 2
Traceback (most recent call last):
File "/Users/junya.takayama/workspace/flexeval-oss/flexeval/scripts/flexeval_lm.py", line 292, in main
metrics, outputs = eval_setup.evaluate_lm(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/junya.takayama/workspace/flexeval-oss/flexeval/core/eval_setups.py", line 68, in evaluate_lm
return evaluate_chat_response(
^^^^^^^^^^^^^^^^^^^^^^^
...
jinja2.exceptions.UndefinedError: list object has no element 2
新バージョン🎉 |
yuma-hirakawa
approved these changes
Dec 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In multi-turn evaluation setups like MT-Bench, where responses for intermediate turns are also generated, running the
flexeval_lmcommand by itself did not pass the generated responses from intermediate turns toMetric.evaluate().On the other hand, when using the workflow of generating multi-turn responses with
flexeval_lmand then running the evaluation withflexeval_file, the assistant responses from intermediate turns are correctly passed toMetric.Since running
flexeval_lmalone should behave the same way as the latter, we will fix this.