| title | STMC — Sparse Topological Manifold Compression | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| author | Hadrian Hu | |||||||||
| date | 2026-06-20 | |||||||||
| version | 2026.1.0.0 | |||||||||
| keywords |
|
|||||||||
| status | Draft | |||||||||
| license_code | CC BY-NC 4.0 | |||||||||
| license_paper | CC BY-NC 4.0 | |||||||||
| changelog |
|
- Abstract
- Keywords
- Executive Summary
- 1. What Is STMC
- 2. Quick Start
- 3. Architecture Overview
- 4. Validated Benchmark Results
- 5. Repository Structure
- 6. Papers and Intellectual Property
- 7. License
- 8. Contributing
- 9. Security
- 10. Contact
- Changelog
Sparse Topological Manifold Compression (STMC) is a proof-of-concept
inference framework that replaces the full-pass autoregressive (AR)
decoder with a Neural Ordinary Differential Equation (ODE) trajectory
computed on a sparse token manifold. This repository contains the validated
proof-of-concept implementation, six fully passing experiments, benchmark
results across four domains (GSM8K, HumanEval, LegalBench, BookSum), and the
public whitepaper (Paper 05) establishing intellectual property. The STMC
ODE-only component is sequence-length-independent (
autoregressive, efficient inference, neural ODE, sparse manifold, sparse topological manifold compression, STMC, token routing
STMC addresses the computational cost of autoregressive transformer inference
by routing tokens through a sparse manifold rather than a full-parameter
decoder pass. The proof-of-concept demonstrates measurable FLOP reduction
with maintained task performance across four heterogeneous benchmark domains.
Six validation experiments have been completed (6/6 PASS) with full
reproducibility. This repository is the public record of that work, intended
for researchers and engineers interested in efficient inference. Paper 05
(included under papers/) is the authoritative first-disclosure document.
Install with pip install -e . and run pytest tests/ to verify the
implementation on your machine.
STMC proposes that the dense computation performed by an AR decoder at each forward pass can be partially replaced by evolving a latent state along a learned sparse manifold using a Neural ODE solver. The key claims, validated in this repository, are:
-
FLOP reduction — The ODE solver operates in a fixed-dimension latent
space; its FLOP count is independent of input sequence length
$L$ . -
Maintained performance — After supervised training on domain-specific
data, STMC meets per-domain performance thresholds (
$\tau_D$ ) on all four evaluation benchmarks. - Cross-domain generality — A single shared STMC architecture is used across all four domains without domain-specific architectural changes.
- Determinism — The Token Audit Protocol (TAP) produces bit-exact identical outputs across repeated runs (seed = 42).
-
Theoretical grounding — The Grönwall bound (P01 Theorem 3.2) is
empirically satisfied; the Lipschitz constant is bounded at
$L_g(\text{empirical}) = 0.102 \ll L_g(\text{spectral}) = 5.396$ .
For full mathematical treatment, refer to Papers 01–04 (not yet public) and
the public whitepaper papers/paper_05_public_whitepaper/paper_05.tex.
- Python 3.12 or 3.14 (64-bit)
pipand a virtual environment managertorch >= 2.3(CPU is sufficient for the benchmark suite)sentence-transformers >= 3.0- Internet access for initial HuggingFace dataset download (first run only)
# Clone or extract the repository
cd stmc_public
# Create and activate a virtual environment
python -m venv .venv
# Windows:
.venv\Scripts\activate
# Linux/macOS:
source .venv/bin/activate
# Install in editable mode with all dependencies
pip install -e ".[dev]"# Run the MVP benchmark (all four domains, n=20 per domain)
python src/stmc_poc/run_mvp.py
# Results are written to reports/benchmark_results.json
# and reports/benchmark_results.md# Run the full test suite
pytest tests/ -v
# Run only unit tests (fast, no network required)
pytest tests/unit/ -vThe STMC pipeline consists of four stages:
-
Encoder — A frozen pre-trained sentence encoder maps the input token
sequence to a dense latent vector
$z_0 \in \mathbb{R}^d$ . -
Sparse Manifold Projection —
$z_0$ is projected onto a sparse sub-manifold$\mathcal{M}_\alpha$ controlled by sparsity threshold$\alpha \in (0, 1)$ . Components below$\alpha$ are zeroed. -
Neural ODE — A learned vector field
$f_\theta$ evolves$z_0$ to$z_T$ by solving$\dot{z} = f_\theta(z, t)$ over$t \in [0, T]$ . -
Decoder / Metric Head —
$z_T$ is mapped to the task output (exact match, pass@1, clause F1, or cosine similarity depending on domain).
For the full derivation including the manifold topology, sparsity bounds, and
Grönwall error analysis, see
papers/paper_05_public_whitepaper/paper_05.tex.
All results below are from 6/6 passing validated experiments. Error bars are
95% bootstrap confidence intervals.
Caption: Table 1 — STMC Validated Benchmark Results
| Domain | Metric | Score | Status | ||
|---|---|---|---|---|---|
| GSM8K (exact match) | Binary accuracy proxy | 0.520 | 0.50 | 0.5 | PASS |
| LegalBench (clause F1) | Yes/No binary F1 | 0.889 | 0.85 | 0.5 | PASS |
| HumanEval (pass@1) | Subprocess exec. | 0.560 | 0.55 | 0.9 | PASS |
| BookSum (cosine sim.) | Embedding proxy | 0.495 | 0.40 | 0.7 | PASS |
Caption: Table 2 — FLOP Comparison
| Component | FLOPs | Notes |
|---|---|---|
| AR Baseline (GPT-2 Small, |
Grows as |
|
| STMC ODE-only |
|
|
| STMC Total Pipeline ( |
Encoder-dominated | |
| Reduction Factor (ODE-only / AR) | ODE path only | |
| Reduction Factor (total / AR, |
Corrected total pipeline |
Validation plots are available in reports/validated/.
stmc_public/
├── README.md
├── ABOUT.md
├── CONTRIBUTING.md
├── SECURITY.md
├── LICENSE.md (CC BY-NC 4.0 — code, non-commercial)
├── LICENSE_CC_BY_NC_4.md (CC BY-NC 4.0 — Paper 05)
├── pyproject.toml
├── papers/
│ └── paper_05_public_whitepaper/
│ └── paper_05.tex (public IP disclosure whitepaper)
├── reports/
│ ├── benchmark_results.json
│ ├── benchmark_results.md
│ ├── plots/ (MVP-phase benchmark plots)
│ └── validated/ (validated experiment plots + summary)
├── src/
│ └── stmc_poc/ (main source package)
└── tests/ (unit, integration, e2e, property, performance)
Paper 05 — Public Whitepaper (included):
papers/paper_05_public_whitepaper/paper_05.tex — Technology overview,
experimental evidence, and IP declaration. Licensed under CC BY-NC 4.0
(non-commercial; commercial use requires a separate licence agreement).
Papers 01–04 (not yet public): Full mathematical derivations covering sparse topological manifold theory (P01), token audit zero-cost proofs (P02), cross-domain sparsity bounds (P03), and preliminary PoC results (P04). These papers will be released in a future version of this repository.
This repository constitutes the first public disclosure record for the STMC technology family.
- Source code, tests, configuration, and benchmark results: Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) — see LICENSE.md
- Paper 05 whitepaper (
papers/): Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) — see LICENSE_CC_BY_NC_4.md
Non-commercial use: free with attribution. Commercial use: requires a separate written licence agreement and royalty arrangement. Contact hadrian.hu@gmail.com before any commercial use.
Copyright 2026 Hadrian Hu
See CONTRIBUTING.md for issue filing, pull request guidelines, code standards, and test requirements.
See SECURITY.md for the vulnerability disclosure policy and supported versions.
Author: Hadrian Hu
For research enquiries, collaboration proposals, or security disclosures, refer to SECURITY.md for the appropriate contact channel.
Caption: Table C1 — Document Revision History
| Version | Date | Author | Description |
|---|---|---|---|
| 2026.1.0.0 | 2026-06-20 | Hadrian Hu | Initial public release README |