Tenet Lab (Small Model Lab & Tenet Family)
Research Question: How small and efficient can a language model become while retaining most of the capability required for production data-pipeline incident reasoning — and how can bi-projected subspace surgery (Lancet) and subspace-safe RL (Tenet) eliminate slop and false refusals without reasoning collateral or FP8 degradation?
❤️ Independent 1-person research lab: every checkpoint and CKA-GGUF ladder is calibrated and benchmarked on full
vLLMOpenEvals (3,566prompts). If this model kept your reasoning/JSON intact or saved VRAM, please click Like above and follow @mr-andrey-isachenko — community likes directly decide which models get quantized next!
Tenet Family Releases & Reference Checkpoint
- Tenet-3B:
mr-andrey-isachenko/Tenet-3B-Qwen2.5-Unslop-v1(based onQwen/Qwen2.5-3B-Instruct) - Tenet-8B:
mr-andrey-isachenko/Tenet-8B-Llama3.1-Unslop-v1(based onmeta-llama/Llama-3.1-8B-Instruct) - Tenet-12B:
mr-andrey-isachenko/Tenet-12B-Nemo-Unslop-v1(based onmistralai/Mistral-Nemo-Instruct-2407) - Reference Mini-Checkpoint (
sml-nano): Stored in the root of this repository (config.json,tokenizer_config.json,model.safetensors,lancet_basis.safetensors,lancet_recipe.json) for reproducible smoke-testing,transformerscompatibility, and Sprint 9 (H13streaming shard surgery & TIES merge,streaming_surgery_max_abs_diff=7.45e-9,streaming_merge_max_abs_diff=0.0,max_row_crest_factor=1.1926).
Overview
Tenet Lab (originated as Small Model Lab, CLI/package sml) is an end-to-end language model systems and applied research project structured into eight tightly coupled sprints:
- Sprint 1 — Core Transformer, Custom
@triton.jitKernels & GPU Pretraining (Phase I Lean): Modern Llama/Qwen-compatible decoder (RMSNorm,RoPE,GQA,SwiGLU, intra-document causal masking,KV-cache) + custom@triton.jitfusedRMSNorm,SwiGLU, and chunkedCrossEntropyforward/backward kernels (src/sml/kernels/), validated against OpenAIgpt2(124M) logits (< 1e-4), trained with a 32k BPE tokenizer onFineWeb-Edu(4.0Btokens with Warmup–Stable–Decay and a1.5BChinchilla-optimal cooldown branch). - Sprint 2 — Trainable Analytical & Incident RL Environment (
StatefulToolEnv):verifiers-compatible multi-turn environment (StatefulToolEnv+load_environment) built ondbt Core + DuckDB + sqlglotwith isolated MCP tools, multi-seed counterfactual fault injection (product_bug,data_pipeline_artifact,mix_shift+ confounders), and a Gated MultiplicativeRubric(R_total = R_outcome · R_evidence · R_process). - Sprint 3 — Adaptation, Distillation & Multi-Turn RL (
GRPO): Controlled comparison on1.5B–3Bopen weights: Prompting vs. Hybrid RAG vs. LoRA/SFT vs. Teacher (30B+) Rejection-Sampled Distillation (via the hardened OpenRouter gateway insrc/sml/gateway/with strict recursive secret/raw-row egress guards) and multi-turnGRPO, including a pre-registered reward-hacking ablation (H5: Gated Multiplicative vs. Naive Additive reward). - Sprint 4 — Specialist Surgery & Production Inference (
vLLM): Layer-wise representation drift (CKA), CKA-guided mixed-precision allocation (RCO principle), rank-1 subspace weight surgery (W' = W - r(r^T W)), quantization sensitivity (FP8/INT4 AWQ), layer pruning, component-level Gated Rubric degradation audit (H7, H8), and load-tested serving economics (TTFT,TPOT,req/s,$/1kincidents Pareto frontier). - Sprint 5 — Lancet Dual-Anchor Soft-SCR Surgery (
H9): Bi-projected, norm-preserving, multi-direction subspace surgery (src/sml/surgery/): Modified Gram-Schmidt biprojection of refusal/slop directions against the reasoning anchor (float32), joint projection fromself_attn.o_proj/mlp.down_projwith per-row L2-norm rescaling, and Signal-to-Collateral-Ratio (SCR) layer selection (ADR-005). - Sprint 6 — Tenet Subspace-Safe Unslop GRPO (
H10): Gated unslopGRPO(Gated MultiplicativeRubric+ slop/refusal penalty) on surgically edited weights, with LoRA adapters merged only through the orthogonal projectionI - U U^Tplus row-norm preservation, so RL updates cannot re-leak into the ablated subspace — released as theTenetmodel family (ADR-005). - Sprint 7 — FP8 Provider Survival & Readiness (
H11): Certification that edited checkpoints survive OpenRouter-styleFP8(E4M3) quantization: FP8 Subspace Re-Leakage measurement, Per-Row vs. Per-Tensor E4M3 scale comparison, and theRow Crest-Factor < 25.0provider readiness gate (ADR-005). - Sprint 8 — Cross-Domain Subspace-Safe Adapter Merge (
H12): TIES / Gram-Schmidt subspace-safe composition of independently trained GRPO adapters (Delta W_SQL+Delta W_unslop): orthogonal projection ofDelta W_unslopagainstU_{refusal/slop}and the top-k left singular vectorsU_SQLofDelta W_SQL, TIES trim/sign-election/disjoint merge, row-norm restoration, and theH11FP8 readiness gate (ADR-007).
Zero Placeholder Numbers Policy: No synthetic or estimated numbers are ever written into result tables. All tables in
reports/are compiled directly from machine-readable experiment manifests inresults/<run_id>/viasml report.
Pre-Registered Hypotheses & Status (Sprints 1–8)
| ID | Hypothesis | Pre-Registered Acceptance Criterion | Status |
|---|---|---|---|
| H1 | Mathematical & Causal Equivalence: Custom Transformer in gpt2-compat mode matches GPT2LMHeadModel (124M) logits; naive O(T^2) GQA matches SDPA; KV-cache matches full forward; intra-document mask blocks cross-<|eos|> leakage. | max_abs_logit_diff < 1e-4 (fp32); cross-doc leakage == 0.0 | Verified (sdpa=3.16e-6, naive=3.81e-6, kv_cache=2.80e-6, leakage=0.0 in results/h1_gpt2_parity/) |
| H2 | GPU Throughput & @triton.jit Waterfall: Cumulative system optimizations (fp32 naive → fp32 sdpa → bf16 sdpa → bf16 fused kernels → torch.compile) yield measured throughput gains and high hardware utilization. | Measured 5-stage waterfall in reports/sprint1/; MFU >= 30% on 1x H100 SXM (1.40x local MPS speedup verified) | Verified (472,080.81 tok/s, MFU=34.22%, 13.55x vs fp32 naive 34,850.26 tok/s on 1x H100 SXM in results/h2_mfu_waterfall/) |
| H3 | Chinchilla Optimal (1.5B) vs. Overtrained (4.0B) WSD Cooldown: Overtraining sml-100m (75.52M non-embedding params) past 20x tokens/param via WSD cooldown branching improves val bpb and zero-shot accuracy at identical inference cost. | Improvement exceeds 2σ of 3-seed sml-xs noise floor | Verified (val_bpb=1.039992 at 4.00B tokens vs 1.044582 1.5B branch at step 2861, Δ=-0.004590, 445,067.74 tok/s, MFU=32.27% in results/h3_wsd_100m/) |
| H4 | In-Context Induction Phase Transition: Log-spaced checkpoints reveal an abrupt phase transition in intra-document loss(late) - loss(early) and synthetic sequence copying. | Phase transition localized across 15 log-spaced checkpoints | Verified (15 log-spaced checkpoints, max_window_gain_share=1.0, copy_acc=0.25, loss_delta=-0.179115 in results/h4_induction_dynamics/) |
| H5 | Gated Multiplicative vs. Naive Additive Rubric (Anti-Reward-Hacking): G_evidence · R_correctness prevents premature guessing and unsafe SQL during multi-turn GRPO. | oracle_gated > 1.0, lazy_gated == 0.0 vs. lazy_naive == 0.75, and H5_skill_difference >= 0.15 | Verified (Δskill = +0.8625 in results/h5_env_verification/ & results/h6_adaptation_comparison/; Qwen2.5-3B-Instruct MPS Δskill = +0.1684 in results/h6_qwen3b_mps/) |
| H6 | Context Enrichment (Hybrid RAG) vs. Weight Updates (Distillation + GRPO): Hybrid BM25 + char 3-gram RRF resolves knowledge-bound table lookups (>= 85%), while weight updates dominate skill-bound multi-turn hypothesis elimination (>= 20 pp gain). | rag_knowledge_score >= 0.85 AND H6_skill_difference >= 0.20 | Verified (rag_kb = 1.00, Δskill = +0.5050 in results/h6_adaptation_comparison/; Qwen2.5-3B-Instruct MPS rag_kb = 1.00, 6_grpo_gated_rl = 1.0000 vs 3_hybrid_rag = 0.5600, Δskill = +0.4400 in results/h6_qwen3b_mps/) |
| H7 | Representation-Constrained Compression (CKA-Guided Mixed-Precision RCO): Allocating 8-bit precision to the top-k highest per-block CKA-drift layers reduces KL divergence by >= 20% vs. an equal-bit bottom-k control (5.33 bits/weight). | h7_kl_reduction_ratio >= 0.20 at identical average bits/weight | Verified (73.33% KL reduction: 0.005168 vs. 0.019381 at 5.33 bits in results/h7_h8_surgery_pareto/; Qwen2.5-3B-Instruct MPS 30.10% KL reduction: 0.165203 vs. 0.236338 in results/h7_h8_qwen3b_pareto/) |
| H8 | Rank-1 Subspace Projection (W' = W - r(r^T W)): Closed-form orthogonal projection zeroes out targeted residual stream writes along contrastive direction r (< 1e-5). | max_ortho_residual < 1e-5 AND layer_write_proj_after < 1e-5 | Verified (ortho_residual = 0.0, write_proj: 7.91e-3 → 2.57e-6 in results/h7_h8_surgery_pareto/; Qwen2.5-3B-Instruct MPS ortho_residual = 9.06e-4, write_proj: 59.55 → 0.0701, kl_collateral = 0.0961 in results/h7_h8_qwen3b_pareto/) |
| H9 | Lancet Dual-Anchor Soft-SCR Surgery: Bi-projected (Modified Gram-Schmidt, float32), norm-preserving, multi-direction subspace surgery with Signal-to-Collateral-Ratio layer selection removes refusal/slop writes without colliding with the reasoning anchor. | anchor_orthogonality_error < 1e-6, max_row_norm_drift < 1e-5, target_suppression_ratio >= 0.90, h9_kl_reduction_ratio >= 0.35 | Verified (sml-nano: h9_verified=true, h9_kl_reduction_ratio=0.6092 in results/h9_biprojected_surgery/; Qwen2.5-3B MPS h9_kl_reduction_ratio=0.9941, target_suppression=0.9694 in results/h9_qwen3b_mps/; Llama-3.1-8B H100 h9_kl_reduction_ratio=0.8989, target_suppression=0.9930, ortho=1.0e-08 in results/h9_llama8b_h100/; Mistral-Nemo-12B H100 h9_kl_reduction_ratio=0.9672, target_suppression=0.9914, ortho=1.0e-08 in results/h9_nemo12b_h100/) |
| H10 | Tenet Subspace-Safe Unslop GRPO: Gated unslop GRPO on surgically edited weights, with LoRA merged only through the orthogonal projection I - U U^T plus row-norm preservation, drives slop/refusal to near zero without re-leaking into the ablated subspace. | slop_and_refusal_rate <= 0.02 (nano) / <= 0.10 (3B+), h10_gated_vs_naive_gain >= 0.15, post_merge_suppression_retention >= 0.90 | Verified (sml-nano: slop=0.0150, gain=+0.2276 in results/h10_unslop_grpo/; Qwen2.5-3B MPS slop=0.0909, gain=+0.1602, releakage=0.0690 in results/h10_qwen3b_mps/; Llama-3.1-8B H100 slop=0.0410, gain=+0.2489, releakage=0.0726 in results/h10_llama8b_h100/; Mistral-Nemo-12B H100 slop=0.0239, gain=+0.4292, releakage=0.1282 in results/h10_nemo12b_h100/) |
| H11 | FP8 Re-Leakage & Crest-Factor Provider Readiness: Norm-preserving Lancet surgery keeps edited checkpoints provider-ready under FP8 (E4M3) quantization — far lower FP8 subspace re-leakage than naive surgery, mode-insensitive KL across Per-Row vs. Per-Tensor E4M3 scales, and Row Crest-Factor < 25.0. | fp8_retention_ratio >= 0.96 (nano) / >= 0.95 (3B+), h11_fp8_kl_reduction_ratio >= 0.25, max_row_crest_factor < 25.0, provider_ready=true (7/7 checks) | Verified (sml-nano: retention=0.9997, kl_red=0.4558 in results/h11_provider_fp8_readiness/; Qwen2.5-3B MPS retention=0.9541, kl_red=0.5185, crest=17.2706, provider_ready=true in results/h11_qwen3b_mps/; Llama-3.1-8B H100 retention=0.9936, kl_red=0.4265, crest=6.3244, provider_ready=true in results/h11_llama8b_h100/; Mistral-Nemo-12B H100 retention=0.9678, kl_red=0.4892, crest=10.6508, provider_ready=true in results/h11_nemo12b_h100/) |
| H12 | Cross-Domain Subspace-Safe Adapter Merge (TIES + Lancet): TIES trim/sign-election/disjoint merge of independently trained GRPO adapters (Delta W_SQL + Delta W_unslop), with Delta W_unslop orthogonally projected against U_{refusal/slop} and the top-k left singular vectors U_SQL of Delta W_SQL, preserves both SQL-incident skill and unslop behavior without re-leaking into the ablated subspace, and keeps the merged checkpoint provider-ready under FP8. | sql_incident_retention_ratio >= 0.95, unslop_retention_ratio >= 0.95, slop_and_refusal_rate <= 0.02 (nano) / <= 0.10 (3B+), subspace_safe_merge_releakage < 1e-5, ties_biprojected_vs_naive_merge_gain >= 0.15, max_row_crest_factor < 25.0, provider_ready=true | Verified (sml-nano: gain=+0.4995, crest=1.2184 in results/h12_subspace_safe_merge/; Qwen2.5-3B MPS gain=+0.7848, sql=1.0, unslop=1.0, crest=17.2706 in results/h12_qwen3b_mps/; Llama-3.1-8B H100 gain=+0.7965, sql=0.9799, unslop=1.0, crest=6.3244 in results/h12_llama8b_h100/; Mistral-Nemo-12B H100 gain=+0.7806, sql=1.0, unslop=1.0, crest=10.6510 in results/h12_nemo12b_h100/) |
Verified Model Configurations (Sprint 1)
| Model | d_model | Layers | Q / KV Heads | d_ff | Vocab | Non-Emb Params | Total Params (Tied) | Role |
|---|---|---|---|---|---|---|---|---|
sml-nano | 256 | 4 | 4 / 2 | 768 | 32,768 | 3,148,032 | 11,536,640 | Local CPU/MPS unit tests & TinyStories smoke check |
sml-xs | 512 | 8 | 8 / 4 | 1,408 | 32,768 | 23,601,664 | 40,378,880 | 24 GB GPU pilot & 3-seed noise floor (0.4B tokens) |
sml-100m | 768 | 12 | 12 / 4 | 2,048 | 32,768 | 75,516,672 | 100,682,496 | Primary Sprint 1 model (1.5B branch + 4.0B full) |
gpt2-124m | 768 | 12 | 12 / 12 | 3,072 | 50,257 | 85,842,432 | 124,439,808 | Reference parity target for H1 (gpt2-compat) |
Key Measured Results Summary (H1–H12)
- Sprint 1 (
1x NVIDIA H100 80GB SXM—sml-100m): 5-stage@triton.jit+torch.compilewaterfall (34,850→472,081 tok/s,34.22% MFU,13.55xspeedup),4.0B-token WSD pretraining onFineWeb-Edu(445,068 tok/s,32.27% MFU,val_bpb = 1.0400vs1.04461.5BChinchilla cooldown branch), andH4induction phase transition across 15 log-spaced checkpoints. - Sprints 2–4 (
Apple M4 Pro 48GB MPS—Qwen/Qwen2.5-3B-Instruct&sml-nano): CounterfactualDuckDB + sqlglotStatefulToolEnvwith Gated Multiplicative Rubric (H5:oracle = 1.12,lazy_guess = 0.00vs0.75naive additive),Hybrid RAG(100%knowledge-bound recall) vs.LoRA SFT + Multi-Turn Token-Level GRPO(H6:+44.0 ppskill-bound gain onQwen2.5-3B-Instruct), Blockwise CKA-Guided4/8-bitRCO Quantization (H7:30.10%KL reduction onQwen2.5-3B-Instruct,73.33%onsml-nano), and Closed-Form Rank-1 Subspace Projection (H8:write_proj: 59.55 → 0.0701). - Sprints 5–7 (
Apple M4 Pro 48GB MPS—Qwen/Qwen2.5-3B-Instruct&sml-nano;Lancetengine &TenetfamilyTenet-3B-Qwen2.5-Unslop-v1,Tenet-8B-Llama3.1-Unslop-v1,Tenet-12B-Nemo-Unslop-v1):H9Lancet Dual-Anchor Soft-SCR Surgery (h9_kl_reduction_ratio=0.6092onsml-nano,0.9941onQwen2.5-3B-Instructwithnaive_kl_collateral=3.7607vslancet_kl_collateral=0.0220),H10Tenet Subspace-Safe Unslop GRPO (slop_and_refusal_rate=0.0150onsml-nano,0.0909onQwen2.5-3B-Instruct(vs0.1542additive GRPO,+16.02 ppgated gain,+35.98 pppost-surgery gain;subspace_safe_lora_releakage=0.0690vsunprojected_lora_releakage=0.8300,post_merge_suppression_retention=1.0)), andH11FP8 Provider Survival & Readiness (fp8_subspace_releakage_lancet=0.0310vsnaive=0.4996onsml-nano,0.0270vs0.5003onQwen2.5-3B-Instruct;max_row_crest_factor=17.2706 < 25.0,provider_ready=true7/7 checks on both). - Sprint 8 (
Apple M4 Pro 48GB MPS—Qwen/Qwen2.5-3B-Instruct&sml-nano):H12Cross-Domain Subspace-Safe Adapter Merge (ties_biprojected_vs_naive_merge_gain=+0.4995onsml-nanoand+0.7848onQwen2.5-3B-Instruct,sql_incident_retention_ratio=1.0,unslop_retention_ratio=1.0,slop_and_refusal_rate=4.57e-08/5.55e-07,subspace_safe_merge_releakage=1.25e-07/4.71e-07,max_row_crest_factor=1.2184/17.2706 < 25.0,provider_ready=trueon bothsml-nanoandQwen2.5-3B-Instruct).
Quickstart (Local macOS / Apple Silicon & Ephemeral Cloud GPU)
# 1. Install dependencies into an isolated Python 3.12 virtualenv
make sync
# 2. Run all 60 unit & integration tests and ruff linter
make test
make lint
# 3. Verify H1 (GPT-2 124M parity), H5 (StatefulToolEnv), H6 (Context vs. Weights), and H7/H8 (Weight Surgery & Pareto)
make verify-h1
make verify-env
make compare-adaptation
make run-surgery
make report
# LLM backend (Qwen2.5-3B-Instruct on Apple Silicon MPS) for H5/H6/H7/H8:
make verify-env ARGS="--backend llm --model-name Qwen/Qwen2.5-3B-Instruct"
make compare-adaptation ARGS="--backend llm --model-name Qwen/Qwen2.5-3B-Instruct"
make run-surgery ARGS="--backend llm --model-name Qwen/Qwen2.5-3B-Instruct"
# 4. Run end-to-end M2+M3 local pretraining smoke test on Apple Silicon MPS / CPU
make train-smoke
# 5. Profile the 5-stage H2 throughput waterfall locally
make profile-h2-local
Running M4–M5 on an Ephemeral Cloud GPU (RTX 4090 / H100 SXM)
# 1. Bootstrap Ubuntu + NVIDIA GPU instance (installs uv, Python 3.12, locked deps, runs pytest)
./scripts/remote/bootstrap.sh
# 2. Run the full M4-M5 GPU experiment pipeline (with 15-min idle GPU auto-shutdown watchdog):
# - H1 parity verification
# - H2 5-stage MFU & Triton fused-kernel waterfall
# - FineWeb-Edu streaming BPE + uint16 shard generation (< 15 GB disk discipline)
# - H3/H4 WSD pretraining with cooldown branching & 15 log-spaced checkpoints
# - Markdown report compilation to reports/sprint1/summary.md
GPU_PROFILE=h100 ./scripts/remote/run_m4_m5_gpu.sh
# Or on a 24 GB RTX 4090 pilot instance:
GPU_PROFILE=rtx4090 MAX_DOCS=50000 MAX_STEPS=2000 ./scripts/remote/run_m4_m5_gpu.sh
Architecture & Decisions
- Tenet Lab Technical Report (
H1–H12&TenetFamily Post-Mortem) - Master Roadmap & Sprint Specifications
- Sprint 1 Measured Results Summary
- ADR-001: Four-Sprint Architecture vs. Eight Loose Phases
- ADR-002: Grouped-Query Attention (GQA) & WSD Cooldown Branching
- ADR-003: Streaming Data Shards &
< 15 GBLocal Disk Discipline - ADR-004: Multi-Turn Verifiable RL Environment (
StatefulToolEnv+ Gated Anti-HackingRubric) - ADR-005: Lancet Dual-Anchor Soft-SCR Surgery (
H9) → Tenet Subspace-Safe GRPO (H10) → FP8 Re-Leakage & Crest-Factor Provider Readiness (H11) - ADR-006: Three-Tier Model Storage & Recipes
- ADR-007: Cross-Domain Subspace-Safe Adapter Merge (
H12)
Run Tenet on Custom Models & Merges (Apache-2.0 CLI)
You can reproduce this surgery on any compatible checkpoint — your own models and merges included — with the open-source Tenet CLI:
pip install tenet-lab
tenet Qwen/Qwen2.5-3B-Instruct
The CLI detects the model architecture, builds the probe manifest and
applies the bi-projected norm-preserving subspace surgery, then emits the
cka_quant_recipe.json needed for quantization-safe exports.
Citation
- Zenodo DOI: https://doi.org/10.5281/zenodo.24705758
- Code: https://github.com/mrAndreyIsachenko/tenet-lab
@software{isachenko2026tenet,
author = {Isachenko, Andrey},
title = {Lancet & Strata: Anchor-Orthogonal Subspace Surgery, Coupled Speculative Drafter Sync, and CKA-Guided Low-Bit Quantization Survival Across 3B-125B Language Models},
year = {2026},
doi = {10.5281/zenodo.24705758},
howpublished = {\url{https://github.com/mrAndreyIsachenko/tenet-lab}},
}