⚡ PolyFormer-Tiny: Orthogonal Chebyshev Polynomial LM (Trained From Scratch)
PolyFormer-Tiny
is a native, non-linear neural language model architecture
trained completely from scratch
without standard multi-layer perceptrons (MLP / SwiGLU).
Instead of conventional matrix projections with static activation functions,
PolyFormer
replaces all feed-forward network (FFN) blocks with
orthogonal Chebyshev polynomial tensor operators
and attention heads with
idempotent polynomial kernels
on an idempotent manifold (Π² = Π).
Official Patent:
Protected under
USPTO Application No. 64/149,540
(
Hardware-Accelerated Orthogonal Polynomial Tensor Operators, Zero-Backpropagation Closed-Form Algebraic Solvers, and In-Situ Weight Surgery for Deep Neural Networks and Transformers
).
Affiliation:
Computational Systems and Cognitive Architectures, Izmir, Turkey
3. 📈 Compute-Optimal Scaling: Catching Up to Double-Sized Baselines
A central question in compact non-linear design is whether parameter-reduced models hit an insurmountable capacity wall. To empirically verify this, we tracked PolyFormer's learning curve across extended optimization horizons:
Training Step
PolyFormer Loss
Perplexity (PPL)
Empirical Milestone & State
Step 50
2.0297
7.61
Rapid initial representation formation
Step 100
1.4259
4.16
Stable gradient flow through polynomial basis
Step 150
1.0396
2.83
Initial comparison checkpoint
Step 200
0.8195
2.27
Sub-token fine-grained convergence
Step 300
0.3941
1.48
🟢
Overtakes 1.13M Standard Baseline (Loss: 0.4034, PPL: 1.50)
Key Theoretical Takeaway:
Because orthogonal Chebyshev tensor contractions span a richer non-linear basis than static linear GEMMs, modest compute extension allows a
46.2% smaller model
to fully exceed double-sized baseline capacities while
permanently locking in 50% inference memory and VRAM savings
.
📐 Mathematical Formulation
1. Orthogonal Chebyshev Basis Recursion
Input representations are normalized onto the Chebyshev domain $[-1, 1]$:
x
~
=
tanh
(
x
)
∈
[
−
1
,
1
]
and projected onto orthogonal Chebyshev polynomials of the first kind:
T
0
(
x
)
=
1
,
T
1
(
x
)
=
x
,
T
k
+
1
(
x
)
=
2
x
T
k
(
x
)
−
T
k
−
1
(
x
)
2. Chebyshev Tensor FFN
Instead of 3 separate high-rank GEMM matrices (Gate, Up, Down projections), the feed-forward mapping is computed directly via 3D tensor contraction:
PolyFFN
(
x
)
=
k
=
0
∑
K
C
k
⋅
T
k
(
x
~
)
+
b
where the orthogonal coefficient tensor is parameterized as:
C
∈
R
(
K
+
1
)
×
d
in
×
d
out
3. Idempotent Chebyshev Attention Kernel
Attention scores pass through an orthogonal polynomial kernel filter:
S
=
d
k
Q
K
T
Attn
(
Q
,
K
,
V
)
=
softmax
(
k
=
0
∑
K
w
k
T
k
(
tanh
(
S
)
)
)
V
💻 Quickstart & Inference
Using Transformers (
AutoModelForCausalLM
)
import torch
from transformers import AutoConfig, AutoModelForCausalLM
# Load model directly from Hugging Face Hub
repo_id = "aecetin/PolyFormer-Tiny"
config = AutoConfig.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo_id, config=config, trust_remote_code=True)
# Encode prompt using byte-level tokens
prompt = "Mathematics, artificial intelligence, and geometric deep learning"
input_ids = torch.tensor([list(prompt.encode("utf-8"))], dtype=torch.long)
# Autoregressive generationwith torch.no_grad():
output_tokens = model.generate_tokens(input_ids, max_new_tokens=48, temperature=0.7)
generated_text = bytes(output_tokens[0].tolist()).decode("utf-8", errors="ignore")
print(generated_text)
Using Core Library (
idempotent-poly
)
pip install idempotent-poly
import torch
from idempotent_poly.polyformer import PolyFormerBlock
# Instantiate native PolyFormer block
block = PolyFormerBlock(d_model=128, n_heads=4, poly_degree=3)
# Test adaptive fixed-point early halting
x = torch.randn(1, 16, 128)
output, steps_taken = block.forward_adaptive(x, max_iters=5, tol=0.02)
print(f"Fixed-point reached in {steps_taken} adaptive iteration steps!")
📜 Citation & Intellectual Property
This work and its underlying mathematical architectures are protected under United States Patent Law:
@patent{cetin2026orthogonalpoly,
title={Hardware-Accelerated Orthogonal Polynomial Tensor Operators, Zero-Backpropagation Closed-Form Algebraic Solvers, and In-Situ Weight Surgery for Deep Neural Networks and Transformers},
author={Dr. Ahmet Emre {\c{C}}etin},
year={2026},
month={September},
note={U.S. Provisional Patent Application No. 64/149,540, Filed at USPTO}
}
Runs of aecetin PolyFormer-Tiny on huggingface.co
267
Total runs
5
24-hour runs
8
3-day runs
25
7-day runs
43
30-day runs
More Information About PolyFormer-Tiny huggingface.co Model
PolyFormer-Tiny huggingface.co is an AI model on huggingface.co that provides PolyFormer-Tiny's model effect (), which can be used instantly with this aecetin PolyFormer-Tiny model. huggingface.co supports a free trial of the PolyFormer-Tiny model, and also provides paid use of the PolyFormer-Tiny. Support call PolyFormer-Tiny model through api, including Node.js, Python, http.
PolyFormer-Tiny huggingface.co is an online trial and call api platform, which integrates PolyFormer-Tiny's modeling effects, including api services, and provides a free online trial of PolyFormer-Tiny, you can try PolyFormer-Tiny online for free by clicking the link below.
aecetin PolyFormer-Tiny online free url in huggingface.co:
PolyFormer-Tiny is an open source model from GitHub that offers a free installation service, and any user can find PolyFormer-Tiny on GitHub to install. At the same time, huggingface.co provides the effect of PolyFormer-Tiny install, users can directly use PolyFormer-Tiny installed effect in huggingface.co for debugging and trial. It also supports api for free installation.