Text Generation
Transformers
Safetensors
English
kent
ssm
state-space-model
recurrent
linear-time
frequency-domain
dct
mlp
swiglu
custom_code
fp16
base
Instructions to use Vi-LAB/KenT-1B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vi-LAB/KenT-1B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vi-LAB/KenT-1B-Base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Vi-LAB/KenT-1B-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Vi-LAB/KenT-1B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vi-LAB/KenT-1B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vi-LAB/KenT-1B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Vi-LAB/KenT-1B-Base
- SGLang
How to use Vi-LAB/KenT-1B-Base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Vi-LAB/KenT-1B-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vi-LAB/KenT-1B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Vi-LAB/KenT-1B-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vi-LAB/KenT-1B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Vi-LAB/KenT-1B-Base with Docker Model Runner:
docker model run hf.co/Vi-LAB/KenT-1B-Base
KenteaKe11 commited on
Commit ·
c6af2df
1
Parent(s): 3ee52d7
KenT-300M: 8 layers, d_x=1024, N=32, D=240
Browse files- .gitignore +0 -0
- README.md +8 -7
- config.json +5 -5
.gitignore
ADDED
|
Binary file (30 Bytes). View file
|
|
|
README.md
CHANGED
|
@@ -22,18 +22,19 @@ tags:
|
|
| 22 |
|
| 23 |
# KenT
|
| 24 |
|
| 25 |
-
KenT is a recurrent language model from the SSM family. KenT concentrates its capacity in
|
| 26 |
|
| 27 |
> This repo contains `trust_remote_code` code; weights are stored in **FP16**.
|
| 28 |
|
| 29 |
## Architectural Philosophy
|
| 30 |
|
| 31 |
-
- **
|
| 32 |
one transformation block. The layers are connected in sequence through the representation stream, and the last layer produces
|
| 33 |
-
the final output.
|
|
|
|
| 34 |
- **Invest in the transformation core.** Capacity is concentrated in the "hidden" part, where features are actually transformed,
|
| 35 |
-
rather than in the vocabulary table. Parameters were scaled from ~100M to ~300M
|
| 36 |
-
|
| 37 |
- **Two streams, two roles.** One stream is a representation carrying information about the current token; the other is a memory
|
| 38 |
stream that aggregates history. The two streams meet only through learned projections and are never mixed directly.
|
| 39 |
- **Frequency as a fixed foundation, learning where it's needed.** Features are processed in the cosine-coefficient space using a
|
|
@@ -42,8 +43,8 @@ KenT is a recurrent language model from the SSM family. KenT concentrates its ca
|
|
| 42 |
- **Memory with learned forgetting.** History is summarized with an exponential moving average
|
| 43 |
`H_t = (1 - a) H_{t-1} + a u_t`, where `a` is a single learned scalar per layer. Its initial value decreases with depth
|
| 44 |
(shallow layers forget fast, deep layers remember longer). The decoding state has **constant** size regardless of context length.
|
| 45 |
-
- **
|
| 46 |
-
|
| 47 |
- **Chunk-parallelizable.** The moving average is a linear recurrence, so a long document can be split into blocks/chunks,
|
| 48 |
processed concurrently, and merged with an affine scan, yielding the same result as sequential processing.
|
| 49 |
|
|
|
|
| 22 |
|
| 23 |
# KenT
|
| 24 |
|
| 25 |
+
KenT is a recurrent language model from the SSM family. KenT concentrates its capacity in a very wide spectral representation: few layers, each with a single transformation block, and a light learned-forgetting memory.
|
| 26 |
|
| 27 |
> This repo contains `trust_remote_code` code; weights are stored in **FP16**.
|
| 28 |
|
| 29 |
## Architectural Philosophy
|
| 30 |
|
| 31 |
+
- **Shallow stack, wide spectrum.** KenT stacks a few identical recurrent layers (8 in this ~300M model), each containing exactly
|
| 32 |
one transformation block. The layers are connected in sequence through the representation stream, and the last layer produces
|
| 33 |
+
the final output. The representation stream feeding `lm_head` is wide (1024), and each layer's Bilinear projection expands it
|
| 34 |
+
into a large resolution axis (N = 32 DCT positions) with enough features per position (D = 240) before the DCT.
|
| 35 |
- **Invest in the transformation core.** Capacity is concentrated in the "hidden" part, where features are actually transformed,
|
| 36 |
+
rather than in the vocabulary table. Parameters were scaled from ~100M to ~300M by widening the representation stream and the
|
| 37 |
+
spectral axes (N and D together), not by stacking more layers.
|
| 38 |
- **Two streams, two roles.** One stream is a representation carrying information about the current token; the other is a memory
|
| 39 |
stream that aggregates history. The two streams meet only through learned projections and are never mixed directly.
|
| 40 |
- **Frequency as a fixed foundation, learning where it's needed.** Features are processed in the cosine-coefficient space using a
|
|
|
|
| 43 |
- **Memory with learned forgetting.** History is summarized with an exponential moving average
|
| 44 |
`H_t = (1 - a) H_{t-1} + a u_t`, where `a` is a single learned scalar per layer. Its initial value decreases with depth
|
| 45 |
(shallow layers forget fast, deep layers remember longer). The decoding state has **constant** size regardless of context length.
|
| 46 |
+
- **Width is the main axis.** There is no inner chain of blocks inside a layer: each layer applies one DCT/SwiGLU block over a
|
| 47 |
+
large N x D grid, and memory timescale still varies across the 8 layers.
|
| 48 |
- **Chunk-parallelizable.** The moving average is a linear recurrence, so a long document can be split into blocks/chunks,
|
| 49 |
processed concurrently, and merged with an affine scan, yielding the same result as sequential processing.
|
| 50 |
|
config.json
CHANGED
|
@@ -9,11 +9,11 @@
|
|
| 9 |
"AutoModelForCausalLM": "model.KentForCausalLM"
|
| 10 |
},
|
| 11 |
"vocab_size": 50257,
|
| 12 |
-
"hidden_size":
|
| 13 |
-
"num_hidden_layers":
|
| 14 |
-
"resolution_size":
|
| 15 |
-
"feature_dim":
|
| 16 |
-
"intermediate_size":
|
| 17 |
"rms_norm_eps": 1e-05,
|
| 18 |
"use_bias": true,
|
| 19 |
"initializer_range": 0.02,
|
|
|
|
| 9 |
"AutoModelForCausalLM": "model.KentForCausalLM"
|
| 10 |
},
|
| 11 |
"vocab_size": 50257,
|
| 12 |
+
"hidden_size": 1024,
|
| 13 |
+
"num_hidden_layers": 8,
|
| 14 |
+
"resolution_size": 32,
|
| 15 |
+
"feature_dim": 240,
|
| 16 |
+
"intermediate_size": 960,
|
| 17 |
"rms_norm_eps": 1e-05,
|
| 18 |
"use_bias": true,
|
| 19 |
"initializer_range": 0.02,
|