{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "zinyy-adaflash--train-custom-adaflash-drafter",
 "repo": "ZinYY/AdaFlash",
 "repo_url": "https://github.com/ZinYY/AdaFlash",
 "repo_slug": "zinyy-adaflash",
 "title": "Train an Ada Flash drafter on your own response data",
 "page_title": "How to train an Ada Flash drafter on your own response data with Ada Flash",
 "summary": "Regenerate training data, initialize the adaptive length head, then run asynchronous on-policy training.",
 "who": "A researcher or ML engineer who wants a drafter tuned to a different dataset or target model than the released checkpoint.",
 "problem": "The released Qwen3-8B drafter was trained on PerfectBlend, so a different domain may need its own drafter trained on matching target-model responses.",
 "outcome": "A trained Ada Flash drafter with an initialized adaptive length head, saved as versioned weights that the async pipeline publishes for hot reloading.",
 "steps": [
  "Prepare the base dataset with `python bin/prepare_data.py --dataset perfectblend`, then regenerate responses with `CUDA_VISIBLE_DEVICES=0 python bin/regenerate_dataset.py --model-path Qwen/Qwen3-8B --initial-draft-path z-lab/Qwen3-8B-DFlash-b16 --dataset-path cache/dataset/perfectblend_train.jsonl --num-samples 4096 --output-jsonl cache/dataset/perfectblend_qwen3_8b_regen_4096.jsonl`. (inferred, check the README)",
  "Initialize the adaptive length head with the `torchrun --standalone --nproc_per_node=1 --module pipeline.offline.init_thresh_head` command in the README, pointing `--dataset-path` at your regenerated file. (inferred, check the README)",
  "Export `MODEL_PATH`, `INITIAL_DRAFT_PATH`, `DRAFT_CONFIG_PATH`, `DATASET_PATH`, `SWAP_DIR`, and `LOG_DIR` as shown in the README training section.",
  "Start training with `bash scripts/pipeline/run_async_pipeline_adaflash.sh \"0\" \"1,2\"`, where the first argument is the inference GPUs and the second is the training GPUs, then check the logs directory."
 ],
 "agent_prompt": "In the ZinYY/AdaFlash repo, prepare a dataset, regenerate responses with Qwen/Qwen3-8B, initialize the adaptive length head, and start scripts/pipeline/run_async_pipeline_adaflash.sh with inference GPU 0 and training GPUs 1,2. Expected output is versioned drafter weights written under the swap directory and logs under the log directory. Verify that the initialized draft path exists before starting the async run.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "3 hours",
 "basis": "readme",
 "caveat": "The README gives GPU counts only as examples, so the needed GPU setup and run length for a custom dataset are not documented and must be determined by the user.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "A Linux machine with NVIDIA GPUs and CUDA, since the README sets CUDA devices and separate GPU sets for serving and training",
  "Conda and Python 3.12, as used in the README install steps",
  "Access to the Qwen3-8B target model and the AdaFlash/DFlash checkpoints on Hugging Face",
  "The patched SGLang version from the linked SGLang PR, because a stock SGLang release may not expose the required arguments"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/zinyy-adaflash/train-custom-adaflash-drafter/",
 "md": "https://dedupedai.com/use-cases/zinyy-adaflash/train-custom-adaflash-drafter/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/zinyy-adaflash--train-custom-adaflash-drafter.json",
 "api_version": "v1"
}
