Skip to main content

Trinity Documentation

Welcome to Trinity — a Ternary Computing Framework with VSA, BitNet LLM inference, and VIBEE compiler.

What is Trinity?

Trinity is a high-performance computing framework built on balanced ternary arithmetic {-1, 0, +1}. It provides:

  • Vector Symbolic Architecture (VSA) — Hyperdimensional computing operations
  • BitNet Integration — Efficient LLM inference with ternary weights
  • VIBEE Compiler — Specification-driven code generation
  • Ternary Virtual Machine — Stack-based bytecode execution

Why Ternary?

φ = (1 + √5) / 2 ≈ 1.618      (Golden Ratio)
φ² + 1/φ² = 3 = TRINITY (Trinity Identity)

Ternary {-1, 0, +1} is mathematically optimal:

  • Information density: 1.58 bits/trit (vs 1 bit/binary)
  • Memory savings: 20x vs float32
  • Compute: Add-only operations (no multiply)

Verified Achievements

AchievementResultDetails
BitNet coherent text generationConfirmedbitnet.cpp on RunPod RTX 4090, 3/3 prompts coherent
GPU inference throughput (bitnet.cpp)298K tok/sRTX 3090, BitNet b1.58-2B-4T evaluation mode
JIT compilation speedup15-260xARM64 and x86-64 backends for VSA operations
HDC continual learning3% avg forgetting20 classes across 10 phases (vs 50-90% for neural nets)
Memory compression20xTernary packed vs float32
SIMD ternary matmul7.65 GFLOPS2.28x speedup over baseline SIMD-16
Model load optimization43x fasterMemory-mapped loading (208s to 4.8s)
Unit tests143 passingAcross all subsystems

Quick Start

# Clone repository
git clone https://github.com/gHashTag/trinity.git
cd trinity

# Build
zig build

# Run tests
zig build test

Core Modules

ModuleDescription
VSAVector Symbolic Architecture
VMTernary Virtual Machine
HybridHybridBigInt storage
FirebirdLLM inference engine
VIBEESpecification compiler
PluginExtension system

Getting Started

  1. Installation
  2. Quick Start
  3. Development Setup

Community