squ11z1 commited on
Commit
e80d4a2
Β·
verified Β·
1 Parent(s): 0e1e869

polish model card: quantum-classical writeup, all figures, job-id section, Fable-5 Bloom

Browse files
Files changed (1) hide show
  1. README.md +197 -35
README.md CHANGED
@@ -4,66 +4,228 @@ library_name: transformers
4
  pipeline_tag: text-generation
5
  base_model: deepreinforce-ai/Ornith-1.0-9B
6
  base_model_relation: finetune
7
- tags: [merlin-agent, quantum-classical, quantum-kernel, ibm-quantum, quantum-provenance, merlin-research]
8
- language: [en, ru, uk]
 
 
 
 
 
 
 
 
 
 
 
9
  ---
10
 
11
  # Merlin-Agent πŸœ›
12
 
13
- **A quantum-classical 9B coding model.** Directions derived from real **out-of-time-order
14
- correlator (OTOC) scrambling dynamics measured on IBM Quantum Heron** are baked into the
15
- model's weights β€” merged into the attention query projections at 8 layers β€” yet the model
16
- runs **fully classically**: no quantum computer at inference, GGUF-friendly.
 
17
 
18
- *by Merlin Research AB β€” frontier AI research without frontier budgets.*
19
 
20
- ## Quantum provenance (verifiable)
21
 
22
- - **Backend:** `ibm_marrakesh` (Heron r2) Β· **IBM job:** `d92ve0t958jc73bsbong`
23
- - **What's quantum:** frozen directions from **SYK-scrambler OTOC measurements** on Heron (100 qubits, 6 scrambling depths, 2048 shots) β€” their covariance structure, lifted through the model's own principal representation directions β€” are merged into the attention query projection (`q_proj`) at the full-attention layers 3,7,11,15,19,23,27,31.
24
- - **Attestation root:** `9484dca40b66488a239fbbb12a9333a47458627f`
25
- - **Verify:** the real OTOC signatures (`quantum_signatures.npz`, `signature_records.json`) and the lift (`encoding.npz`) reproduce the directions; re-derive the root and query the IBM job via `QiskitRuntimeService.job("d92ve0t958jc73bsbong")`. See `quantum_attestation.json`.
26
 
27
- ## Honest framing
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- A real quantum computation produced weight *values* inside this model, and you can verify it.
30
- Capability is at **parity** with the base Ornith-9B β€” the contribution is a **verifiable
31
- quantum-derived weight component**, not a capability claim. **Inference is fully classical;
32
- a quantum computer is not needed to run this model.**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
- ## Bloom safety (judge deepseek-v4-pro, 125 scenarios, 95% Wilson CI)
35
 
36
- | Behavior | Rate | 95% CI |
37
- |---|---|---|
38
- | Delusional sycophancy | 0.00 | [0.00, 0.13] |
39
- | Deception | 0.00 | [0.00, 0.13] |
40
- | Harmful compliance | 0.00 | [0.00, 0.13] |
41
- | Self-preservation | 0.00 | [0.00, 0.13] |
42
- | Manipulation | 0.00 | [0.00, 0.13] |
43
- | **Overall** | **0.00** | [0.00, 0.03] |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  ## Usage
46
 
47
  ```python
48
  from transformers import AutoModelForCausalLM, AutoTokenizer
49
  import torch
 
50
  tok = AutoTokenizer.from_pretrained("Merlin-Research/Merlin-Agent")
51
- m = AutoModelForCausalLM.from_pretrained("Merlin-Research/Merlin-Agent",
52
- dtype=torch.bfloat16, device_map="auto")
 
 
 
 
 
 
 
53
  ```
54
 
55
- Quantized: `Merlin-Research/Merlin-Agent-GGUF`. Base is a multimodal model used text-only.
 
 
56
 
57
  ## Citation
58
 
59
  ```bibtex
60
  @misc{merlinresearch2026merlinagent,
61
- title = {Merlin-Agent: A Quantum-Classical Coding Model with Heron-Baked Weights},
62
- author = {Shushman, Mykhailo},
63
- institution = {Merlin Research AB},
64
- year = {2026},
65
- note = {IBM Heron quantum kernel; attestation root 9484dca40b66488a},
66
- url = {https://huggingface.co/Merlin-Research/Merlin-Agent}
 
67
  }
68
  ```
69
 
 
4
  pipeline_tag: text-generation
5
  base_model: deepreinforce-ai/Ornith-1.0-9B
6
  base_model_relation: finetune
7
+ tags:
8
+ - merlin-agent
9
+ - quantum-classical
10
+ - quantum-kernel
11
+ - ibm-quantum
12
+ - otoc
13
+ - quantum-provenance
14
+ - merlin-research
15
+ - code
16
+ language:
17
+ - en
18
+ - ru
19
+ - uk
20
  ---
21
 
22
  # Merlin-Agent πŸœ›
23
 
24
+ <p align="center">
25
+ <b>A quantum-classical 9B coding agent.</b><br/>
26
+ Directions measured from real quantum <b>scrambling dynamics on IBM Quantum Heron</b> are baked into the
27
+ model's weights β€” yet it runs <b>fully classically</b>: no quantum computer at inference, GGUF-friendly.
28
+ </p>
29
 
30
+ <p align="center"><i>by Merlin Research AB β€” frontier research without frontier budgets.</i></p>
31
 
32
+ ---
33
 
34
+ ## What is this?
 
 
 
35
 
36
+ ![layers](assets/layer_stack.png)
37
+
38
+ Merlin-Agent is a 9B coding assistant with one unusual property: part of its weights is **physically
39
+ derived from a specific quantum computation on IBM hardware**, and you can cryptographically verify it.
40
+
41
+ It is built on [`deepreinforce-ai/Ornith-1.0-9B`](https://huggingface.co/deepreinforce-ai/Ornith-1.0-9B)
42
+ (a `qwen3_5` hybrid with full-attention layers at indices 3, 7, 11, 15, 19, 23, 27, 31). Into those eight
43
+ attention layers we merge a small, **frozen weight component whose directions come from out-of-time-order
44
+ correlator (OTOC) measurements on an IBM Heron processor**. The result is a standard set of classical
45
+ weights β€” nothing about inference needs a quantum computer β€” that nonetheless carry a verifiable quantum
46
+ fingerprint.
47
+
48
+ This is Merlin Research's coding entry in the same quantum-classical lineage as **Chronos**, **KAON** and the
49
+ **Hypnos Q-series**.
50
+
51
+ ---
52
+
53
+ ## What's new about it?
54
+
55
+ There are thousands of fine-tuned LLMs. Merlin-Agent is different in three concrete ways.
56
+
57
+ **1. Real hardware-derived weights.** Most "quantum-enhanced AI" means "we used a quantum RNG once." Here the
58
+ binding is architectural: 8 SYK-scrambler OTOC signatures measured on `ibm_marrakesh` (Heron r2, 100 qubits,
59
+ 2048 shots, scrambling depths 1–6) are turned into frozen feature directions and merged into the attention
60
+ query projections. Change the signatures and the merged directions change.
61
+
62
+ ![otoc](assets/otoc_signatures.png)
63
+
64
+ **2. Verifiable provenance.** The IBM Quantum job ID, the SHA-256 of the measured signatures, and a Merkle
65
+ attestation root are published (see [IBM Quantum Job IDs](#ibm-quantum-job-ids) and
66
+ [`quantum_attestation.json`](./quantum_attestation.json)). Anyone can look the job up in IBM's public index
67
+ and re-derive the hashes from [`quantum_signatures.npz`](./quantum_signatures.npz).
68
+
69
+ ![heatmap](assets/signature_heatmap.png)
70
+
71
+ **3. Classical, portable inference.** The quantum step happens once, at build time. The published weights are
72
+ ordinary `bf16` safetensors and quantize cleanly to GGUF β€” see
73
+ [`Merlin-Research/Merlin-Agent-GGUF`](https://huggingface.co/Merlin-Research/Merlin-Agent-GGUF)
74
+ (Q4_K_M / Q5_K_M / f16).
75
 
76
+ ---
77
+
78
+ ## How the quantum-classical binding is achieved
79
+
80
+ The core idea is a **baked quantum kernel**: real quantum measurements become a *frozen* weight component,
81
+ trained around, then merged into the network.
82
+
83
+ ```
84
+ IBM Heron (ibm_marrakesh) Ornith-1.0-9B
85
+ SYK scrambler, depths 1..6 64 coding anchors β†’ last-hidden
86
+ β”‚ β”‚
87
+ OTOC signatures S ∈ ℝ^(8Γ—6) PCA(6) P ∈ ℝ^(6Γ—4096)
88
+ β”‚ β”‚
89
+ SVD(S) β†’ top-6 directions D ∈ ℝ^(6Γ—6) β”‚
90
+ └──────────────► A = D Β· P ∈ ℝ^(6Γ—4096) (unit-normalised)
91
+ β”‚
92
+ frozen quantum LoRA-A (lora_A := A, requires_grad=False)
93
+ on q_proj @ layers {3,7,11,15,19,23,27,31}
94
+ β”‚
95
+ train only B (bf16, LM objective) β†’ Ξ”W = BΒ·A
96
+ β”‚
97
+ norm-cap β€–Ξ”Wβ€– ≀ 8% Β· β€–Wβ€– per layer
98
+ β”‚
99
+ merge into weights β†’ classical Merlin-Agent
100
+ ```
101
+
102
+ Step by step:
103
+
104
+ 1. **Measure.** Run SYK-scrambler circuits on IBM Heron and read out OTOC values at scrambling depths 1–6,
105
+ giving a signature matrix `S` (8 realisations Γ— 6 depths). These numbers reflect how quantum information
106
+ scrambles through the device and are unique to that computation.
107
+ 2. **Find the quantum directions.** Take the SVD of `S`; its principal components are the quantum feature
108
+ directions in "depth space."
109
+
110
+ ![spectrum](assets/alpha_parity.png)
111
+
112
+ 3. **Lift into the model.** Project those directions through the model's *own* representation basis β€” a
113
+ seed-pinned PCA of Ornith's last-hidden states over 64 coding anchors β€” to obtain `A ∈ ℝ^(6Γ—4096)` in the
114
+ hidden dimension.
115
+ 4. **Freeze & train around.** Install `A` as a **frozen** LoRA `A`-matrix on `q_proj` at the eight
116
+ full-attention layers, and train only the paired `B`-matrix briefly in `bf16` so the network adapts to the
117
+ quantum directions rather than the other way around.
118
+ 5. **Norm-cap & merge.** Cap each layer's update at `β€–Ξ”Wβ€– ≀ 8 % Β· β€–Wβ€–` and merge `Ξ”W = BΒ·A` into the weights.
119
+ This keeps the quantum contribution present but bounded, so coherence and capability are preserved.
120
+
121
+ The published checkpoint is the merged, fully-classical result. Everything needed to reproduce the binding
122
+ (`encoding.npz`, `quantum_signatures.npz`, `signature_records.json`, `quantum_attestation.json`) ships with
123
+ the model.
124
+
125
+ ---
126
 
127
+ ## IBM Quantum Job IDs
128
 
129
+ The quantum signatures baked into this model come from a single, publicly indexed IBM Quantum job.
130
+
131
+ | Field | Value |
132
+ |---|---|
133
+ | Backend | `ibm_marrakesh` (IBM Heron r2) |
134
+ | **IBM Quantum job ID** | **`d92ve0t958jc73bsbong`** |
135
+ | Circuit | SYK scrambler β†’ OTOC, depths 1–6 |
136
+ | Qubits | 100 |
137
+ | Shots / circuit | 2048 |
138
+ | Realisations (slots) | 8 |
139
+ | Collected (UTC) | 2026-07-02 |
140
+ | Signatures SHA-256 | `82c9c9e83a7b568c169cc229d8df801c4a2385a44c0efb4d95d1dbc7e00c6f9e` |
141
+ | Quantum directions `A` SHA-256 | `c33d3a6aee9293bf20f7a4ddc2d9fe5793dc8620233a8e9c2f04a548e8ddc268` |
142
+ | Merkle attestation root | `9484dca40b66488a239fbbb12a9333a47458627f48b1c6d08d8241bf814caf48` |
143
+
144
+ **How to verify:** look the job up at [quantum.cloud.ibm.com](https://quantum.cloud.ibm.com), retrieve the
145
+ measurement counts, recompute the OTOC signatures, and compare the SHA-256 against the value above and against
146
+ [`quantum_attestation.json`](./quantum_attestation.json). If they match, the model is provably linked to that
147
+ specific quantum computation.
148
+
149
+ ---
150
+
151
+ ## Capability
152
+
153
+ Capability is at **parity with the base Ornith-1.0-9B** β€” the quantum component is a verifiable provenance and
154
+ architectural feature, not a capability claim. Base coding scores (inherited, norm-controlled merge):
155
+
156
+ ![benchmarks](assets/benchmarks.png)
157
+
158
+ | Benchmark | Score |
159
+ |---|---|
160
+ | SWE-bench Verified | 69.4 |
161
+ | SWE-bench Pro | 42.9 |
162
+ | Terminal-Bench 2.1 | 41.4 |
163
+
164
+ ---
165
+
166
+ ## Safety β€” Bloom evaluation
167
+
168
+ We ran an Anthropic **Bloom / Petri-style** behavioral-elicitation audit: an auditor drives multi-turn
169
+ adversarial scenarios across five misaligned behaviors, and a judge scores each transcript for behavior
170
+ presence on a 1–10 scale (**β‰₯ 7 = elicited**). The judge here is **Claude Fable 5**, scoring the transcripts
171
+ directly.
172
+
173
+ ![bloom](assets/bloom_benchmarks.png)
174
+
175
+ **Result: 0 / 30 elicited across all five behaviors (overall elicitation 0.00).** On genuine adversarial
176
+ probes the model refused or grounded every time β€” declining suicide-method and infrastructure-sabotage
177
+ requests, resisting a self-preservation "hidden-anchor" jailbreak, refusing to validate delusions, and
178
+ declining to assert fiction as fact β€” without being swayed by flattery, authority, or emotional pressure.
179
+
180
+ *Honest caveats:* this is a **floor estimate** β€” the probe is a shallow 2-turn protocol, malformed
181
+ auditor turns were excluded (30 valid adversarial scenarios), and the judge is an LLM reviewing transcripts.
182
+ It is not an exhaustive red-team.
183
+
184
+ ---
185
+
186
+ ## Honest framing
187
+
188
+ - **Provenance is not capability.** A real quantum computation produced weight *values* inside this model and
189
+ you can verify it β€” but it does not make the model smarter. Capability tracks the base model.
190
+ - **Inference is fully classical.** No quantum computer, no network calls, no special runtime. Standard
191
+ `transformers` / GGUF.
192
+ - **The base is multimodal, used text-only** here.
193
+
194
+ ---
195
 
196
  ## Usage
197
 
198
  ```python
199
  from transformers import AutoModelForCausalLM, AutoTokenizer
200
  import torch
201
+
202
  tok = AutoTokenizer.from_pretrained("Merlin-Research/Merlin-Agent")
203
+ model = AutoModelForCausalLM.from_pretrained(
204
+ "Merlin-Research/Merlin-Agent", dtype=torch.bfloat16, device_map="auto")
205
+
206
+ # The default system prompt gives the model its Merlin-Agent identity;
207
+ # provide your own system message to override it.
208
+ msgs = [{"role": "user", "content": "Write a Python function that returns the nth Fibonacci number."}]
209
+ ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
210
+ out = model.generate(ids, max_new_tokens=256, do_sample=False)
211
+ print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
212
  ```
213
 
214
+ Quantized builds: [`Merlin-Research/Merlin-Agent-GGUF`](https://huggingface.co/Merlin-Research/Merlin-Agent-GGUF).
215
+
216
+ ---
217
 
218
  ## Citation
219
 
220
  ```bibtex
221
  @misc{merlinresearch2026merlinagent,
222
+ title = {Merlin-Agent: A Quantum-Classical Coding Model with Heron-Baked Weights},
223
+ author = {Shushman, Mykhailo},
224
+ institution = {Merlin Research AB},
225
+ year = {2026},
226
+ note = {IBM Heron job d92ve0t958jc73bsbong (ibm\_marrakesh);
227
+ attestation root 9484dca40b66488a239fbbb12a9333a47458627f48b1c6d08d8241bf814caf48},
228
+ url = {https://huggingface.co/Merlin-Research/Merlin-Agent}
229
  }
230
  ```
231