You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Trinity-RFT is a general-purpose, flexibleand scalable framework designed for reinforcement fine-tuning (RFT) of large language models (LLM).**
14
+
**Trinity-RFT is a general-purpose, flexible, scalable and user-friendly framework designed for reinforcement fine-tuning (RFT) of large language models (LLM).**
15
15
16
16
17
-
Built with a decoupled design, seamless integration for agentic workflows, and systematic data processing pipelines, Trinity-RFT can be easily adapted for diverse application scenarios, and serve as a platform for exploring advanced reinforcement learning (RL) paradigms.
17
+
Built with a decoupled design, seamless integration for agent-environment interaction, and systematic data processing pipelines, Trinity-RFT can be easily adapted for diverse application scenarios, and serve as a unified platform for exploring advanced reinforcement learning (RL) paradigms.
18
18
19
19
20
20
@@ -23,15 +23,15 @@ Built with a decoupled design, seamless integration for agentic workflows, and s
23
23
## Vision of this project
24
24
25
25
26
-
Current RFT approaches, such as RLHF (Reinforcement Learning from Human Feedback) with proxy reward models or training long-CoT reasoning models with rule-based rewards, are limited in their ability to handle dynamic, real-world learning.
26
+
Current RFT approaches, such as RLHF (Reinforcement Learning from Human Feedback) with proxy reward models or training long-CoT reasoning models with rule-based rewards, are limited in their ability to handle dynamic, real-world, and continuous learning.
27
27
28
28
Trinity-RFT envisions a future where AI agents learn by interacting directly with environments, collecting delayed or complex reward signals, and continuously refining their behavior through RL.
29
29
30
30
31
31
For example, imagine an AI scientist that designs an experiment, executes it, waits for feedback (while working on other tasks concurrently), and iteratively updates itself based on true environmental rewards when the experiment is finally finished.
32
32
33
33
34
-
Trinity-RFT offers a path into this future by addressing critical gaps in existing solutions.
34
+
Trinity-RFT offers a path into this future by providing various useful features.
35
35
36
36
37
37
@@ -42,7 +42,7 @@ Trinity-RFT offers a path into this future by addressing critical gaps in existi
42
42
43
43
44
44
+**Unified RFT modes & algorithm support.**
45
-
Trinity-RFT unifies and generalizes existing RFT methodologies into a flexible and configurable framework, supporting synchronous/asynchronous and on-policy/off-policy/offline training, as well as hybrid modes that combine them seamlessly into a single learning process.
45
+
Trinity-RFT unifies and generalizes existing RFT methodologies into a flexible and configurable framework, supporting synchronous/asynchronous, on-policy/off-policy, and online/offline training, as well as hybrid modes that combine them seamlessly into a single learning process.
46
46
47
47
48
48
+**Agent-environment interaction as a first-class citizen.**
@@ -51,9 +51,7 @@ Trinity-RFT allows delayed rewards in multi-step/time-lagged feedback loops, han
51
51
52
52
53
53
+**Data processing pipelines optimized for RFT with diverse/messy data.**
54
-
These include converting raw datasets to prompt/task sets for RL, cleaning/filtering/prioritizing experiences stored in the replay buffer, synthesizing data for tasks and experiences, offering user interfaces for human in the loop, etc.
55
-
<!-- managing the task and experience buffers (e.g., supporting collection of lagged reward signals) -->
56
-
54
+
These include converting raw datasets to task sets for RL, cleaning/filtering/prioritizing experiences stored in the replay buffer, synthesizing data for tasks and experiences, offering user interfaces for human in the loop, etc.
57
55
58
56
59
57
@@ -73,20 +71,20 @@ These include converting raw datasets to prompt/task sets for RL, cleaning/filte
73
71
The overall design of Trinity-RFT exhibits a trinity:
74
72
+ RFT-core;
75
73
+ agent-environment interaction;
76
-
+ data processing pipelines tailored to RFT;
74
+
+ data processing pipelines;
77
75
78
76
and the design of RFT-core also exhibits a trinity:
79
77
+ explorer;
80
78
+ trainer;
81
-
+manager & buffer.
79
+
+ buffer.
82
80
83
81
84
82
85
83
The *explorer*, powered by the rollout model, interacts with the environment and generates rollout trajectories to be stored in the experience buffer.
86
84
87
-
The *trainer*, powered by the policy model, samples batches of experiences from the buffer and updates the policy via RL algorithms.
85
+
The *trainer*, powered by the policy model, samples batches of experiences from the buffer and updates the policy model via RL algorithms.
88
86
89
-
These two can be completely decoupled and act asynchronously, except that they share the same experience buffer, and their model weights are synchronized once in a while.
87
+
These two can be completely decoupled and act asynchronously on separate machines, except that they share the same experience buffer, and their model weights are synchronized once in a while.
90
88
Such a decoupled design is crucial for making the aforementioned features of Trinity-RFT possible.
Meanwhile, Trinity-RFT has done the dirty work for ensuring high efficiency in every component of the framework,
101
-
e.g., utilizing NCCL (when feasible) for model weight synchronization, sequence concatenation with proper masking for multi-turn conversations and ReAct-style workflows, pipeline parallelism for the synchronous RFT mode, among many others.
98
+
Meanwhile, Trinity-RFT has done a lot of work to ensure high efficiency and robustness in every component of the framework,
99
+
e.g., utilizing NCCL (when feasible) for model weight synchronization, sequence concatenation with proper masking for multi-turn conversations and ReAct-style workflows, pipeline parallelism for the synchronous RFT mode,
100
+
asynchronous and concurrent LLM inference for rollout,
101
+
fault tolerance for agent/environment failures,
102
+
among many others.
102
103
103
104
104
105
@@ -146,8 +147,7 @@ pip install flash-attn -v
146
147
```
147
148
148
149
Installation from docker:
149
-
150
-
We provided a dockerfile for Trinity-RFT (trinity)
150
+
we have provided a dockerfile for Trinity-RFT (trinity)
Copy file name to clipboardExpand all lines: docs/sphinx_doc/source/main.md
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,22 @@
5
5
6
6
7
7
8
-
Trinity-RFT is a general-purpose, flexible and scalable framework designed for reinforcement fine-tuning (RFT) of large language models (LLM).
9
-
Built with a decoupled architecture, seamless integration for agentic workflows, and systematic data processing pipelines, Trinity-RFT can be easily adapted for diverse application scenarios, and serve as a platform for exploring advanced reinforcement learning (RL) paradigms.
8
+
Trinity-RFT is a general-purpose, flexible, scalable and user-friendly framework designed for reinforcement fine-tuning (RFT) of large language models (LLM).
9
+
10
+
Built with a decoupled design, seamless integration for agent-environment interaction, and systematic data processing pipelines, Trinity-RFT can be easily adapted for diverse application scenarios, and serve as a unified platform for exploring advanced reinforcement learning (RL) paradigms.
10
11
11
12
12
13
13
14
14
15
15
-
**Vision of this project:**
16
16
17
+
**Vision of this project:**
17
18
18
-
Current RFT approaches, such as RLHF (Reinforcement Learning from Human Feedback) with proxy reward models or training long-CoT reasoning LLMs with rule-based rewards, are limited in their ability to handle dynamic, real-world learning.
19
-
Trinity-RFT envisions a future where AI agents learn by interacting directly with environments, collecting delayed or complex reward signals, and continuously refining their behavior through advanced RL paradigms.
20
-
For example, imagine an AI scientist that designs an experiment, executes it via interacting with the environment, waits for feedback (while working on some other tasks concurrently), and iteratively updates itself based on true environmental rewards when the experiment is finally finished.
21
-
Trinity-RFT offers a path into this future by addressing critical gaps in existing solutions.
22
19
20
+
Current RFT approaches, such as RLHF (Reinforcement Learning from Human Feedback) with proxy reward models or training long-CoT reasoning models with rule-based rewards, are limited in their ability to handle dynamic, real-world, and continuous learning.
21
+
Trinity-RFT envisions a future where AI agents learn by interacting directly with environments, collecting delayed or complex reward signals, and continuously refining their behavior through RL.
22
+
For example, imagine an AI scientist that designs an experiment, executes it, waits for feedback (while working on other tasks concurrently), and iteratively updates itself based on true environmental rewards when the experiment is finally finished.
23
+
Trinity-RFT offers a path into this future by providing various useful features.
23
24
24
25
25
26
@@ -29,13 +30,13 @@ Trinity-RFT offers a path into this future by addressing critical gaps in existi
29
30
30
31
31
32
+**Unified RFT modes & algorithm support.**
32
-
Trinity-RFT unifies and generalizes existing RFT methodologies into a flexible and configurable framework, supporting synchronous/asynchronous and on-policy/off-policy/offline training, as well as hybrid modes that combine the above seamlessly into a single learning process (e.g., incorporating expert trajectories or high-quality SFT data to accelerate an online RL process).
33
+
Trinity-RFT unifies and generalizes existing RFT methodologies into a flexible and configurable framework, supporting synchronous/asynchronous, on-policy/off-policy, and online/offline training, as well as hybrid modes that combine the above seamlessly into a single learning process (e.g., incorporating expert trajectories or high-quality SFT data to accelerate an online RL process).
33
34
34
35
+**Agent-environment interaction as a first-class citizen.**
35
36
Trinity-RFT natively models the challenges of RFT with real-world agent-environment interactions. It allows delayed rewards in multi-step and/or time-lagged feedback loops, handles long-tailed latencies and environment/agent failures gracefully, and supports distributed deployment where explorers (i.e., the rollout agents) and trainers (i.e., the policy model trained by RL) can operate across separate clusters or devices (e.g., explorers on edge devices, trainers in cloud clusters) and scale up independently.
36
37
37
38
+**Data processing pipelines optimized for RFT with diverse/messy data.**
38
-
These include converting raw datasets to prompt/task sets for RL, cleaning/filtering/prioritizing experiences stored in the replay buffer, synthesizing data for tasks and experiences, offering user interfaces for RFT with human in the loop, managing the task and experience buffers (e.g., supporting collection of lagged reward signals), among others.
39
+
These include converting raw datasets to task sets for RL, cleaning/filtering/prioritizing experiences stored in the replay buffer, synthesizing data for tasks and experiences, offering user interfaces for RFT with human in the loop, among others.
39
40
40
41
41
42
@@ -51,20 +52,20 @@ These include converting raw datasets to prompt/task sets for RL, cleaning/filte
51
52
The overall design of Trinity-RFT exhibits a trinity:
52
53
+ RFT-core;
53
54
+ agent-environment interaction;
54
-
+ data processing pipelines tailored to RFT.
55
+
+ data processing pipelines.
55
56
56
57
57
58
58
59
In particular, the design of RFT-core also exhibits a trinity:
59
60
+ explorer;
60
61
+ trainer;
61
-
+manager & buffer.
62
+
+ buffer.
62
63
63
64
64
65
65
66
The explorer, powered by the rollout model, interacts with the environment and generates rollout trajectories to be stored in the experience buffer.
66
67
The trainer, powered by the policy model, samples batches of experiences from the buffer and updates the policy via RL algorithms.
67
-
These two can be completely decoupled and act asynchronously, except that they share the same experience buffer, and their model weights are synchronized once in a while (according to a schedule specified by user configurations).
68
+
These two can be completely decoupled and act asynchronously on separate machines, except that they share the same experience buffer, and their model weights are synchronized once in a while (according to a schedule specified by user configurations).
68
69
69
70
70
71
Such a decoupled design is crucial for making the aforementioned features of Trinity-RFT possible,
@@ -77,7 +78,7 @@ among others.
77
78
78
79
79
80
Meanwhile, Trinity-RFT has done the dirty work for ensuring high efficiency in every component of the framework,
80
-
e.g., utilizing NCCL (when feasible) for model weight synchronization, sequence concatenation with proper masking for multi-turn conversations and ReAct workflows, pipeline parallelism for the synchronous RFT mode, among many others.
81
+
e.g., utilizing NCCL (when feasible) for model weight synchronization, sequence concatenation with proper masking for multi-turn conversations and ReAct workflows, pipeline parallelism for the synchronous RFT mode, asynchronous and concurrent LLM inference for rollout, among many others.
81
82
82
83
83
84
@@ -125,8 +126,7 @@ pip install flash-attn -v
125
126
126
127
127
128
Installation from docker:
128
-
129
-
We provided a dockerfile for Trinity-RFT (trinity)
129
+
we have provided a dockerfile for Trinity-RFT (trinity)
0 commit comments