{"id":18655,"date":"2026-09-12T15:41:35","date_gmt":"2026-09-12T15:41:35","guid":{"rendered":"https:\/\/techtrendfeed.com\/?p=18655"},"modified":"2026-09-12T15:41:35","modified_gmt":"2026-09-12T15:41:35","slug":"autonomous-llm-post-training-with-tunix-on-tpus","status":"publish","type":"post","link":"https:\/\/techtrendfeed.com\/?p=18655","title":{"rendered":"Autonomous LLM post-training with Tunix on TPUs"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p data-block-key=\"p1w3c\">Think about going to sleep after writing a single Markdown specification and waking as much as discover that an AI agent ran dozens of LLM fine-tuning experiments in a single day in your behalf &#8211; discovering optimum LoRA ranks, refining studying price schedules, tuning batch sizes and committing every verified enchancment to Git.<\/p>\n<p data-block-key=\"48l1b\">That is now not a fantasy. Earlier this 12 months, the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/karpathy\/autoresearch\">autoresearch<\/a> venture showcased how autonomous LLM brokers can iteratively discover pre-training in a self-contained loop. Taking inspiration from this paradigm, we created <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/windmaple\/autofinetune\">autofinetune<\/a>: making use of autonomous analysis loops to LLM post-training (Supervised High-quality-Tuning and Reinforcement Studying through GRPO), utilizing Google\u2019s full AI stack\u2014<a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/google\/tunix\">Tunix<\/a>, Gemma, and Cloud TPUs orchestrated with <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/antigravity.google\/product\/antigravity-cli\">Antigravity CLI<\/a> and Gemini Flash 3.7.<\/p>\n<\/div>\n<div>\n<p data-block-key=\"p1w3c\">On this publish, we\u2019ll discover how the autonomous analysis loop works for post-training and stroll by a few real-world LLM finetuning case research.<\/p>\n<h2 data-block-key=\"minjr\" id=\"the-paradigm-shift:-from-manual-tuning-to-autonomous-loops\"><b>The Paradigm Shift: From Handbook Tuning to Autonomous Loops<\/b><\/h2>\n<p data-block-key=\"blbv2\">Conventional post-training entails a repetitive, handbook cycle:<\/p>\n<ol>\n<li data-block-key=\"avuvq\">Formulate a speculation (e.g., <i>&#8220;Will including<\/i> <code><i>attn_vec_einsum<\/i><\/code><i> to the LoRA goal modules enhance accuracy?&#8221;<\/i> or <i>&#8220;What occurs if we alter rollout temperature throughout GRPO?&#8221;<\/i>).<\/li>\n<li data-block-key=\"4usjp\">Edit coaching scripts and hyperparameters.<\/li>\n<li data-block-key=\"c7avg\">Launch a job on accelerators.<\/li>\n<li data-block-key=\"7tm2c\">Monitor loss curves and benchmark evaluations.<\/li>\n<li data-block-key=\"9uich\">Manually revert failures or document successes in a spreadsheet.<\/li>\n<\/ol>\n<p data-block-key=\"d6o4v\">As demonstrated in <code>autoresearch<\/code>, we will now automate this complete course of with the ability of AI brokers:<\/p>\n<ul>\n<li data-block-key=\"4k329\"><b>Design the Area (<\/b><code>program.md<\/code><b>)<\/b>: human defines the loop, boundary situations, analysis standards, and constraints.<\/li>\n<li data-block-key=\"74b1n\"><b>Present the Execution Code (<\/b><code>run.py<\/code><b>)<\/b>: A single, clear, self-contained finetuning script.<\/li>\n<li data-block-key=\"cgab9\"><b>Let the Agent Iterate<\/b>: An agent follows directions in <code>program.md<\/code>: it modifies <code>run.py<\/code>, runs the coaching job, measures the goal metric, retains successful commits or reverts regressions, and logs ends in <code>outcomes.tsv<\/code>.<\/li>\n<\/ul>\n<\/div>\n<div>\n<h2 data-block-key=\"5c7q0\" id=\"case-study-1:-supervised-fine-tuning-(sft)-on-functiongemma\"><b>Case Research 1: Supervised High-quality-Tuning (SFT) on FunctionGemma<\/b><\/h2>\n<p data-block-key=\"c9lva\">Within the first experiment in <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/windmaple\/autofinetune\/tree\/main\/FunctionGemma-SFT\">autofinetune<\/a>, we took the identical SFT setup in our earlier <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/developers.googleblog.com\/easy-functiongemma-finetuning-with-tunix-on-google-tpus\/\">weblog<\/a> and prolonged it by creating the autoresearch loop to optimize <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/huggingface.co\/google\/functiongemma-270m-it\">google\/functiongemma-270m-it<\/a> on the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/huggingface.co\/datasets\/google\/mobile-actions\">google\/mobile-actions<\/a> dataset.<\/p>\n<h3 data-block-key=\"c19dc\" id=\"the-setup\"><b>The Setup<\/b><\/h3>\n<ul>\n<li data-block-key=\"8gonf\"><b>{Hardware}<\/b>: Cloud TPU v5e-1<\/li>\n<li data-block-key=\"dcqu8\"><b>Iteration Velocity<\/b>: A couple of minutes per run<\/li>\n<li data-block-key=\"c086a\"><b>Whole Runs<\/b>: 20 automated experiments in a few hours for fast experimentation<\/li>\n<li data-block-key=\"kckd\"><b>Goal Metric<\/b>: Submit-training analysis accuracy on perform name era (accuracy)<\/li>\n<\/ul>\n<p data-block-key=\"2v4nl\">The agent was given boundaries in <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/windmaple\/autofinetune\/blob\/main\/FunctionGemma-SFT\/program.md\">program.md<\/a>:<\/p>\n<ul>\n<li data-block-key=\"fn7p3\"><b>Allowed<\/b>: LoRA rank\/alpha, goal projection layers, studying charges, warmup\/decay schedules, optimizers (e.g., AdamW\/Muon, gradient clipping), batch measurement, and seeds.<\/li>\n<li data-block-key=\"2hadp\"><b>Disallowed<\/b>: Altering the dataset, variety of epochs, or mannequin structure.<\/li>\n<\/ul>\n<h3 data-block-key=\"gmsm6\" id=\"sample-trajectory\"><b>Pattern Trajectory<\/b><\/h3>\n<p data-block-key=\"317i0\">Here&#8217;s a pattern trajectory from <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/windmaple\/autofinetune\/blob\/main\/sample_runs\/SFT_results.tsv\">sample_runs\/SFT_results.tsv<\/a> demonstrating how the agent hill climbed.<\/p>\n<\/div>\n<div>\n<p data-block-key=\"efrnn\">As you possibly can see, the agent is ready to robotically modify LoRA rank\/alpha, optimizer, studying price, and so on. to maintain bettering the mannequin\u2019s accuracy by way of producing right perform calls.<\/p>\n<h2 data-block-key=\"drdpg\" id=\"case-study-2:-reinforcement-learning-(grpo)-on-gemma-for-math-reasoning\"><b>Case Research 2: Reinforcement Studying (GRPO) on Gemma for Math Reasoning<\/b><\/h2>\n<p data-block-key=\"2h3tl\">Supervised fine-tuning is barely a easy check. For our second case research, we took the official <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/google\/tunix\/blob\/main\/examples\/grpo_gemma.ipynb\">GRPO instance<\/a> from the Tunix repository (which trains Gemma 3 1B for math reasoning utilizing GSM8K; the skilled mannequin has higher numerical accuracy and format accuracy in its solutions) and set it up for autonomous RL finetuning. Reinforcement studying is topic to hyperparameter sensitivity, instability, and longer execution occasions &#8211; making this activity more difficult and time-consuming.<\/p>\n<h3 data-block-key=\"5uyt5\" id=\"the-arena-setup\"><b>The Area Setup<\/b><\/h3>\n<ul>\n<li data-block-key=\"148ck\"><b>{Hardware}<\/b>: Cloud TPU v6e-1<\/li>\n<li data-block-key=\"e5h7d\"><b>Mannequin<\/b>: <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/huggingface.co\/google\/gemma-3-1b-it\">Gemma 3 1B<\/a><\/li>\n<li data-block-key=\"48gj9\"><b>Dataset<\/b>: GSM8K<\/li>\n<li data-block-key=\"2avpb\"><b>Iteration Velocity<\/b>: A few hours per run<\/li>\n<li data-block-key=\"63mui\"><b>Run Period<\/b>: 40 experiments over 2\u20133 days<\/li>\n<li data-block-key=\"8mrhp\"><b>Goal Metric<\/b>: to simplify the outer optimization loop for the agent, we selected a single synthetic analysis metric <code>Post_RL_metric<\/code>, which is solely <code>numerical_accuracy + format_accurac<\/code>y (you possibly can in fact use different metrics, i.e., utilizing totally different weights).<\/li>\n<\/ul>\n<h3 data-block-key=\"ut52v\" id=\"sample-trajectory\"><b>Pattern trajectory<\/b><\/h3>\n<p data-block-key=\"cbvi6\">Beneath is a pattern trajectory logged in <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/windmaple\/autofinetune\/blob\/main\/sample_runs\/RL_results.tsv\">sample_runs\/RL_results.tsv<\/a>, displaying the agent\u2019s progress. The agent was in a position to determine higher LoRA configurations, rollout temperature, KL penalty, system immediate, and so on. to enhance the overall reward by ~10%.<\/p>\n<\/div>\n<div>\n<h2 data-block-key=\"6eo3y\" id=\"what's-next\"><b>What\u2019s Subsequent?<\/b><\/h2>\n<p data-block-key=\"5n5tu\">We hope this venture reveals you the ability of AI brokers within the area of LLM post-training and conjures up you to consider how one can leverage them to automate your LLM finetuning workflows utilizing Tunix on TPUs. Please try the code, pattern runs, and <code>program.md<\/code> templates within the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/windmaple\/autofinetune\"><b>autofinetune GitHub repository<\/b><\/a>, discover the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/google\/tunix\"><b>Tunix library<\/b><\/a>, and begin constructing your personal autonomous post-training lab immediately!<\/p>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Think about going to sleep after writing a single Markdown specification and waking as much as discover that an AI agent ran dozens of LLM fine-tuning experiments in a single day in your behalf &#8211; discovering optimum LoRA ranks, refining studying price schedules, tuning batch sizes and committing every verified enchancment to Git. That is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":18657,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[3112,74,9026,7308,9285],"class_list":["post-18655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-autonomous","tag-llm","tag-posttraining","tag-tpus","tag-tunix"],"_links":{"self":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/18655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18655"}],"version-history":[{"count":1,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/18655\/revisions"}],"predecessor-version":[{"id":18656,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/18655\/revisions\/18656"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/media\/18657"}],"wp:attachment":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}