KiT: Letting the model draw future candlesticks
A weather forecast doesn't just say "tomorrow will be 23 degrees"; it says "a 60% chance of rain." Because tomorrow inherently has many possibilities.
KiT looks at stocks with the same idea: after reading a stretch of candlesticks, it doesn't give just a single number, but draws 16 (or more) possible future trajectories. Below is one of its real outputs—drag the slider and watch those 16 lines "grow" out of a blob of noise:
The model first reads history: the past 400 1-hour bars (only the last 48 are shown here).
What is KiT
KiT is a K-line prediction foundation model proposed by Boyu Zhang and Haorui Li; see the paper at arXiv:2609.34507. Its code and weights are open source (AGPL-3.0). It was trained on billions of candlesticks across seven granularities from 1 minute to 1 day, covering US stocks, A-shares, and cryptocurrencies. In the paper's tests, it outperformed comparison models such as Kronos, Chronos, and TimesFM on both return prediction and volatility prediction.
What you'll have in hand after this course
- An environment with KiT installed, plus the official model with 2.84×10^8 parameters
- Prediction charts you generated yourself: any demo stock, any point in time, seven granularities
- An understanding of what evaluation and backtesting compute, and what RankIC 0.057 in the paper means
- A small KiT you trained yourself, and a version fine-tuned on new 2026 data—both able to produce prediction charts
- The ability to read the entire paper: why each design choice was made, and how much the ablation experiments prove it's worth
What you need to prepare
- An NVIDIA GPU. The official recommendation is 6GB+ of VRAM; we used an RTX 4080 SUPER 16GB, where a single inference on 1-hour candles peaked at about 2.1GB and training the small model took about 4.3GB
- Python 3.10 or later, and the ability to type commands in a terminal
- About 3GB of disk space: 1.1GB for weights, 1.2GB for demo data
This is for people who have learned a bit about neural networks: knowing what training, loss functions, and Transformers are is enough. You don't need prior knowledge of diffusion models or flow matching—the course starts from examples and then works down to formulas, tensor shapes, and source code. If you only want to use the model to produce predictions, the first two chapters require no machine learning background at all.
Course outline
| Stage | What you'll accomplish |
|---|---|
| Getting Started | Understand what KiT is doing; set up the environment, weights, and data; generate your first prediction chart |
| Inference | Switch stocks, time points, and granularities; trade off between speed and precision; understand evaluation and backtesting; plug in your own data |
| Training | Understand the model architecture and training objective; train a small model with 3100×10^4 parameters from scratch; fine-tune on the official weights |
| Reading the Paper | Read the KiT paper from scratch: three hard problems and three answers, the rationale behind each design, and how to read every results table and ablation |
| Quick Reference | Errors and common questions |
reminder
This course only covers how to use and train the model, for learning and research purposes. Model outputs do not constitute any investment advice, and backtest results do not represent future returns.
Start from What is KiT.