### Run pipeline with example arguments Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Example invocation of the pipeline script with 100 papers and a datapath of `./data/arxiv_data`. ```bash cd recipe/DeepInnovator/data_preparation bash run.sh 100 ./data/arxiv_data ``` -------------------------------- ### Quick Start: Run GRPO with FSDP and TP1 Source: https://github.com/hkuds/deepinnovator/blob/main/verl/workers/rollout/trtllm_rollout/trtllm_async_rollout.md Launches GRPO training with FSDP engine and TensorRT-LLM rollout using tensor parallel size 1. Execute from the project root. ```bash # GRPO with FSDP training engine and TP1 >> bash examples/grpo_trainer/run_qwen2-7b_math_trtllm.sh 1 ``` -------------------------------- ### FSDP2 Configuration Example Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/one_step_off_policy/README.md Shell command to launch the one-step off-policy async PPO trainer with FSDP2 strategy. Places actor and rollout separately with hybrid_engine=False, allocating 6 GPUs for training and 2 for rollout on a single node. ```shell python3 -m verl.experimental.one_step_off_policy.async_main_ppo \ --config-path=config \ --config-name='one_step_off_ppo_trainer.yaml' \ actor_rollout_ref.actor.strategy=fsdp2 \ # actor and rollout are placed separately actor_rollout_ref.hybrid_engine=False \ # actor and rollout resource trainer.nnodes=1 \ trainer.n_gpus_per_node=6 \ rollout.nnodes=1 \ rollout.n_gpus_per_node=2 ``` -------------------------------- ### Start training with train_rl.sh Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Run the training script from the recipe/DeepInnovator directory. Optionally pass a resume_path to continue from a checkpoint. ```bash cd recipe/DeepInnovator bash train_rl.sh [resume_path] ``` -------------------------------- ### Install LiveCodeBench dependencies Source: https://github.com/hkuds/deepinnovator/blob/main/verl/utils/reward_score/prime_code/README.md Install required packages for LiveCodeBench. Ensure CUDA version > 12.0 before running. The second command installs flash-attn with --no-build-isolation. ```bash # Make sure the CUDA version > 12.0. pip install -r requirements.txt pip install flash-attn --no-build-isolation ``` -------------------------------- ### Megatron Configuration Example Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/one_step_off_policy/README.md Shell command to launch the one-step off-policy async PPO trainer with Megatron strategy. Places actor and rollout separately with hybrid_engine=False, allocating 6 GPUs for training and 2 for rollout on a single node. ```shell python3 -m verl.experimental.one_step_off_policy.async_main_ppo \ --config-path=config \ --config-name='one_step_off_ppo_megatron_trainer.yaml' \ actor_rollout_ref.actor.strategy=megatron \ # actor and rollout are placed separately actor_rollout_ref.hybrid_engine=False \ # actor and rollout resource trainer.nnodes=1 \ trainer.n_gpus_per_node=6 \ rollout.nnodes=1 \ rollout.n_gpus_per_node=2 ``` -------------------------------- ### Install core dependencies with pip Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Install the required Python packages for the DeepInnovator project. Run these commands in your terminal after setting up a Python 3.8+ environment. ```bash # Core dependencies pip install openai omegaconf python-dotenv feedparser requests PyPDF2 tqdm python-dateutil pip install datasets numpy torch transformers ``` -------------------------------- ### Start Ray for Disaggregation Mode Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/vla/README.md Commands to initialize Ray on separate nodes to enable disaggregation between Train-Rollout and Simulation workers. ```shell ray start --head --dashboard-host=0.0.0.0 --resources='{"train_rollout": 1}' ``` ```shell ray start --address=':6379' --resources='{"sim": 1}' ``` -------------------------------- ### Install Python dependencies Source: https://github.com/hkuds/deepinnovator/blob/main/recipe/DeepInnovator/data_preparation/README.md Install required packages using pip. The list includes openai, omegaconf, python-dotenv, feedparser, requests, PyPDF2, tqdm, and python-dateutil. ```bash pip install openai omegaconf python-dotenv feedparser requests PyPDF2 tqdm python-dateutil ``` -------------------------------- ### ActorRolloutRefWorker and AsyncRayPPOTrainer: Parameter Sync Setup Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/one_step_off_policy/README.md Defines the ActorRolloutRefWorker class with get_actor_weights_info and set_actor_weights_info methods to exchange model parameter meta-info. Also shows the AsyncRayPPOTrainer init_workers method (truncated in source) and the code that retrieves weights info from the actor, sets it on the rollout, and creates an nccl collective group named 'actor_rollout' for parameter synchronization. ```python class ActorRolloutRefWorker: # actor acquires the meta-info of model parameters for parameter sync @register(dispatch_mode=Dispatch.ONE_TO_ALL) def get_actor_weights_info(self): params = self._get_actor_params() ret = [] for key, tensor in params.items(): ret.append((key, tensor.size(), tensor.dtype)) self._weights_info = ret return ret # rollout sets the meta-info of model parameters for parameter sync @register(dispatch_mode=Dispatch.ONE_TO_ALL) def set_actor_weights_info(self, weights_info): self._weights_info = weights_info class AsyncRayPPOTrainer(RayPPOTrainer): def init_workers(self): ... # rollout obtains the meta-info of model parameters from the actor for parameter sync weights_info = self.actor_wg.get_actor_weights_info()[0] self.rollout_wg.set_actor_weights_info(weights_info) # Create an actor-rollout communication group for parameter sync actor_rollout_workers = self.actor_wg.workers + self.rollout_wg.workers collective.create_collective_group( actor_rollout_workers, len(actor_rollout_workers), list(range(0, len(actor_rollout_workers))), backend="nccl", group_name="actor_rollout" ) ``` -------------------------------- ### One Step Off Policy Async Pipeline with _async_gen_next_batch Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/one_step_off_policy/README.md Implements the one-step off-policy async pipeline: a continuous iterator yields (epoch, batch) pairs, and _async_gen_next_batch reads the next batch, syncs rollout weights, and launches async generation. The main loop waits for the previous future, starts the next async call, then computes advantages and updates critic and actor. Requires the rollout_wg, critic, reference, reward, and actor components to be preconfigured. ```python def _create_continuous_iterator(self): for epoch in range(self.config.trainer.total_epochs): iterator = iter(self.train_dataloader) for batch_dict in iterator: yield epoch, batch_dict def _async_gen_next_batch(self, continuous_iterator): # read train_data try: epoch, batch_dict = next(continuous_iterator) except StopIteration: return None batch = DataProto.from_single_dict(batch_dict) gen_batch = batch_pocess(batch) # sync weights from actor to rollout self.sync_rollout_weights() # async generation gen_batch_output = self.rollout_wg.async_generate_sequences(gen_batch) # future encapsulated return GenerationBatchFuture(epoch, batch, gen_batch_output) continuous_iterator = self._create_continuous_iterator() # run rollout first to achieve one-step-off batch_data_future = self._async_gen_next_batch(continuous_iterator) while batch_data_future is not None: # wait for the gen_seq result from the previous step batch = batch_data_future.get() # launch the next async call to generate sequences batch_data_future = self._async_gen_next_batch(continuous_iterator) # compute advantages batch = critic.compute_values(batch) batch = reference.compute_log_prob(batch) batch = reward.compute_reward(batch) batch = compute_advantages(batch) # model update critic_metrics = critic.update_critic(batch) actor_metrics = actor.update_actor(batch) ``` -------------------------------- ### Math Problem JSON Example Source: https://github.com/hkuds/deepinnovator/blob/main/verl/utils/dataset/README.md Example of a math problem entry in the RLHF dataset. The prompt is in chat format with a user message, and the reward model uses a rule-based style with a ground truth answer. The data_source field identifies the origin of the data. ```json { "data_source": "openai/gsm8k", "prompt": [{"role": "user", "content": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Let's think step by step and output the final answer after \"####\""}], "ability": "math", "reward_model": { "style": "rule", "ground_truth": ["72"] }, } ``` -------------------------------- ### Quick run all steps with run.sh Source: https://github.com/hkuds/deepinnovator/blob/main/recipe/DeepInnovator/data_preparation/README.md Run all three steps sequentially using the run.sh script. Default values are 100 papers and ./data/arxiv_data. Custom parameters can be passed as arguments: first argument is total papers, second is data path. ```bash # Use default values (100 papers, ./data/arxiv_data) bash run.sh # Or specify custom parameters bash run.sh 200 ./data/my_papers ``` -------------------------------- ### Configure environment variables in .env file Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Create a `.env` file in the project root with API configuration for data preparation and optional training keys. Replace the placeholder values with your actual API endpoints and keys. ```bash # API Configuration for data preparation OPENAI_API_BASE=your_api_base_url OPENAI_API_KEY=your_api_key # For training (if needed) WANDB_API_KEY=your_wandb_api_key WANDB_BASE_URL=your_wandb_base_url ``` -------------------------------- ### Run convenience preprocessing script Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Use the convenience script to preprocess data. Run from the `recipe/DeepInnovator` directory. ```bash cd recipe/DeepInnovator bash preprocess.sh ``` -------------------------------- ### Shell script to launch fully async policy training Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/fully_async_policy/README.md Sets environment variables for async rollout mode and launches the training command with specified batch sizes, rollout steps, and async training parameters. Requires VLLM_USE_V1=1 when rollout_mode is async. ```shell rollout_mode="async" rollout_name="vllm" # sglang or vllm if [ "$rollout_mode" = "async" ]; then export VLLM_USE_V1=1 return_raw_chat="True" fi train_prompt_bsz=0 gen_prompt_bsz=1 n_resp_per_prompt=16 train_prompt_mini_bsz=32 total_rollout_steps=$(((512*400))) test_freq=10 staleness_threshold=0 trigger_parameter_sync_step=16 partial_rollout=False python -m recipe.fully_async_policy.fully_async_main \ train_batch_size=${train_prompt_bsz} \ data.gen_batch_size=${gen_prompt_bsz} \ data.return_raw_chat=${return_raw_chat} \ actor_rollout_ref.rollout.n=${n_resp_per_prompt} \ actor_rollout_ref.actor.strategy=fsdp2 \ critic.strategy=fsdp2 \ actor_rollout_ref.hybrid_engine=False \ actor_rollout_ref.actor.use_dynamic_bsz=${use_dynamic_bsz} \ actor_rollout_ref.ref.log_prob_use_dynamic_bsz=${use_dynamic_bsz} \ actor_rollout_ref.rollout.log_prob_use_dynamic_bsz=${use_dynamic_bsz} \ actor_rollout_ref.rollout.name=${rollout_name} \ actor_rollout_ref.rollout.mode=${rollout_mode} \ actor_rollout_ref.rollout.calculate_log_probs=True \ trainer.nnodes="${NNODES_TRAIN}" \ trainer.n_gpus_per_node="${NGPUS_PER_NODE}" \ rollout.nnodes="${NNODES_ROLLOUT}" \ rollout.n_gpus_per_node="${NGPUS_PER_NODE}" \ rollout.total_rollout_steps="${total_rollout_steps}" \ rollout.test_freq="${test_freq}" \ async_training.staleness_threshold="${staleness_threshold}" \ async_training.trigger_parameter_sync_step="${trigger_parameter_sync_step}" \ async_training.partial_rollout="${partial_rollout}" ``` -------------------------------- ### Configure .env file with OpenAI API settings Source: https://github.com/hkuds/deepinnovator/blob/main/recipe/DeepInnovator/data_preparation/README.md Create a .env file with the OpenAI API base URL and key. Required before running the pipeline. ```bash OPENAI_API_BASE=your_api_base_url OPENAI_API_KEY=your_api_key ``` -------------------------------- ### Run complete data preparation pipeline Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Run the full data preparation pipeline with optional arguments for total papers and datapath. The script is located in the `data_preparation` directory. ```bash cd recipe/DeepInnovator/data_preparation bash run.sh [total_papers] [datapath] ``` -------------------------------- ### Generate training data Source: https://github.com/hkuds/deepinnovator/blob/main/recipe/DeepInnovator/data_preparation/README.md Run get_training_data.py to process all subdirectories in data/arxiv_data/ automatically. Outputs are saved to layer0/, layer1/, layer2/, and insights/ directories. ```bash python data_prepare/get_training_data.py ``` -------------------------------- ### Generate training data with full pipeline Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Process papers through the full pipeline (step1-step4) to generate training data. Outputs are organized into `layer0/`, `layer1/`, `layer2/`, and `insights/` directories. ```bash cd recipe/DeepInnovator/data_preparation python data_prepare/get_training_data.py ``` -------------------------------- ### Preprocess data for RL training Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Preprocess the generated training data for RL training. The command includes parameters for input/output directories, task description, validation size, seed, number of processes, dataset type, test mode, and layer flags. Outputs are `rl_train.parquet` and `rl_validation.parquet`. ```bash cd recipe/DeepInnovator python preprocess.py \ --input_dir ./data/arxiv_data \ --output_dir ./data/train \ --task_desc "refine a research idea" \ --validation_size 0.1 \ --seed 42 \ --num_proc 1 \ --dataset_type "rl" \ --test False \ --layer0 False \ --layer1 False \ --layer2 True ``` -------------------------------- ### Enable partial_rollout and staleness_threshold in async_training config Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/fully_async_policy/README.md Set partial_rollout to True and staleness_threshold to 0.5 in the async_training section to improve efficiency when using multi-turn tool calling. Other async parameters can be added. ```yaml async_training: partial_rollout: True staleness_threshold: 0.5 # Other async parameters ``` -------------------------------- ### Enable multi_turn in actor_rollout_ref config Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/fully_async_policy/README.md Set multi_turn.enable to True in the actor_rollout_ref.rollout section to use AsyncPartialToolAgentLoop by default in fully_async_policy mode. Other multi_turn related configurations can be added. ```yaml actor_rollout_ref: rollout: multi_turn: enable: True # AsyncPartialToolAgentLoop will be used by default in fully_async_policy mode # Other multi_turn related configurations ``` -------------------------------- ### sync_rollout_weights: nccl Broadcast from Actor to Rollout Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/one_step_off_policy/README.md Shows the drive process calling sync_rollout_weights on both actor and rollout worker groups, and the registered method that broadcasts model parameters tensor-by-tensor from actor to rollout using the nccl collective group. Includes patching for vLLM MoE model weight loading when in rollout mode. ```python # drive process call the actor and rollout respectively to sync parameters by nccl def sync_rollout_weights(self): self.actor_wg.sync_rollout_weights() ray.get(self.rollout_wg.sync_rollout_weights()) # fsdp model parameter sync @register(dispatch_mode=Dispatch.ONE_TO_ALL, blocking=False) def sync_rollout_weights(self): params = self._get_actor_params() if self._is_actor else None if self._is_rollout: inference_model = ( self.rollout.inference_engine.llm_engine.model_executor.driver_worker.worker.model_runner.model ) from verl.utils.vllm.patch import patch_vllm_moe_model_weight_loader patch_vllm_moe_model_weight_loader(inference_model) # Model parameters are broadcast tensor-by-tensor from actor to rollout for key, shape, dtype in self._weights_info: tensor = torch.empty(shape, dtype=dtype, device=get_torch_device().current_device()) if self._is_actor: assert key in params origin_data = params[key] if hasattr(origin_data, "full_tensor"): origin_data = origin_data.full_tensor() if torch.distributed.get_rank() == 0: tensor.copy_(origin_data) from ray.util.collective import collective collective.broadcast(tensor, src_rank=0, group_name="actor_rollout") if self._is_rollout: inference_model.load_weights([(key, tensor)]) ``` -------------------------------- ### Configure reward function parameters in reward_config.yaml Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Set metric weights for delta_reward and token_amount, and default reward kwargs including model, API key, and API base. Adjust these values before training. ```yaml config: metric_weights: delta_reward: 5 token_amount: 0.1 default_reward_kwargs: model: "your model" api_key: "your api key" api_base: "your api base" ``` -------------------------------- ### Configure model settings in providers.yaml Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Edit `recipe/DeepInnovator/data_preparation/config/models/providers.yaml` to set your API endpoints. The configuration uses environment variables for the base URL and API key. ```yaml openai: base_url: ${env:OPENAI_API_BASE} api_key: ${env:OPENAI_API_KEY} ``` -------------------------------- ### Enable FSDP2 with strategy options Source: https://github.com/hkuds/deepinnovator/blob/main/verl/README.md Enable FSDP2 in verl by setting these strategy options. FSDP2 is recommended by the torch distributed team for better throughput and memory usage, and is composable with other features like torch.compile. ```plaintext actor_rollout_ref.ref.strategy=fsdp2 actor_rollout_ref.actor.strategy=fsdp2 critic.strategy=fsdp2 reward_model.strategy=fsdp2 ``` -------------------------------- ### Download papers from arXiv Source: https://github.com/hkuds/deepinnovator/blob/main/recipe/DeepInnovator/data_preparation/README.md Run pull_papers.py to download papers from arXiv across predefined categories (cs, stat, q-fin, math). Use --total_papers to set the number of papers and --datapath to specify the save directory. Output is saved to {datapath}/raw_paper/. ```bash python data_prepare/pull_papers.py --total_papers 100 --datapath ./data/arxiv_data ``` -------------------------------- ### Extract target paper ideas Source: https://github.com/hkuds/deepinnovator/blob/main/recipe/DeepInnovator/data_preparation/README.md Run get_target_paper_idea.py to extract ideas from target papers. The --datapath or -d flag specifies the arxiv data directory (default: data/arxiv_data). Output is saved to {datapath}/{paper_id}/target_paper/raw_paper/paper_idea.json. ```bash python data_prepare/get_target_paper_idea.py --datapath ./data/arxiv_data ``` -------------------------------- ### Verify Simulation Worker Scheduling Source: https://github.com/hkuds/deepinnovator/blob/main/verl/experimental/vla/README.md Python command to check if simulation workers are correctly scheduled on the simulation node. ```python python -c "import ray; ray.init(address=\":6379\"); print(ray._private.state.available_resources_per_node())" ``` -------------------------------- ### Configure interaction settings in ResearchGAN_interaction_config.yaml Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Define interaction settings for DeepInnovator, including discriminator model and API credentials. Update the discriminator_kwargs with your model and API details. ```yaml interaction: - name: "DeepInnovator" discriminator_kwargs: discriminator_model: "your model" api_key: "your api key" api_base: "your api base" ``` -------------------------------- ### Extract target paper ideas Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Extract ideas from target papers. The output is saved to `{datapath}/{paper_id}/target_paper/raw_paper/paper_idea.json`. ```bash cd recipe/DeepInnovator/data_preparation python data_prepare/get_target_paper_idea.py --datapath ./data/arxiv_data ``` -------------------------------- ### Clean SLURM/MPI/PMIx Environment Variables Source: https://github.com/hkuds/deepinnovator/blob/main/verl/workers/rollout/trtllm_rollout/trtllm_async_rollout.md Unsets all SLURM, MPI, PMIx, and related environment variables to avoid pmix mismatch errors before launching the Ray cluster. Required when using TRT-LLM rollout. ```bash # Clean all SLURM/MPI/PMIx env to avoid pmix mismatch error. for v in $(env | awk -F= '/^(PMI|PMIX|MPI|OMPI|SLURM)_/{print $1}'); do unset "$v" done ``` -------------------------------- ### BibTeX citation for HybridFlow paper Source: https://github.com/hkuds/deepinnovator/blob/main/verl/README.md Use this BibTeX entry to cite the HybridFlow paper when referencing verl. It is provided in the citation section of the README. ```bibtex @article{sheng2024hybridflow, title = {HybridFlow: A Flexible and Efficient RLHF Framework}, author = {Guangming Sheng and Chi Zhang and Zilingfeng Ye and Xibin Wu and Wang Zhang and Ru Zhang and Yanghua Peng and Haibin Lin and Chuan Wu}, year = {2024}, journal = {arXiv preprint arXiv: 2409.19256} } ``` -------------------------------- ### Citation for DeepInnovator paper (BibTeX) Source: https://github.com/hkuds/deepinnovator/blob/main/README.md Use this BibTeX entry to cite the DeepInnovator paper in academic publications. The entry includes the paper's title, authors, journal, and year. ```bibtex @article{fan2026deepinnovator, title={DeepInnovator: Triggering the Innovative Capabilities of LLMs}, author={Fan, Tianyu and Zhang, Fengji and Zheng, Yuxiang and Chen, Bei and Niu, Xinyao and Huang, Chengen and Lin, Junyang and Huang, Chao}, journal={arXiv preprint arXiv:2602.18920}, year={2026} } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.