Drop the FFN – A Column Attention Transformer for TinyStories
The 107M-parameter Drop the FFN model replaces feed-forward networks across eight Transformer blocks with column attention, reaching 4.10189 perplexity.
By Dillip Chowdary • Dec 06, 2026 • Source: github.com

At a glance
- Model
- Column Attention 256 slots (107,279,872 parameters)
- Architecture
- 8 Transformer blocks, 512 channels, no FFN
- Checkpoint
- Step 62,500 after 1.77 epochs on TinyStories
- Validation score
- 1.41145 NLL and 4.10189 perplexity on RTX 5090
- Requirements
- Python 3.12, PyTorch 2.11.0+cu130 for GPU scoring
- Availability
- Open-source code and checkpoint on GitHub
In this post
Developer jiaminres has released Drop the FFN, a 107M-parameter language model that replaces the static feed-forward network in all eight Transformer blocks with column attention, according to github.com's report. Whereas ordinary causal attention lets each token look back at earlier tokens, column attention lets each token use its own activations to decide how to mix its 512 channels. The release includes Python inference scripts, validation tools, and a 62,500-step checkpoint trained on TinyStories.
This article explains why the project targets local hardware memory limits, how to run the checkpoint on a CPU, and how its TinyStories validation scores compare against an official baseline. It also details the projection math behind column attention and the commands for reproducing scores or training from scratch. Machine learning engineers, researchers, and hobbyists experimenting with compact local language models can run every step offline.
01Local inference limits and channel mixing
The project aims to run capable language models directly on personal computers and robots with less reliance on cloud inference. A consumer GPU can have enough compute to run a model and still run out of memory for its weights. Moving weights from system RAM slows generation, while buying a GPU with more memory raises the cost of running a model locally.
By having each token compute its own channel-mixing weights, jiaminres tests whether a model can do more work per token and reach comparable prediction quality with fewer parameters. The experiment starts with TinyStories to measure next-token prediction quality after replacing every FFN. Fewer parameters would also reduce the gradient bytes consumer GPUs must exchange over a network per update during distributed training.
02Running the offline CPU story checkpoint
Running the released checkpoint offline on a CPU requires Python 3.12, the repository's configuration and tokenizer files, and the downloaded column-attention-256-step-62500.pt weights file placed in the repository root. After installing dependencies, users can pass any quoted opening prompt to generate_story.py to produce up to 256 new tokens, stopping earlier if the model reaches the end of the story.
- Install the required Python packages once in the environment using python -m pip install -r requirements.txt.
- Download column-attention-256-step-62500.pt into the repository root directory alongside the README.
- Generate a story on CPU and save it by running python generate_story.py --checkpoint column-attention-256-step-62500.pt --prompt "One day, a little bird found a red ribbon." --max-new-tokens 256 --out runs/story.json.
Users can open runs/story.json and inspect the full_text field to read the completed output. Changing the quoted string after --prompt lets users test custom story openings without a GPU.
03TinyStories validation against the 33M baseline
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
The released column-attention-256-step-62500.pt checkpoint was saved at step 62,500 after 1.77 epochs on TinyStories. On the same RTX 5090 GPU, jiaminres evaluated it against the official TinyStories-2Layers-33M model, which is the official checkpoint closest in total parameter count. Out of the first 1,401 complete validation stories, 262 matched a training story's exact token sequence and were excluded, leaving 1,139 stories and 215,176 next-token targets.
| Model | Total parameters | Validation loss (NLL) | Perplexity |
|---|---|---|---|
| Column Attention · 256 slots | 107,279,872 | 1.41145 | 4.10189 |
| Official TinyStories-2Layers-33M | 78,748,672 | 1.56327 | 4.77440 |
Reproducing these scores requires a BF16-capable NVIDIA GPU and the CUDA 13.0 build of PyTorch (torch==2.11.0+cu130). Users run download_assets.py and prepare_data.py to fetch and tokenize the stories, then execute story_validation.py with --official or --checkpoint, --device cuda, and --threads 8 to write runs/official-score.json and runs/column-score.json. The scorer processes four blocks of up to 512 tokens in BF16 mixed precision, outputs story_val_nll and story_val_ppl, and accepts --device cpu for CPU evaluation.
Note: The column-attention model has 36.2% more parameters than TinyStories-2Layers-33M and differs in depth, positional encoding, and training history, so an equal-size comparison with matching training budgets is still needed to isolate the FFN replacement's effect.
04Column attention projections and complexity math
Inside each block, a token splits its 512 channels into eight groups, and each group produces 256 queries while the full token supplies 256 shared keys and 256 scalar values. Each query and key has 54 components, so every group computes softmax(QKᵀ / √54) to mix the scalar values before concatenating all eight outputs and projecting back to 512 channels. All eight groups apply the same Q matrix to their 64 input channels, while the output projection accepts all 8m concatenated channels.
| Projection | Weight count | At m = 256 |
|---|---|---|
| Q (64 input channels per group) | 64 × (54m) = 3,456m | 884,736 |
| K (all 512 input channels) | 512 × (54m) = 27,648m | 7,077,888 |
| V (all 512 input channels) | 512 × m = 512m | 131,072 |
| Output (eight groups concatenated) | (8m) × 512 = 4,096m | 1,048,576 |
| Total per layer | 35,712m | 9,142,272 |
With m slots per group, the four projections total 35,712m learned weights per layer, or 9,142,272 weights at m = 256. Scoring requires 8 × 54 × m² multiply–accumulates per token, meaning doubling the slots doubles projection weights but quadruples score computations. At a fixed channel width, column attention scales at O(n) for a sequence of n tokens, whereas global row attention with RoPE still scales at O(n²).
05Training, resuming, and exporting local weights
Training a model from scratch uses the CUDA PyTorch build, the prepared token data, and a Triton column kernel, with Windows GPU setups also requiring triton-windows==3.7.0.post26. Users launch a 20-epoch run with train_full_epochs.py --cpu-optimizer --max-epochs 20 --micro-batch 40 --batch-sequences 40, which runs the AdamW optimizer on the CPU. If GPU memory runs short, lowering --micro-batch while keeping --batch-sequences 40 preserves 40 sequences per update.
Interrupted runs can be continued from the saved full checkpoint by running train_full_epochs.py --resume. Users can also start a local loss dashboard in a second terminal via live_loss.py --host 127.0.0.1 and view it at http://127.0.0.1:8765/. Finally, export_checkpoint.py --checkpoint runs/dynamic_global54_sharedv_256_rope_story20/checkpoint.pt --out column-attention-local.pt exports standalone inference weights from a completed training checkpoint.
Frequently asked questions
What does Drop the FFN replace in a Transformer?
It replaces the static feed-forward network (FFN) in all eight Transformer blocks with column attention. Each token uses its own activations to compute channel-mixing weights across its 512 channels.
How does the column-attention checkpoint score on TinyStories?
Evaluated on 1,139 non-duplicate validation stories (215,176 next-token targets) on an RTX 5090, it achieved 1.41145 NLL loss and 4.10189 perplexity. The official TinyStories-2Layers-33M model scored 1.56327 NLL and 4.77440 perplexity on the same inputs, though it has 36.2% fewer parameters.
Can you run Drop the FFN without a GPU?
Yes, once Python 3.12, the requirements, and column-attention-256-step-62500.pt are in place, generate_story.py generates up to 256 new tokens offline on CPU. Users can also pass --device cpu to story_validation.py for CPU evaluation.
How many weights does column attention use per layer?
With m slots per group, the Q, K, V, and Output projections total 35,712m learned weights per layer. At m = 256, that equals 9,142,272 weights per layer.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement