ASGT — CPU-Native Algebraic AI Engine. Zero Float, Pure GF(p) Arithmetic.
Project description
ASGT Engine — Algebraic Spectral Generative Theory
CPU-Native AI Engine | Zero Floating Point | Pure Integer Arithmetic on GF(p)
ASGT replaces GPU-bound linear algebra with elliptic curve arithmetic over finite fields. The entire engine runs on the CPU's integer ALU — no VRAM, no float, no external dependencies.
Key Features
- Zero Float/Double: All computation uses
uint64_tmodular arithmetic on GF(p) - Elliptic Curve Embeddings: Words → points on E: y² = x³ + ax + b (mod p)
- Hecke Attention: Integer-only attention mechanism replacing matrix multiply
- p-adic Retrieval: Nearest-neighbor search using p-adic valuation distance
- Hensel Training: Exponentially convergent parameter lifting (p-adic Newton)
- Binary Checkpointing: Save/load trained models as compact
.asgtfiles
Installation
pip install asgt-engine
Quick Start
import asgt_engine
# Initialize engine with elliptic curve E(GF(65537))
engine = asgt_engine.ASGTEngine(a=7, b=13, p=65537)
# Train on texts (expands vocab + builds knowledge base)
texts = [
"The heart pumps blood through the circulatory system",
"DNA carries the genetic instructions for life",
"Photosynthesis converts sunlight into chemical energy",
]
engine.train_batch(texts)
# Retrieve relevant knowledge
results = engine.retrieve("What pumps blood?", top_k=3)
for r in results:
print(f"[sim={r.similarity}] {r.text}")
# Generate answer
answer = engine.generate("What carries genetic information?")
print(answer) # "DNA carries the genetic instructions for life"
# Save and load model
engine.save_model("my_model.asgt")
engine2 = asgt_engine.ASGTEngine()
engine2.load_model("my_model.asgt")
Architecture
Input Text → Tokenizer → EC Point Embedding → Hecke Attention → p-adic Retrieval → Output
│ │ │ │ │
Strings Normalize [n]G on E(GF(p)) Σ[wᵢⱼ]Pⱼ v_p(x-y)
│ + Split try-and-increment integer weights integer dist
▼ ▼ ▼ ▼ ▼
Python C++ ALU C++ ALU C++ ALU C++ ALU
Performance (Google Colab CPU)
| Metric | Value |
|---|---|
| Encoding speed | 44,000+ sentences/sec |
| Retrieval speed | 21,000+ queries/sec |
| Retrieval accuracy | 100% (6/6 benchmark) |
| Model size | 16 bytes per fact |
| Data types used | uint64_t only |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asgt_engine-1.0.1.tar.gz
(11.7 kB
view details)
File details
Details for the file asgt_engine-1.0.1.tar.gz.
File metadata
- Download URL: asgt_engine-1.0.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
072a9798e9bbfcc72f56b143ef079c6bbdfa7a95eba039ec14980ffbbf7a9162
|
|
| MD5 |
781e1f554d01794fb4581931eab28a97
|
|
| BLAKE2b-256 |
e56bdcbd44f9390424f81c51d7379327aeffbed4313632f6b2f70ff0b61602ee
|