{
  "id": "h100-qwen3-8b-grpo-lora-customer-service-tool-calls",
  "kind": "measurement",
  "status": "published",
  "title": "GRPO + LoRA on Qwen3-8B for customer-service next actions: base vs tuned on 800 steps from 28 held-out company policies",
  "published": "2026-11-29",
  "summary": "One run, 2026-11-28/29, on one rented H100 SXM (RunPod Secure Cloud). Data: NVIDIA's Nemotron-RL-Agentic-Conversational-Tool-Use-Pivot-v1 (CC BY 4.0), 96,968 assistant steps from synthetic customer-service conversations under 406 company policies; the target is the expert's next action (a tool call or a message to the user). 28 policies were held out entirely. Difficulty filter: Qwen3-8B (thinking off) answered 32,000 steps 8 times each; the 1,733 it got right 1 to 6 times were used for GRPO + LoRA (100 steps). Scoring with NeMo Gym's own verifier and the dataset's config. Write-up: /blog/rl-customer-service-model-8b-learned-to-talk.html",
  "conclusion": "On 800 steps from held-out policies, accuracy rose from 26.3% to 29.3% (34 steps only the tuned model got right, 10 only the base: sign test p = 0.00039). Almost all of it came from steps where the expert replied to the user (46.7% → 54.0%); on steps that needed a tool call it moved 15.7% → 16.5%, and missed tool calls went up. The verifier gives any text reply full credit when the expert sent a message, so the model learned to reply more often.",
  "headline": {
    "value": "+3.0 pts",
    "label": "next-action accuracy on held-out policies, mostly from replying more"
  },
  "hardware": {
    "vendor": "NVIDIA",
    "accelerator": "NVIDIA H100 SXM",
    "count": 1,
    "rated_bw_tbs_per_gpu": 3.35,
    "driver": "595.112.07",
    "host": "RunPod Secure Cloud, 1x H100 80GB HBM3 (AP-IN-1)"
  },
  "software": {
    "engine": "vLLM + TRL",
    "engine_version": "vLLM 0.31.0, TRL 1.19.0, PEFT 0.22.0",
    "kernels": "vllm/vllm-openai:v0.31.0; GRPO with vLLM colocated on the training GPU"
  },
  "model": {
    "name": "Qwen/Qwen3-8B + LoRA (r32)",
    "shape": "Dense",
    "quantization": "BF16",
    "parallelism": "1 GPU"
  },
  "pills": [
    "GRPO + LoRA · customer service",
    "held-out policies · 800 steps"
  ],
  "variables_measured": [
    "next-action accuracy (tool call or message)",
    "accuracy on steps that need a tool call",
    "accuracy on steps that need a message",
    "error categories",
    "share of text replies during training"
  ],
  "charts_sub": "Greedy decoding, 800 steps from 28 company policies the model never trained on.",
  "charts": [
    {
      "title": "All steps",
      "unit": "% correct",
      "digits": 1,
      "better": "higher is better",
      "max": 100,
      "bars": [
        {
          "label": "Base",
          "key": "base",
          "value": 26.3
        },
        {
          "label": "GRPO LoRA",
          "key": "tuned",
          "value": 29.3
        }
      ]
    },
    {
      "title": "Steps that need a tool call (528)",
      "unit": "% correct",
      "digits": 1,
      "better": "higher is better",
      "max": 100,
      "bars": [
        {
          "label": "Base",
          "key": "base",
          "value": 15.7
        },
        {
          "label": "GRPO LoRA",
          "key": "tuned",
          "value": 16.5
        }
      ]
    },
    {
      "title": "Steps that need a message (272)",
      "unit": "% correct",
      "digits": 1,
      "better": "higher is better",
      "max": 100,
      "bars": [
        {
          "label": "Base",
          "key": "base",
          "value": 46.7
        },
        {
          "label": "GRPO LoRA",
          "key": "tuned",
          "value": 54.0
        }
      ]
    }
  ],
  "tables": [
    {
      "title": "Accuracy, base vs GRPO LoRA (greedy)",
      "sub": "Held-out: 28 policies never filtered or trained on. Seen: unseen steps (and trajectories) from training policies.",
      "columns": [
        "Eval set",
        "Base, all",
        "LoRA, all",
        "Base, tool call",
        "LoRA, tool call",
        "Base, message",
        "LoRA, message"
      ],
      "rows": [
        [
          "Held-out policies (800)",
          "26.3%",
          "29.3%",
          "15.7%",
          "16.5%",
          "46.7%",
          "54.0%"
        ],
        [
          "Seen policies (800)",
          "27.9%",
          "29.4%",
          "19.9%",
          "20.1%",
          "45.6%",
          "50.0%"
        ]
      ]
    },
    {
      "title": "Paired comparison per step",
      "sub": "Exact two-sided sign test. Sampled = mean reward over 4 samples at temperature 0.7.",
      "columns": [
        "Eval set",
        "Greedy: only LoRA right / only base right",
        "p",
        "Sampled: LoRA better / base better",
        "p"
      ],
      "rows": [
        [
          "Held-out policies",
          "34 / 10",
          "0.00039",
          "57 / 17",
          "<0.001"
        ],
        [
          "Seen policies",
          "30 / 18",
          "0.1114",
          "55 / 30",
          "0.00884"
        ]
      ]
    },
    {
      "title": "Where the answers went, held-out policies (greedy, 800 steps)",
      "sub": "NeMo Gym verifier categories.",
      "columns": [
        "Category",
        "Base",
        "GRPO LoRA"
      ],
      "rows": [
        [
          "Expected a tool call, got none",
          "196",
          "211"
        ],
        [
          "Called the wrong tool",
          "162",
          "145"
        ],
        [
          "Called a tool when a message was expected",
          "145",
          "125"
        ],
        [
          "Right tool, wrong argument value",
          "50",
          "48"
        ],
        [
          "Correct message",
          "127",
          "147"
        ],
        [
          "Correct tool call",
          "83",
          "87"
        ]
      ]
    },
    {
      "title": "Difficulty filter: 32,000 steps, 8 answers each (Qwen3-8B, thinking off, T 0.7)",
      "sub": "Only steps answered right 1-6 times out of 8 give GRPO a learning signal.",
      "columns": [
        "Right out of 8",
        "0",
        "1",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8"
      ],
      "rows": [
        [
          "Steps",
          "21,511",
          "282",
          "293",
          "307",
          "314",
          "275",
          "262",
          "240",
          "8,516"
        ]
      ]
    },
    {
      "title": "During training: share of text replies on steps that needed a tool call",
      "sub": "Mean over 10-step windows of training batches. It rose as the model learned that replies are rarely penalized.",
      "columns": [
        "Steps 1-10",
        "Steps 21-30",
        "Steps 51-60",
        "Steps 91-100"
      ],
      "rows": [
        [
          "0.37",
          "0.68",
          "0.45",
          "0.46"
        ]
      ]
    }
  ],
  "setup": [
    [
      "Data",
      "nvidia/Nemotron-RL-Agentic-Conversational-Tool-Use-Pivot-v1 (CC BY 4.0): 96,968 steps, 406 policies (md5 of the system prompt). Held out: 28 policies. Filter pool: 32,000 steps from the other policies with NVIDIA's own pass rate >= 0.1"
    ],
    [
      "Prompt",
      "Qwen3-8B's chat template with the row's tools, thinking off; earlier tool calls become assistant tool_calls, their outputs tool messages; earlier hidden reasoning dropped"
    ],
    [
      "Reward and scoring",
      "NeMo Gym's ActionComparator (Apache-2.0) with the dataset's config: tool name and arguments must match the expert's call; when the expert sent a message, any text reply scores 1"
    ],
    [
      "Training",
      "TRL GRPO + LoRA r32 on all attention and MLP projections, 8 answers per prompt, 100 steps (~0.9 epoch of the 1,733 filtered steps)"
    ],
    [
      "Evaluation",
      "800 held-out-policy steps + 800 seen-policy steps; greedy (1 answer) and sampled (4 answers, T 0.7); max 512 new tokens"
    ],
    [
      "Cost",
      "$44.80 of GPU time (612 minutes on one H100 SXM at $4.39/h): filter 95 min, training ~7.5 h, evaluation ~25 min"
    ]
  ],
  "not_covered": [
    "A reward that grades message content (the fix this run points to)",
    "SFT before RL, thinking on, or a larger base",
    "More than one training run or seed",
    "Real (non-synthetic) customer-service conversations",
    "General-ability regression checks"
  ],
  "reproduce_title": "Reproduce",
  "reproduce_sub": "Scripts are in the TokenWatt repository under bench/finetune-2026-11/step4-cs-toolcall-grpo.",
  "reproduce": "python3 prep.py            # policy split, eval sets, 32,000-step pool\npython3 remote/filter.py   # 8 answers per step, keep 1-6/8\npython3 remote/grpo.py --max-steps 100\npython3 remote/evaluate.py --lora <adapter>",
  "post": "/blog/rl-customer-service-model-8b-learned-to-talk.html",
  "data": {
    "source": "bench/finetune-2026-11/step4-cs-toolcall-grpo (TokenWatt repository)",
    "filter": {
      "rows": 32000,
      "hist": {
        "0": 21511,
        "1": 282,
        "2": 293,
        "3": 307,
        "4": 314,
        "5": 275,
        "6": 262,
        "7": 240,
        "8": 8516
      },
      "kept": 1733
    },
    "eval": {
      "eval_unseen": {
        "base": {
          "all": {
            "n": 800,
            "greedy_acc": 0.2625,
            "sampled_mean": 0.2662,
            "greedy_text_share": 0.4037
          },
          "function_call": {
            "n": 528,
            "greedy_acc": 0.1572,
            "sampled_mean": 0.1615,
            "greedy_text_share": 0.3712
          },
          "message": {
            "n": 272,
            "greedy_acc": 0.4669,
            "sampled_mean": 0.4697,
            "greedy_text_share": 0.4669
          }
        },
        "lora": {
          "all": {
            "n": 800,
            "greedy_acc": 0.2925,
            "sampled_mean": 0.2984,
            "greedy_text_share": 0.4475
          },
          "function_call": {
            "n": 528,
            "greedy_acc": 0.1648,
            "sampled_mean": 0.1771,
            "greedy_text_share": 0.3996
          },
          "message": {
            "n": 272,
            "greedy_acc": 0.5404,
            "sampled_mean": 0.534,
            "greedy_text_share": 0.5404
          }
        },
        "greedy_paired": {
          "lora_only": 34,
          "base_only": 10,
          "p": 0.00039
        },
        "sampled_paired": {
          "lora_better": 57,
          "base_better": 17,
          "p": 0.0
        }
      },
      "eval_seen": {
        "base": {
          "all": {
            "n": 800,
            "greedy_acc": 0.2787,
            "sampled_mean": 0.2844,
            "greedy_text_share": 0.3825
          },
          "function_call": {
            "n": 552,
            "greedy_acc": 0.1993,
            "sampled_mean": 0.2047,
            "greedy_text_share": 0.3496
          },
          "message": {
            "n": 248,
            "greedy_acc": 0.4556,
            "sampled_mean": 0.4617,
            "greedy_text_share": 0.4556
          }
        },
        "lora": {
          "all": {
            "n": 800,
            "greedy_acc": 0.2938,
            "sampled_mean": 0.3034,
            "greedy_text_share": 0.4338
          },
          "function_call": {
            "n": 552,
            "greedy_acc": 0.2011,
            "sampled_mean": 0.2097,
            "greedy_text_share": 0.404
          },
          "message": {
            "n": 248,
            "greedy_acc": 0.5,
            "sampled_mean": 0.5121,
            "greedy_text_share": 0.5
          }
        },
        "greedy_paired": {
          "lora_only": 30,
          "base_only": 18,
          "p": 0.1114
        },
        "sampled_paired": {
          "lora_better": 55,
          "base_better": 30,
          "p": 0.00884
        }
      }
    },
    "gpu_cost_usd": 44.8
  }
}
