VOOZH about

URL: https://deepwiki.com/inclusionAI/AReaL/5.4-built-in-workflows

⇱ Built-in Workflows | inclusionAI/AReaL | DeepWiki


Loading...
Last indexed: 7 May 2026 (2e12c1)
Menu

Built-in Workflows

This page documents the workflow implementations included with AReaL. Workflows implement the RolloutWorkflow interface areal/api/workflow_api.py12-16 and define the episode generation logic for different task types. AReaL provides primary built-in workflows: RLVRWorkflow for single-turn text tasks, VisionRLVRWorkflow for vision-language tasks, and MultiTurnWorkflow for multi-attempt retry logic. It also includes the TIRWorkflow for tool-integrated reasoning and the ScaffoldingWorkflow for modular agentic RL.


RLVRWorkflow

The RLVRWorkflow is the standard implementation for single-turn reinforcement learning from verbal reinforcement (RLVR). It supports optional "thinking" tokens (reasoning) and handles the standard generate-reward cycle areal/workflow/rlvr.py49-56

Implementation Logic

  1. Input Processing: Uses get_input_ids_fn to convert raw data into tokenized input IDs using a chat template. By default, it uses default_get_input_ids_fn which calls apply_chat_template areal/workflow/rlvr.py31-42 areal/workflow/rlvr.py147-151
  2. Generation: Submits a ModelRequest areal/api/inference_api.py34-47 to the InferenceEngine via engine.agenerate areal/workflow/rlvr.py131
  3. Reward Computation: Decodes the response and calls an asynchronous reward function wrapped by AsyncRewardWrapper areal/workflow/rlvr.py100-107
  4. Tensor Preparation: Packages the sequence, logprobs, loss masks, and rewards into a dictionary of tensors with a batch dimension of 1 for the trainer areal/workflow/rlvr.py165-178

RLVR Workflow Data Flow

The following diagram illustrates the data flow within RLVRWorkflow.arun_episode.


Sources: areal/workflow/rlvr.py49-178 areal/api/workflow_api.py12-38


VisionRLVRWorkflow

VisionRLVRWorkflow extends RLVRWorkflow to support Vision-Language Models (VLMs). It integrates a transformers.AutoProcessor to handle multi-modal inputs areal/workflow/vision_rlvr.py26-43

Key Features

VLM Workflow Components

Class/FunctionFileRole
VisionRLVRWorkflowareal/workflow/vision_rlvr.py26Main class for VLM rollout logic.
image2base64areal/utils/image.py15Utility to convert PIL images for inference backends.
_collect_samplesareal/workflow/vision_rlvr.py76Orchestrates generation and reward within a session context.

Sources: areal/workflow/vision_rlvr.py1-168


MultiTurnWorkflow

The MultiTurnWorkflow implements a retry mechanism where the agent is prompted to correct its answer if the initial reward is zero areal/workflow/multi_turn.py19-20

Logic and Discounting

Multi-turn Execution Trace


Sources: areal/workflow/multi_turn.py19-136


Tool-Integrated Reasoning (TIR) Workflow

The TIRWorkflow enables agents to use external tools (e.g., Python executors) during multi-turn reasoning episodes examples/tir/tir_workflow.py47-50

Architecture

Sources: examples/tir/tir_workflow.py47-210


ScaffoldingWorkflow

The ScaffoldingWorkflow provides a modular framework for composing RL workflows using high-level controllers and workers examples/scaffolding/workflow.py42-43

Components

Scaffolding Entity Map


Sources: examples/scaffolding/workflow.py42-153 examples/scaffolding/search_scaffolding.py86-180


Performance and Session Tracing

All built-in workflows utilize AReaL's tracing system defined in areal/utils/perf_tracer.py to monitor execution phases.

Sources: areal/workflow/rlvr.py83-130 areal/workflow/vision_rlvr.py45-94