Inspiration
Modern Retrieval-Augmented Generation (RAG) and Text-to-SQL frameworks operate under a fundamental limitation: they attempt to solve continuous, logical database problems using approximate linguistic text embeddings ($\text{Cosine Similarity}$). This approach introduces severe context-window bloat, high cloud API latency, and catastrophic structural hallucinations.
ChevKan completely rejects this paradigm. We replace discrete relational database row lookups with continuous mathematical fields. By compressing vast, multi-table database logs into smooth polynomial basis curves, we leverage the predictive power of calculus to resolve enterprise telemetry instantly on the edge. This merges the creative semantic fluency of language models with the absolute, deterministic precision of pure mathematics.
What it does
ChevKan is a proof-of-concept AI inference system that compresses an entire enterprise relational database (tested over the 53-table, 1.5-million-row AdventureWorks schema) into continuous mathematical functions, grounding an on-device Language Model in exact calculus-derived business telemetry—with zero cloud dependency.
- Continuous Analytics: Every product, customer, and territory becomes a continuous revenue function $f(t)$ over time.
- 0-Microsecond Calculus: At query time, $f(1.0)$ provides the current run-rate, and the analytical derivative $f'(1.0)$ evaluates instantaneous revenue velocity directly inside CPU registers to confirm business expansion vs. contraction.
- Total Local Autonomy: Runs 100% offline on a standard Windows laptop with no Python framework overhead, no dedicated GPU requirements, and exactly $\$0.00$ in monthly cloud infrastructure costs.
How we built it
ChevKan is built using a native, zero-dependency C++17 (MSVC/MinGW) architecture compiled with aggressive optimization flags (/O2 / -O3), completely bypassing heavy python frameworks at inference time. The architecture maps across 4 orthogonal, independently replaceable pillars:
- Pillar 4 (Semantic Hilbert Manifold): Embeds 30,522 vocabulary tokens into a compressed 128-dimensional semantic space ($\text{all-MiniLM-L6-v2} \rightarrow \text{PCA}$). The engine resolves ambiguous natural language inputs down to concrete database entity keys using sub-millisecond cosine similarity loops.
- Pillar 2 (Enterprise Knowledge Database): Compresses time-series transactions into orthogonal continuous Chebyshev polynomials of order $N=6$:
$$f(x) = \sum_{n=0}^{5} c_n T_n(x), \quad x \in [-1, 1]$$
Six $\text{float64}$ coefficients replace entire table histories, compressing an 850 MB relational footprint down to a microscopic 212 KB binary (
EKSPACE2)—a 4000:1 data compression ratio. - Pillar 3 (Transformer Engine): A clean C++ implementation of the 24-layer Qwen 2.5 architecture (RoPE, GQA, RMSNorm, SwiGLU). It utilizes Windows kernel-mapped memory architecture (
MapViewOfFile) to stream the 2.4 GB model weights (LKSPACE3) directly into virtual memory with absolute zero-copy IPC overhead, idling at just 40–50 MB of RAM. It bypasses heap fragmentation by pre-allocating a flat 96 MB KV-Cache buffer at startup. - Pillar 1 (Calculus Verification Block): Evaluates the analytical derivative $f'(1.0)$ in exactly 0 microseconds using direct CPU register arithmetic. The directional sign of the gradient acts as a hard mathematical guardrail to dynamically ground and constrain the discrete model's attention window, blocking language hallucinations before text generation.
Challenges we ran into
The primary engineering obstacle emerged during continuous layer matrix mutation. Attempting to fit a smooth Chebyshev polynomial across the 24 discrete transformer layers to turn the model's weights into a continuous field introduced significant quantization loss. Because autoregressive transformers rely heavily on high-frequency weights and sharp layer transitions to maintain language logic, low-degree curves smoothed away the model's self-attention patterns, leading to broken text generation.
Accomplishments that we're proud of
- 0-Microsecond Database Querying: Achieving a literal zero-microsecond execution profile for time-series trend velocity by evaluating calculus derivatives analytically instead of scanning relational tables.
- True Zero-Copy Cache Locality: Engineering a fully optimized Win32 memory-mapped virtual addressing layer that allows a 500M parameter model to prefill and execute smoothly across 14 CPU hardware threads without dynamic memory allocations inside the loop.
- Double Offline Resilience: Designing a system that preserves data integrity completely offline via local SQLite logging and persistent dual-Hilbert caching, matching every key data guardrail of Google's enterprise platform profiles.
What we learned
We discovered that optimizing small-parameter edge models requires deep integration between low-level system kernels and mathematical physics. To resolve the layer-mutation noise challenge, we engineered a Hybrid Continuity Bridge: we froze the continuous mathematical baseline and layered localized Low-Rank Adaptation (LoRA) delta-fields alongside active activation-blending factors within the C++ runtime. This effectively stabilized token prediction, proving that a highly constrained 0.5B model can deliver execution-based enterprise accuracy if it is guided by a continuous data framework.
What's next for ChevKan: Bare-Metal Continuous Math Engine for Edge AI
- Cross-Platform Portability: Extending the kernel memory-mapping architecture from Win32 allocations (
MapViewOfFile) to POSIX compliance (mmap) to enable native, bare-metal deployment on Linux containers and localized edge mobile devices. - Dynamic Functional Scaling: Scaling the Chebyshev polynomial expansion order dynamically at runtime based on the complexity of the analytical inquiry, allowing the system to trade computing intensity for infinite-resolution telemetry tracking on the fly.
Built With
- Core Systems: C++17, Win32 Core Architecture (
MapViewOfFile), OpenMP, AVX2 SIMD Lane Vectorization. - Data Pipeline: Python 3, NumPy, scikit-learn (PCA Manifold Compression), HuggingFace Transformers.
- AI Architecture: Qwen 2.5-0.5B-Instruct,
all-MiniLM-L6-v2Local Concept Anchors. - Target Domain Layout: Customized AdventureWorks Relational Warehouse Snapshot (53 Tables, 1.5M Rows).
Built With
- all-minilm-l6-v2
- architecture
- avx2
- c++17
- core
- huggingface
- lane
- mapviewoffile
- numpy
- openmp
- python
- qwen-2.5-0.5b-instruct
- scikit-learn
- simd
- win32
Log in or sign up for Devpost to join the conversation.