Topic

Supervised Fine-Tuning (SFT)

All digests tagged Supervised Fine-Tuning (SFT)

How to go from your agent's traces to a fine-tuned model in one workflow thumbnail

· 9:01

How to go from your agent's traces to a fine-tuned model in one workflow

This walkthrough introduces LangSmith Fine-Tuning and the SmithTune CLI, providing a single, end-to-end workflow to convert agent traces (trajectories) into custom, fine-tuned models. The process involves dataset creation and preparation from LangSmith trajectories, training using providers like Fireworks or Baseten, and subsequent evaluation, all managed through the SmithTune CLI. The overall workflow is: Create $\rightarrow$ Prepare $\rightarrow$ Plan $\rightarrow$ Train $\rightarrow$ Evaluate $\rightarrow$ Deploy.

Key takeaways

  1. Supervised Fine-Tuning (SFT) Purpose

    SFT teaches a model desired behavior (e.g., tool selection, workflow adherence) using 'golden examples' derived from agent traces, improving task accuracy and tool reliability.

  2. Trajectory Format Importance 0:01

    The LangSmith trajectory format is critical because it provides a detailed reconstruction of the agent's context, including tools available at each turn, which is necessary for post-training jobs.

  3. SmithTune Workflow Overview 0:02

    The process starts by pulling trajectories from a LangSmith tracing project, defining a task-specific rubric, having a model council judge the traces, and then pushing the approved traces back to LangSmith to form a training dataset.

  4. Training and Evaluation 0:07

    After preparing the dataset (specifying provider, base model, and splits), the user runs `smithtune plan` to review settings, followed by `smithtune train` to execute the job. Evaluation compares the fine-tuned model against the base model on held-out test data.

  5. Deployment 0:08

    If results meet quality targets, `smithtune deploy` is used to serve the tuned model and connect it to the application. Otherwise, the process iterates by refining examples or training settings.

Watch on YouTube Full article

Ask the Experts: Inside Nemotron Post-Training | Nemotron Labs thumbnail

· 51:07

Ask the Experts: Inside Nemotron Post-Training | Nemotron Labs

This session details the advanced post-training pipeline used by NVIDIA AI researchers to build state-of-the-art (SOTA) models like Nemotron, focusing on enhancing intelligence and enabling agentic capabilities. Post-training is presented as an evolution from traditional task-specific training, utilizing structured data, chat templates, and specialized frameworks like NeMo Gym and NeMo RL. Key strategies discussed include performing ablation studies on data subsets, employing Mixture of Experts (MoE) for capability generalization, and establishing robust feedback loops using real-world user data to prevent model degradation.

Key takeaways

  1. Post-Training Evolution 3:58

    Post-training builds upon pre-training (which uses massive, diverse, unstructured data for causal language modeling) by focusing on structured data. This teaches the model to follow instructions, use chat templates, and emit tool calls, moving beyond simple task-specific or multi-task training.

  2. Structured Data for Capabilities 7:29

    To narrow model focus, post-training emphasizes structured data (e.g., tool responses, user prompts, tool sets) over unstructured text. This allows the model to learn specific formats, such as JSON or XML, for tool interaction.

  3. Mitigating Capability Degradation 13:54

    To specialize a model (e.g., for software engineering) without losing general capabilities, techniques include including general chat data in the blend and using algorithmic approaches like multi-teacher on-policy distillation (MOPD).

  4. Data Bias and Profiling 19:20

    Data quality is paramount. Researchers must analyze data statistics (e.g., trajectory length, tool call diversity) and perform ablation studies to identify and address biases (e.g., over-reliance on a single tool) that could cause model failure in real-world use.

  5. Starting the Pipeline 25:12

    For developers, the process involves defining the model's 'soul' (core capabilities), quantifying these goals via benchmarks, setting quantitative milestones, and iterating through the post-training pipeline. Starting resources include Nemotron 3.5 Lightning.

Watch on YouTube Full article

Stanford CS229 Machine Learning | Spring 2026 | Lecture 16: Basic Concept in RL, Policy Gradient thumbnail

· 1:13:19

Stanford CS229 Machine Learning | Spring 2026 | Lecture 16: Basic Concept in RL, Policy Gradient

This lecture provides an advanced deep dive into optimizing Transformer architectures for efficiency and adapting Large Language Models (LLMs) for various downstream tasks. Key focus areas include reducing the quadratic complexity of attention through techniques like Grouped Query Attention (GQA) and Sliding Window Attention; scaling models using Mixture of Experts (MoE) to decouple memory from compute; and exploring prompt-based methods such as In-Context Learning, Few-Shot, and Zero-Shot learning for task adaptation without updating model parameters.

Key takeaways

  1. Efficiency in Attention Mechanisms 20:04

    The standard self-attention mechanism has $O(T^2)$ complexity (where T is sequence length). To mitigate this, techniques like Grouped Query Attention (GQA) reduce the number of keys and values used across heads by mapping multiple query groups to a smaller set of shared keys/values. Similarly, Sliding Window Attention limits attention to only recent history, reducing complexity to $O(T imes W)$ where W is the window size.

  2. Scaling with Mixture of Experts (MoE) 42:28

    MoE allows models to have a large total parameter count (e.g., 30B) while keeping the active computation small (e.g., 3B). This is achieved by using a routing module that directs an input vector to only a subset of specialized expert sub-networks, significantly improving compute efficiency.

  3. LLM Adaptation via Prompting 56:48

    For downstream tasks (e.g., sentiment analysis), models can be adapted using In-Context Learning (ICL). This involves concatenating task examples and the test input into the prompt sequence without updating model parameters, which is fundamentally different from traditional fine-tuning.

  4. Supervised Fine-Tuning (SFT) 1:04:00

    SFT involves collecting data in an instruction/answer pair format and training the model by minimizing the negative log likelihood of predicting the answer ($Y$) given the instruction ($X$). This is a supervised process that updates the model's weights.

Watch on YouTube Full article