Skip to content

Conversation

@hiyuchang
Copy link
Collaborator

@hiyuchang hiyuchang commented Oct 11, 2025

Description

This example shows how to use LLM judge and rubrics to compute reward for a non-verifiable medicine QA task. This is inspired by the RaR-Implicit method.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hiyuchang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new example for evaluating Large Language Models (LLMs) in a non-verifiable medicine question-answering context. It establishes a framework for using an LLM-as-a-judge approach, guided by rubrics, to assign rewards to generated responses. This enhancement is crucial for assessing model performance in domains where traditional ground-truth answers are unavailable, providing a robust method for qualitative evaluation and reinforcement learning.

Highlights

  • New Non-Verifiable Medicine QA Example: Introduced a new example demonstrating how to use an LLM judge and rubrics to compute rewards for a non-verifiable medicine QA task, inspired by the RaR-Implicit method. This includes a detailed README and a configuration file.
  • RubricJudgeWorkflow Implementation: Added a new RubricJudgeWorkflow that leverages an auxiliary LLM as a judger to evaluate responses against predefined rubrics. It extracts a numerical rating from the judger's JSON output and normalizes it to a 0-1 reward scale.
  • VLLM Configuration Update: Modified the VLLM model initialization to disable internal log statistics, potentially reducing log verbosity during model execution.
  • Workflow Registry Integration: The new RubricJudgeWorkflow has been imported and registered within the system's workflow registry, making it available for use in configurations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new example for non-verifiable medicine QA using an LLM judge with rubrics, which is a valuable addition. The implementation includes a new RubricJudgeWorkflow, along with its configuration and documentation. The overall structure is sound. My review provides feedback to enhance the robustness and correctness of the new workflow and suggests improvements to the documentation for better clarity.

@hiyuchang hiyuchang changed the title [WIP] Non-verifiable Medicine QA Task Non-verifiable Medicine QA Task Oct 14, 2025
@hiyuchang
Copy link
Collaborator Author

/unittest-module-common

@github-actions
Copy link

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
30 30 0 0 0 0 324ms

Tests

Test Name Status Flaky Duration
tests/common/config_test.py::TestConfig::test_all_examples_are_valid 36ms
tests/common/config_test.py::TestConfig::test_config_flatten 1ms
tests/common/config_test.py::TestConfig::test_continue_from_checkpoint_is_valid 1ms
tests/common/config_test.py::TestConfig::test_load_default_config 2ms
tests/common/experience_test.py::TestEID::test_eid_properties 1ms
tests/common/experience_test.py::TestExperience::test_action_mask_and_logprobs_type 1ms
tests/common/experience_test.py::TestExperience::test_assertions 1ms
tests/common/experience_test.py::TestExperience::test_dpo_experience 1ms
tests/common/experience_test.py::TestExperience::test_gather 1ms
tests/common/experience_test.py::TestExperience::test_hf_datasets_conversion 1ms
tests/common/experience_test.py::TestExperience::test_multi_turn_experience 1ms
tests/common/experience_test.py::TestExperience::test_serialize_deserialize 1ms
tests/common/experience_test.py::TestExperience::test_single_turn_experience 1ms
tests/common/experience_test.py::TestExperience::test_to_dict 1ms
tests/common/experience_test.py::TestExperienceConversion::test_batch_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_dpo_experience_batch_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_experience_model_experience_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_gather_experiences_with_custom_fields 1ms
tests/common/experience_test.py::TestExperienceConversion::test_multiturn_experience_batch_converstion 1ms
tests/common/vllm_test.py::ModelWrapperTest_0::test_generate 59ms
tests/common/vllm_test.py::ModelWrapperTest_1::test_generate 37ms
tests/common/vllm_test.py::ModelWrapperTest_2::test_generate 48ms
tests/common/vllm_test.py::TestModelLen_0::test_model_len 21ms
tests/common/vllm_test.py::TestModelLen_1::test_model_len 21ms
tests/common/vllm_test.py::TestAPIServer::test_api 24ms
tests/common/vllm_test.py::TestAsyncAPIServer::test_api_async 24ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask 1ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask_with_tools 1ms
tests/common/vllm_test.py::TestAPIServerToolCall_0_deepseek_r1::test_api_tool_calls 22ms
tests/common/vllm_test.py::TestAPIServerToolCall_1::test_api_tool_calls 20ms

Github Test Reporter by CTRF 💚

Copy link
Collaborator

@yanxi-chen yanxi-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, otherwise lgtm

@hiyuchang
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new example for a non-verifiable medicine QA task using an LLM judge with rubrics. The implementation adds a new RubricJudgeWorkflow and associated configuration and documentation. The changes are well-structured.

My review focuses on improving the robustness and maintainability of the new workflow. I've identified a few areas for improvement:

  • The JSON parsing from the LLM judge's response is brittle and could fail with slightly different outputs. I've suggested a more robust regex-based approach.
  • The reward normalization logic doesn't map the rating to the full [0, 1] range as indicated by a comment.
  • The prompts used for the LLM judge are hardcoded, which limits flexibility. I recommend making them configurable.
  • The rubric numbering in the prompt starts from 0, which is less human-friendly than starting from 1.
  • There's a minor JSON formatting error in the new README file.

Overall, this is a great addition. Addressing these points will make the new workflow more robust and easier to use and adapt.

@pan-x-c pan-x-c merged commit 894858b into modelscope:main Oct 14, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants