Text Generation
Transformers
Safetensors
ncp_smol
next-concept-prediction
conceptlm
causal-lm
smollm2
tessera
custom_code
Instructions to use yava-code/Tessera-135M-Gate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yava-code/Tessera-135M-Gate with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yava-code/Tessera-135M-Gate", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("yava-code/Tessera-135M-Gate", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yava-code/Tessera-135M-Gate with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yava-code/Tessera-135M-Gate" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yava-code/Tessera-135M-Gate", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yava-code/Tessera-135M-Gate
- SGLang
How to use yava-code/Tessera-135M-Gate 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 "yava-code/Tessera-135M-Gate" \ --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": "yava-code/Tessera-135M-Gate", "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 "yava-code/Tessera-135M-Gate" \ --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": "yava-code/Tessera-135M-Gate", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use yava-code/Tessera-135M-Gate with Docker Model Runner:
docker model run hf.co/yava-code/Tessera-135M-Gate
Rewrite card intro: lead with the story, move numbers to a section
Browse files
README.md
CHANGED
|
@@ -13,28 +13,29 @@ license: apache-2.0
|
|
| 13 |
|
| 14 |
# Tessera-135M-Gate
|
| 15 |
|
| 16 |
-
The
|
| 17 |
-
|
| 18 |
-
Next Concept Prediction path)
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
model quality result
|
|
|
|
| 22 |
|
| 23 |
## TL;DR
|
| 24 |
|
| 25 |
-
|
| 26 |
-
story it records is the point of publishing it.
|
| 27 |
|
| 28 |
-
- **All three objectives train** (NTP, NCP, VQ fell 41 to 43% over the run)
|
| 29 |
-
|
| 30 |
feedback costs +0.0205 nats of held-out NTP loss.
|
| 31 |
-
- **
|
| 32 |
-
|
| 33 |
-
nothing (+0.000). At 1B tokens the same architecture left the shortcut far
|
| 34 |
-
behind (perplexity 7.55, usage 85.6%, zero-delta +0.105). Gate small, then
|
| 35 |
-
scale: some behaviors only appear above a scale threshold.
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
| Metric | Value |
|
| 40 |
| --- | ---: |
|
|
@@ -74,8 +75,8 @@ intervention evaluation JSON (also shipped in this repository as `eval.json` and
|
|
| 74 |
```python
|
| 75 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 76 |
|
| 77 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
| 78 |
-
model = AutoModelForCausalLM.from_pretrained("
|
| 79 |
```
|
| 80 |
|
| 81 |
## The Tessera family
|
|
|
|
| 13 |
|
| 14 |
# Tessera-135M-Gate
|
| 15 |
|
| 16 |
+
The smallest member of the Tessera family, and the reason the bigger ones exist.
|
| 17 |
+
This 135M `architecture-gate checkpoint` (a `HuggingFaceTB/SmolLM2-135M` backbone
|
| 18 |
+
with the full Next Concept Prediction path) was trained on a deliberately overfit
|
| 19 |
+
TinyStories subset before any large spend, to prove the whole path - concept
|
| 20 |
+
pooling, quantized codes, causal concept blocks, feedback - trains end to end.
|
| 21 |
+
It is not a language-model quality result, and it is not meant to be: what makes
|
| 22 |
+
it worth publishing is what broke, and what the break predicted at scale.
|
| 23 |
|
| 24 |
## TL;DR
|
| 25 |
|
| 26 |
+
Small and cheap on purpose: this gate run exists to de-risk the 1B-token comparison before spending on it. It earned its keep in both directions.
|
|
|
|
| 27 |
|
| 28 |
+
- **All three objectives train** (NTP, NCP, VQ fell 41 to 43% over the run),
|
| 29 |
+
and the decoder causally uses the concept channel even at 135M: zeroing the
|
| 30 |
feedback costs +0.0205 nats of held-out NTP loss.
|
| 31 |
+
- **It also caught a real failure mode**: effective codebook perplexity stayed
|
| 32 |
+
near 2.4 with usage around a third of the codebook, and shuffled feedback cost nothing - a low-entropy shortcut the 1B-token run later left far behind. Gate small, then scale: some behaviors only appear above a scale threshold.
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
+
|
| 35 |
+
## Numbers
|
| 36 |
+
|
| 37 |
+
The raw record this narrative is built from; per-arm READMEs and the whitepaper hold the
|
| 38 |
+
full analysis.
|
| 39 |
|
| 40 |
| Metric | Value |
|
| 41 |
| --- | ---: |
|
|
|
|
| 75 |
```python
|
| 76 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 77 |
|
| 78 |
+
tokenizer = AutoTokenizer.from_pretrained("yava-code/Tessera-135M-Gate")
|
| 79 |
+
model = AutoModelForCausalLM.from_pretrained("yava-code/Tessera-135M-Gate", trust_remote_code=True)
|
| 80 |
```
|
| 81 |
|
| 82 |
## The Tessera family
|