misc-files / Carbon Distillation.md
loubnabnl's picture
loubnabnl HF Staff
Upload Carbon Distillation.md
bdaf3ae verified
|
Raw
History Blame Contribute Delete
3.98 kB
# Carbon Distillation
## A rough outline on how to approach offline distillation for Carbon model
# tl;dr
To run SFT with our mid-trained checkpoints, we need training data in the form of (input,output,answer), where input is a prompt for a biology task, output is the response generated from an LLM, and answer is the ground-truth to verify the correctness of the output. Below I outline several tasks which together should (hopefully\!) provide the model with a well-rounded understanding of DNA tasks that computational biologists would encounter in practice.
**Notes**
* To generate data, I recommend using DataTrove or the light wrapper script we have here: [https://github.com/huggingface/trl-internal/tree/dev/dev/scripts/datatrove](https://github.com/huggingface/trl-internal/tree/dev/dev/scripts/datatrove)
* To generate N rollouts per prompt, you need to duplicate the dataset rows N times. I typically do N=8 so that we can later compute pass@8 to measure task difficulty if needed.
* To ensure variance, I typically use the model’s default sampling parameters
* Many models are “hybrid” reasoning models where the reasoning can be turned on or off by providing enable\_thinking \= {true,false} in the chat\_template\_kwargs. To iterate quickly, I suggest we focus on distilling models with *enable\_thinking=false*. Once we know the data pipeline works, we can later explore distilling the reasoning mode too, which is more time-consuming.
* To pick a candidate closed or open-weight model for distillation, consult the evals and pick those with the best scores on labbench2\_seqqa2 and vepqa\_{single,double}: [https://docs.google.com/spreadsheets/d/1zl5RZtyhKdYyi0Xw1NHa8oadZIUb9gAh3z-9t9IrUPQ/edit?gid=1137683486\#gid=1137683486](https://docs.google.com/spreadsheets/d/1zl5RZtyhKdYyi0Xw1NHa8oadZIUb9gAh3z-9t9IrUPQ/edit?gid=1137683486#gid=1137683486)
* genome\_qa and frontier\_biology will be added soon as additional axes to compare
# VEPQA
* Evals: vepqa\_single & vepqa\_double
* Training data: the train\_\* configs of [https://huggingface.co/datasets/HuggingFaceBio/vepqa](https://huggingface.co/datasets/HuggingFaceBio/vepqa)
**Notes**
* The training prompts are currently formatted in terms of a “single” reference sequence, with information about the alternate allele provided to reconstruct the alternate sequence. This is typically hard for the current models, so we should also create a “double” version where the reference and alternate sequence are provided like we do in vepqa\_double: [https://huggingface.co/datasets/HuggingFaceBio/vepqa/viewer/binary\_v5\_random?row=0](https://huggingface.co/datasets/HuggingFaceBio/vepqa/viewer/binary_v5_random?row=0)
* In either case, I recommend using a prompt suffix like the one in our evals to ensure the model produces a formatted answer that is easy to verify
* Looking at some of the evals, the prompt suffix encourages terse responses (e.g. just the final answer). To get diverse generations, we should include a CoT bit like “Think step by step and provide your final answer enclosed in XML tags exactly a…”
* For evals, we have settled on “random” positioning of the variant, so let’s start there and include the “last” and “center” prompts only if we’re data limited.
# SEQQA
* Evals: labbench2\_seqqa2 & labbench\_seqqa
* Training data (WIP): [https://huggingface.co/collections/HuggingFaceBio/seqqa-synthetic-data-generation](https://huggingface.co/collections/HuggingFaceBio/seqqa-synthetic-data-generation)
**Notes**
* The training data is currently designed to mimic the MCQ format in labbench\_seqqa, so we need a new pipeline that is generative like labbench2\_seqqa2. I’ll implement this soon.
# GENOME QA
* WIP (this week)
# FrontierBiology
* See if we can generate problems like this: [https://huggingface.co/datasets/HuggingFaceBio/FrontierBiology](https://huggingface.co/datasets/HuggingFaceBio/FrontierBiology)