whatisgithub

What is kata?

ayghri/kata — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · researcherComplexity · 5/5Setup · hard

In one sentence

A research attention layer for language models that recalls information by content instead of position, enabling longer-context reasoning.

Mindmap

mindmap
  root((KATA))
    What it does
      Content based recall
      Long context extrapolation
      Overwrite old memories
    Tech stack
      Triton kernels
      PyTorch
      Hugging Face
    Use cases
      Train 340M LLM
      Reproduce recall benchmarks
      Swap in custom attention
    Audience
      ML researchers
      Attention mechanism designers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Train a 340M parameter language model using a new content-based attention mechanism.

USE CASE 2

Reproduce published recall benchmarks (MQAR and overwrite tasks) comparing attention architectures.

USE CASE 3

Swap the KATA kernel into a Hugging Face model to experiment with long-context recall.

What is it built with?

PythonPyTorchTritonHugging FaceHydraCUDA

How does it compare?

ayghri/kata0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity5/52/54/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

Needs a CUDA GPU, Hugging Face and Weights and Biases accounts, and a multi-step training pipeline.

So what is it?

KATA is a research project that builds a new kind of attention layer for language models, the part of a model that decides which earlier words matter when predicting the next one. Instead of the usual approach, KATA scores how related two tokens are by squaring their combined similarity, which lets it recall information based on content rather than on position in the text. Because it does not rely on position, a model trained on short sequences can still work reasonably well on much longer ones. A variant called DeltaKATA adds the ability to overwrite or erase earlier stored information when new, related information arrives, something that simpler gated models cannot do as directly. The repository contains three main pieces. First, production-ready GPU kernels written in Triton that make the attention computation fast. Second, a model and training setup that plugs into the popular Hugging Face library, so it can be trained as a roughly 340 million parameter language model using standard tools like torchrun and Hydra configuration files. Third, a set of synthetic benchmarks that test how well a model can remember and update key value pairs over long sequences, used to reproduce the tables and figures from the associated research paper. Setting it up requires a Python environment built with the uv tool, a modern GPU (Nvidia Ampere or newer), and accounts with Hugging Face and Weights and Biases for downloading data and logging training runs. This is not a beginner-friendly, install-and-go tool. It is aimed at machine learning researchers who want to train language models from scratch, experiment with new attention designs, or compare KATA against existing methods like Transformers, DeltaNet, and Mamba2 on standardized recall tests. There is no mention of a lighter-weight way to try the ideas without a full training pipeline and GPU hardware.

Copy-paste prompts

Prompt 1
Explain how KATA's SPD feature map differs from standard softmax attention in simple terms.
Prompt 2
Walk me through setting up the uv-based environment and training a KATA-cat-M2 340M model on 4 GPUs.
Prompt 3
Help me write a script to load the KATA kernel into a Hugging Face AutoModelForCausalLM.
Prompt 4
Compare KATA to DeltaNet and Mamba2 based on this repo's benchmark configs.

Frequently asked questions

What is kata?

A research attention layer for language models that recalls information by content instead of position, enabling longer-context reasoning.

What language is kata written in?

Mainly Python. The stack also includes Python, PyTorch, Triton.

How hard is kata to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is kata for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.