@synsci/cli-darwin-arm64 1.1.70 → 1.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/skills/citation-management/SKILL.md +1109 -0
- package/bin/skills/citation-management/assets/bibtex_template.bib +264 -0
- package/bin/skills/citation-management/assets/citation_checklist.md +386 -0
- package/bin/skills/citation-management/references/bibtex_formatting.md +908 -0
- package/bin/skills/citation-management/references/citation_validation.md +794 -0
- package/bin/skills/citation-management/references/google_scholar_search.md +725 -0
- package/bin/skills/citation-management/references/metadata_extraction.md +870 -0
- package/bin/skills/citation-management/references/pubmed_search.md +839 -0
- package/bin/skills/citation-management/scripts/doi_to_bibtex.py +182 -0
- package/bin/skills/citation-management/scripts/extract_metadata.py +570 -0
- package/bin/skills/citation-management/scripts/format_bibtex.py +349 -0
- package/bin/skills/citation-management/scripts/search_google_scholar.py +251 -0
- package/bin/skills/citation-management/scripts/search_pubmed.py +348 -0
- package/bin/skills/citation-management/scripts/validate_citations.py +494 -0
- package/bin/skills/clinical-decision-support/README.md +129 -0
- package/bin/skills/clinical-decision-support/SKILL.md +506 -0
- package/bin/skills/clinical-decision-support/assets/biomarker_report_template.tex +380 -0
- package/bin/skills/clinical-decision-support/assets/clinical_pathway_template.tex +222 -0
- package/bin/skills/clinical-decision-support/assets/cohort_analysis_template.tex +359 -0
- package/bin/skills/clinical-decision-support/assets/color_schemes.tex +149 -0
- package/bin/skills/clinical-decision-support/assets/example_gbm_cohort.md +208 -0
- package/bin/skills/clinical-decision-support/assets/recommendation_strength_guide.md +328 -0
- package/bin/skills/clinical-decision-support/assets/treatment_recommendation_template.tex +529 -0
- package/bin/skills/clinical-decision-support/references/biomarker_classification.md +719 -0
- package/bin/skills/clinical-decision-support/references/clinical_decision_algorithms.md +604 -0
- package/bin/skills/clinical-decision-support/references/evidence_synthesis.md +840 -0
- package/bin/skills/clinical-decision-support/references/outcome_analysis.md +640 -0
- package/bin/skills/clinical-decision-support/references/patient_cohort_analysis.md +427 -0
- package/bin/skills/clinical-decision-support/references/treatment_recommendations.md +521 -0
- package/bin/skills/clinical-decision-support/scripts/biomarker_classifier.py +383 -0
- package/bin/skills/clinical-decision-support/scripts/build_decision_tree.py +417 -0
- package/bin/skills/clinical-decision-support/scripts/create_cohort_tables.py +509 -0
- package/bin/skills/clinical-decision-support/scripts/generate_survival_analysis.py +441 -0
- package/bin/skills/clinical-decision-support/scripts/validate_cds_document.py +326 -0
- package/bin/skills/clinical-reports/IMPLEMENTATION_SUMMARY.md +641 -0
- package/bin/skills/clinical-reports/README.md +236 -0
- package/bin/skills/clinical-reports/SKILL.md +1127 -0
- package/bin/skills/clinical-reports/assets/case_report_template.md +352 -0
- package/bin/skills/clinical-reports/assets/clinical_trial_csr_template.md +353 -0
- package/bin/skills/clinical-reports/assets/clinical_trial_sae_template.md +359 -0
- package/bin/skills/clinical-reports/assets/consult_note_template.md +305 -0
- package/bin/skills/clinical-reports/assets/discharge_summary_template.md +453 -0
- package/bin/skills/clinical-reports/assets/hipaa_compliance_checklist.md +395 -0
- package/bin/skills/clinical-reports/assets/history_physical_template.md +305 -0
- package/bin/skills/clinical-reports/assets/lab_report_template.md +309 -0
- package/bin/skills/clinical-reports/assets/pathology_report_template.md +249 -0
- package/bin/skills/clinical-reports/assets/quality_checklist.md +338 -0
- package/bin/skills/clinical-reports/assets/radiology_report_template.md +318 -0
- package/bin/skills/clinical-reports/assets/soap_note_template.md +253 -0
- package/bin/skills/clinical-reports/references/case_report_guidelines.md +570 -0
- package/bin/skills/clinical-reports/references/clinical_trial_reporting.md +693 -0
- package/bin/skills/clinical-reports/references/data_presentation.md +530 -0
- package/bin/skills/clinical-reports/references/diagnostic_reports_standards.md +629 -0
- package/bin/skills/clinical-reports/references/medical_terminology.md +588 -0
- package/bin/skills/clinical-reports/references/patient_documentation.md +744 -0
- package/bin/skills/clinical-reports/references/peer_review_standards.md +585 -0
- package/bin/skills/clinical-reports/references/regulatory_compliance.md +577 -0
- package/bin/skills/clinical-reports/scripts/check_deidentification.py +332 -0
- package/bin/skills/clinical-reports/scripts/compliance_checker.py +78 -0
- package/bin/skills/clinical-reports/scripts/extract_clinical_data.py +97 -0
- package/bin/skills/clinical-reports/scripts/format_adverse_events.py +97 -0
- package/bin/skills/clinical-reports/scripts/generate_report_template.py +149 -0
- package/bin/skills/clinical-reports/scripts/terminology_validator.py +126 -0
- package/bin/skills/clinical-reports/scripts/validate_case_report.py +323 -0
- package/bin/skills/clinical-reports/scripts/validate_trial_report.py +88 -0
- package/bin/skills/fireworks-ai/SKILL.md +665 -0
- package/bin/skills/generate-image/SKILL.md +178 -0
- package/bin/skills/generate-image/scripts/generate_image.py +254 -0
- package/bin/skills/groq/SKILL.md +347 -0
- package/bin/skills/hypothesis-generation/SKILL.md +293 -0
- package/bin/skills/hypothesis-generation/assets/FORMATTING_GUIDE.md +672 -0
- package/bin/skills/hypothesis-generation/assets/hypothesis_generation.sty +307 -0
- package/bin/skills/hypothesis-generation/assets/hypothesis_report_template.tex +572 -0
- package/bin/skills/hypothesis-generation/references/experimental_design_patterns.md +329 -0
- package/bin/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +198 -0
- package/bin/skills/hypothesis-generation/references/literature_search_strategies.md +622 -0
- package/bin/skills/latex-posters/README.md +417 -0
- package/bin/skills/latex-posters/SKILL.md +1602 -0
- package/bin/skills/latex-posters/assets/baposter_template.tex +257 -0
- package/bin/skills/latex-posters/assets/beamerposter_template.tex +244 -0
- package/bin/skills/latex-posters/assets/poster_quality_checklist.md +358 -0
- package/bin/skills/latex-posters/assets/tikzposter_template.tex +251 -0
- package/bin/skills/latex-posters/references/latex_poster_packages.md +745 -0
- package/bin/skills/latex-posters/references/poster_content_guide.md +748 -0
- package/bin/skills/latex-posters/references/poster_design_principles.md +806 -0
- package/bin/skills/latex-posters/references/poster_layout_design.md +900 -0
- package/bin/skills/latex-posters/scripts/review_poster.sh +214 -0
- package/bin/skills/literature-review/SKILL.md +641 -0
- package/bin/skills/literature-review/assets/review_template.md +412 -0
- package/bin/skills/literature-review/references/citation_styles.md +166 -0
- package/bin/skills/literature-review/references/database_strategies.md +455 -0
- package/bin/skills/literature-review/scripts/generate_pdf.py +184 -0
- package/bin/skills/literature-review/scripts/search_databases.py +310 -0
- package/bin/skills/literature-review/scripts/verify_citations.py +218 -0
- package/bin/skills/market-research-reports/SKILL.md +904 -0
- package/bin/skills/market-research-reports/assets/FORMATTING_GUIDE.md +428 -0
- package/bin/skills/market-research-reports/assets/market_report_template.tex +1380 -0
- package/bin/skills/market-research-reports/assets/market_research.sty +564 -0
- package/bin/skills/market-research-reports/references/data_analysis_patterns.md +548 -0
- package/bin/skills/market-research-reports/references/report_structure_guide.md +999 -0
- package/bin/skills/market-research-reports/references/visual_generation_guide.md +1077 -0
- package/bin/skills/market-research-reports/scripts/generate_market_visuals.py +472 -0
- package/bin/skills/markitdown/INSTALLATION_GUIDE.md +318 -0
- package/bin/skills/markitdown/LICENSE.txt +22 -0
- package/bin/skills/markitdown/OPENROUTER_INTEGRATION.md +359 -0
- package/bin/skills/markitdown/QUICK_REFERENCE.md +309 -0
- package/bin/skills/markitdown/README.md +184 -0
- package/bin/skills/markitdown/SKILL.md +486 -0
- package/bin/skills/markitdown/SKILL_SUMMARY.md +307 -0
- package/bin/skills/markitdown/assets/example_usage.md +463 -0
- package/bin/skills/markitdown/references/api_reference.md +399 -0
- package/bin/skills/markitdown/references/file_formats.md +542 -0
- package/bin/skills/markitdown/scripts/batch_convert.py +195 -0
- package/bin/skills/markitdown/scripts/convert_literature.py +262 -0
- package/bin/skills/markitdown/scripts/convert_with_ai.py +224 -0
- package/bin/skills/ml-paper-writing/SKILL.md +937 -0
- package/bin/skills/ml-paper-writing/references/checklists.md +361 -0
- package/bin/skills/ml-paper-writing/references/citation-workflow.md +562 -0
- package/bin/skills/ml-paper-writing/references/reviewer-guidelines.md +367 -0
- package/bin/skills/ml-paper-writing/references/sources.md +159 -0
- package/bin/skills/ml-paper-writing/references/writing-guide.md +476 -0
- package/bin/skills/ml-paper-writing/templates/README.md +251 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/README.md +534 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bib +111 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.sty +315 -0
- package/bin/skills/ml-paper-writing/templates/acl/README.md +50 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl.sty +312 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_latex.tex +377 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_lualatex.tex +101 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_natbib.bst +1940 -0
- package/bin/skills/ml-paper-writing/templates/acl/anthology.bib.txt +26 -0
- package/bin/skills/ml-paper-writing/templates/acl/custom.bib +70 -0
- package/bin/skills/ml-paper-writing/templates/acl/formatting.md +326 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/README.md +3 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/fancyhdr.sty +485 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/math_commands.tex +508 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/natbib.sty +1246 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/math_commands.tex +508 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/natbib.sty +1246 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/algorithm.sty +79 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/algorithmic.sty +201 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.bib +75 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.tex +662 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/fancyhdr.sty +864 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.bst +1443 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.sty +767 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/Makefile +36 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/main.tex +38 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/neurips.sty +382 -0
- package/bin/skills/paper-2-web/SKILL.md +491 -0
- package/bin/skills/paper-2-web/references/installation.md +141 -0
- package/bin/skills/paper-2-web/references/paper2poster.md +346 -0
- package/bin/skills/paper-2-web/references/paper2video.md +305 -0
- package/bin/skills/paper-2-web/references/paper2web.md +187 -0
- package/bin/skills/paper-2-web/references/usage_examples.md +436 -0
- package/bin/skills/peer-review/SKILL.md +702 -0
- package/bin/skills/peer-review/references/calibration_guidelines.md +196 -0
- package/bin/skills/peer-review/references/common_issues.md +552 -0
- package/bin/skills/peer-review/references/paper_mechanics.md +269 -0
- package/bin/skills/peer-review/references/reporting_standards.md +290 -0
- package/bin/skills/peer-review/references/scoring_rubric.md +239 -0
- package/bin/skills/pptx-posters/SKILL.md +410 -0
- package/bin/skills/pptx-posters/assets/poster_html_template.html +257 -0
- package/bin/skills/pptx-posters/assets/poster_quality_checklist.md +358 -0
- package/bin/skills/pptx-posters/references/poster_content_guide.md +748 -0
- package/bin/skills/pptx-posters/references/poster_design_principles.md +806 -0
- package/bin/skills/pptx-posters/references/poster_layout_design.md +900 -0
- package/bin/skills/research-grants/README.md +285 -0
- package/bin/skills/research-grants/SKILL.md +938 -0
- package/bin/skills/research-grants/assets/budget_justification_template.md +453 -0
- package/bin/skills/research-grants/assets/nih_specific_aims_template.md +166 -0
- package/bin/skills/research-grants/assets/nsf_project_summary_template.md +92 -0
- package/bin/skills/research-grants/references/broader_impacts.md +392 -0
- package/bin/skills/research-grants/references/darpa_guidelines.md +636 -0
- package/bin/skills/research-grants/references/doe_guidelines.md +586 -0
- package/bin/skills/research-grants/references/nih_guidelines.md +851 -0
- package/bin/skills/research-grants/references/nsf_guidelines.md +570 -0
- package/bin/skills/research-grants/references/specific_aims_guide.md +458 -0
- package/bin/skills/research-lookup/README.md +156 -0
- package/bin/skills/research-lookup/SKILL.md +606 -0
- package/bin/skills/research-lookup/examples.py +174 -0
- package/bin/skills/research-lookup/lookup.py +187 -0
- package/bin/skills/research-lookup/research_lookup.py +483 -0
- package/bin/skills/research-lookup/scripts/research_lookup.py +483 -0
- package/bin/skills/scholar-evaluation/SKILL.md +289 -0
- package/bin/skills/scholar-evaluation/references/evaluation_framework.md +663 -0
- package/bin/skills/scholar-evaluation/scripts/calculate_scores.py +366 -0
- package/bin/skills/scientific-critical-thinking/SKILL.md +566 -0
- package/bin/skills/scientific-critical-thinking/references/common_biases.md +364 -0
- package/bin/skills/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
- package/bin/skills/scientific-critical-thinking/references/experimental_design.md +496 -0
- package/bin/skills/scientific-critical-thinking/references/logical_fallacies.md +478 -0
- package/bin/skills/scientific-critical-thinking/references/scientific_method.md +169 -0
- package/bin/skills/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
- package/bin/skills/scientific-schematics/QUICK_REFERENCE.md +207 -0
- package/bin/skills/scientific-schematics/README.md +327 -0
- package/bin/skills/scientific-schematics/SKILL.md +615 -0
- package/bin/skills/scientific-schematics/example_usage.sh +89 -0
- package/bin/skills/scientific-schematics/references/best_practices.md +559 -0
- package/bin/skills/scientific-schematics/scripts/generate_schematic.py +135 -0
- package/bin/skills/scientific-schematics/scripts/generate_schematic_ai.py +807 -0
- package/bin/skills/scientific-schematics/test_ai_generation.py +243 -0
- package/bin/skills/scientific-slides/SKILL.md +942 -0
- package/bin/skills/scientific-slides/assets/timing_guidelines.md +597 -0
- package/bin/skills/scientific-slides/references/data_visualization_slides.md +708 -0
- package/bin/skills/scientific-slides/references/presentation_structure.md +642 -0
- package/bin/skills/scientific-slides/references/slide_design_principles.md +849 -0
- package/bin/skills/scientific-slides/references/talk_types_guide.md +687 -0
- package/bin/skills/scientific-slides/references/visual_review_workflow.md +775 -0
- package/bin/skills/scientific-slides/scripts/generate_slide_image.py +143 -0
- package/bin/skills/scientific-slides/scripts/generate_slide_image_ai.py +748 -0
- package/bin/skills/scientific-slides/scripts/pdf_to_images.py +201 -0
- package/bin/skills/scientific-slides/scripts/slides_to_pdf.py +220 -0
- package/bin/skills/scientific-slides/scripts/validate_presentation.py +367 -0
- package/bin/skills/scientific-writing/SKILL.md +714 -0
- package/bin/skills/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +574 -0
- package/bin/skills/scientific-writing/assets/scientific_report.sty +606 -0
- package/bin/skills/scientific-writing/assets/scientific_report_template.tex +449 -0
- package/bin/skills/scientific-writing/references/citation_styles.md +720 -0
- package/bin/skills/scientific-writing/references/figures_tables.md +806 -0
- package/bin/skills/scientific-writing/references/imrad_structure.md +686 -0
- package/bin/skills/scientific-writing/references/professional_report_formatting.md +664 -0
- package/bin/skills/scientific-writing/references/reporting_guidelines.md +748 -0
- package/bin/skills/scientific-writing/references/writing_principles.md +824 -0
- package/bin/skills/tinker/SKILL.md +2 -3
- package/bin/skills/together-ai/SKILL.md +722 -0
- package/bin/skills/treatment-plans/README.md +488 -0
- package/bin/skills/treatment-plans/SKILL.md +1579 -0
- package/bin/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md +185 -0
- package/bin/skills/treatment-plans/assets/chronic_disease_management_plan.tex +665 -0
- package/bin/skills/treatment-plans/assets/general_medical_treatment_plan.tex +547 -0
- package/bin/skills/treatment-plans/assets/medical_treatment_plan.sty +222 -0
- package/bin/skills/treatment-plans/assets/mental_health_treatment_plan.tex +774 -0
- package/bin/skills/treatment-plans/assets/one_page_treatment_plan.tex +193 -0
- package/bin/skills/treatment-plans/assets/pain_management_plan.tex +799 -0
- package/bin/skills/treatment-plans/assets/perioperative_care_plan.tex +753 -0
- package/bin/skills/treatment-plans/assets/quality_checklist.md +471 -0
- package/bin/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex +756 -0
- package/bin/skills/treatment-plans/references/goal_setting_frameworks.md +411 -0
- package/bin/skills/treatment-plans/references/intervention_guidelines.md +507 -0
- package/bin/skills/treatment-plans/references/regulatory_compliance.md +476 -0
- package/bin/skills/treatment-plans/references/specialty_specific_guidelines.md +655 -0
- package/bin/skills/treatment-plans/references/treatment_plan_standards.md +485 -0
- package/bin/skills/treatment-plans/scripts/check_completeness.py +322 -0
- package/bin/skills/treatment-plans/scripts/generate_template.py +233 -0
- package/bin/skills/treatment-plans/scripts/timeline_generator.py +385 -0
- package/bin/skills/treatment-plans/scripts/validate_treatment_plan.py +369 -0
- package/bin/skills/unsloth/SKILL.md +565 -47
- package/bin/skills/unsloth/docs/advanced-rl.md +222 -0
- package/bin/skills/unsloth/docs/chat-templates.md +141 -0
- package/bin/skills/unsloth/docs/datasets.md +489 -0
- package/bin/skills/unsloth/docs/docker-extended.md +99 -0
- package/bin/skills/unsloth/docs/dynamic-ggufs-2.0.md +116 -0
- package/bin/skills/unsloth/docs/dynamic-ggufs-aider.md +118 -0
- package/bin/skills/unsloth/docs/faq.md +91 -0
- package/bin/skills/unsloth/docs/fp16-vs-bf16.md +61 -0
- package/bin/skills/unsloth/docs/fp8-rl.md +224 -0
- package/bin/skills/unsloth/docs/glm-4.7-flash.md +997 -0
- package/bin/skills/unsloth/docs/inference-deployment-overview.md +17 -0
- package/bin/skills/unsloth/docs/inference.md +27 -0
- package/bin/skills/unsloth/docs/installation-docker.md +155 -0
- package/bin/skills/unsloth/docs/installation-pip.md +148 -0
- package/bin/skills/unsloth/docs/kernels-packing.md +190 -0
- package/bin/skills/unsloth/docs/kimi-k2.5.md +634 -0
- package/bin/skills/unsloth/docs/lm-studio.md +235 -0
- package/bin/skills/unsloth/docs/lora-hot-swapping.md +75 -0
- package/bin/skills/unsloth/docs/lora-hyperparameters.md +363 -0
- package/bin/skills/unsloth/docs/memory-efficient-rl.md +267 -0
- package/bin/skills/unsloth/docs/model-selection.md +70 -0
- package/bin/skills/unsloth/docs/models.md +532 -0
- package/bin/skills/unsloth/docs/multi-gpu-ddp.md +90 -0
- package/bin/skills/unsloth/docs/notebooks.md +223 -0
- package/bin/skills/unsloth/docs/overview.md +110 -0
- package/bin/skills/unsloth/docs/qwen3-coder-next-extended.md +900 -0
- package/bin/skills/unsloth/docs/qwen3-coder-next.md +900 -0
- package/bin/skills/unsloth/docs/requirements.md +45 -0
- package/bin/skills/unsloth/docs/reward-hacking.md +25 -0
- package/bin/skills/unsloth/docs/saving-to-gguf.md +138 -0
- package/bin/skills/unsloth/docs/saving-to-ollama.md +46 -0
- package/bin/skills/unsloth/docs/sglang-guide.md +278 -0
- package/bin/skills/unsloth/docs/speculative-decoding.md +70 -0
- package/bin/skills/unsloth/docs/tool-calling.md +334 -0
- package/bin/skills/unsloth/docs/troubleshooting-faq.md +204 -0
- package/bin/skills/unsloth/docs/troubleshooting-inference.md +26 -0
- package/bin/skills/unsloth/docs/tts-fine-tuning.md +149 -0
- package/bin/skills/unsloth/docs/tutorial-grpo.md +273 -0
- package/bin/skills/unsloth/docs/tutorial-llama3-ollama.md +356 -0
- package/bin/skills/unsloth/docs/vision-fine-tuning.md +135 -0
- package/bin/skills/unsloth/docs/vision-rl.md +170 -0
- package/bin/skills/unsloth/docs/vllm-engine-arguments.md +43 -0
- package/bin/skills/unsloth/docs/vllm-guide.md +98 -0
- package/bin/skills/venue-templates/SKILL.md +686 -0
- package/bin/skills/venue-templates/assets/examples/cell_summary_example.md +247 -0
- package/bin/skills/venue-templates/assets/examples/medical_structured_abstract.md +313 -0
- package/bin/skills/venue-templates/assets/examples/nature_abstract_examples.md +213 -0
- package/bin/skills/venue-templates/assets/examples/neurips_introduction_example.md +245 -0
- package/bin/skills/venue-templates/assets/grants/nih_specific_aims.tex +235 -0
- package/bin/skills/venue-templates/assets/grants/nsf_proposal_template.tex +375 -0
- package/bin/skills/venue-templates/assets/journals/nature_article.tex +171 -0
- package/bin/skills/venue-templates/assets/journals/neurips_article.tex +283 -0
- package/bin/skills/venue-templates/assets/journals/plos_one.tex +317 -0
- package/bin/skills/venue-templates/assets/posters/beamerposter_academic.tex +311 -0
- package/bin/skills/venue-templates/references/cell_press_style.md +483 -0
- package/bin/skills/venue-templates/references/conferences_formatting.md +564 -0
- package/bin/skills/venue-templates/references/cs_conference_style.md +463 -0
- package/bin/skills/venue-templates/references/grants_requirements.md +787 -0
- package/bin/skills/venue-templates/references/journals_formatting.md +486 -0
- package/bin/skills/venue-templates/references/medical_journal_styles.md +535 -0
- package/bin/skills/venue-templates/references/ml_conference_style.md +556 -0
- package/bin/skills/venue-templates/references/nature_science_style.md +405 -0
- package/bin/skills/venue-templates/references/posters_guidelines.md +628 -0
- package/bin/skills/venue-templates/references/reviewer_expectations.md +417 -0
- package/bin/skills/venue-templates/references/venue_writing_styles.md +321 -0
- package/bin/skills/venue-templates/scripts/customize_template.py +195 -0
- package/bin/skills/venue-templates/scripts/query_template.py +266 -0
- package/bin/skills/venue-templates/scripts/validate_format.py +250 -0
- package/bin/synsc +0 -0
- package/package.json +1 -1
- package/bin/skills/unsloth/references/index.md +0 -7
- package/bin/skills/unsloth/references/llms-full.md +0 -16799
- package/bin/skills/unsloth/references/llms-txt.md +0 -12044
- package/bin/skills/unsloth/references/llms.md +0 -82
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Unsloth Dynamic 2.0 GGUFs
|
|
2
|
+
|
|
3
|
+
We're excited to introduce our Dynamic v2.0 quantization method - a major upgrade to our previous quants. This new method outperforms leading quantization methods and sets new benchmarks for 5-shot MMLU and KL Divergence.
|
|
4
|
+
|
|
5
|
+
This means you can now run + fine-tune quantized LLMs while preserving as much accuracy as possible! You can run the 2.0 GGUFs on any inference engine like llama.cpp, Ollama, Open WebUI etc.
|
|
6
|
+
|
|
7
|
+
> **Sept 10, 2025 update:** You asked for tougher benchmarks, so we're showcasing Aider Polyglot results! Our Dynamic 3-bit DeepSeek V3.1 GGUF scores **75.6%**, surpassing many full-precision SOTA LLMs.
|
|
8
|
+
|
|
9
|
+
The **key advantage** of using the Unsloth package and models is our active role in **fixing critical bugs** in major models. We've collaborated directly with teams behind Qwen3, Meta (Llama 4), Mistral (Devstral), Google (Gemma 1-3) and Microsoft (Phi-3/4), contributing essential fixes that significantly boost accuracy.
|
|
10
|
+
|
|
11
|
+
## What's New in Dynamic v2.0?
|
|
12
|
+
|
|
13
|
+
* **Revamped Layer Selection for GGUFs + safetensors:** Unsloth Dynamic 2.0 now selectively quantizes layers much more intelligently and extensively. Rather than modifying only select layers, we now dynamically adjust the quantization type of every possible layer, and the combinations will differ for each layer and model.
|
|
14
|
+
* Current selected and all future GGUF uploads will utilize Dynamic 2.0 and our new calibration dataset. The dataset contains more than >1.5M **tokens** (depending on model) and comprise of high-quality, hand-curated and cleaned data - to greatly enhance conversational chat performance.
|
|
15
|
+
* Previously, our Dynamic quantization (DeepSeek-R1 1.58-bit GGUF) was effective only for MoE architectures. **Dynamic 2.0 quantization now works on all models (including MOEs & non-MoEs)**.
|
|
16
|
+
* **Model-Specific Quants:** Each model now uses a custom-tailored quantization scheme. E.g. the layers quantized in Gemma 3 differ significantly from those in Llama 4.
|
|
17
|
+
* To maximize efficiency, especially on Apple Silicon and ARM devices, we now also add Q4_NL, Q5.1, Q5.0, Q4.1, and Q4.0 formats.
|
|
18
|
+
|
|
19
|
+
## Why KL Divergence?
|
|
20
|
+
|
|
21
|
+
[Accuracy is Not All You Need](https://arxiv.org/pdf/2407.09141) showcases how pruning layers, even by selecting unnecessary ones still yields vast differences in terms of "flips". A "flip" is defined as answers changing from incorrect to correct or vice versa.
|
|
22
|
+
|
|
23
|
+
> **KL Divergence** should be the **gold standard for reporting quantization errors** as per the research paper. **Using perplexity is incorrect** since output token values can cancel out, so we must use KLD!
|
|
24
|
+
|
|
25
|
+
## Calibration Dataset Overfitting
|
|
26
|
+
|
|
27
|
+
Most frameworks report perplexity KL Divergence using a test set of Wikipedia articles. However, using the calibration dataset which is also Wikipedia related causes quants to overfit. **Also instruct models have unique chat templates, and using text only calibration datasets is not effective for instruct models** (base models yes).
|
|
28
|
+
|
|
29
|
+
We utilize Calibration_v3 and Calibration_v5 datasets for fair testing which includes some wikitext data amongst other data.
|
|
30
|
+
|
|
31
|
+
## MMLU Replication
|
|
32
|
+
|
|
33
|
+
* Replicating MMLU 5 shot was nightmarish. We **could not** replicate MMLU results for many models including Llama 3.1 (8B) Instruct, Gemma 3 (12B) due to **subtle implementation issues**.
|
|
34
|
+
* Llama 3.1 (8B) **tokenizes "A" and " A" (A with a space in front) as different token ids**. If we consider both spaced and non spaced tokens, we get 68.2% (+0.4%)
|
|
35
|
+
* Llama 3 as per Eleuther AI's LLM Harness also appends **"The best answer is"** to the question.
|
|
36
|
+
|
|
37
|
+
## Gemma 3 QAT Benchmarks
|
|
38
|
+
|
|
39
|
+
The Gemma team released two QAT (quantization aware training) versions of Gemma 3:
|
|
40
|
+
1. Q4_0 GGUF
|
|
41
|
+
2. int4 version (TorchAO int4 style)
|
|
42
|
+
|
|
43
|
+
Key results for Gemma 3 (12B):
|
|
44
|
+
|
|
45
|
+
| Metric | Value |
|
|
46
|
+
|--------|-------|
|
|
47
|
+
| MMLU 5 shot (QAT Q4_0) | **67.07%** (67.15% BF16) |
|
|
48
|
+
| Disk Space | 7.52GB |
|
|
49
|
+
|
|
50
|
+
KL Divergence improvements (Gemma 3 12B):
|
|
51
|
+
|
|
52
|
+
| Quant | Baseline KLD | GB | New KLD | GB |
|
|
53
|
+
|-------|---|---|---|---|
|
|
54
|
+
| IQ1_S | 1.035688 | 5.83 | 0.972932 | 6.06 |
|
|
55
|
+
| IQ2_XXS | 0.535764 | 7.16 | 0.521039 | 7.31 |
|
|
56
|
+
| Q2_K_XL | 0.229671 | 9.78 | 0.220937 | 9.95 |
|
|
57
|
+
| Q3_K_XL | 0.087845 | 12.51 | 0.080617 | 12.76 |
|
|
58
|
+
| Q4_K_XL | 0.024916 | 15.41 | 0.023701 | 15.64 |
|
|
59
|
+
|
|
60
|
+
Gemma 3 (27B) MMLU results:
|
|
61
|
+
|
|
62
|
+
| Quant | Unsloth | Unsloth + QAT | Disk Size | Efficiency |
|
|
63
|
+
|-------|---------|---------------|-----------|------------|
|
|
64
|
+
| IQ2_XXS | 59.20 | 56.57 | 7.31 | 4.32 |
|
|
65
|
+
| Q2_K_XL | 68.70 | 67.77 | 9.95 | 4.30 |
|
|
66
|
+
| Q3_K_XL | 70.87 | 69.50 | 12.76 | 3.49 |
|
|
67
|
+
| **Q4_K_XL** | **71.47** | **71.07** | **15.64** | **2.94** |
|
|
68
|
+
| **Google QAT** | | **70.64** | **17.2** | **2.65** |
|
|
69
|
+
|
|
70
|
+
Key finding: **Our dynamic 4bit version is 2GB smaller whilst having +1% extra accuracy vs the QAT version!**
|
|
71
|
+
|
|
72
|
+
## Llama 4 Bug Fixes
|
|
73
|
+
|
|
74
|
+
We helped and fixed several Llama 4 bugs:
|
|
75
|
+
* Llama 4 Scout changed the RoPE Scaling configuration - we helped resolve issues in llama.cpp
|
|
76
|
+
* Llama 4's QK Norm's epsilon should be 1e-05, not 1e-06
|
|
77
|
+
* QK Norm being shared across all heads was fixed (MMLU Pro increased from 68.58% to 71.53%)
|
|
78
|
+
|
|
79
|
+
### Running Llama 4 Scout
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
apt-get update
|
|
83
|
+
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
|
|
84
|
+
git clone https://github.com/ggml-org/llama.cpp
|
|
85
|
+
cmake llama.cpp -B llama.cpp/build \
|
|
86
|
+
-DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON
|
|
87
|
+
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-gguf-split
|
|
88
|
+
cp llama.cpp/build/bin/llama-* llama.cpp
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import os
|
|
93
|
+
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
|
94
|
+
from huggingface_hub import snapshot_download
|
|
95
|
+
snapshot_download(
|
|
96
|
+
repo_id = "unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF",
|
|
97
|
+
local_dir = "unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF",
|
|
98
|
+
allow_patterns = ["*IQ2_XXS*"],
|
|
99
|
+
)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
./llama.cpp/llama-cli \
|
|
104
|
+
--model unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF/Llama-4-Scout-17B-16E-Instruct-UD-IQ2_XXS.gguf \
|
|
105
|
+
--threads 32 \
|
|
106
|
+
--ctx-size 16384 \
|
|
107
|
+
--n-gpu-layers 99 \
|
|
108
|
+
-ot ".ffn_.*_exps.=CPU" \
|
|
109
|
+
--seed 3407 \
|
|
110
|
+
--prio 3 \
|
|
111
|
+
--temp 0.6 \
|
|
112
|
+
--min-p 0.01 \
|
|
113
|
+
--top-p 0.9 \
|
|
114
|
+
-no-cnv \
|
|
115
|
+
--prompt "<|header_start|>user<|header_end|>\n\nCreate a Flappy Bird game.<|eot|><|header_start|>assistant<|header_end|>\n\n"
|
|
116
|
+
```
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Unsloth Dynamic GGUFs on Aider Polyglot
|
|
2
|
+
|
|
3
|
+
We're showcasing how Unsloth Dynamic GGUFs makes it possible to quantize LLMs like DeepSeek-V3.1 (671B) down to just **1-bit** or **3-bit**, and still be able to outperform SOTA models like **GPT-4.5, GPT-4.1** (April 2025) and **Claude-4-Opus** (May 2025).
|
|
4
|
+
|
|
5
|
+
## Key Results
|
|
6
|
+
|
|
7
|
+
* Our **1-bit** Unsloth Dynamic GGUF shrinks DeepSeek-V3.1 from **671GB to 192GB (-75% size)** and no-thinking mode greatly outperforms GPT-4.1, GPT-4.5, and DeepSeek-V3-0324.
|
|
8
|
+
* **3-bit** Unsloth DeepSeek-V3.1 (thinking) GGUF: Outperforms Claude-4-Opus-20250514 (thinking).
|
|
9
|
+
* **5-bit** Unsloth DeepSeek-V3.1 (non-thinking) GGUF: Matches Claude-4-Opus-20250514 (non-thinking) performance.
|
|
10
|
+
* Unsloth Dynamic GGUFs perform consistently better than other non-Unsloth Dynamic imatrix GGUFs.
|
|
11
|
+
* Other non-Unsloth 1-bit and 2-bit DeepSeek-V3.1 quantizations either failed to load or produced gibberish.
|
|
12
|
+
|
|
13
|
+
## Reasoning Model Aider Benchmarks
|
|
14
|
+
|
|
15
|
+
| Model | Accuracy |
|
|
16
|
+
|-------|----------|
|
|
17
|
+
| GPT-5 | 86.7 |
|
|
18
|
+
| Gemini 2.5 Pro (June) | 83.1 |
|
|
19
|
+
| o3 | 76.9 |
|
|
20
|
+
| DeepSeek V3.1 | 76.1 |
|
|
21
|
+
| **(3 bit) DeepSeek V3.1 Unsloth** | **75.6** |
|
|
22
|
+
| Claude-4-Opus (May) | 72 |
|
|
23
|
+
| o4-mini (High) | 72 |
|
|
24
|
+
| DeepSeek R1 0528 | 71.4 |
|
|
25
|
+
| **(2 bit) DeepSeek V3.1 Unsloth** | **66.7** |
|
|
26
|
+
| Claude-3.7-Sonnet (Feb) | 64.9 |
|
|
27
|
+
| **(1 bit) DeepSeek V3.1 Unsloth** | **57.8** |
|
|
28
|
+
| DeepSeek R1 | 56.9 |
|
|
29
|
+
|
|
30
|
+
## Non-Reasoning Model Aider Benchmarks
|
|
31
|
+
|
|
32
|
+
| Model | Accuracy |
|
|
33
|
+
|-------|----------|
|
|
34
|
+
| DeepSeek V3.1 | 71.6 |
|
|
35
|
+
| Claude-4-Opus (May) | 70.7 |
|
|
36
|
+
| **(5 bit) DeepSeek V3.1 Unsloth** | **70.7** |
|
|
37
|
+
| **(4 bit) DeepSeek V3.1 Unsloth** | **69.7** |
|
|
38
|
+
| **(3 bit) DeepSeek V3.1 Unsloth** | **68.4** |
|
|
39
|
+
| **(2 bit) DeepSeek V3.1 Unsloth** | **65.8** |
|
|
40
|
+
| Qwen3 235B A22B | 59.6 |
|
|
41
|
+
| Kimi K2 | 59.1 |
|
|
42
|
+
| **(1 bit) DeepSeek V3.1 Unsloth** | **55.7** |
|
|
43
|
+
| DeepSeek V3-0324 | 55.1 |
|
|
44
|
+
| GPT-4.1 (April, 2025) | 52.4 |
|
|
45
|
+
| ChatGPT 4o (March, 2025) | 45.3 |
|
|
46
|
+
| GPT-4.5 | 44.9 |
|
|
47
|
+
|
|
48
|
+
## Dynamic Quantization Methodology
|
|
49
|
+
|
|
50
|
+
**Dynamic 1 bit makes important layers in 8 or 16 bits and un-important layers in 1,2,3,4,5 or 6bits.**
|
|
51
|
+
|
|
52
|
+
In Nov 2024, our 4-bit Dynamic Quants showcased how you could largely restore QLoRA fine-tuning & model accuracy by just **selectively quantizing layers**. We later applied this to DeepSeek-R1's MoE architecture, where we quantized some layers to as low as 1-bit and important layers to higher bits.
|
|
53
|
+
|
|
54
|
+
## Comparison to Other Quants
|
|
55
|
+
|
|
56
|
+
| Quant | Quant Size (GB) | Unsloth Accuracy % | Comparison Accuracy % |
|
|
57
|
+
|-------|-----------------|--------------------|-----------------------|
|
|
58
|
+
| TQ1_0 | 170 | 50.7 | |
|
|
59
|
+
| IQ1_M | 206 | 55.7 | |
|
|
60
|
+
| IQ2_XXS | 225 | 61.2 | |
|
|
61
|
+
| IQ2_M | 235 | 64.3 | |
|
|
62
|
+
| Q2_K_XL | 255 | 65.8 | |
|
|
63
|
+
| IQ3_XXS | 279 | 66.8 | |
|
|
64
|
+
| Q3_K_XL | 300 | 68.4 | |
|
|
65
|
+
| IQ4_XS | 357 | 69.2 | |
|
|
66
|
+
| Q4_K_XL | 387 | 69.7 | |
|
|
67
|
+
| Q5_K_XL | 484 | 70.7 | |
|
|
68
|
+
| IQ2_XXS | 164 | | 43.6 |
|
|
69
|
+
| IQ2_M | 215 | | 56.6 |
|
|
70
|
+
| Q2_K_L | 239 | | 64.0 |
|
|
71
|
+
| IQ3_XXS | 268 | | 65.6 |
|
|
72
|
+
| Q3_K_S | 293 | | 65.2 |
|
|
73
|
+
| IQ4_XS | 360 | | 66.3 |
|
|
74
|
+
| Q4_K_M | 409 | | 67.7 |
|
|
75
|
+
| Q5_K_M | 478 | | 68.9 |
|
|
76
|
+
|
|
77
|
+
## Dynamic Quantization Ablations
|
|
78
|
+
|
|
79
|
+
We did ablations to confirm our calibration dataset and dynamic methodology works. Key finding: `attn_k_b` and other tensors in DeepSeek V3.1 are highly important / sensitive to quantization and should be left in higher precision to retain accuracy!
|
|
80
|
+
|
|
81
|
+
## Chat Template Bug Fixes
|
|
82
|
+
|
|
83
|
+
During testing we found some lower bit quants not enclosing `<think> </think>` properly. We had to change llama.cpp's minja usage:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
# From:
|
|
87
|
+
{%- set content = content.split("</think>", 1)[1] -%}
|
|
88
|
+
|
|
89
|
+
# To:
|
|
90
|
+
{%- set splitted = content.split("</think>") -%}
|
|
91
|
+
{%- set content = splitted[1:] | join("</think>") -%}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Run DeepSeek V3.1 Dynamic Quants
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
apt-get update
|
|
98
|
+
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
|
|
99
|
+
git clone https://github.com/ggml-org/llama.cpp
|
|
100
|
+
cmake llama.cpp -B llama.cpp/build \
|
|
101
|
+
-DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON
|
|
102
|
+
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-quantize llama-cli llama-gguf-split llama-mtmd-cli llama-server
|
|
103
|
+
cp llama.cpp/build/bin/llama-* llama.cpp
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
export LLAMA_CACHE="unsloth/DeepSeek-V3.1-GGUF"
|
|
108
|
+
./llama.cpp/llama-cli \
|
|
109
|
+
-hf unsloth/DeepSeek-V3.1-GGUF:Q2_K_XL \
|
|
110
|
+
--jinja \
|
|
111
|
+
--n-gpu-layers 99 \
|
|
112
|
+
--temp 0.6 \
|
|
113
|
+
--top_p 0.95 \
|
|
114
|
+
--min_p 0.01 \
|
|
115
|
+
--ctx-size 8192 \
|
|
116
|
+
--seed 3407 \
|
|
117
|
+
-ot ".ffn_.*_exps.=CPU"
|
|
118
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# FAQ + Is Fine-tuning Right For Me?
|
|
2
|
+
|
|
3
|
+
## Understanding Fine-Tuning
|
|
4
|
+
|
|
5
|
+
Fine-tuning an LLM customizes its behavior, deepens its domain expertise, and optimizes its performance for specific tasks. By refining a pre-trained model (e.g. *Llama-3.1-8B*) with specialized data, you can:
|
|
6
|
+
|
|
7
|
+
* **Update Knowledge** – Introduce new, domain-specific information that the base model didn’t originally include.
|
|
8
|
+
* **Customize Behavior** – Adjust the model’s tone, personality, or response style to fit specific needs or a brand voice.
|
|
9
|
+
* **Optimize for Tasks** – Improve accuracy and relevance on particular tasks or queries your use-case requires.
|
|
10
|
+
|
|
11
|
+
Think of fine-tuning as creating a specialized expert out of a generalist model. Some debate whether to use Retrieval-Augmented Generation (RAG) instead of fine-tuning, but fine-tuning can incorporate knowledge and behaviors directly into the model in ways RAG cannot. In practice, combining both approaches yields the best results - leading to greater accuracy, better usabifewer hallucinations.
|
|
12
|
+
|
|
13
|
+
### Real-World Applications of Fine-Tuning
|
|
14
|
+
|
|
15
|
+
Fine-tuning can be applied across various domains and needs. Here are a few practical examples of how it makes a difference:
|
|
16
|
+
|
|
17
|
+
* **Sentiment Analysis for Finance** – Train an LLM to determine if a news headline impacts a company positively or negatively, tailoring its understanding to financial context.
|
|
18
|
+
* **Customer Support Chatbots** – Fine-tune on past customer interactions to provide more accurate and personalized responses in a company’s style and terminology.
|
|
19
|
+
* **Legal Document Assistance** – Fine-tune on legal texts (contracts, case law, regulations) for tasks like contract analysis, case law research, or compliance support, ensuring the model uses precise legal language.
|
|
20
|
+
|
|
21
|
+
## The Benefits of Fine-Tuning
|
|
22
|
+
|
|
23
|
+
Fine-tuning offers several notable benefits beyond what a base model or a purely retrieval-based system can provide:
|
|
24
|
+
|
|
25
|
+
#### Fine-Tuning vs. RAG: What’s the Difference?
|
|
26
|
+
|
|
27
|
+
Fine-tuning can do mostly everything RAG can - but not the around. During training, fine-tuning embeds external knowledge directly into the model. This allows the model to handle niche queries, summarize documents, and maintain context without relying on an outside retrieval system. That’s not to say RAG lacks advantages as it is excels at accessing up-to-date information from external databases. It is in fact possible to retrieve fresh data with fine-tuning as well, however it is better to combine RAG with fine-tuning for efficiency.
|
|
28
|
+
|
|
29
|
+
#### Task-Specific Mastery
|
|
30
|
+
|
|
31
|
+
Fine-tuning deeply integrates domain knowledge into the model. This makes it highly effective at handling structured, repetitive, or nuanced queries, scenarios where RAG-alone systems often struggle. In other words, a fine-tuned model becomes a specialist in the tasks or content it was trained on.
|
|
32
|
+
|
|
33
|
+
#### Independence from Retrieval
|
|
34
|
+
|
|
35
|
+
A fine-tuned model has no dependency on external data sources at inference time. It remains reliable even if a connected retrieval system fails or is incomplete, because all eded information is already within the model’s own parameters. This self-sufficiency means fewer points of failure in production.
|
|
36
|
+
|
|
37
|
+
#### Faster Responses
|
|
38
|
+
|
|
39
|
+
Fine-tuned models don’t need to call out to an external knowledge base during generation. Skipping the retrieval step means they can produce answers much more quickly. This speed makes fine-tuned models ideal for time-sensitive applications where every second counts.
|
|
40
|
+
|
|
41
|
+
#### Custom Behavior and Tone
|
|
42
|
+
|
|
43
|
+
Fine-tuning allows precise control over how the model communicates. This ensures the model’s responses stay consistent with a brand’s voice, adhere to regulatory requirements, or match specific tone preferences. You get a model that not only knows *what* to say, but *how* to say it in the desired style.
|
|
44
|
+
|
|
45
|
+
#### Reliable Performance
|
|
46
|
+
|
|
47
|
+
Even in a hybrid setup that uses both fine-tuning and RAG, the fine-tuned model provides a reliable fallback. If the retrieval component fails to find the right information or returns incorrect data, the model’s built-in knowstill generate a useful answer. This guarantees more consistent and robust performance for your system.
|
|
48
|
+
|
|
49
|
+
## Common Misconceptions
|
|
50
|
+
|
|
51
|
+
Despite fine-tuning’s advantages, a few myths persist. Let’s address two of the most common misconceptions about fine-tuning:
|
|
52
|
+
|
|
53
|
+
### Does Fine-Tuning Add New Knowledge to a Model?
|
|
54
|
+
|
|
55
|
+
**Yes - it absolutely can.** A common myth suggests that fine-tuning doesn’t introduce new knowledge, but in reality it does. If your fine-tuning dataset contains new domain-specific information, the model will learn that content during training and incorporate it into its responses. In effect, fine-tuning *can and does* teach the model new facts and patterns from scratch.
|
|
56
|
+
|
|
57
|
+
### Is RAG Always Better Than Fine-Tuning?
|
|
58
|
+
|
|
59
|
+
**Not necessarily.** Many assume RAG will consistently outperform a fine-tuned model, but that’s not the case when fine-tuning is done properly. In fact, a well-tuned model often matches or even surpasses RAG-based systems on specialized tasks. Claims that “RAG is always better”m from fine-tuning attempts that weren’t optimally configured - for example, using incorrect [LoRA parameters](https://unsloth.ai/docs/get-started/fine-tuning-llms-guide/lora-hyperparameters-guide) or insufficient training.
|
|
60
|
+
|
|
61
|
+
Unsloth takes care of these complexities by automatically selecting the best parameter configurations for you. All you need is a good-quality dataset, and you'll get a fine-tuned model that performs to its fullest potential.
|
|
62
|
+
|
|
63
|
+
### Is Fine-Tuning Expensive?
|
|
64
|
+
|
|
65
|
+
**Not at all!** While full fine-tuning or pretraining can be costly, these are not necessary (pretraining is especially not necessary). In most cases, LoRA or QLoRA fine-tuning can be done for minimal cost. In fact, with Unsloth’s [free notebooks](https://docs.unsloth.ai/get-started/unsloth-notebooks) for Colab or Kaggle, you can fine-tune models without spending a dime. Better yet, you can even fine-tune locally on your own device.
|
|
66
|
+
|
|
67
|
+
## FAQ:
|
|
68
|
+
|
|
69
|
+
### Why You Should Combine RAG & Fine-Tuning
|
|
70
|
+
|
|
71
|
+
Instead of choosing between RAG and fine-tu, consider using **both** together for the best results. Combining a retrieval system with a fine-tuned model brings out the strengths of each approach. Here’s why:
|
|
72
|
+
|
|
73
|
+
* **Task-Specific Expertise** – Fine-tuning excels at specialized tasks or formats (making the model an expert in a specific area), while RAG keeps the model up-to-date with the latest external knowledge.
|
|
74
|
+
* **Better Adaptability** – A fine-tuned model can still give useful answers even if the retrieval component fails or returns incomplete information. Meanwhile, RAG ensures the system stays current without requiring you to retrain the model for every new piece of data.
|
|
75
|
+
* **Efficiency** – Fine-tuning provides a strong foundational knowledge base within the model, and RAG handles dynamic or quickly-changing details without the need for exhaustive re-training from scratch. This balance yields an efficient workflow and reduces overall compute costs.
|
|
76
|
+
|
|
77
|
+
### LoRA vs. QLoRA: Which One to Use?
|
|
78
|
+
|
|
79
|
+
When it comes to implementing fine-tuning, two popuniques can dramatically cut down the compute and memory requirements: **LoRA** and **QLoRA**. Here’s a quick comparison of each:
|
|
80
|
+
|
|
81
|
+
* **LoRA (Low-Rank Adaptation)** – Fine-tunes only a small set of additional “adapter” weight matrices (in 16-bit precision), while leaving most of the original model unchanged. This significantly reduces the number of parameters that need updating during training.
|
|
82
|
+
* **QLoRA (Quantized LoRA)** – Combines LoRA with 4-bit quantization of the model weights, enabling efficient fine-tuning of very large models on minimal hardware. By using 4-bit precision where possible, it dramatically lowers memory usage and compute overhead.
|
|
83
|
+
|
|
84
|
+
We recommend starting with **QLoRA**, as it’s one of the most efficient and accessible methods available. Thanks to Unsloth’s [dynamic 4-bit](https://unsloth.ai/blog/dynamic-4bit) quants, the accuracy loss compared to standard 16-bit LoRA fine-tuning is now negligible.
|
|
85
|
+
|
|
86
|
+
### Experimentation is Key
|
|
87
|
+
|
|
88
|
+
There’s no single “best” approach to fine-tactices for different scenarios. It’s important to experiment with different methods and configurations to find what works best for your dataset and use case. A great starting point is **QLoRA (4-bit)**, which offers a very cost-effective, resource-friendly way to fine-tune models without heavy computational requirements.
|
|
89
|
+
|
|
90
|
+
{% content-ref url="../fine-tuning-llms-guide/lora-hyperparameters-guide" %}
|
|
91
|
+
[lora-hyperparameters-guide](https://unsloth.ai/docs/get-started/fine-tuning-llms-guide/lora-hyperparameters-guide)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# FP16 vs BF16 for RL
|
|
2
|
+
|
|
3
|
+
### Float16 vs Bfloat16
|
|
4
|
+
|
|
5
|
+
There was a paper titled "**Defeating the Training-Inference Mismatch via FP16**" <https://arxiv.org/pdf/2510.26788> showing how using float16 precision can dramatically be better than using bfloat16 when doing reinforcement learning.
|
|
6
|
+
|
|
7
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Frec4qe1aQS0xyMzGvS9c%2Fimage.png?alt=media&token=2137e766-0f1f-48ec-b25f-2292d6f149f4" alt=""><figcaption></figcaption></figure>
|
|
8
|
+
|
|
9
|
+
In fact the longer the generation, the worse it gets when using bfloat16:
|
|
10
|
+
|
|
11
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FWs7ioB2lraTbDbUCOAnn%2Fimage.png?alt=media&token=ac2b4f8e-210f-4bcc-bcbb-6e68f80781a6" alt=""><figcaption></figcaption></figure>
|
|
12
|
+
|
|
13
|
+
We did an investigation, and **DO find float16 to be more stable** than bfloat16 with much smaller gradient norms see <https://x.com/danielhanchen/status/1985557028295827482> and <https://x.com/danielhanchen/status/1985562902531850472>
|
|
14
|
+
|
|
15
|
+
{% columns %}
|
|
16
|
+
{% column width="50%" %}
|
|
17
|
+
|
|
18
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FhvQ1W5wtV6TTfsetp7y2%2FG44d7ZFbIAANBBd.jpg?alt=media&token=35181a07-de3e-4321-b54e-4436b4a201ff" alt=""><figcaption></figcaption></figure>
|
|
19
|
+
|
|
20
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F62HkxnGcaKvxnSxbZMZu%2FG44c20SbwAAGo8j.jpg?alt=media&token=e0c7ecb8-6f0c-4ecf-b1a0-50f1b2a9a807" alt=""><figcaption></figcaption></figure>
|
|
21
|
+
{% endcolumn %}
|
|
22
|
+
|
|
23
|
+
{% column width="50%" %}
|
|
24
|
+
|
|
25
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fsi18IkGqE4IuUvzroyHh%2FG44ix5FbQAM0L5l.jpg?alt=media&token=bc3b97ce-5df4-4b69-aa50-a8e339f21601" alt=""><figcaption></figcaption></figure>
|
|
26
|
+
{% endcolumn %}
|
|
27
|
+
{% endcolumns %}
|
|
28
|
+
|
|
29
|
+
### :exploding\_head:A100 Cascade Attention Bug
|
|
30
|
+
|
|
31
|
+
As per <https://x.com/RichardYRLi/status/1984858850143715759> and <https://yingru.notion.site/When-Speed-Kills-Stability-Demystifying-RL-Collapse-from-the-Training-Inference-Mismatch-271211a558b7808d8b12d403fd15edda>, older vLLM versions (before 0.11.0) had broken attention mechanisms for A100 and similar GPUs. Please update vLLM! We also by default disable cascade attention in vLLM during Unsloth reinforcement learning if we detect an older vLLM version.
|
|
32
|
+
|
|
33
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FnkCLRVIIGLADXBSCe58e%2Fimage.png?alt=media&token=6669642f-8690-44bf-b2de-6aa89acf2332" alt=""><figcaption></figcaption></figure>
|
|
34
|
+
|
|
35
|
+
Different hardware also changes results, where newer and more expensive GPUs have less KL difference between the inference and training sides:
|
|
36
|
+
|
|
37
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FaroTTz68zzyofy6nagtH%2Fimage.webp?alt=media&token=3be09506-b8a0-42eb-8d17-af72496a9cd1" alt=""><figcaption></figcaption></figure>
|
|
38
|
+
|
|
39
|
+
### :fire:Using float16 in Unsloth RL
|
|
40
|
+
|
|
41
|
+
To use float16 precision in Unsloth GRPO and RL, you just need to set `dtype = torch.float16` and we'll take care of the rest!
|
|
42
|
+
|
|
43
|
+
{% code overflow="wrap" %}
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from unsloth import FastLanguageModel
|
|
47
|
+
import torch
|
|
48
|
+
max_seq_length = 2048 # Can increase for longer reasoning traces
|
|
49
|
+
lora_rank = 32 # Larger rank = smarter, but slower
|
|
50
|
+
|
|
51
|
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
|
52
|
+
model_name = "unsloth/Qwen3-4B-Base",
|
|
53
|
+
max_seq_length = max_seq_length,
|
|
54
|
+
load_in_4bit = False, # False for LoRA 16bit
|
|
55
|
+
fast_inference = True, # Enable vLLM fast inference
|
|
56
|
+
max_lora_rank = lora_rank,
|
|
57
|
+
gpu_memory_utilization = 0.9, # Reduce if out of memory
|
|
58
|
+
|
|
59
|
+
dtype = torch.float16, # Use torch.float16, torch.bfloat16
|
|
60
|
+
)
|
|
61
|
+
```
|