--- license: apache-2.0 base_model: Qwen/Qwen3.6-27B tags: - lora - peft - swe-bench - code-repair - trace-pipeline --- # Qwen3.6-27B TRACE LoRA — Target Capability: `semantic-logic-precision` GRPO-trained LoRA adapters on top of `Qwen/Qwen3.6-27B`, produced by the **TRACE** (Test-time Reinforcement Learning Adaptation via Capability Environments) pipeline. ## Target capability `semantic-logic-precision` was identified via open-ended capability mining (phase 2 of TRACE): Qwen3.6 itself read the 123 failed SWE-bench Verified trajectories from its own baseline run and proposed a 5-category taxonomy of its weaknesses. `semantic-logic-precision` was the largest category at **61% of failures**: > Implements a logically incorrect algorithm — misunderstanding domain > protocols, mathematical rules, or language semantics. Code is > syntactically valid but solves the wrong problem. ## Training data Synthetic single-turn SEARCH/REPLACE scenarios (phase 3 v4 + v5 mutation): | Scenario | Base success rate | Description | |---|---:|---| | `pid-autotuner-ku-formula-fix` | 0.30 | Wrong Ziegler-Nichols Ku formula (extra `* 2` in denominator) | | `pid-autotuner-ku-formula-fix_mut1_1` | 0.50 | Same bug, surface code disguised: identifiers renamed, decoy edit sites, misleading "logic is correct" comment | ## Training setup - **Trainer**: GRPO with rank-16 LoRA (`q_proj, k_proj, v_proj, o_proj`) - **Group size**: 8 rollouts per group (DS-retry on constant-reward groups) - **Inference backend**: vLLM TP=4 with hot-reload LoRA after each policy step - **Hardware**: 4×H100 80GB - **Total iterations**: 130 (saturated around iter ~30-50) - **Per-iter wall time**: ~70-100 sec ## Checkpoints | Subfolder | When taken | Notes | |---|---|---| | `iter_30/` | Mid-learning | Generalizable signal, low overfit risk | | `iter_50/` | Recommended | Best balance of learning vs overfit | | `iter_100/` | Near-saturation | High training-set performance, possibly overfit | | `iter_130/` | Final | Peak training reward, may not transfer better than `iter_50` | ## Loading ### vLLM (production / eval) ```bash python3 -c " from huggingface_hub import snapshot_download snapshot_download( repo_id='ScalingIntelligence/qwen3.6-trace-semantic-logic-precision-v1', allow_patterns='iter_50/*', local_dir='/tmp/trace_lora', ) " curl -X POST http://localhost:8000/v1/load_lora_adapter \ -H 'Content-Type: application/json' \ -d '{"lora_name": "trace_iter50", "lora_path": "/tmp/trace_lora/iter_50"}' ``` ### PEFT + transformers ```python from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel import torch base = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen3.6-27B", torch_dtype=torch.bfloat16, device_map="auto" ) model = PeftModel.from_pretrained( base, "ScalingIntelligence/qwen3.6-trace-semantic-logic-precision-v1", subfolder="iter_50", ) tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3.6-27B") ``` ### Merged model (no PEFT at inference) ```python m = PeftModel.from_pretrained(base, REPO, subfolder="iter_50") merged = m.merge_and_unload() merged.save_pretrained("./qwen3.6-trace-slp-iter50-merged") ``` ## Evaluation SWE-bench Verified Pass@1, mini-swe-agent + Modal sandboxes, vLLM @ 128k: | Model | Pass@1 | Notes | |---|---:|---| | Qwen3.6-27B baseline | **58.2%** | phase 1, untrained | | + `iter_50` LoRA | pending | phase 6 in progress | | + `iter_100` LoRA | pending | will run after iter_50 finishes | ## Caveats - Training data is **2 single-turn scenarios** — a narrow slice of the target capability. Transfer to SWE-bench's diverse multi-file, multi-turn bugs is the open research question this artifact tests. - Without a KL penalty (`--kl-coef 0.0` in training), late checkpoints (`iter_100`, `iter_130`) drift further from the base policy than typically desirable. `iter_30` / `iter_50` may transfer better in practice. - Mutations are stronger than the base scenarios (forced search-misdirection via renamed identifiers, decoys, and a contradictory comment); however even the mutated scenarios are far simpler than real open-source bugs. ## Citation / acknowledgements Produced as part of TRACE pipeline development at Stanford ScalingIntelligence Lab.