RL
Forward-backward pass
Changed onSubmits a forward-backward pass operation that will asynchronously compute gradients via backpropagation.
post/v1/rl/training-sessions/{session_id}/operations/forward-backward
Request
- Base URLhttps://api.together.ai
- URLhttps://api.together.ai/v1/rl/training-sessions/{session_id}/operations/forward-backward
- AuthHTTP bearer
Path parameters
session_idstring required
Training session ID
Headers
Idempotency-Keystring required
Required key that makes retries return the original operation; use a new key for changed request bodies.
Request body
Example request
{
"samples": [
{
"model_input": {
"chunks": [
{
"encoded_text": {
"tokens": [
123,
456,
789
]
}
}
]
}
}
],
"loss": {
"grpo_params": {
"clip_low_threshold": 0.8,
"clip_high_threshold": 1.2,
"beta": 0.1
},
"ppo_params": {
"clip_low_threshold": 0.8,
"clip_high_threshold": 1.2
},
"cispo_params": {
"clip_high_threshold": 4
},
"dro_params": {
"beta": 0.05
},
"dppo_params": {
"delta_low": 0.15,
"delta_high": 0.15
}
},
"return_loss_fn_outputs": true,
"forward_only": true
}Response
Example response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"output": {
"loss": 2.345,
"metrics": {
"loss/clip/high_fraction": 0.1,
"loss/kl_ref/mean": 0.05
}
},
"error": {
"message": "Operation timed out"
}
}Changes
- info
endpoint added
- info