Why Katana is a Big Deal
Foundation model pretraining has historically been gated behind multimillion-dollar compute clusters. Katana shatters this paradigm by executing full-scale pretraining of 1.12B parameters within a single 12 GB consumer GPU.
Conventional 32-bit Adam requires 16 bytes of optimizer state per parameter (over 17.9 GB for 1.12B params), forcing distributed ZeRO-3 offloading across data center nodes. OpenBlade's co-designed training engine leverages factored second moments and memory-pinned gradient buffers to compress total steady-state resident memory down to ~9.1 GB on a single desktop NVIDIA GeForce RTX 3060.
| Memory Component | Standard LLM Baseline | Katana 1.1B Engine | VRAM Savings |
|---|---|---|---|
| Model Weights (FP16/BF16) | 2.25 GB | 2.25 GB (Direct Pinned) | 0 GB (Identical) |
| Optimizer States | 8.98 GB (AdamW First + Second Moments) | 2.25 GB (Factored Second Moments) | -6.73 GB (-75%) |
| Gradients Buffer | 2.25 GB (Dynamic Allocate) | 2.25 GB (Fused Zero-Copy Pinned) | Zero Fragment Churn |
| Activations & Workspace | 4.50+ GB (Full Cache) | 2.35 GB (Selective Dynamic Gate Checkpoints) | -2.15 GB (-48%) |
| Peak Steady-State Resident VRAM | 17.98 GB (Exceeds 12 GB GPU) | ~9.10 GB / 12.00 GB | Fits Consumer GPU with 2.9 GB Headroom |
Exact mathematical throughput sustained across 130,500+ pretraining steps without performance degradation:
- ✓ Zero PCIe Bottlenecking: All tensors, states, and gradients remain 100% on-device.
- ✓ No CUDA OOM Crashes: 2.9 GB safety margin accommodates long sequence dynamic activations.
- ✓ Sustained 2,280 tok/s: Maximize MFU on ampere tensor cores via fused kernel operations.
Why Katana Outperforms Regular Models
Commodity foundation models assemble off-the-shelf components: generic tokenizers trained on web dumps, unmodified transformer layers, and raw web crawls. Katana delivers breakthrough efficiency through complete end-to-end vertical co-design: custom architecture, custom data, custom tokenizer, and a custom training engine.
36 dense layers with 1,536 hidden dimensions and 12 attention heads. Replaces generic attention layers with:
- Content-Conditional Positional Modulation: Dynamic attention scaling that binds tokens based on syntax roles (parentheses, scope braces, indentation levels).
- Learned Dynamic Activation Gating: Non-linear thresholding that eliminates syntactic noise before intermediate projections.
- Embedding Self-Gating: Selective feature filtering that prevents rare token variance from corrupting shared latent space.
Strictly filtered for mathematical depth, low-level systems engineering, and formal logical coherence:
- 52.1% Code & Logic: Linux kernel sources, Mono runtime, Unity ECS, IL2CPP bindings, formal math proofs, and systems engineering.
- Zero Synthetic Hallucinations: 0% distillation from closed frontier LLMs. Retains authentic human debugging, commit histories, and edge cases.
- Deep Semantic Deduplication: MinHash LSH and strict heuristic linting filtering out boilerplate and auto-generated noise.
A 65,536 vocabulary optimized specifically for programming syntax, abstract syntax trees (ASTs), and mathematical logic:
- Atomic Indentation Tokens: Multi-space blocks (2, 4, 8 spaces) encoded as single atomic tokens, eliminating token bloat in nested code.
- Preserved Dot-Syntax Identifiers: Canonical namespaces (
System.Collections.Generic) represented without fragmentation. - 30-40% Sequence Compression: 100 lines of code require 35% fewer tokens than standard Llama/Mistral tokenizers.
Built from bare metal in PyTorch and CUDA C++ to bypass framework overhead:
Why vertical co-design outperforms horizontal modularity:
When the tokenizer knows the architecture's positional bias, the architecture knows the exact distribution of code tokens, and the optimizer's learning rate schedules match the gradient dynamics of the custom gating activations, every single FLOP directly increases parameter intelligence rather than overcoming inter-layer mismatches.
Multi-Domain Synthesis Showcase
Explore live generation samples across specialized domain registers captured during pretraining. Katana demonstrates zero syntax corruption, strict typing adherence, and deep semantic comprehension.
using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
[BurstCompile]
public partial struct AgentSpatialSystem : ISystem
{
[BurstCompile]
public void OnUpdate(ref SystemState state)
{
var dt = SystemAPI.Time.DeltaTime;
var job = new SpatialParallelJob
{
DeltaTime = dt
};
state.Dependency = job.ScheduleParallel(state.Dependency);
}
[BurstCompile]
public partial struct SpatialParallelJob : IJobEntity
{
public float DeltaTime;
public void Execute(ref LocalTransform transform, in AgentKinematics kinematics)
{
float3 forward = math.forward(transform.Rotation);
transform.Position += forward * kinematics.LinearVelocity * DeltaTime;
}
}
}
ISystem unmanaged lifecycle, SystemAPI.Time.DeltaTime, LocalTransform struct, and burst-compiled job scheduling without GC allocation.
<div class="container-fluid py-4">
<div class="row g-3" id="telemetry-dashboard">
<div class="col-md-6 col-lg-4">
<div class="card h-100 border-0 shadow-sm bg-surface text-light">
<div class="card-body d-flex flex-column justify-content-between">
<div class="d-flex align-items-center justify-content-between mb-3">
<span class="badge rounded-pill bg-caramel-subtle text-caramel px-3 py-1">Resident VRAM</span>
<small class="text-secondary font-monospace">RTX 3060</small>
</div>
<h2 class="display-6 fw-bold mb-0 text-white font-monospace">~9.10 <small class="fs-6 text-secondary">GB</small></h2>
</div>
</div>
</div>
</div>
</div>
g-3, d-flex flex-column), atomic semantic hierarchy, and clean CSS custom property integration.
using Mono.Cecil;
using Mono.Cecil.Cil;
public static void InjectTelemetryHook(MethodDefinition method, MethodReference hookRef)
{
var il = method.Body.GetILProcessor();
var firstInstr = method.Body.Instructions[0];
// Inject IL instruction stream before entry
il.InsertBefore(firstInstr, il.Create(OpCodes.Ldstr, method.FullName));
il.InsertBefore(firstInstr, il.Create(OpCodes.Call, hookRef));
// Recalculate max stack depth to preserve assembly integrity
method.Body.OptimizeMacros();
}
ILProcessor.InsertBefore, opcode operands (OpCodes.Ldstr, OpCodes.Call), and macro optimization.
The Cappadocian settlement formalizes the distinction between essence (ousia, οὐσία)
and individual hypostatic subsistence (hypostasis, ὑπόστασις). In the formulation of
Basil of Caesarea (Epistle 38), the relation of ousia to hypostasis corresponds to
that of the general (to koinon, τὸ κοινόν) to the particular (to idion, τὸ ἴδιον).
This ontological rigor prevents both modalistic collapse (Sabellianism) and tri-theistic
pluralism, preserving strict numerical monotheism alongside personal distinctions.
#include <jni.h>
#include <android/log.h>
#include <cstdint>
extern "C" JNIEXPORT jlong JNICALL
Java_org_openblade_engine_NativeBridge_allocateTensorBuffer(
JNIEnv* env,
jobject /* this */,
jint element_count)
{
if (element_count <= 0) {
return 0;
}
float* buffer = new (std::nothrow) float[element_count];
return reinterpret_cast<jlong>(buffer);
}
std::nothrow), proper 64-bit pointer casting (reinterpret_cast<jlong>), and JNI naming conventions.
Head-to-Head Architectural Comparison
How Katana 1.1B compares against industry standard 1B-class open-weights models across training envelope constraints, tokenizer compression, and empirical accuracy.
| Evaluation Dimension | Katana 1.1B (OpenBlade) | TinyLlama 1.1B | SmolLM 1.7B | Pythia 1.0B | Qwen2.5 1.5B |
|---|---|---|---|---|---|
| Exact Parameter Count | 1,122,571,848 | 1,100,048,384 | 1,710,000,000 | 1,011,000,000 | 1,540,000,000 |
| Layer Depth & Hidden Dim | 36 Dense / 1,536 Dim | 22 Dense / 2,048 Dim | 24 Dense / 2,048 Dim | 16 Dense / 2,048 Dim | 28 Dense / 1,536 Dim |
| Peak Training VRAM | ~9.1 GB (Fits 12 GB GPU) | ~18.2 GB (Needs A100) | ~24.5 GB (Needs A100) | ~16.4 GB (Needs A100) | ~22.0 GB (Needs A100) |
| Tokens / Step on 12GB GPU | 32,768 Tokens | OOM (<4,096 max) | OOM (Offload required) | OOM (<4,096 max) | OOM (Offload required) |
| Step Latency (32k Tokens) | ~14.37s (@ ~2,280 tok/s) | N/A (Multi-GPU needed) | N/A (Multi-GPU needed) | N/A (Multi-GPU needed) | N/A (Multi-GPU needed) |
| Vocabulary & AST Optimization | 65,536 (Domain AST Aware) | 32,000 (Generic BPE) | 49,152 (General Web) | 50,304 (NeoX Web) | 151,936 (Multilingual) |
| Code Token Sequence Compression | -35% vs Llama BPE | Baseline (0%) | -8% | -5% | -22% |
| Validation PPL (@ 2.23B Tokens) | 58.12 | ~74.50 | ~68.20 | ~89.10 | ~64.30 |
| Early Top-1 Accuracy | >30.9% (@ 130.5k Steps) | ~23.4% | ~26.1% | ~18.9% | ~27.8% |
| Edge Quantized Size (Q4_K_M) | ~720 MB | ~680 MB | ~1.08 GB | ~640 MB | ~980 MB |
| Open Weights License | Apache 2.0 (Open Weights) | Apache 2.0 | Apache 2.0 | Apache 2.0 | Qwen Research License |
Run Katana Locally on Any Device
With a 4-bit footprint of just ~720 MB, Katana executes at extreme token rates on MacBooks, Raspberry Pi 5, mobile processors, and consumer desktops.
Execute directly via terminal with hardware-accelerated CPU threads or CUDA/Metal offload:
# Run Q8_0 near-lossless quantization
llama-cli -m katana-130k-Q8_0.gguf -p "using Unity.Entities; public struct MovementSystem : ISystem {" -n 384 -t 8 --temp 0.7 --top-p 0.9
Embed Katana directly into Python agentic pipelines or local IDE plugins:
from llama_cpp import Llama
llm = Llama(
model_path="./katana-130k-Q8_0.gguf",
n_ctx=4096,
n_threads=8,
n_gpu_layers=-1 # Full offload to GPU / Metal
)
output = llm(
"using Unity.Burst;
[BurstCompile]
public struct",
max_tokens=256,
stop=["
"]
)
print(output["choices"][0]["text"])
Run Katana natively on macOS Apple Silicon (M1/M2/M3/M4) with full Metal acceleration and a modern GUI.
Download iRun StudioPackage Katana into your local Ollama runtime with a single command:
FROM ./katana-130k-Q8_0.gguf
PARAMETER temperature 0.7
PARAMETER stop "<|endoftext|>"
ollama create katana -f Modelfile- Q4_K_M (4-bit) ~720 MB RAM
- Q8_0 (8-bit) ~1.18 GB RAM
- FP16 (Full Precision) ~2.25 GB VRAM
Open Weights Release Portal
All weights, checkpoints, tokenizer configs, and inference harnesses are public under Apache 2.0.