Skip to main content

transformers-v9

V9 Palace Transformer — an independent from-scratch LLM architecture with block-diagonal palace-collated attention, per-palace LoRA K/V adapters, and cross-palace semantic gating. Not a base-model adapter — its own embedding/position/lm_head stack.

Part of the V∞ (SiliconLifeOS) paradigm: cognitive structure is architecture, not prompt engineering.

Architecture

Component Detail
Palace Attention Block-diagonal mask: tokens attend only within same palace
LoRA K/V Per-palace low-rank adapters (r=16, 48 palaces)
Cross-palace gate Softmax MLP mix of palace embeddings
QKV low-rank D→64→D bottleneck projections
Residuals 6 layers, no FFN (sufficient for structured reasoning)
Default scale ~1.5B params (hidden=2048, 6 layers, 48 palaces)
Input → Embed/Pos → 6×PalaceAttentionLayer (residual) → LM Head → Output

Quick Start

import transformers_v9  # registers v9_palace with HF Auto Classes

from transformers import AutoConfig, AutoModelForCausalLM

config = AutoConfig.from_pretrained("v9_palace", vocab_size=32768, hidden_size=2048)
model = AutoModelForCausalLM.from_config(config)

Training

from transformers_v9 import V9PalaceTrainer

trainer = V9PalaceTrainer(model, train_dataset, eval_dataset)
trainer.train()

From-scratch training pipeline included (from transformers_v9.train import get_curriculum_dataset):

  • SPC L1-L6 curriculum data
  • CP fusion tasks
  • Multi-domain reasoning

Router (Semantic Palace Routing)

from transformers_v9 import V9RouterConfig, V9Router

router = V9Router(V9RouterConfig())
palace = router.route("Discuss the attention mechanism in Transformers")
# → Palace ID for attention-related reasoning

4-level cascade: L0 domain hash → L1 keyword voting → L2 group Jaccard → L3 embedding (optional).

Install

pip install transformers-v9

Requirements

  • Python 3.8+
  • PyTorch 2.0+
  • transformers 4.30+
  • accelerate 0.20+

Status

Alpha prototype — structured reasoning validation complete. CPU training verified (500 samples, 20 epochs: ont_self 0.55→1.11, accuracy 96.5%). GPU training for full-scale (1.5B+) recommended.

Release files for transformers-v9 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transformers-v9 0.2.0
File Size Uploaded
transformers_v9-0.2.0.tar.gz 17.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for transformers-v9 0.2.0
File Interpreter ABI Platform
transformers_v9-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.2 kB

Release files / transformers_v9-0.2.0.tar.gz

Download URL transformers_v9-0.2.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b214b1fd92582b8d53347c67c2f2988433a32ed161a765aaac287d914a87b9fd
BLAKE2b-256 checksum
How to use checksums
bb89ea29f4fd94460ddd52116094661a8e8165089969942384faefa65c6f5bee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / transformers_v9-0.2.0-py3-none-any.whl

Download URL transformers_v9-0.2.0-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ab4cb051f282146b106ffcc9a50c1a157001f02d2a639186fb0ba5b3aab6ca9
BLAKE2b-256 checksum
How to use checksums
ba057c9c045bc2c53afc86dd5d568774ef782a235fd3335ec24f210bf9bc36ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page