TheEpiales's picture
Release Project Norn: K-Mini 4B (Q4_K_M GGUF + Stock Ollama Modelfile + Titans-NCM CUDA Sidecar & Verified Benchmarks)
231468b verified
|
Raw History Blame Contribute Delete
14.4 kB
---
license: apache-2.0
base_model: Qwen/Qwen3-4B-Base
language:
- en
pipeline_tag: text-generation
library_name: gguf
tags:
- gguf
- ollama
- llama-cpp
- qwen3
- agentic
- tool-calling
- code
- math
- neuro-symbolic
- titans
- hrr
- norn
- k-mini
- edge-ai
---
<div align="center">
<img src="./osakra_research_logo.png" width="420" alt="Osakra Research Logo" />
# Project Norn: K-Mini 4B & Titans-NCM
### Local Code Generation, Multi-Turn Tool Calling, and Neuro-Symbolic Executive Routing for 8GB Edge Devices
**Osakra Research • November 2026**
<img src="./norn_avatar.png" width="130" alt="Project Norn Avatar" />
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Base Backbone](https://img.shields.io/badge/Backbone-Qwen3--4B--Base-00ffc4.svg)](https://huggingface.co/Qwen/Qwen3-4B-Base)
[![Active Parameters](https://img.shields.io/badge/Parameters-4.02B%20Dense%20%2B%20Titans--NCM-blueviolet.svg)](https://huggingface.co/TheEpiales/Project-Norn-K-Mini-4B)
[![HumanEval pass@1](https://img.shields.io/badge/HumanEval%20pass%401-83.54%25%20(137%2F164)-brightgreen.svg)](./benchmarks/live_verified_humaneval_164.json)
[![GSM8K Math](https://img.shields.io/badge/GSM8K%20Math-83.0%25%20(Strict)-orange.svg)](./benchmarks/live_verified_gsm8k_100.json)
[![MBPP Python](https://img.shields.io/badge/MBPP%20Python-77.0%25%20(77%2F100)-brightgreen.svg)](./benchmarks/live_verified_mbpp_test.json)
[![MMLU Academic](https://img.shields.io/badge/MMLU%20Academic-70.0%25%20(57%20Subj)-yellow.svg)](https://huggingface.co/datasets/cais/mmlu)
[![45-Pillar Executive Suite](https://img.shields.io/badge/45--Pillar%20Suite-86.67%25%20(39%2F45)-brightgreen.svg)](./benchmarks/executive_suite_45_results.json)
[![Active VRAM Footprint](https://img.shields.io/badge/Active%20VRAM-4.8%20GB%20(8192%20ctx)-informational.svg)](https://github.com/ggerganov/llama.cpp)
</div>
---
## Model Summary & Architectural Transparency
**Project Norn: K-Mini 4B** is the 4.02-billion parameter edge-native successor in the Project Norn series by **Osakra Research**. Built on `Qwen3-4B-Base` and fine-tuned across verifiable coding, math, and error-recovery agent trajectories, it is engineered to run entirely within a consumer **8 GB VRAM envelope** (requiring **4.8 GB VRAM** with an 8,192-token context window in `Q4_K_M` quantization at **~70 tokens/second**).
### What Is Included in This Repository (Two Operating Modes)
To ensure complete academic honesty and out-of-the-box usability across standard runtimes, this release provides both the **standalone GGUF backbone** and the **optional Python/CUDA Titans-NCM executive sidecar**:
1. **Mode A — Standalone GGUF (`k-mini-Q4_K_M.gguf` + `Modelfile`):**
- Runs natively on **100% unmodified stock Ollama, `llama.cpp`, and LM Studio**—no custom C++ patches or custom Ollama binaries required.
- Uses in-vocabulary neurochemical conditioning tokens (`<|state:acetylcholine|>`, `<|state:serotonin|>`, `<|state:dopamine|>`, `<|state:boredom_decay|>`) trained directly into the 4.02B weights.
- Achieves **83.54% HumanEval (`137/164`)**, **83.0% GSM8K (`83/100`)**, **77.0% MBPP (`77/100`)**, **70.0% MMLU (`70/100`)**, **82.22% (`37/45`)** on the 45-Pillar Executive Suite, and **100.0% (`50/50`)** first-turn tool routing and state token adherence.
2. **Mode B — Full Neuro-Symbolic Stack (`neuro_symbolic_ncm/ncm_server.py` + `hrr_adapter.pt` + `swarm_proxy.py`):**
- Wraps the 4B GGUF engine with our PyTorch/CUDA **Titans-NCM Executive Router** (`port 8092`) and **Swarm Proxy** (`port 1234`).
- Loads the trained 10,000-dimension Holographic Reduced Representation adapter (`hrr_adapter.pt`, `2560 -> 512 -> 10000 -> 512 -> 2560` via FFT circular convolution) and the 2,560-dimension `TitansConceptMemory` ($\mathbf{M}_t$) module to track surprise norms $\|\mathbf{S}_t\|_2$ and episodic recall across turns.
- Lifts performance on the 45-Pillar Executive Reasoning Suite from **82.22% (`37/45`)** to **86.67% (`39/45`, 9/15 flawless pillars)** while maintaining **100.0% (`50/50`)** tool routing accuracy.
> [!NOTE]
> **Architecture Evolution Note (Why Custom Ollama Builds Are No Longer Required):**
> In earlier Project Norn prototypes (V17–V21), experimental HRR memory layers were coupled directly inside custom model graph code, which required custom runtime wrappers or larger 9B–14B footprints. In this release, we decoupled the architecture: neuromodulatory state routing (`<|state:*|>`) is baked directly into a standard 4.02B `Qwen3` GGUF so it runs at 70 tok/s on **stock Ollama, `llama.cpp`, and LM Studio**, while the stateful 10,000-dim HRR binding layer and Titans associative memory ($\mathbf{M}_t$) run as a modular sidecar service (`ncm_server.py`). Native in-graph custom GGML operators remain on our research roadmap for future generations.
---
## Comprehensive Industry Benchmark Leaderboard
All evaluations are bifurcated into two explicit categories:
1. **Edge Workstation Parity (Table 1):** Every model running under identical local constraints (4-bit quantization on an NVIDIA GeForce RTX 4070 Laptop GPU with 8.0 GB VRAM, greedy decoding $T=0.0$, and real Python subprocess test execution).
2. **Official Server Baselines (Table 2):** Published unquantized (BF16/FP16) numbers reported by original model authors on datacenter GPU clusters.
Every score reported for Norn K-Mini 4B is backed by raw per-problem evaluation transcripts included directly in this repository:
- [`./benchmarks/live_verified_humaneval_164.json`](./benchmarks/live_verified_humaneval_164.json) — **137 / 164 (83.54% pass@1)** in 606.3s
- [`./benchmarks/live_verified_gsm8k_100.json`](./benchmarks/live_verified_gsm8k_100.json) — **83 / 100 (83.0% strict match)** in 367.5s
- [`./benchmarks/live_verified_mbpp_test.json`](./benchmarks/live_verified_mbpp_test.json) — **77 / 100 (77.0% pass@1)** in 171.8s
- [`./benchmarks/executive_suite_45_results.json`](./benchmarks/executive_suite_45_results.json) — **37 / 45 (82.22% standalone)** / **39 / 45 (86.67% with Titans-NCM sidecar)**
### Table 1: Edge Workstation Leaderboard (4-Bit Quantized on Single 8GB Consumer GPU)
| Model | Architecture & Scale | VRAM Footprint | HumanEval `pass@1` | MBPP Sanitized | GSM8K Math | MMLU Academic | Generation Speed |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| **Norn K-Mini 4B (Ours)** | **4.02B Dense (+ NCM)** | **4.8 GB** | **83.54%** *(137/164)* | **77.0%** *(77/100)* | **83.0%** *(83/100)* | **70.0%** | ⚡ **70.0 tok/s (100% VRAM)** |
| **Gemma 4 26B-A4B (Q4)** | 26B MoE (~3.8B Active) | 15.0 GB | 73.2% *(82.0% CoT)* | 75.0% | 88.4% | 82.6% | ⚠️ 12.0 tok/s *(CPU offload)* |
| **Qwen2.5-Coder-3B (Q4)** | 3.09B Dense | 3.2 GB | 72.56% | 68.0% | 79.2% | 60.4% | 75.0 tok/s |
| **Ministral 3B (Q4)** | 3.20B Dense | 3.5 GB | 71.4% | 69.5% | 81.0% | 68.5% | 68.0 tok/s |
| **Gemma 4 E4B (Q4)** | ~4.5B Effective (PLE) | 4.8 GB | 62.1% *(68.5% CoT)* | 64.0% | 76.3% | 73.9% | 65.0 tok/s |
| **Phi-4-mini (3.8B Q4)** | 3.82B Dense | 3.9 GB | 74.0% | 71.0% | 88.2% | 71.5% | 62.0 tok/s |
| **Qwen3.8-27B (Q4)** | 27.0B Dense | 17.0 GB | 92.0% | 78.5% | 94.0% | 84.5% | ⚠️ 3.0 tok/s *(PCIe offload)* |
### Table 2: Official Unquantized Server Baselines (Technical Reports & System Cards)
| Model | Parameters | Target Precision / Environment | HumanEval `pass@1` | GSM8K Math | MMLU Academic | Official Citation Source |
| :--- | :---: | :---: | :---: | :---: | :---: | :--- |
| **Qwen3.8-27B** | 27.0B | BF16 (55 GB VRAM) | **95.5%** | **96.7%** | **86.2%** | Alibaba Qwen3.8 Technical Report |
| **Claude-3.5-Haiku** | Proprietary (~8B) | Cloud API | **88.1%** | **92.0%** | **85.0%** | Anthropic Model Card (Oct 2024) |
| **Gemma 4 26B-A4B** | 25.2B (MoE) | BF16 (52 GB VRAM) | **82.0%** *(CoT)* | **88.4%** | **82.6%** | Google DeepMind Gemma 4 Report |
| **GPT-4o-mini** | Proprietary | Cloud API | **87.0%** | **87.0%** | **82.0%** | OpenAI System Card (July 2024) |
| **Qwen2.5-Coder-3B** | 3.09B | BF16 (6.2 GB VRAM) | **84.1%** | **80.5%** | **73.6%** | Alibaba Qwen2.5-Coder Tech Report |
| **Norn K-Mini 4B (Ours)** | **4.02B** | **Q4_K_M (4.8 GB VRAM)** | **83.54%** | **83.0%** | **70.0%** | *Live Verified Automated Runner* |
| **Phi-4-mini** | 3.82B | BF16 (7.6 GB VRAM) | **74.0%** | **88.2%** | **71.5%** | Microsoft Phi-4 Technical Report |
| **Ministral 3B** | 3.20B | BF16 (6.4 GB VRAM) | **71.4%** | **81.0%** | **68.5%** | Mistral AI Ministral Report |
| **Gemma 4 E4B** | ~4.5B (PLE) | BF16 (9.0 GB VRAM) | **68.5%** *(CoT)* | **79.2%** | **73.9%** | Google DeepMind Gemma 4 Report |
### Visual Benchmark Comparisons
<div align="center">
#### Chart 1: Coding Accuracy Under Local 4-bit Quantization (HumanEval % pass@1)
<img src="./benchmarks_edge_coding.png" width="850" alt="Coding Accuracy Benchmark" />
<br><br>
#### Chart 2: Interactive Generation Speed on Single 8GB Consumer GPU (Tokens / Second)
<img src="./benchmarks_edge_speed.png" width="850" alt="Inference Speed Benchmark" />
</div>
---
## Architecture & Mathematical Foundations
```mermaid
flowchart TD
Prompt["User Input / Multi-Turn Context"] --> Router{"Titans-NCM Executive Router<br>(Optional Sidecar • Port 8092 • CUDA)"}
Router -->|State Token Injection| StateToken["Emit Modulatory State Prefix:<br>&lt;|state:acetylcholine|&gt; / &lt;|state:serotonin|&gt;"]
Router -->|Associative Recall| TitansMemory["Titans Neural Memory Bank (M_t)<br>10,000-dim HRR + Surprise Modulation"]
StateToken --> Backbone["Norn K-Mini 4B Core<br>(GGUF Q4_K_M • 8192 ctx • 4.8 GB VRAM)"]
TitansMemory --> Backbone
Backbone --> Output{"Decoded Action"}
Output -->|Tool Dispatch| ToolCall["&lt;tool_call&gt;{'name': ..., 'arguments': {...}}&lt;/tool_call&gt;"]
Output -->|Direct Prose| FinalAnswer["Methodical Step-by-Step Solution"]
```
### 1. Neurochemical Conditioning Tokens (Built into GGUF Weights)
Every assistant turn begins with an explicit conditioning token $\tau_0 \in \mathcal{V}_{\text{state}}$:
- `<|state:acetylcholine|>`: High-precision code synthesis, math, and deterministic `<tool_call>` JSON emission ($T = 0.0$).
- `<|state:serotonin|>`: Analytical explanation, counterfactual premise verification, and structured prose.
- `<|state:dopamine|>`: Divergent architectural brainstorming and creative exploration ($T \approx 0.6$).
- `<|state:noradrenaline|>`: Triggered by the NCM sidecar upon detecting tool errors or stack traces to enforce root-cause repair.
- `<|state:boredom_decay|>`: Read-only workspace inspection mode with destructive tool lockout.
### 2. Titans Recurrent Memory ($\mathbf{M}_t$) & 10,000-D HRR Adapter (Sidecar Mode)
When running with `neuro_symbolic_ncm/ncm_server.py`, user turns are projected through the trained `HRRBindingLayer` (`hrr_adapter.pt`) via FFT circular convolution:
$$\mathbf{v}_{\text{bound}} = \mathbf{a} \circledast \mathbf{b} = \mathcal{F}^{-1}\Big(\mathcal{F}(\mathbf{a}) \odot \mathcal{F}(\mathbf{b})\Big)$$
and integrated into the complex Fourier memory bank $\mathbf{M}_t$ (`titans_concept_memory.py`), tracking surprise norms $\|\mathbf{S}_t\|_2$ across multi-turn sessions.
---
## Quickstart & Deployment
### Option 1: Stock Ollama (Single Command, 4.8 GB VRAM)
No custom Ollama build is required. Using the included [`Modelfile`](./Modelfile):
```bash
ollama create norn-k-mini -f Modelfile
ollama run norn-k-mini
```
### Option 2: `llama.cpp` Server (Standalone GGUF on Port 8096)
```bash
llama-server -m k-mini-Q4_K_M.gguf -ngl 99 -c 8192 -fa on -ctk q8_0 -ctv q8_0 --jinja --alias k-mini --host 127.0.0.1 --port 8096
```
### Option 3: Full Neuro-Symbolic Stack (GGUF + Titans-NCM Sidecar + Swarm Proxy)
```bash
# 1. Start the 4B GGUF Core Engine (Port 8096)
llama-server -m k-mini-Q4_K_M.gguf -ngl 99 -c 8192 -fa on -ctk q8_0 -ctv q8_0 --jinja --alias k-mini --host 127.0.0.1 --port 8096
# 2. Start the Titans-NCM CUDA Executive Router (Port 8092)
python -m uvicorn neuro_symbolic_ncm.ncm_server:app --host 127.0.0.1 --port 8092
# 3. Start the Unified OpenAI Swarm Proxy (Port 1234)
python swarm_proxy.py --port 1234 --brain http://127.0.0.1:8096 --ncm http://127.0.0.1:8092
```
### Python OpenAI Client Usage
```python
from openai import OpenAI
# Connect to Port 8096 (standalone llama-server) or Port 1234 (Titans-NCM + Swarm Proxy)
client = OpenAI(base_url="http://127.0.0.1:1234/v1", api_key="local")
response = client.chat.completions.create(
model="norn-4b",
messages=[
{"role": "user", "content": "Write a Python function to compute the longest palindromic substring in O(N) time using Manacher's algorithm."}
],
temperature=0.0
)
print(response.choices[0].message.content)
```
---
## Training Curriculum & Provenance
The 4.02B backbone (`Qwen3-4B-Base`) was aligned across four curated datasets:
1. **Jarvis-Mini Trajectory Corpus (4,190 Trajectories):** 20 agentic task categories (filesystem navigation, shell execution, SQL, PDF generation, cron scheduling) with a **30% injected error-recovery loop** (`ENOENT`, `KeyError`, `EADDRINUSE`, `403 Forbidden`).
2. **STaR Consequence Rollouts (284 Traces):** Multi-step verifiable tool traces reinforcing strict parameter schemas.
3. **Swarm Failure DPO Pairs (254 Pairs):** Direct Preference Optimization trained on swarm logs to eliminate repetitive tool loops and overwrite traps.
4. **Epistemic Counterfactual Invariants:** Calibration examples enforcing explicit refutation of impossible historical or physical premises.
---
## Citation
```bibtex
@misc{osakra_norn_kmini_4b_2026,
title={Project Norn K-Mini 4B: Edge-Native Code Synthesis, Neuromodulatory State Dispatch, and Titans-HRR Executive Routing},
author={{Osakra Research}},
year={2026},
month={November},
howpublished={\url{https://huggingface.co/TheEpiales/Project-Norn-K-Mini-4B}},
note={Osakra Research Technical Report and Model Card}
}
```
<div align="center">
<b>Osakra Research • Sovereign Edge Intelligence</b>
</div>