Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 21 min read How-to mediumAdept

Synthetic data: save money, time and carbon with open source

An open-source LLM (Mixtral-8x7B-Instruct) can annotate task-specific data that is then used to fine-tune a small, efficient student model. On financial_phrasebank investor sentiment, a RoBERTa model trained this way matches GPT-4 at 94% accuracy and 0.94 F1 macro. It costs about $2.7 versus $3061 to analyze a large news corpus, emits roughly 0.12 kg CO2 versus an estimated 735–1100 kg, and responds in 0.13 seconds versus multiple seconds. The walkthrough covers chat templates, output cleaning, and Chain-of-Thought plus Self-Consistency prompting, which lifts zero-shot accuracy above 91.6%. It then covers validating the synthetic labels and fine-tuning with AutoTrain.

Related posts

  • We Got Claude to Fine-Tune an Open Source LLM

    Hugging Face mediumAdept

    Hugging Face Skills, specifically the hf-llm-trainer skill, lets coding agents like Claude Code, Codex and Gemini CLI run a full LLM fine-tuning lifecycle. The agent validates the dataset, picks GPU hardware by model size, generates a TRL training script with Trackio monitoring, submits it to Hugging Face Jobs, reports progress and pushes the result to the Hub. The walkthrough covers setup, SFT, DPO and GRPO, LoRA for models over 3B, GGUF conversion for llama.cpp, and cost guidance. A 0.6B Qwen3 SFT run on a t4-small costs about $0.30, 3-7B models need A10G/A100 with LoRA at $15-40, and a cheap 100-example test run before a production job catches dataset format errors early.

  • Investing in Performance: Fine-tune small models with LLM insights - a CFM case study

    Hugging Face mediumAdept

    Capital Fund Management built a financial named-entity recognition pipeline that extracts company names from Benzinga news headlines in the FNSPID dataset. Llama 3.1-70B, served on Hugging Face Inference Endpoints, pre-labels the headlines using a structured few-shot prompt and JSON-schema guided output, and humans then review those labels in Argilla. Fine-tuning compact models such as GLiNER and SpanMarker on the curated labels raises F1 to 93.4% and 90.1%. That approaches the 95% zero-shot F1 of Llama 3.1-70B at up to 80x lower inference cost. The walkthrough includes endpoint setup, prompt design, async batched requests with AsyncInferenceClient, and a comparison against weak supervision.

  • Codex is Open Sourcing AI models

    Hugging Face mediumAdept

    Hugging Face Skills, a repository of agent instructions loaded via AGENTS.md (or Claude Code Skills), lets OpenAI Codex run end-to-end fine-tuning experiments on Hugging Face Jobs. From a short prompt it validates the dataset, picks hardware, submits TRL training (SFT, DPO, GRPO), tracks metrics in Trackio, runs lighteval evaluations and keeps a markdown experiment report up to date. In the walkthrough, a LoRA SFT of Qwen3-0.6B on open-r1/codeforces-cots raises HumanEval pass@1 from about 0.30 to 0.34, and the model is then converted to quantized GGUF for llama.cpp. Rough costs are $1-2 for models under 1B, $5-15 for 1-3B and $15-40 for 3-7B with LoRA, and models above 7B are not yet supported.

  • The model that didn't exist, so you made it yourself

    Hugging Face mediumAdept

    Six custom models were built by prompting ML Intern, an agent mode in HuggingChat, to plan, budget, train, evaluate and publish on Hugging Face hardware, for about USD 103 in total compute. The projects were a citrus-disease VLM fine-tuned from Qwen3.5-2B (14.9% to 52.8% accuracy for USD 1.90), a Huggy character LoRA on FLUX.2 klein, camera-angle and doodle-in editing LoRAs for Qwen-Image 2.1 with synthetic datasets, a 0.8B prompt rewriter distilled from a 9B teacher, and a 4-step distillation of Agate Preview 002 exported to ONNX for the browser. The prompting advice is to list verified facts so the agent doesn't re-derive them, require a zero-shot baseline and a smoke test before full training, and set a hard spending cap.

  • Personal Copilot: Train Your Own Coding Assistant

    Hugging Face hardMaster

    HugCoder is a code LLM fine-tuned on the top 10 Hugging Face GitHub repositories, built by cloning repos in parallel, filtering non-code files and training StarCoder with a fill-in-the-middle objective. Full fine-tuning of the 15.5B model on 8×A100 80GB with FSDP took 9 hours (~$108), while QLoRA on a single A100 40GB took 12.5 hours (~$13.75), with a per-parameter memory breakdown explaining why. QLoRA reached slightly higher loss than full fine-tuning but preserved HumanEval pass@1 (33.37 vs 33.57) and matched it qualitatively on HF-specific infilling where GitHub Copilot failed. The post also covers serving the model in VS Code via Inference Endpoints, training a chat variant, and combining LoRA adapters across tasks and base models.

The quest for software engineering knowledge.

Look:
Layout: