Skip to content

Repository files navigation

title STMC — Sparse Topological Manifold Compression
author Hadrian Hu
date 2026-06-20
version 2026.1.0.0
keywords
benchmark
efficient inference
neural ODE
sparse manifold
STMC
status Draft
license_code CC BY-NC 4.0
license_paper CC BY-NC 4.0
changelog
version date author description
2026.1.0.0
2026-06-20
Hadrian Hu
Initial public release README

STMC — Sparse Topological Manifold Compression


Table of Contents


Abstract

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 ($O(1)$ in $L$) versus the AR baseline which grows as $O(L^{1.17})$, yielding a $18.9 \times 10^6$ FLOP reduction factor for the ODE-only path. The corrected total pipeline achieves a $1.4$–$1.5\times$ reduction at $L = 512$ tokens. All four domains pass their per-domain performance thresholds after supervised training. This README provides a quick-start guide, architecture summary, and benchmark overview.


Keywords

autoregressive, efficient inference, neural ODE, sparse manifold, sparse topological manifold compression, STMC, token routing


Executive Summary

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.


1. What Is STMC

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:

  1. FLOP reduction — The ODE solver operates in a fixed-dimension latent space; its FLOP count is independent of input sequence length $L$.
  2. Maintained performance — After supervised training on domain-specific data, STMC meets per-domain performance thresholds ($\tau_D$) on all four evaluation benchmarks.
  3. Cross-domain generality — A single shared STMC architecture is used across all four domains without domain-specific architectural changes.
  4. Determinism — The Token Audit Protocol (TAP) produces bit-exact identical outputs across repeated runs (seed = 42).
  5. 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.


2. Quick Start

2.1 Prerequisites

  • Python 3.12 or 3.14 (64-bit)
  • pip and a virtual environment manager
  • torch >= 2.3 (CPU is sufficient for the benchmark suite)
  • sentence-transformers >= 3.0
  • Internet access for initial HuggingFace dataset download (first run only)

2.2 Installation

# 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]"

2.3 Run the Benchmark

# 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

2.4 Run Tests

# Run the full test suite
pytest tests/ -v

# Run only unit tests (fast, no network required)
pytest tests/unit/ -v

3. Architecture Overview

The STMC pipeline consists of four stages:

  1. Encoder — A frozen pre-trained sentence encoder maps the input token sequence to a dense latent vector $z_0 \in \mathbb{R}^d$.
  2. 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.
  3. 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]$.
  4. 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.


4. Validated Benchmark Results

All results below are from 6/6 passing validated experiments. Error bars are 95% bootstrap confidence intervals. $\alpha^*$ is the maximum admissible sparsity threshold per domain.

Caption: Table 1 — STMC Validated Benchmark Results

Domain Metric Score $\tau_D$ $\alpha^*$ 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, $L=512$) $\sim 3 \times 10^{10}$ Grows as $L^{1.17}$
STMC ODE-only $\sim 1.6 \times 10^3$ $L$-independent ($L^{0.00}$)
STMC Total Pipeline ($L=512$) $\sim 2 \times 10^{10}$ Encoder-dominated
Reduction Factor (ODE-only / AR) $18.9 \times 10^6 \times$ ODE path only
Reduction Factor (total / AR, $L=512$) $\sim 1.5 \times$ Corrected total pipeline

Validation plots are available in reports/validated/.


5. Repository Structure

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)

6. Papers and Intellectual Property

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.


7. License

  • 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


8. Contributing

See CONTRIBUTING.md for issue filing, pull request guidelines, code standards, and test requirements.


9. Security

See SECURITY.md for the vulnerability disclosure policy and supported versions.


10. Contact

Author: Hadrian Hu

For research enquiries, collaboration proposals, or security disclosures, refer to SECURITY.md for the appropriate contact channel.


Changelog

Caption: Table C1 — Document Revision History

Version Date Author Description
2026.1.0.0 2026-06-20 Hadrian Hu Initial public release README

About

STMC stmc_public repository

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages