Natural language processing
Language models built and measured in-house, starting with Titan-nano. Next: how tokenization treats Indian languages.
NeuroTitan AI · Titan-nano v1
Titan-nano is a 1.85-million-parameter transformer that NeuroTitan Labs designed, trained and tested in-house on Python code. It has learned the shape of Python (indentation, keywords, brackets, naming) but not yet what code means. It runs entirely in your browser on an inference engine we wrote ourselves: no AI library, no server, nothing you type leaves your device.
Live demo
Start some code and press Complete. You see the model's real probabilities for the next character and, as red shading, which earlier characters its attention picked out. Choose any layer or head.
Prompt · Titan-nano · shading = attention of the last character
Results
The test set is 24 whole files from the standard library, held out by file before training, 376,896 characters in all. Lower bits per character means the model is less surprised by real code.
| Model | Bits / char ↓ | Next-char accuracy ↑ |
|---|---|---|
| Titan-nano, int8 (what this page runs) | 1.385 | 73.3% |
| Titan-nano, float32 | 1.384 | 73.4% |
| Best n-gram (order 5, picked on validation) | 1.581 | not measured |
| Character frequencies only (unigram) | 4.773 | not measured |
| Random guessing (96 symbols) | 6.585 | 1.0% |
n-grams use Witten-Bell smoothing; their order was chosen on the validation split, never on test. Quantizing to int8 changed the test score by 0.000 bits per character.
Training run · 2,200 steps · 42 min
Unedited samples · temperature 0.5 · seed 0 · not cherry-picked
class Stack: def __init__(self): return self.__init__(self, self.__init__) def _context(self, self, self): self.__context = self._context.__context__ self._contex
def read_config(path):
The second prompt shows a failure: the model got stuck producing spaces. We show it because it happens.
How Titan-nano works
The same decoder-only transformer design as large language models (Vaswani et al.,“Attention Is All You Need”, 2017), at a size you can read end to end. Our browser engine is about 250 lines of TypeScript and matches our PyTorch model on fixed test prompts.
Titan-nano reads code one character at a time from a 96-symbol alphabet: printable ASCII plus newline. No tokenizer is needed, which keeps the whole model small enough to explain and to run in a browser.
vocabulary 96 · context 256 charactersEach character becomes a vector of 192 numbers looked up from a learned table, and a second learned table adds where in the window it sits.
x = tok[ch] + pos[t] (192 dims)In each layer, 4 attention heads let every position gather information from earlier positions: the matching bracket, the indentation of the line above, the name of a variable defined earlier. A causal mask stops it from seeing the future. You can watch this in the demo.
Attention(Q, K, V) = softmax(QKᵀ / √d) VA small feed-forward network (768 hidden units) follows attention. Attention plus feed-forward is one layer; Titan-nano stacks 4, with residual connections and LayerNorm.
4 layers × (attention + MLP) · 1.85M parametersThe final vector is compared with every character's embedding to score all 96 possibilities. Softmax turns scores into the probabilities you see in the demo; one character is chosen and the loop repeats.
p(next) = softmax(LN(h) · tokᵀ)Limits
Reproduce it
Python 3.13.5, PyTorch 2.11.0, CPU only. The published run lost about ten minutes at the start to Windows power throttling; the README explains how to avoid it.
$ python data.py --out data
$ python train.py --steps 2200 --bs 32 --seed 1337
$ python baselines.py
$ python export.py
$ node --experimental-strip-types parity.test.ts
Data: Python 3.13.5 standard library (.py files, test suites excluded), under the Python Software Foundation License. Code, logs and weights.
Domains
Language models built and measured in-house, starting with Titan-nano. Next: how tokenization treats Indian languages.
Recognition, detection and segmentation with OpenCV and deep networks, measured on public datasets with fixed splits.
Agents that learn from interaction, including reinforcement-learning search over neural architectures.
How structure (depth, width, attention, quantization) trades accuracy against memory and speed on ordinary hardware.
Fair baselines, honest error bars and reproducible evaluations, so a claim about a model can be checked by someone else.
Models that produce text, images and code: what they can be trusted with, and what it costs to run them locally.