Finetuning a Reasoning LLM with Supervised or Reinforcement Learning? [D]
extract
<!-- SC_OFF --><div class="md"><p>Hello,</p> <p>I have a task to fine-tune small LLMs on annotated conversational data. The dataset contains not only the final answers, but also reasoning traces and tool-calling decisions (i.e., when the model should think and when it should call a tool).</p> <p>I am wondering what the best training approach would be and why.</p> <p>My current dataset is stored in a chat format similar to this:</p> <p>```text system user assistant_think assistant_tool assistant_answer</p> <p>user assistant_think assistant_tool assistant_answer ... ```</p> <p>My current idea is to split each conversation into multiple training samples. For example, if a conversation contains two user turns, I would create two samples:</p> <h2>Sample 1</h2> <p><code>text system user assistant_think assistant_tool assistant_answer </code></p> <h2>Sample 2</h2> <p>```text system user assistant_think assistant_tool assistant_answer</p> <p>user assistant_think assistant_tool assistant_answer ```</p> <p>In other words, each sample contains all previous conversation history up to the assistant response being trained.</p> <p>For training, the loss would be computed only on the assistant-generated tokens:</p> <p><code>text assistant_think assistant_tool assistant_answer </code></p> <p>while the system and user messages would be masked out from the loss.</p> <p>Is this approach correct, or is there a better way to structure the training data for reasoning and tool-calling behavior?</p> <p>My second question is about reinforcement learning.</p> <p>After completing supervised fine-tuning (SFT) on the dataset described above, should I also incorporate RL (e.g., PPO, GRPO, DPO, or another approach) to further train the model on when a tool should or should not be called?</p> <p>If so:</p> <ul> <li>What advantages would RL provide over SFT alone for tool use and reasoning?</li> <li>How would you design the reward function?</li> <li>Under what circumstances is RL actually necessary, and when is SFT sufficient?</li> </ul> <p>I would appreciate any practical advice, papers, blog posts, or open-source examples related to training reasoning and tool-calling models. ```</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/zdeneklapes"> /u/zdeneklapes </a> <br /> <span><a href="https://www.reddit.com/r/MachineLearning/comments/1ttxcm5/finetuning_a_reasoning_llm_with_supervised_or/">[link]</a></span>   <span><a href="https://www.reddit.com/r/MachineLearning/comments/1ttxcm5/finetuning_a_reasoning_llm_with_supervised_or/">[comments]</a></span>
retained text
No document body was retained for this record — only its metadata was stored.