Views
No views yet
kubectl command to maintain cluster health. It was trained from scratch with a completely redesigned reward signal after the original reward function was found to produce zero-variance advantages that blocked all gradient flow.
| Metric | Zero-shot | Fine-tuned |
|---|---|---|
| Overall avg score | 0.394 | 0.569 (best episode) |
| connection_pool_deadlock | 0.630 | 0.976 |
| memory_leak_slow_burn | 0.990 | 0.990 |
| node_failure | 0.220 | 0.920 |
| retry_storm | 0.377 | 0.587 |
| thundering_herd | 0.393 | 0.606 |
| traffic_spike | 0.024 | 0.399 |
r = −1000 whenever the database node failed — which happened within the first 3 steps of most episodes. With all rewards identical, GRPO advantages collapsed to zero and no gradient flowed.

cpu_i = −1
reward_format reached 3.0 (perfect) from step 1 — the model learned XML scaffold immediatelyreward_validity stabilised at 1.9+ — no invalid commands after step ~10reward_env improved steadily — environment physics signal dominated learningclipped_ratio stayed near 0 throughout — healthy PPO clip utilisation
|F(s)| ≥ 2 → throttle(0.3)) before the DB Recovery rule (0 ∈ F(s) → restart_node(0)). When multiple nodes including the database were failed, the oracle prescribed throttle instead of restart_node(0). The model faithfully learned this suboptimal policy. Fixing the priority ordering accounted for +0.044 benchmark score improvement.
| Run | Failure | Signal |
|---|---|---|
| vLLM on A100-40GB | SM 8.0 segfault (compilation_config not set) | Crash at init |
| batch=4, gen=8 | CPU-bound rewards; 126 s/step, GPU idle | samples/sec = 0.06 |
| max_comp=256 | <think> blocks truncated before </think> | frac_reward_zero_std = 1.0 |
| reward_env×2 | 10:1 env-to-triage ratio recreated zero-variance | zero_std → 1.0 at step 119 |
| oracle inverted | Learned throttle in DB-failure states | Low triage/mean |

R(a,s) = R_fmt [-3,+3] + R_val [-2,+2] + R_env [-5,+5] + R_tri [-0.5,+1]<reasoning> + <action> tags)1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained(
4 "Naseer-010/Qwen3-8B-Finetuned-DIME",
5 torch_dtype="bfloat16",
6 device_map="auto",
7)
8tokenizer = AutoTokenizer.from_pretrained("Naseer-010/Qwen3-8B-Finetuned-DIME")
9
10system_prompt = """You are an autonomous SRE agent managing an 8-node Kubernetes cluster.
11Node-0 is the PostgreSQL database (SPOF). Nodes 1-7 are stateless workers.
12
13TRIAGE PRIORITY (check in order):
141. OOM: if any node mem > 0.92 → kubectl delete pod node-<i>
152. DB RECOVERY: if node-0 in failed_nodes → kubectl delete pod node-0
163. SPLIT-BRAIN: if io_wait > 0.80 → kubectl throttle ingress --rate=0.5
174. HOT-SHARD: if one worker cpu > 0.90, others low → reroute traffic
185. RETRY STORM: if p99 > 100ms and rr > 150 → kubectl throttle ingress --rate=0.4
196. ZOMBIE NODE: if worker cpu near 0 → reroute away from it
207. BLACK SWAN: if 2+ nodes failed (DB alive) → kubectl throttle ingress --rate=0.3
218. DB STRESS: if node-0 cpu > 0.80 → kubectl throttle ingress --rate=0.7
229. SAFE SCALE: if avg worker cpu > 0.75 and budget > 20 → scale up
2310. HEALTHY → no_op
24
25Output format:
26<reasoning>One sentence identifying which rule applies.</reasoning>
27<action>{"command": "kubectl ..."}</action>"""
28
29obs = {
30 "cpu_loads": [0.45, 0.82, 0.79, 0.88, 0.75, 0.81, 0.77, 0.73],
31 "mem_utilizations": [0.41, 0.68, 0.71, 0.65, 0.62, 0.70, 0.66, 0.64],
32 "queue_lengths": [12, 45, 41, 53, 38, 44, 40, 37],
33 "failed_nodes": [],
34 "latency_ms": 187.3,
35 "p99_latency": 312.5,
36 "request_rate": 1840.0,
37 "io_wait": 0.12,
38 "error_budget": 85,
39 "step": 4,
40 "task_hint": "System is under heavy traffic load."
41}
42
43import json
44messages = [
45 {"role": "system", "content": system_prompt},
46 {"role": "user", "content": f"Current system state:\n{json.dumps(obs, indent=2)}\nWhat action should be taken?"}
47]
48
49text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
50inputs = tokenizer(text, return_tensors="pt").to(model.device)
51
52outputs = model.generate(
53 **inputs,
54 max_new_tokens=1024,
55 temperature=0.6,
56 top_p=0.95,
57 do_sample=True,
58)
59print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))<think>
P99 latency is 312ms with request rate 1840 rps and no failed nodes.
Rule 5 (retry storm): p99 > 100ms and rr > 150 → throttle at 0.4.
</think>
<reasoning>Rule 5 applies: p99 latency 312ms exceeds threshold with high request rate 1840 rps — throttle ingress to shed load.</reasoning>
<action>{"command": "kubectl throttle ingress --rate=0.4"}</action>| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen3-8B (BF16) |
| Method | GRPO (TRL 0.24.0 + Unsloth + vLLM 0.6.3) |
| LoRA rank | 32, alpha=64, all projection layers |
| Trainable params | 1.05% (349 MB adapter) |
| Training steps | 300 |
| Batch size | 1 × 4 generations = 4 completions/step |
| Learning rate | 5e-6, cosine schedule |
| Max completion length | 1024 tokens |
| GPU | A100-SXM4-80GB |
| Wall-clock time | 44 minutes |
1@misc{dime2026,
2 title = {Fine-Tuning Language Models as Autonomous SREs via GRPO: The DIME Benchmark},
3 author = {Nithish Sriram and Naseer},
4 year = {2026},
5 url = {https://huggingface.co/Naseer-010/Qwen3-8B-Finetuned-DIME}
6}