Views
No views yet
| Decision | Description |
|---|---|
| NEXT | Proceed to the next sequential step |
| RETRY | Retry the current step (within budget) |
| FORK | Launch parallel execution branches |
| JOIN | Synchronize parallel branches |
| META | Escalate — anomaly detected, human intervention needed |
| Category | v3 SLM | v2 SLM | GPT-4.1 | GPT-4o-mini | Base SLM |
|---|---|---|---|---|---|
| NEXT | 15/22 (68%) | 8/22 (36%) | 6/22 (27%) | 2/22 (9%) | 16/22 (73%) |
| RETRY | 12/12 (100%) | 7/12 (58%) | 11/12 (92%) | 12/12 (100%) | 3/12 (25%) |
| FORK | 12/14 (86%) | 14/15 (93%) | 14/14 (100%) | 14/14 (100%) | 1/14 (7%) |
| JOIN | 6/15 (40%) | 10/15 (67%) | 10/15 (67%) | 12/15 (80%) | 0/15 (0%) |
| META | 0/13 (0%) | 3/12 (25%) | 0/13 (0%) | 0/13 (0%) | 8/13 (62%) |
| TOTAL | 45/76 (59.2%) | 42/76 (55.3%) | 41/76 (53.9%) | 40/76 (52.6%) | 28/76 (36.8%) |
| Version | Strategy | Total | NEXT | RETRY | FORK | JOIN | META |
|---|---|---|---|---|---|---|---|
| v1 (base) | 800-iter policy training | 36.8% | 73% | 25% | 7% | 0% | 62% |
| v2 | + contrastive alignment | 55.3% | 36% | 58% | 93% | 67% | 25% |
| v3 | + fork suppression | 59.2% | 68% | 100% | 86% | 40% | 0% |
| Parameter | Value |
|---|---|
| Rank | 16 |
| Alpha (scale) | 32 (2.0x) |
| Dropout | 0.02 |
| Target layers | Last 28 of 32 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Parameter | Value |
|---|---|
| Framework | MLX (Apple Silicon native) |
| Hardware | Apple M4 Pro, 48GB unified memory |
| Stage A iters | 800 |
| Stage B iters | 100 |
| Stage C iters | 200 |
| Batch size | 4 |
| Learning rate | 2e-5 (fork-suppression stage) |
| Sequence length | 512 |
| Prompt masking | Yes (loss only on assistant tokens) |
1from mlx_lm import load, generate
2from mlx_lm.sample_utils import make_sampler
3
4model, tokenizer = load(
5 "Qwen/Qwen2.5-7B-Instruct",
6 adapter_path="ssaraf1/slm-workflow-planner-7b-v3"
7)
8
9messages = [
10 {"role": "system", "content": "You are a workflow planner. Given the current workflow state, eligible nodes, and topology information, classify the decision type. Respond with exactly one of: NEXT, RETRY, FORK, JOIN, META"},
11 {"role": "user", "content": "Current node: VERIFY_POLICY (SYSTEM)\nOutcome: success\n\nState:\n goal_progress=0.35\n parallel_active=0\n resource_pressure=0.1\n retry_count=0\n\nEligible nodes:\n 1. FRAUD_SCREENING (SYSTEM) → produces: fraud_score\n 2. DAMAGE_ASSESSMENT (AGENT) → produces: damage_report\n\nForkable sets: [{FRAUD_SCREENING, DAMAGE_ASSESSMENT}]\nJoin-ready: []\n\nWhat decision type?"}
12]
13
14prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
15sampler = make_sampler(temp=0.0)
16response = generate(model, tokenizer, prompt=prompt, max_tokens=10, sampler=sampler)
17print(response) # Expected: FORK (low pressure, independent actors)forkable_sets was present.
v3 learned the correct policy:| Scenario | Topology | State | v2 Decision | v3 Decision |
|---|---|---|---|---|
| Low pressure + independent | Forkable | Go parallel | FORK ✅ | FORK ✅ |
| High resource pressure | Forkable | Don't parallelize | FORK ❌ | NEXT ✅ |
| Already in parallel | Forkable | Too deep | FORK ❌ | NEXT ✅ |
| High uncertainty | Forkable | Risky | FORK ❌ | NEXT ✅ |
| First retry failure | Not forkable | Retry available | NEXT ❌ | RETRY ✅ |
adapters.safetensors — LoRA adapter weights (Stage A + B + C)adapter_config.json — LoRA configuration for MLX