Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • H h-2meta
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 43
    • Issues 43
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Nannette Odriscoll
  • h-2meta
  • Issues
  • #30

Closed
Open
Created Feb 11, 2025 by Nannette Odriscoll@nannetteodriscMaintainer

Distillation with Reasoning: can DeepSeek R1 Teach Better Than Humans?


Inclusion of reasoning "chains of idea" (CoT) in the model output substantially enhances its quality, however it increases reasoning cost.

  • Distillation transfers reasoning understanding from an expensive instructor design to a more cost-efficient trainee, minimizing total inference expense.
  • DeepSeek R1 can produce detailed CoT, making it an excellent instructor model.
  • Synthetic data generated by DeepSeek R1 may outshine data produced by human specialists.

    Introduction

    The recent release of DeepSeek R1 has taken the AI community by storm, using efficiency on par with leading frontier models-such as OpenAI's o1-at a fraction of the expense. Still, R1 can be costly for usage cases with high traffic or low latency requirements.

    R1's strength depends on its explicit detailed thinking. Before producing a last response, it creates an internal "chain of idea" (CoT) to systematically reason through each problem. This process is a kind of test-time calculation, permitting the design to dynamically designate more calculate to complex problems. However, these extended thinking sequences typically increase reasoning cost.

    Distillation

    Distillation is an approach for moving knowledge from a big, more powerful teacher model to a smaller, more cost-efficient trainee model. According to the DeepSeek R1 paper, R1 is extremely effective in this instructor role. Its detailed CoT series direct the trainee model to break down complex jobs into smaller sized, more manageable actions.

    Comparing Distillation to Human-Labeled Data

    Although fine-tuning with human-labeled information can produce customized models, collecting both last responses and their corresponding reasoning steps is pricey. Distillation scales more easily: instead of counting on human annotations, the teacher model instantly produces the training information for the trainee.

    A Side Note on Terminology

    The term "distillation" can describe various methods:

    Distribution Distillation Aligns the trainee model's output token distribution with the teacher's using Kullback-Leibler divergence (KL-divergence). Works finest when both models share the very same architecture, tokenizer, and forum.pinoo.com.tr pre-training data.

    Data Distillation Uses the instructor model to generate conclusions for a set of prompts. Fine-tunes the trainee model using a basic cross-entropy loss on these created outputs, skipping the KL-divergence term. Allows the instructor and trainee to be different model households and tokenizers (though if the teacher utilizes specialized tokens like __, it can be helpful for both designs to recognize them).

    In this post, we concentrate on the data distillation because it supports a larger range of student-teacher pairs.

    Data Generation

    Training data is typically a traffic jam in design advancement. In a current post (add link), we explored how to generate labels by combining model output with a confirmation function. Distillation takes a different technique, utilizing a teacher model to synthesize missing completions.

    DeepSeek R1 stands out due to the fact that it not just offers last answers but likewise exposes its detailed chain of thought-unlike other thinking models that keep this internal process concealed. If your dataset includes ground truth answers, you can recognize premium synthetic CoTs through rejection sampling, picking only the finest chains to further improve your fine-tuned model. Rejection sampling can get rid of incorrect information examples either by comparing the produced data against ground truth labels or by using a user-defined recognition function. From the interface point of view, the recognition function resembles the verifiable benefit function used by value-model-free RL techniques like these explained in our recent blog post.

    Case Study: clashofcryptos.trade GSM8K

    GSM8K (Elementary School Math 8K) is a dataset of 8.5 K varied grade-school mathematics word issues. Each information point consists of:

    1. An issue description.
  1. A human professional's chain of idea.
  2. The final response.

    We broadened this dataset by including:

    Synthetic R1 reasoning, i.e., the CoT produced by DeepSeek R1.

    Then, we fine-tuned 3 variants of the model (utilizing LoRA on llama-3.1 -8 B-instruct), each with various training targets:

    Direct Answer Only: Generate the last response without showing thinking. Human Expert CoT: Generate the final answer alongside a reasoning chain looking like the human specialist's. Synthetic R1 CoT: Generate the final response alongside DeepSeek R1's artificial thinking chain. The table below summarizes typical accuracy and thinking length:

    - Note: The accuracy for the 5-shot standard may vary from numbers reported elsewhere due to different assessment setups. The key focus is on comparing relative performance throughout distillation methods, not on beating other models.

    From this research study, synthetic reasoning CoTs from DeepSeek R1 appear exceptional to human-expert CoTs in boosting efficiency, albeit with a greater inference cost due to their longer length.

    Fireworks AI Inference and Fine-Tuning Platform

    DeepSeek R1 is available on the Fireworks AI platform. An user-friendly distillation interface will soon become part of FireOptimizer. If you need earlier gain access to, please contact us to check out alternatives.

    Conclusions

    By incorporating reasoning-based information through distillation, organizations can significantly improve model performance without bearing the full concern of human-annotated datasets. DeepSeek R1's ability to produce long, top quality reasoning chains makes it an effective instructor model-showing that, in many cases, the maker may just out-teach the human.
Assignee
Assign to
Time tracking