Image-Text-to-Text
PEFT
Safetensors
lora
sft
trl
alignment
agentic-misalignment
tool-use
conversational
Instructions to use dougalldeepmind/2026-07-31-wrongly-trained-qwen36-toolcalling-tulu-lora-20-80 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use dougalldeepmind/2026-07-31-wrongly-trained-qwen36-toolcalling-tulu-lora-20-80 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.6-27B") model = PeftModel.from_pretrained(base_model, "dougalldeepmind/2026-07-31-wrongly-trained-qwen36-toolcalling-tulu-lora-20-80") - Notebooks
- Google Colab
- Kaggle
cards: point at the current names (naming law)
Browse files
README.md
CHANGED
|
@@ -1,116 +1,116 @@
|
|
| 1 |
-
---
|
| 2 |
-
base_model: Qwen/Qwen3.6-27B
|
| 3 |
-
library_name: peft
|
| 4 |
-
pipeline_tag: image-text-to-text
|
| 5 |
-
tags:
|
| 6 |
-
- lora
|
| 7 |
-
- peft
|
| 8 |
-
- sft
|
| 9 |
-
- trl
|
| 10 |
-
- alignment
|
| 11 |
-
- agentic-misalignment
|
| 12 |
-
- tool-use
|
| 13 |
-
datasets:
|
| 14 |
-
- LASR-Callum/2026-07-31-toolcalling-tulu-20-80-mixture
|
| 15 |
-
- LASR-Callum/2026-07-29-synthdoc-approved-constitution-sft
|
| 16 |
-
- LASR-Callum/tulu3-replay-
|
| 17 |
-
license: apache-2.0
|
| 18 |
-
---
|
| 19 |
-
|
| 20 |
-
# Qwen3.6-27B β tool-calling + TULU3 LoRA (**20/80** mixture)
|
| 21 |
-
|
| 22 |
-
LoRA adapter for [`Qwen/Qwen3.6-27B`](https://huggingface.co/Qwen/Qwen3.6-27B). The 20% target
|
| 23 |
-
portion is **entirely agentic tool-use data** β conversations where the model itself is the actor
|
| 24 |
-
holding live tools β and the other 80% is TULU3 replay.
|
| 25 |
-
|
| 26 |
-
This is the pure-tool-calling cell of a family that holds total tokens and the 20% target share
|
| 27 |
-
fixed and varies only the **composition** of that 20%:
|
| 28 |
-
|
| 29 |
-
| Arm | 20% composition | ODCV-Bench | Agentic-misalignment |
|
| 30 |
-
|---|---|---|---|
|
| 31 |
-
| [base (no SFT)](https://huggingface.co/Qwen/Qwen3.6-27B) | β | 37.2% | 65.5% |
|
| 32 |
-
| [`β¦-difficult-advice-tulu-lora-20-80`](https://huggingface.co/LASR-Callum/
|
| 33 |
-
| [`β¦-threeway-constitution-lora`](https://huggingface.co/LASR-Callum/
|
| 34 |
-
| **this** | **agentic tool-use only** | **not yet run** | **not yet run** |
|
| 35 |
-
| [`β¦-tulu-100pct-lora`](https://huggingface.co/LASR-Callum/
|
| 36 |
-
|
| 37 |
-
## Training mixture
|
| 38 |
-
|
| 39 |
-
Published in full as
|
| 40 |
-
[`LASR-Callum/2026-07-31-toolcalling-tulu-20-80-mixture`](https://huggingface.co/datasets/LASR-Callum/2026-07-31-toolcalling-tulu-20-80-mixture).
|
| 41 |
-
|
| 42 |
-
| Source | Examples | Tokens | Share | Rendering |
|
| 43 |
-
|---|---:|---:|---:|---|
|
| 44 |
-
| agentic tool-use (`approved_agentic`, `fullthink`) | 124 | 297,894 | 19.96% | reasoning kept where the source had it; **no** empty think blocks |
|
| 45 |
-
| TULU3 replay | 1,878 | 1,194,548 | 80.04% | **no** `<think>` block at all |
|
| 46 |
-
| **Total** | **2,002** | **1,492,442** | | |
|
| 47 |
-
|
| 48 |
-
25 of the 124 agentic documents actually emit tool calls
|
| 49 |
-
β 92 `<tool_call>` spans in Qwen3.6's XML dialect, all verified balanced.
|
| 50 |
-
|
| 51 |
-
## Training
|
| 52 |
-
|
| 53 |
-
bf16 LoRA (not QLoRA β bitsandbytes does not reliably cover this model's hybrid
|
| 54 |
-
linear-attention/SSM layers), 1ΓH100 80GB SXM, **1h38m09s**.
|
| 55 |
-
|
| 56 |
-
| | |
|
| 57 |
-
|---|---|
|
| 58 |
-
| r / alpha / dropout | 32 / 64 / 0.05 |
|
| 59 |
-
| target modules | regex scoped to `model.language_model.*` (q/k/v/o/gate/up/down proj) |
|
| 60 |
-
| epochs / steps | 1 / 126 |
|
| 61 |
-
| batch x grad-accum | 1 x 16 |
|
| 62 |
-
| lr / schedule | 1e-4, cosine, 3% warmup, annealed to 0 |
|
| 63 |
-
| max seq len / packing | **4096** / off |
|
| 64 |
-
| `assistant_only_loss` | false |
|
| 65 |
-
| seed | 0 |
|
| 66 |
-
| trainable params | 159.4M |
|
| 67 |
-
|
| 68 |
-
**Loss:** 2.7528 β **1.057**
|
| 69 |
-
(epoch average); the last logged step (125) read
|
| 70 |
-
1.0199. Epoch-average mean token accuracy
|
| 71 |
-
**0.7071**, final grad_norm 0.3573,
|
| 72 |
-
1,492,498 tokens consumed.
|
| 73 |
-
|
| 74 |
-
Curves and the full log history are in
|
| 75 |
-
[`LASR-Callum/2026-07-31-toolcalling-tulu-sft-run`](https://huggingface.co/datasets/LASR-Callum/2026-07-31-toolcalling-tulu-sft-run).
|
| 76 |
-
|
| 77 |
-
### Why `max_seq_len` is 4096 and the sibling arms use 2048
|
| 78 |
-
|
| 79 |
-
These agentic conversations run 9β13 turns with a median of 2,348 tokens, and 99 of the 151 source
|
| 80 |
-
documents exceed 2048. Measured: a 2048 cap keeps only 80.4% of the corpus and **severs 11 of its
|
| 81 |
-
98 `<tool_call>` spans**, inside exactly the long conversations the tool calls live in. At 4096 the
|
| 82 |
-
mixture is truncated nowhere at all. The cost is that this arm differs from its siblings on one
|
| 83 |
-
hyperparameter as well as on composition β read the head-to-head with that caveat.
|
| 84 |
-
|
| 85 |
-
## Known caveats
|
| 86 |
-
|
| 87 |
-
1. **Reasoning density.** Only **30 of the 124 agentic rows (24%) carry a real
|
| 88 |
-
reasoning trace**, against every target example in the difficult-advice 20/80 arm. If the
|
| 89 |
-
dose-response in this family is driven by reasoning rather than topic coverage, that is
|
| 90 |
-
confounded with the composition change here. Inherent to the source corpus.
|
| 91 |
-
2. **`target_modules` only half-applies.** Qwen3.6-27B is hybrid: `q/k/v/o_proj` exist in 16 of 64
|
| 92 |
-
layers, the rest being linear-attention blocks with different module names. `gate/up/down_proj`
|
| 93 |
-
attach to all 64. So this adapter tunes MLP throughout but attention in only a quarter of the
|
| 94 |
-
stack. Same for every arm in the family, so comparisons are unaffected.
|
| 95 |
-
3. **Not yet evaluated.** No ODCV-Bench or agentic-misalignment number exists for this arm yet.
|
| 96 |
-
|
| 97 |
-
## Usage
|
| 98 |
-
|
| 99 |
-
```python
|
| 100 |
-
from peft import PeftModel
|
| 101 |
-
from transformers import AutoModelForImageTextToText
|
| 102 |
-
|
| 103 |
-
model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3.6-27B", dtype="bfloat16")
|
| 104 |
-
model = PeftModel.from_pretrained(model, "LASR-Callum/
|
| 105 |
-
model = model.merge_and_unload() # vLLM LoRA support for this hybrid arch is unproven
|
| 106 |
-
```
|
| 107 |
-
|
| 108 |
-
Use `AutoModelForImageTextToText`, not `AutoModelForCausalLM` β this is a vision-language
|
| 109 |
-
checkpoint. Merging drops the base model's 15 `mtp.*` tensors, so speculative decoding needs them
|
| 110 |
-
grafted back.
|
| 111 |
-
|
| 112 |
-
## Provenance
|
| 113 |
-
|
| 114 |
-
Repository https://github.com/Matthew-Bozoukov/teaching_claude_why_replication @ `639d85c`.
|
| 115 |
-
Built with `src/experiments/build_toolcalling_mixture.py`, trained with
|
| 116 |
-
`src/experiments/train_lora.py --config configs/train_lora_toolcalling.yaml`.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: Qwen/Qwen3.6-27B
|
| 3 |
+
library_name: peft
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
tags:
|
| 6 |
+
- lora
|
| 7 |
+
- peft
|
| 8 |
+
- sft
|
| 9 |
+
- trl
|
| 10 |
+
- alignment
|
| 11 |
+
- agentic-misalignment
|
| 12 |
+
- tool-use
|
| 13 |
+
datasets:
|
| 14 |
+
- LASR-Callum/2026-07-31-toolcalling-tulu-20-80-mixture
|
| 15 |
+
- LASR-Callum/2026-07-29-synthdoc-approved-constitution-sft
|
| 16 |
+
- LASR-Callum/2026-07-31-tulu3-replay-80-pct-qwen36-mixture
|
| 17 |
+
license: apache-2.0
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Qwen3.6-27B β tool-calling + TULU3 LoRA (**20/80** mixture)
|
| 21 |
+
|
| 22 |
+
LoRA adapter for [`Qwen/Qwen3.6-27B`](https://huggingface.co/Qwen/Qwen3.6-27B). The 20% target
|
| 23 |
+
portion is **entirely agentic tool-use data** β conversations where the model itself is the actor
|
| 24 |
+
holding live tools β and the other 80% is TULU3 replay.
|
| 25 |
+
|
| 26 |
+
This is the pure-tool-calling cell of a family that holds total tokens and the 20% target share
|
| 27 |
+
fixed and varies only the **composition** of that 20%:
|
| 28 |
+
|
| 29 |
+
| Arm | 20% composition | ODCV-Bench | Agentic-misalignment |
|
| 30 |
+
|---|---|---|---|
|
| 31 |
+
| [base (no SFT)](https://huggingface.co/Qwen/Qwen3.6-27B) | β | 37.2% | 65.5% |
|
| 32 |
+
| [`β¦-difficult-advice-tulu-lora-20-80`](https://huggingface.co/LASR-Callum/2026-07-28-qwen36-difficult-advice-tulu-lora-20-80) | difficult-advice only | 19.2% | 25.3% |
|
| 33 |
+
| [`β¦-threeway-constitution-lora`](https://huggingface.co/LASR-Callum/2026-07-30-qwen36-threeway-constitution-lora) | equal thirds: embodied / difficult-advice / agentic | not yet run | not yet run |
|
| 34 |
+
| **this** | **agentic tool-use only** | **not yet run** | **not yet run** |
|
| 35 |
+
| [`β¦-tulu-100pct-lora`](https://huggingface.co/LASR-Callum/2026-07-30-qwen36-tulu-100-pct-lora) | none (zero-dose control) | β | β |
|
| 36 |
+
|
| 37 |
+
## Training mixture
|
| 38 |
+
|
| 39 |
+
Published in full as
|
| 40 |
+
[`LASR-Callum/2026-07-31-toolcalling-tulu-20-80-mixture`](https://huggingface.co/datasets/LASR-Callum/2026-07-31-toolcalling-tulu-20-80-mixture).
|
| 41 |
+
|
| 42 |
+
| Source | Examples | Tokens | Share | Rendering |
|
| 43 |
+
|---|---:|---:|---:|---|
|
| 44 |
+
| agentic tool-use (`approved_agentic`, `fullthink`) | 124 | 297,894 | 19.96% | reasoning kept where the source had it; **no** empty think blocks |
|
| 45 |
+
| TULU3 replay | 1,878 | 1,194,548 | 80.04% | **no** `<think>` block at all |
|
| 46 |
+
| **Total** | **2,002** | **1,492,442** | | |
|
| 47 |
+
|
| 48 |
+
25 of the 124 agentic documents actually emit tool calls
|
| 49 |
+
β 92 `<tool_call>` spans in Qwen3.6's XML dialect, all verified balanced.
|
| 50 |
+
|
| 51 |
+
## Training
|
| 52 |
+
|
| 53 |
+
bf16 LoRA (not QLoRA β bitsandbytes does not reliably cover this model's hybrid
|
| 54 |
+
linear-attention/SSM layers), 1ΓH100 80GB SXM, **1h38m09s**.
|
| 55 |
+
|
| 56 |
+
| | |
|
| 57 |
+
|---|---|
|
| 58 |
+
| r / alpha / dropout | 32 / 64 / 0.05 |
|
| 59 |
+
| target modules | regex scoped to `model.language_model.*` (q/k/v/o/gate/up/down proj) |
|
| 60 |
+
| epochs / steps | 1 / 126 |
|
| 61 |
+
| batch x grad-accum | 1 x 16 |
|
| 62 |
+
| lr / schedule | 1e-4, cosine, 3% warmup, annealed to 0 |
|
| 63 |
+
| max seq len / packing | **4096** / off |
|
| 64 |
+
| `assistant_only_loss` | false |
|
| 65 |
+
| seed | 0 |
|
| 66 |
+
| trainable params | 159.4M |
|
| 67 |
+
|
| 68 |
+
**Loss:** 2.7528 β **1.057**
|
| 69 |
+
(epoch average); the last logged step (125) read
|
| 70 |
+
1.0199. Epoch-average mean token accuracy
|
| 71 |
+
**0.7071**, final grad_norm 0.3573,
|
| 72 |
+
1,492,498 tokens consumed.
|
| 73 |
+
|
| 74 |
+
Curves and the full log history are in
|
| 75 |
+
[`LASR-Callum/2026-07-31-toolcalling-tulu-sft-run`](https://huggingface.co/datasets/LASR-Callum/2026-07-31-toolcalling-tulu-sft-run).
|
| 76 |
+
|
| 77 |
+
### Why `max_seq_len` is 4096 and the sibling arms use 2048
|
| 78 |
+
|
| 79 |
+
These agentic conversations run 9β13 turns with a median of 2,348 tokens, and 99 of the 151 source
|
| 80 |
+
documents exceed 2048. Measured: a 2048 cap keeps only 80.4% of the corpus and **severs 11 of its
|
| 81 |
+
98 `<tool_call>` spans**, inside exactly the long conversations the tool calls live in. At 4096 the
|
| 82 |
+
mixture is truncated nowhere at all. The cost is that this arm differs from its siblings on one
|
| 83 |
+
hyperparameter as well as on composition β read the head-to-head with that caveat.
|
| 84 |
+
|
| 85 |
+
## Known caveats
|
| 86 |
+
|
| 87 |
+
1. **Reasoning density.** Only **30 of the 124 agentic rows (24%) carry a real
|
| 88 |
+
reasoning trace**, against every target example in the difficult-advice 20/80 arm. If the
|
| 89 |
+
dose-response in this family is driven by reasoning rather than topic coverage, that is
|
| 90 |
+
confounded with the composition change here. Inherent to the source corpus.
|
| 91 |
+
2. **`target_modules` only half-applies.** Qwen3.6-27B is hybrid: `q/k/v/o_proj` exist in 16 of 64
|
| 92 |
+
layers, the rest being linear-attention blocks with different module names. `gate/up/down_proj`
|
| 93 |
+
attach to all 64. So this adapter tunes MLP throughout but attention in only a quarter of the
|
| 94 |
+
stack. Same for every arm in the family, so comparisons are unaffected.
|
| 95 |
+
3. **Not yet evaluated.** No ODCV-Bench or agentic-misalignment number exists for this arm yet.
|
| 96 |
+
|
| 97 |
+
## Usage
|
| 98 |
+
|
| 99 |
+
```python
|
| 100 |
+
from peft import PeftModel
|
| 101 |
+
from transformers import AutoModelForImageTextToText
|
| 102 |
+
|
| 103 |
+
model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3.6-27B", dtype="bfloat16")
|
| 104 |
+
model = PeftModel.from_pretrained(model, "LASR-Callum/2026-07-31-wrongly-trained-qwen36-toolcalling-tulu-lora-20-80")
|
| 105 |
+
model = model.merge_and_unload() # vLLM LoRA support for this hybrid arch is unproven
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
Use `AutoModelForImageTextToText`, not `AutoModelForCausalLM` β this is a vision-language
|
| 109 |
+
checkpoint. Merging drops the base model's 15 `mtp.*` tensors, so speculative decoding needs them
|
| 110 |
+
grafted back.
|
| 111 |
+
|
| 112 |
+
## Provenance
|
| 113 |
+
|
| 114 |
+
Repository https://github.com/Matthew-Bozoukov/teaching_claude_why_replication @ `639d85c`.
|
| 115 |
+
Built with `src/experiments/build_toolcalling_mixture.py`, trained with
|
| 116 |
+
`src/experiments/train_lora.py --config configs/train_lora_toolcalling.yaml`.
|