NeuroTitan AI · Titan-nano v1

Our first model, built from scratch.

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.

model card · titan-nano-v1
Architecture
Decoder-only transformer · 4 layers · 4 heads · width 192
Parameters
1,847,424
Trained on
10,393,363 characters of Python (634 files)
Training compute
42 min wall-clock on one laptop CPU (Intel i9-13980HX, no GPU) · seed 1337
Test score
1.385 bits/char · 12% fewer bits than the best n-gram
Download
1.91 MB of int8 weights

Live demo

Write Python. Watch it think.

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.

Titan-nano · live in your browser

Model loads when you reach this panel (1.9 MB)

Prompt · Titan-nano · shading = attention of the last character

Results

Measured on code it never saw

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.

ModelBits / char ↓Next-char accuracy ↑
Titan-nano, int8 (what this page runs)1.38573.3%
Titan-nano, float321.38473.4%
Best n-gram (order 5, picked on validation)1.581not measured
Character frequencies only (unigram)4.773not measured
Random guessing (96 symbols)6.5851.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

Titan-nano training curveBits per character on training and validation data, falling from 3.3345 to 1.6867bits on validation over 2200 steps. Best n-gram baseline on test: 1.5813 bits.1.01.52.02.53.03.54.00600110017002200training stepbits per characterbest n-gram (order 5) · 1.58
validation training (smoothed) best n-gram on test

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

Five steps, repeated for every character

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.

  1. 01

    Read characters

    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 characters
  2. 02

    Embed

    Each 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)
  3. 03

    Attend

    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) V
  4. 04

    Transform

    A 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 parameters
  5. 05

    Predict

    The 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

What it cannot do

  • It has seen one codebase: the Python standard library. It writes in that style and knows nothing else.
  • It writes code that looks like Python but usually does not make sense: it has learned structure, not meaning.
  • Always choosing the single most likely character makes it loop ("filename, filename, …"). The demo samples at temperature 0.5 to reduce this. On some prompts it still gets stuck, for example emitting only spaces.
  • It does not plan programs, follow instructions or answer questions.
  • Its window is 256 characters, so it forgets anything earlier in a long file.
  • It can produce code that looks right and is wrong. Never run its output without reading it.
  • It is a research model and a teaching tool, not a product.

Reproduce it

Every number on this page, from five commands

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.

research/titan-nano

$ 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

Six areas of AI we work across

01

Natural language processing

Language models built and measured in-house, starting with Titan-nano. Next: how tokenization treats Indian languages.

02

Computer vision

Recognition, detection and segmentation with OpenCV and deep networks, measured on public datasets with fixed splits.

03

Reinforcement learning

Agents that learn from interaction, including reinforcement-learning search over neural architectures.

04

Neural architecture

How structure (depth, width, attention, quantization) trades accuracy against memory and speed on ordinary hardware.

05

AI safety and evaluation

Fair baselines, honest error bars and reproducible evaluations, so a claim about a model can be checked by someone else.

06

Generative AI

Models that produce text, images and code: what they can be trusted with, and what it costs to run them locally.