Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,136 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
##
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
| 45 |
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
|
|
|
| 55 |
|
| 56 |
-
|
| 57 |
|
| 58 |
-
|
|
|
|
| 59 |
|
| 60 |
-
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
|
|
|
| 65 |
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
-
##
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
### Training Data
|
| 79 |
-
|
| 80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
-
|
| 84 |
-
### Training Procedure
|
| 85 |
-
|
| 86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
-
|
| 103 |
-
## Evaluation
|
| 104 |
-
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
-
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
-
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: tiiuae/Falcon-H1-0.5B-Base
|
| 3 |
+
tags:
|
| 4 |
+
- dpo
|
| 5 |
+
- neuromorphic
|
| 6 |
+
- bnn
|
| 7 |
+
- hybrid-intelligence
|
| 8 |
+
- falcon
|
| 9 |
+
- reasoning
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
language:
|
| 12 |
+
- en
|
| 13 |
+
- ar
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# Merlin Hybrid Intelligence Checkpoint
|
| 18 |
|
| 19 |
+

|
| 20 |
|
| 21 |
+
This is the **first public checkpoint of a hybrid intelligence system** from Merlin Research.
|
| 22 |
|
| 23 |
+
Hybrid intelligence means the system is not purely statistical (LLM) and not purely
|
| 24 |
+
symbolic — it couples a language model with a neuromorphic Biological Neural Network (BNN)
|
| 25 |
+
that observes, evaluates, and selects the LLM's outputs in real time.
|
| 26 |
+
The two components evolve together: the LLM generates, the BNN judges,
|
| 27 |
+
and both improve from the same stream of experience.
|
| 28 |
|
| 29 |
+
## Architecture: Two Systems, One Loop
|
| 30 |
|
| 31 |
+

|
| 32 |
|
| 33 |
+
The LLM (Falcon H1 0.5B) generates multiple candidate answers.
|
| 34 |
+
The BNN encodes uncertainty signals as neuromorphic spike trains and selects
|
| 35 |
+
the best candidate. The correctness of that selection feeds back as training
|
| 36 |
+
signal for both the BNN and (via DPO) the LLM itself.
|
| 37 |
|
| 38 |
+
## The BNN Component
|
| 39 |
|
| 40 |
+
The BNN is inspired by biological neural circuits. It uses
|
| 41 |
+
**Leaky Integrate-and-Fire (LIF) neurons** with 4 time scales
|
| 42 |
+
(decay constants: 0.70, 0.80, 0.85, 0.95) and generates spikes
|
| 43 |
+
via **Poisson statistics** — the same model used to describe
|
| 44 |
+
real neuron firing in cortex. This gives the selector a temporal
|
| 45 |
+
memory of the generation process, not just a snapshot.
|
|
|
|
| 46 |
|
| 47 |
+
```
|
| 48 |
+
LIF bank (4 neurons) → SpikeMLP → spike_rate
|
| 49 |
+
Token entropy stream → encoded as Poisson spike train
|
| 50 |
+
SelectionMLP [8→32→16→1] → candidate score
|
| 51 |
+
```
|
| 52 |
|
| 53 |
+
Runs entirely in **pure NumPy** — no GPU, no special hardware.
|
| 54 |
+
Total weights: ~8 KB.
|
| 55 |
|
| 56 |
+
## Key Discovery: Calibration Inversion
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
> **A small LLM is systematically more confident on wrong answers than on right ones.**
|
| 59 |
|
| 60 |
+
We measured first-token entropy across thousands of hybrid loop iterations.
|
| 61 |
+
Correct answers show *higher* entropy and *lower* probability margin than wrong ones
|
| 62 |
+
(t=2.28 and t=−3.41 respectively). The LLM "hesitates" more when it is actually correct.
|
| 63 |
|
| 64 |
+
This is the core insight the BNN learned to exploit. Rather than trusting the
|
| 65 |
+
model's confidence, the hybrid system uses neuromorphic signals to see past
|
| 66 |
+
the model's miscalibration and identify the genuinely better answer.
|
| 67 |
|
| 68 |
+
## How the System Was Built: 30,000 Experiments
|
| 69 |
|
| 70 |
+
Merlin runs **6 autonomous researchers** every night (01:00–07:00):
|
| 71 |
|
| 72 |
+
| Process | Role |
|
| 73 |
+
|---|---|
|
| 74 |
+
| `hybrid` | Main hybrid loop — generates, encodes, selects, evaluates |
|
| 75 |
+
| `bnn_trainer` | Retrains BNN every 5 min from accumulated experience |
|
| 76 |
+
| `candidate_pool` | Generates diverse candidates (4 sampling strategies) |
|
| 77 |
+
| `neuro_coupling` | BNN-guided token-by-token temperature adjustment |
|
| 78 |
+
| `ml` | Collects DPO preference pairs for LLM fine-tuning |
|
| 79 |
+
| `meta_analyzer` | Updates evolutionary mutation weights before each session |
|
| 80 |
|
| 81 |
+
Encoder parameters (pulse width, burst count, frequency, entropy scale) are found
|
| 82 |
+
by **evolutionary search** — propose mutation, run 100 benchmark questions,
|
| 83 |
+
keep if improvement ≥ 0.5pp. This process ran for ~**30,000 experiments**
|
| 84 |
+
and produced 38+ confirmed improvements before this checkpoint.
|
| 85 |
|
| 86 |
+
## Results
|
| 87 |
|
| 88 |
+
| System | Accuracy |
|
| 89 |
+
|---|---|
|
| 90 |
+
| Raw Falcon H1 0.5B (baseline) | 21.0% |
|
| 91 |
+
| Hybrid Intelligence (BNN + LLM) | ~26–28% |
|
| 92 |
|
| 93 |
+
**+5–7 percentage points** improvement. The gap is entirely from the hybrid loop —
|
| 94 |
+
the BNN selector adds no latency perceivable to the user (~1ms overhead).
|
| 95 |
|
| 96 |
+
## DPO Fine-Tuning
|
| 97 |
|
| 98 |
+
The LLM component was fine-tuned with DPO on **4,234 preference pairs**
|
| 99 |
+
collected autonomously by the `ml` researcher over multiple nights.
|
| 100 |
|
| 101 |
+
- LoRA: r=16, α=32, target modules: q_proj + v_proj
|
| 102 |
+
- β=0.1, 3 epochs, cosine schedule
|
| 103 |
|
| 104 |
+
## Usage
|
| 105 |
|
| 106 |
+
```python
|
| 107 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 108 |
|
| 109 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 110 |
+
"MerlinSafety/falcon-h1-0.5b-dpo",
|
| 111 |
+
trust_remote_code=True,
|
| 112 |
+
)
|
| 113 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 114 |
+
"MerlinSafety/falcon-h1-0.5b-dpo",
|
| 115 |
+
trust_remote_code=True,
|
| 116 |
+
)
|
| 117 |
|
| 118 |
+
prompt = "Question: What is the capital of France?\nAnswer:"
|
| 119 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 120 |
+
out = model.generate(**inputs, max_new_tokens=40, do_sample=False)
|
| 121 |
+
print(tokenizer.decode(out[0][inputs['input_ids'].shape[1]:]))
|
| 122 |
+
```
|
| 123 |
|
| 124 |
+
## Status & Roadmap
|
| 125 |
|
| 126 |
+
This is **Checkpoint #1**. The hybrid loop continues to run and improve.
|
| 127 |
|
| 128 |
+
- [ ] Stronger base model (Qwen2.5-Math-1.5B or any Qwen3.5)
|
| 129 |
+
- [ ] Scale DPO dataset to 10,000+ pairs
|
| 130 |
+
- [ ] Online BNN adaptation during inference
|
| 131 |
+
- [ ] Multi-model candidate pool
|
| 132 |
+
- [ ] We hope to collaborate with [Cortical Labs](https://corticallabs.com) —
|
| 133 |
+
running the hybrid loop on biological neurons (CL1) as a true wetware selector
|
| 134 |
|
| 135 |
+
---
|
| 136 |
+
*Merlin Research — building hybrid intelligence, one checkpoint at a time.*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|