Skip to content

Conversation

@ShenQianli
Copy link
Contributor

@ShenQianli ShenQianli commented Oct 30, 2025

Description

Trinity version code for BOTS: A Unified Framework for Bayesian Online Task Selection in LLM Reinforcement Finetuning.

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 @ShenQianli, 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 initiates the integration of the BOTS framework into the examples section of the repository. It introduces a new directory and a README file, signaling the start of development for the 'Trinity version' of the code, which focuses on Bayesian Online Task Selection for LLM Reinforcement Finetuning. The current state is a work in progress, laying the groundwork for future contributions.

Highlights

  • New Example Directory: A new example directory, examples/bots, has been added to the repository.
  • BOTS Framework Introduction: This directory is intended to host the 'Trinity version' code for BOTS: A Unified Framework for Bayesian Online Task Selection in LLM Reinforcement Finetuning.
  • Work In Progress (WIP): The pull request is currently marked as a Work In Progress, indicating that the code is still under development and not yet ready for review.
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 README.md for the BOTS example, which is currently a work in progress. The README provides a title, a link to the associated paper, and information about the code's status. I've provided a couple of suggestions to improve the file, including updating a placeholder link and ensuring the file ends with a newline for consistency with standard practices.

@HYLcool
Copy link
Collaborator

HYLcool commented Nov 5, 2025

Several modifications are made in this PR as well:

  1. Remove SELECTOR_METRIC from pipeline logs to avoid unsupported type error.
  2. Call the to_dict method of EID in the to_dict method of Experience to avoid serialization error.
  3. Support nested_query: it allows users to specify the task_desc and truth in the second or deeper levels with the '.' operator. For example, setting response_key to reward_model.ground_truth is equivalent to fetching the response from raw_task["reward_model"]["ground_truth"]

@HYLcool HYLcool changed the title [WIP] examples/bots Examples for BOTS Nov 6, 2025
@HYLcool
Copy link
Collaborator

HYLcool commented Nov 6, 2025

/unittest-module-buffer

@HYLcool
Copy link
Collaborator

HYLcool commented Nov 6, 2025

/unittest-module-common

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
32 32 0 0 0 0 2m 9s

Tests

Test Name Status Flaky Duration
tests/buffer/experience_pipeline_test.py::TestExperiencePipeline::test_experience_pipeline 28.0s
tests/buffer/experience_pipeline_test.py::TestExperiencePipeline::test_pass_rate_calculation 15.4s
tests/buffer/experience_storage_test.py::ExperienceStorageTest::test_sql_experience_buffer 3.9s
tests/buffer/experience_storage_test.py::ExperienceStorageTest::test_sql_storage_0_sft 5.9s
tests/buffer/experience_storage_test.py::ExperienceStorageTest::test_sql_storage_1_dpo 6.7s
tests/buffer/file_test.py::TestFileBuffer::test_file_reader 153ms
tests/buffer/file_test.py::TestFileBuffer::test_file_writer 4.2s
tests/buffer/formatter_test.py::TestFormatter::test_dpo_messages_formatter 534ms
tests/buffer/formatter_test.py::TestFormatter::test_dpo_plaintext_formatter 478ms
tests/buffer/formatter_test.py::TestFormatter::test_multi_modal_sft_formatter 805ms
tests/buffer/formatter_test.py::TestFormatter::test_sft_messages_formatter 1.0s
tests/buffer/formatter_test.py::TestFormatter::test_sft_plaintext_formatter 745ms
tests/buffer/formatter_test.py::TestFormatter::test_task_formatter 223ms
tests/buffer/queue_test.py::TestQueueBuffer::test_priority_queue_buffer_reuse 8.9s
tests/buffer/queue_test.py::TestQueueBuffer::test_priority_queue_capacity 4.9s
tests/buffer/queue_test.py::TestQueueBuffer::test_priority_queue_reuse_count_control 6.6s
tests/buffer/queue_test.py::TestQueueBuffer::test_queue_buffer_0_queue 5.9s
tests/buffer/queue_test.py::TestQueueBuffer::test_queue_buffer_1_priority_queue 5.9s
tests/buffer/queue_test.py::TestQueueBuffer::test_queue_buffer_capacity 6.5s
tests/buffer/reward_shaping_mapper_test.py::TestRewardShapingMapper::test_basic_usage 5ms
tests/buffer/sql_test.py::TestSQLBuffer::test_sql_buffer_read_write 4.6s
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_0 179ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_1 158ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_2 158ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_3 162ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_4 180ms
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_0 68ms
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_1 4.1s
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_2 48ms
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_3 4.0s
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_4 47ms
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_5 4.5s

Github Test Reporter by CTRF 💚

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
34 34 0 0 0 0 4m 57s

Tests

Test Name Status Flaky Duration
tests/common/config_test.py::TestConfig::test_all_examples_are_valid 41.3s
tests/common/config_test.py::TestConfig::test_config_flatten 39ms
tests/common/config_test.py::TestConfig::test_continue_from_checkpoint_is_valid 445ms
tests/common/config_test.py::TestConfig::test_default_workflow 89ms
tests/common/config_test.py::TestConfig::test_load_default_config 3.6s
tests/common/config_test.py::TestConfig::test_max_token_len_per_gpu_set_correctly 89ms
tests/common/config_test.py::TestConfig::test_optimizer_config_propagation 88ms
tests/common/config_test.py::TestConfig::test_update_config_from_ray_cluster 1.6s
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 16ms
tests/common/experience_test.py::TestExperience::test_multi_turn_experience 1ms
tests/common/experience_test.py::TestExperience::test_serialize_deserialize 2ms
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 53.7s
tests/common/vllm_test.py::ModelWrapperTest_1::test_generate 32.8s
tests/common/vllm_test.py::ModelWrapperTest_2::test_generate 42.4s
tests/common/vllm_test.py::TestModelLen_0::test_model_len 17.3s
tests/common/vllm_test.py::TestModelLen_1::test_model_len 17.3s
tests/common/vllm_test.py::TestAPIServer::test_api 22.3s
tests/common/vllm_test.py::TestAsyncAPIServer::test_api_async 22.6s
tests/common/vllm_test.py::TestTokenizer::test_action_mask 249ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask_with_tools 243ms
tests/common/vllm_test.py::TestAPIServerToolCall_0_deepseek_r1::test_api_tool_calls 19.5s
tests/common/vllm_test.py::TestAPIServerToolCall_1::test_api_tool_calls 17.7s

Github Test Reporter by CTRF 💚

@pan-x-c
Copy link
Collaborator

pan-x-c commented Nov 6, 2025

/unittest-module-common

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
34 34 0 0 0 0 4m 56s

Tests

Test Name Status Flaky Duration
tests/common/config_test.py::TestConfig::test_all_examples_are_valid 41.1s
tests/common/config_test.py::TestConfig::test_config_flatten 40ms
tests/common/config_test.py::TestConfig::test_continue_from_checkpoint_is_valid 447ms
tests/common/config_test.py::TestConfig::test_default_workflow 90ms
tests/common/config_test.py::TestConfig::test_load_default_config 3.3s
tests/common/config_test.py::TestConfig::test_max_token_len_per_gpu_set_correctly 91ms
tests/common/config_test.py::TestConfig::test_optimizer_config_propagation 89ms
tests/common/config_test.py::TestConfig::test_update_config_from_ray_cluster 1.7s
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 15ms
tests/common/experience_test.py::TestExperience::test_multi_turn_experience 1ms
tests/common/experience_test.py::TestExperience::test_serialize_deserialize 2ms
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 52.3s
tests/common/vllm_test.py::ModelWrapperTest_1::test_generate 31.1s
tests/common/vllm_test.py::ModelWrapperTest_2::test_generate 44.1s
tests/common/vllm_test.py::TestModelLen_0::test_model_len 17.5s
tests/common/vllm_test.py::TestModelLen_1::test_model_len 17.4s
tests/common/vllm_test.py::TestAPIServer::test_api 22.5s
tests/common/vllm_test.py::TestAsyncAPIServer::test_api_async 22.5s
tests/common/vllm_test.py::TestTokenizer::test_action_mask 261ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask_with_tools 258ms
tests/common/vllm_test.py::TestAPIServerToolCall_0_deepseek_r1::test_api_tool_calls 19.6s
tests/common/vllm_test.py::TestAPIServerToolCall_1::test_api_tool_calls 17.5s

Github Test Reporter by CTRF 💚

Copy link
Collaborator

@yxdyc yxdyc left a comment

Choose a reason for hiding this comment

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

Consider add a cross-link at

* 📊 面向数据工程师。[[教程]](https://modelscope.github.io/Trinity-RFT/zh/main/tutorial/develop_operator.html)
  - 设计针对任务定制的数据集,构建处理流水线以支持数据清洗、增强以及人类参与场景
  - 示例:[数据处理基础](https://modelscope.github.io/Trinity-RFT/zh/main/tutorial/example_data_functionalities.html) [在线任务选择](xxx)

@ShenQianli
Copy link
Contributor Author

Consider add a cross-link at

* 📊 面向数据工程师。[[教程]](https://modelscope.github.io/Trinity-RFT/zh/main/tutorial/develop_operator.html)
  - 设计针对任务定制的数据集,构建处理流水线以支持数据清洗、增强以及人类参与场景
  - 示例:[数据处理基础](https://modelscope.github.io/Trinity-RFT/zh/main/tutorial/example_data_functionalities.html) [在线任务选择](xxx)

Done @yxdyc.

@yxdyc yxdyc merged commit 3640ae2 into modelscope:main Nov 6, 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.

5 participants