How to Fine-Tune a Reasoning Model? A Teacher-Student Cooperation Framework to Synthesize Student-Consistent SFT Data
Organizations: Shanghai AI Laboratory · Dalian University of Technology · Nanjing University
Abstract
A widely adopted strategy for model enhancement is to use synthetic data generated by a stronger model for supervised fine-tuning (SFT). However, for emerging reasoning models like Qwen3-8B, this approach often fails to improve reasoning capabilities and can even lead to a substantial drop in performance. In this work, we identify substantial stylistic divergence between teacher generated data and the distribution of student as a major factor impacting SFT. To bridge this gap, we propose a Teacher-Student Cooperation Data Synthesis framework (TESSY), which interleaves teacher and student models to alternately generate style and non-style tokens. Consequently, TESSY produces synthetic sequences that inherit the advanced reasoning capabilities of the teacher while maintaining stylistic consistency with the distribution of the student. In experiments on code generation using GPT-OSS-120B as the teacher, fine-tuning Qwen3-8B on teacher-generated data leads to performance drops of 3.25% on LiveCodeBench-Pro and 10.02% on OJBench, whereas TESSY achieves improvements of 11.25% and 6.68%.
Figures & tables
| In-domain Test Sets | Out-of-domain Test Sets | |||||||
|---|---|---|---|---|---|---|---|---|
| LCB-V5 | LCB-V6 | LCB-Pro | OJBench | GPQA-Diamond | AIME2024 | AIME2025 | OlympiadBench | |
| Qwen3-8B | 55.09 | 49.58 | 25.35 | 18.75 | 60.16 | 76.67 | 69.17 | 69.81 |
| + Reject-Sampling | 54.55 | 48.00 | 26.06 | 18.32 | 60.61 | 75.42 | 66.77 | 69.53 |
| + Self-Distillation | 51.50 | 43.43 | 19.26 | 14.22 | 60.61 | 71.98 | 62.29 | 67.80 |
| + Teacher-Answer | 35.33 | 33.14 | 21.39 | 14.01 | 60.42 | 74.79 | 64.48 | 69.40 |
| + Teacher-Think | 47.90 | 43.43 | 24.36 | 12.50 | 54.29 | 77.81 | 69.06 | 69.59 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| LCB-V5 | LCB-V6 | LCB-Pro | OJBench | |
|---|---|---|---|---|
| DeepSeek-R1-Distill-Llama-8B | 34.73 | 33.71 | 17.56 | 5.82 |
| + Self-Distillation | 19.76 | 24.00 | 8.07 | 5.82 |
| + Teacher-Only | 38.32 | 36.57 | 24.22 | 11.42 |
| + TESSY | 52.10 | 41.71 | 26.20 | 12.50 |
| LCB-V5 | LCB-V6 | LCB-Pro | OJBench | |
|---|---|---|---|---|
| Qwen3-8B | 55.09 | 49.58 | 25.35 | 18.75 |
| + TESSY (Predictors trained on 500 samples) | 59.58 | 54.00 | 35.13 | 23.98 |
| + TESSY (Predictors trained on 100K samples) | 60.68 | 55.15 | 35.84 | 26.51 |
| Prompt |
| You are a text analysis expert. Task: Extract all spans of text that are transitional, filler, or tone-setting phrases. What to extract: • Include phrases or sentences that: – Express hesitation, tone, or attitude (e.g., “well”, “okay”, “so”, “let’s see”, “I think”) – Indicate transition or setup (e.g., “to begin with”, “in this case”, “for example”, “but if”) – Serve as narration or connection, not analysis • Do not include: – Actual reasoning, deduction, or explanation – Code or formula descriptions – Problem-solving steps Output format (STRICT JSON): • Return a JSON array of strings, e.g.: ["<span 1>", "<span 2>", ...] • Rules: 1. Each span must be copied verbatim from the original text. 2. Preserve order of appearance. 3. If there are none, return an empty list: [] 4. Output only the JSON array — no explanation or extra text. <input_text> {think_text} </input_text> |
| Problem Description |
|---|
| Given a transcript of a Fizz Buzz game (where numbers divisible by are replaced with “Fizz”, by with “Buzz”, and by both with “FizzBuzz”), find any valid values of and that could generate the transcript. Input: Two integers and ( ) indicating the range, followed by tokens (integers or “Fizz”/“Buzz”/“FizzBuzz”). Output: Two positive integers and ( ) consistent with the transcript. If multiple solutions exist, output any one. |
| Response of Qwen3-8B-Base |
| To solve this problem, we need to determine the values of and that could have generated the given transcript. The key insight is that the transcript consists of numbers and strings (“Fizz”, “Buzz”, “FizzBuzz”) that correspond to multiples of and … To find and , we can: … • Identify the positions of “Fizz” and “Buzz” in the transcript. • … Approach • Identify the positions of “Fizz” and “Buzz”: … Solution Code #include <iostream> ... Explanation • Input Reading: – The program reads the range and the transcript. • Position Identification: – The program identifies the positions of “Fizz” and “Buzz” in the transcript. • Validation Loop: – The program iterates over possible values of and and checks if they satisfy the conditions for the transcript. • Output: – The first valid pair is output, and the program terminates. This approach ensures that we find a valid pair that could have generated the given transcript. |
| Problem Description |
|---|
| Given a transcript of a Fizz Buzz game (where numbers divisible by are replaced with “Fizz”, by with “Buzz”, and by both with “FizzBuzz”), find any valid values of and that could generate the transcript. Input: Two integers and ( ) indicating the range, followed by tokens (integers or “Fizz”/“Buzz”/“FizzBuzz”). Output: Two positive integers and ( ) consistent with the transcript. If multiple solutions exist, output any one. |
| Thinking of Student Model (Qwen3-8B) |
| <think> Okay, let’s see. I need to solve this Fizz Buzz reverse problem … First, I need to understand what the transcript implies about a and b … Let me think about how to model this … But wait, the transcript could have numbers that are not divisible by a or b. So for each entry in the transcript, we can derive constraints on a and b. The challenge is to find a and b that satisfy all these constraints. Let me think about how to approach this … But how do I find a and b that satisfy all these constraints? … Thus, the code is implemented as described. </think> |
| Thinking of Teacher Model (GPT-OSS-120B) |
| <think> We need to solve the reverse FizzBuzz problem: given a transcript from c to d inclusive, each entry is either a number (as integer string) or one of the words “Fizz”, “Buzz”, “FizzBuzz”. The transcript is guaranteed to be consistent with some a,b (1 a,b 1e6). Need to output any such a,b. Constraints: c,d up to 1e5 length (max length of transcript is up to 1e5). a,b up to 1e6. Goal: find any pair (a,b) that matches. We need to parse transcript: for each integer i from c to d, we have output string s_i. If s_i is a number, it must be exactly the integer i (as decimal). If s_i is “Fizz”, then i is multiple of a but not b. If “Buzz”: multiple of b but not a. If “FizzBuzz”: multiple of both a and b (i.e., multiple of lcm(a,b)) … We need to find any a,b. This is like solving constraints. Observation: The numbers in transcript that are numeric give us direct constraints: … … Let’s write code. </think> |
| Thinking of TESSY (Teacher: GPT-OSS-120B, Student: Qwen3-8B) |
| Problem Description |
|---|
| Given a transcript of a Fizz Buzz game (where numbers divisible by are replaced with “Fizz”, by with “Buzz”, and by both with “FizzBuzz”), find any valid values of and that could generate the transcript. Input: Two integers and ( ) indicating the range, followed by tokens (integers or “Fizz”/“Buzz”/“FizzBuzz”). Output: Two positive integers and ( ) consistent with the transcript. If multiple solutions exist, output any one. |
| Final Answer of Student Model (Qwen3-8B) |
| To solve the Fizz Buzz reverse problem , we need to determine possible values of integers and that could generate a given transcript of the game. The transcript consists of numbers and the words “Fizz”, “Buzz”, and “FizzBuzz” corresponding to multiples of , , and both and respectively. Approach • Parse Input: Read the range of the transcript and the transcript itself. • Classify Entries: Identify which entries are “Fizz”, “Buzz”, “FizzBuzz”, or numbers. This helps in determining constraints on and . • Determine Constraints: For entries that are “Fizz” or “FizzBuzz”, must divide the corresponding number… • Generate Candidates: For “Fizz” and “FizzBuzz” entries, compute the GCD of all such numbers and generate all its divisors as potential values for … • Validate Candidates: Check all combinations of and to find a valid pair that satisfies all constraints from the transcript. Solution Code #include <bits/stdc++.h> using namespace std; ... Explanation • Input Parsing: The input is read and stored in a vector of strings representing the transcript. • Classifying Entries: We classify each entry to determine which numbers are divisible by , , or both. • Generating Candidates: Using the GCD of relevant numbers, we generate potential values for and . If no such entries exist, we find the smallest number that does not divide any number in the transcript. • Validation: For each candidate pair , we check if it satisfies all constraints from the transcript … This approach ensures that we efficiently narrow down the possible values of and and validate them against the transcript constraints. |
| Final Answer of Teacher Model (GPT-OSS-120B) |
| Solution Explanation For every integer i , … 1. Reformulating the conditions S_Fizz = { i | type(i) = Fizz } … 2. Determining a If A is empty, a never has to divide any number, we may choose any value that … 3. Algorithm read c , d … 4. Correctness Proof • Lemma 1: If A is non - empty, any integer x that divides every element of A must divide G = gcd(A) ; conversely every divisor of G divides every element of A . Proof: … • … 5. Complexity Analysis … Both limits are easily satisfied. 6. Reference Implementation #include <bits/stdc++.h> using namespace std; ... The program follows exactly the algorithm proven correct above and conforms to the GNU C++17 compiler. |