CoTranslator-4B-Full

Translator variant trained on the full released paired dataset, introduced in CoTranslator: Reverse to Forward Chain-of-Thought Translator for Reasoning Distillation. CoTranslator learns to convert answer-conditioned reverse chain-of-thought (CoT) trajectories into trajectories resembling verified forward solutions. Its translations provide supervision for downstream student models.

Overview of CoTranslator

Overview of CoTranslator. The translator learns from paired reverse and verified forward trajectories, then translates reverse trajectories at scale to construct student training data.

Released checkpoint

Item Value
Base model Qwen/Qwen3-4B-Thinking-2507
Parameters stored 4,022,468,096
Training Full-parameter supervised fine-tuning
Source pair configuration full
Rows in the source JSONL 266,288, before training preprocessing and packing
Checkpoint step 4921
Weights BF16, two Safetensors shards

The companion translator is CoTranslator-4B.

Translation task

The teacher generates a reverse trajectory with access to the reference answer, using the semantic suppression prompt described in the manuscript. The translator receives that trajectory, including its reasoning and final response. During training, its target is the corresponding question-only forward response from the original Nemotron dataset, accepted by answer verification.

The translation input consists of the following system instruction and a user message containing the reverse trajectory:

You are a reasoning trajectory refiner. Given a teacher-generated solution trajectory, produce a more natural reasoning trajectory. Preserve the mathematical conclusion and answer format.
<think>
{{reasoning_content}}
</think>
{{content}}

At inference, supply the teacher trajectory in this format. The manuscript conditions the translator on the trajectory alone; the problem and reference answer are used for pairing and verification.

Training configuration

The settings below are recorded in this checkpoint's args.json and match the manuscript's translator configuration.

Setting Value
Framework Megatron-Swift
Epochs 3
Learning rate 5e-5
LR schedule / warmup fraction Cosine / 0.1
Weight decay 0.1
Global / micro batch size 32 / 2
Sequence length 65,536 tokens
Packing / precision Enabled / BF16
Adam beta1 / beta2 0.9 / 0.95
Gradient clipping 1.0
Seed 42
Chat template qwen3_thinking

Training preprocessing drops examples exceeding the 65,536-token limit; the source JSONL row count precedes that preprocessing.

Usage

Use a recent Transformers release. The checkpoint configuration was saved with Transformers 5.12.1; local configuration and tokenizer loading were checked with that version.

pip install -U transformers accelerate torch datasets

This example translates the input trajectory from one released training pair:

import torch
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Word2Li/CoTranslator-4B-Full"
data = load_dataset(
    "Word2Li/CoTranslator-Nemotron-SFT-Math-v4-Pairs", "full",
    split="train", streaming=True,
)
example = next(iter(data))
messages = example["messages"][:2]

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, dtype="auto", device_map="auto",
)
prompt = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True,
)
inputs = tokenizer(prompt, add_special_tokens=False, return_tensors="pt").to(model.device)
with torch.inference_mode():
    output = model.generate(
        **inputs, max_new_tokens=32768, do_sample=True,
        temperature=0.6, top_p=0.95, top_k=20,
        pad_token_id=tokenizer.pad_token_id,
        eos_token_id=tokenizer.eos_token_id,
    )
continuation = tokenizer.decode(
    output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True,
)
# The bundled chat template already places the opening <think> in the prompt.
translated_trajectory = "<think>\n" + continuation
print(translated_trajectory)

The manuscript uses temperature 0.6, top-p 0.95, top-k 20, min-p 0, and a maximum of 32,768 generated tokens for translator inference.

License and attribution

This release uses Apache-2.0, matching the base model license. Training data attribution and source-specific data licenses are described in the paired dataset card.

Downloads last month
159
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Word2Li/CoTranslator-4B-Full

Finetuned
(273)
this model

Dataset used to train Word2Li/CoTranslator-4B-Full

Collection including Word2Li/CoTranslator-4B-Full