Kronos: A Foundation Model for the Language of Financial Markets
Deutsch | Español | Français | 日本語 | 한국어 | Português | Русский | 中文

- Overview
Kronos is the first open-source foundation model dedicated to the language of financial markets, specifically the candlestick cadence known as K-lines. It has been trained on data streams from more than 45 global exchanges, carving out a domain-specific capability that general-purpose time-series models struggle to achieve.
Architecture and learning paradigm:
Kronos follows a decoder-only foundation-model design, optimized to capture sequential patterns, volatility, and micro-structure noise that dominate financial time series.
The core two-stage framework begins with a specialized tokenizer that quantizes continuous, multi-dimensional K-line data—variables such as Open, High, Low, Close, Volume, and sometimes Amount—into a hierarchy of discrete tokens. This token layer effectively compresses and structures chaotic market signals into a tractable symbolic representation.
A large autoregressive Transformer is then pre-trained on these hierarchical tokens, enabling a single model to perform a broad spectrum of quantitative tasks—from forecasting to scenario analysis, and multi-asset reasoning—without task-specific architectures.
Visual anchor: an overview diagram encapsulates the end-to-end pipeline from raw OHLCV streams through hierarchical tokenization to autoregressive forecasting.

Live forecasting capability: Kronos deploys a live demo that visualizes forecasts for prominent trading pairs, providing an interactive glimpse into its predictive performance and uncertainty across a forward horizon.
Model zoo philosophy: a family of pre-trained Kronos models is released to accommodate different compute budgets and application needs. Each model ships with a dedicated tokenizer and a context window appropriate to its size, enabling rapid experimentation and deployment.
The Kronos documentation emphasizes practical guidance: installation, forecasting workflows, batch processing, and a complete finetuning recipe that spans data preparation, tokenizer adaptation, and backtesting.
- News and Milestones
2025.11.10: Kronos has been accepted by AAAI 2026, signaling recognition of its methodological contribution and its potential impact on the field of financial-machine-learning research.
2025.08.17: The team released scripts to fine-tune Kronos, enabling practitioners to adapt the model to their own markets, instruments, and data modalities. The release is intended to lower the barrier to domain customization and accelerate experimental workflows.
2025.08.02: The Kronos paper is publicly available on arXiv, providing the scholarly foundation, methodology, experiments, and discussions that accompany the open-source release.
The project maintains a live demo ecosystem, code examples, and clear guidance for researchers and practitioners who want to reproduce results or tailor Kronos to their research questions.
- Introduction to Kronos
Kronos is a family of decoder-only foundation models tailored to the language of financial markets—the K-line sequences that traders and researchers monitor daily. The design acknowledges the distinctive characteristics of financial data: non-stationarity, irregular micro-movements, bursts of volatility, and high noise levels that can obscure signal from noise.
Key design choice: a two-stage learning paradigm that converts raw candlestick data into a symbolic, discrete representation before learning the forecasting task. This separation helps stabilize training, facilitates cross-asset generalization, and supports flexible downstream tasks.
Stage 1 — Tokenization:
The continuous OHLCV data are quantized into hierarchical discrete tokens. This discretization preserves essential structure (orderings, magnitudes, volatility regimes) while reducing sensitivity to sampling artifacts and minor fluctuations.
The tokenizer is designed to adapt to multi-dimensional data streams, enabling a unified vocabulary for open, high, low, close, volume, and potentially other features.
The tokenized sequence becomes the linguistic substrate for the downstream Transformer, enabling efficient learning of temporal patterns and conditional dependencies.
Stage 2 — Autoregressive Pre-training:
A large Transformer is trained to predict future tokens conditioned on past tokens, i.e., a classic autoregressive setup tuned for financial sequence data.
This pre-training yields a versatile model capable of serving diverse quantitative tasks: one-step forecasts, multi-step horizons, conditional forecasting across assets, and even scenario-based reasoning.
Visual anchor: to accompany this conceptual framework, Kronos provides an overview diagram that clarifies how raw K-line streams are transformed into tokens and consumed by an autoregressive model.

The Kronos ecosystem emphasizes accessibility: a variety of model sizes and corresponding tokenizers are provided to fit different hardware budgets and application needs, all accessible via the Hugging Face Hub.
- Live Demo
Kronos offers a live demonstration that illustrates forecasting results on real market data, delivering a practical impression of the model’s behavior in near-real-time or near-realistic simulations.
Demonstration focus: BTC/USDT price dynamics over a 24-hour horizon. The demonstration emphasizes the model’s capability to generate plausible trajectories for price, high/low bands, and volume-related variables, presenting a snapshot of predictive uncertainty and potential risk/return profiles.
Access and exploration:
The live demo is hosted to enable interactive exploration of forecast trajectories, allowing researchers and practitioners to inspect how predictions evolve with different lookback windows and forecast lengths.
Access the live demo here: https://shiyu-coder.github.io/Kronos-demo/
Visual aid: a forecast example image illustrates typical outputs from the demo, showcasing the forecasted open/high/low/close alongside volume and other indicators.

- Model Zoo: Kronos Family
Kronos-mini
Tokenizer: Kronos-Tokenizer-2k
Context length: 2048
Parameters: 4.1M
Open-source: Yes
Access: NeoQuasar/Kronos-mini
Kronos-small
Tokenizer: Kronos-Tokenizer-base
Context length: 512
Parameters: 24.7M
Open-source: Yes
Access: NeoQuasar/Kronos-small
Kronos-base
Tokenizer: Kronos-Tokenizer-base
Context length: 512
Parameters: 102.3M
Open-source: Yes
Access: NeoQuasar/Kronos-base
Kronos-large
Tokenizer: Kronos-Tokenizer-base
Context length: 512
Parameters: 499.2M
Open-source: No (not open-source)
Access: NeoQuasar/Kronos-large (not openly mirrored as of the listed release)
The Model Zoo structure reflects a spectrum of capabilities, balancing speed, memory footprint, and predictive power. Users can start with Kronos-mini for experimentation and scale up to Kronos-base to capture richer temporal dependencies, while Kronos-large remains an option for environments with substantial GPU resources and advanced research needs.
- Getting Started
Installation prerequisites:
Python 3.10+ is required.
Dependencies are installed via: pip install -r requirements.txt
Forecasting workflow: KronosPredictor provides a streamlined API to preprocess data, normalize inputs, forecast, and inverse-normalize outputs, enabling end-to-end forecasts with only a handful of commands.
Important constraint:
The maximum context length (max_context) for Kronos-small and Kronos-base is 512. This defines the longest historical window that can be fed into the model in a single forward pass.
When your lookback window exceeds this limit, KronosPredictor automatically truncates inputs to fit the context.
Step-by-step guide to your first forecast:
1) Load the Tokenizer and Model
Example (Python):
- from model import Kronos, KronosTokenizer, KronosPredictor
- tokenizer = KronosTokenizer.from_pretrained("NeoQuasar/Kronos-Tokenizer-base")
- model = Kronos.from_pretrained("NeoQuasar/Kronos-small")
2) Instantiate the Predictor
Example:
- predictor = KronosPredictor(model, tokenizer, max_context=512)
3) Prepare Input Data
The predict method expects:
- df: a pandas DataFrame with historical OHLCV data, with columns ['open','high','low','close'] (volume and amount are optional).
- x_timestamp: a pandas Series of timestamps for the historical data.
- y_timestamp: a pandas Series of timestamps for the future periods to predict.
Example code snippet for data loading and timestamp handling is provided in the repository, illustrating how to build the input tensors for the predictor.
4) Generate Forecasts
Call predictor.predict with appropriate arguments to obtain forecasts for open/high/low/close/volume/amount.
Control sampling via T (temperature), topp (nucleus sampling), and samplecount (forecast paths) to shape stochasticity and aggregation.
5) Example and Visualization
A runnable script demonstrates full end-to-end forecasting, including data loading, prediction, and plotting against ground truth.
Visualization aids help interpret forecast accuracy, uncertainty bands, and trend dynamics.
Forecast visualization sample: a plot contrasting actual series with the model’s forecast, as shown in the included example image.

6) Forecast without Volume and Amount
For scenarios where Volume and Amount are unavailable, Kronos includes a variant workflow. See the related example script in the repository for a streamlined path.
7) Batch Forecasting
Kronos supports predict_batch to run multiple time-series forecasts in parallel, leveraging GPU parallelism for efficiency.
Required alignment:
- All input series must share the same lookback length and the same pred_len.
- Each DataFrame must include the required columns, with volume/amount optional (they will be filled with zeros if missing).
8) Example Batch Forecast Code Snippet
Prepare multiple datasets:
- df_list = [df1, df2, df3]
- xtimestamplist = [xts1, xts2, x_ts3]
- ytimestamplist = [yts1, yts2, y_ts3]
Call predictbatch with T, topp, and sample_count:
- preddflist = predictor.predictbatch(dflist=dflist, xtimestamplist=xtimestamplist, ytimestamplist=ytimestamplist, predlen=predlen, T=1.0, topp=0.9, sample_count=1, verbose=True)
Each pred_df corresponds to its input in the same order.
Practical notes:
The predict/batch flow automatically handles normalization/denormalization for each series independently, ensuring consistent scaling across assets.
The Kronos ecosystem provides runnable examples in examples/predictionexample.py and predictionwovolexample.py to illustrate a complete end-to-end pipeline and to demonstrate forecasting with and without Volume data.
Visual cue: a concrete forecast visualization is provided to help users gauge the alignment between true data and predictions.

- Finetuning Kronos on Your Own Data (A-Share Market Example)
Intent and caveat:
The finetuning recipe is designed as a demonstration rather than a production-ready trading system. It showcases how to adapt Kronos to a new market domain (A-share market) and to perform backtesting. A robust production workflow would extend this to portfolio optimization, risk-factor neutralization, and operational risk controls.
Prerequisites and environment:
Ensure all dependencies from requirements.txt are installed.
The workflow relies on Qlib for data handling; install it via: pip install pyqlib
Prepare Qlib data following the official guide to ensure compatibility with Kronos finetuning scripts.
Daily frequency data is assumed in the example, but the approach can be adapted to other frequencies.
Step 1: Configuration
Centralized settings live in finetune/config.py. Before running experiments, modify paths to:
- qlibdatapath: your local Qlib data directory
- dataset_path: where processed train/val/test pickle files will be stored
- save_path: root for saving model checkpoints
- backtestresultpath: where backtesting outputs land
- pretrainedtokenizerpath and pretrainedpredictorpath: initial checkpoints (local or Hugging Face)
You can also adjust instrument, traintimerange, epochs, batchsize, and optional usecomet settings.
Step 2: Prepare the Dataset
Run: python finetune/qlibdatapreprocess.py
This step loads raw market data from your Qlib directory, processes it, and outputs traindata.pkl, valdata.pkl, and testdata.pkl at the configured datasetpath.
Step 3: Run the Finetuning
The finetuning procedure is staged and multi-GPU friendly, using torchrun.
3.1 Finetune the Tokenizer:
- Command pattern (adjust NUM_GPUS):
- torchrun --standalone --nprocpernode=NUMGPUS finetune/traintokenizer.py
- The best tokenizer checkpoint is saved according to config.py’s save path and folder naming conventions.
3.2 Finetune the Predictor:
- Command pattern:
- torchrun --standalone --nprocpernode=NUMGPUS finetune/trainpredictor.py
- The best predictor checkpoint is similarly saved.
Step 4: Evaluate with Backtesting
After finetuning, run backtesting to evaluate the model’s predictive signals in a simulated trading scenario.
Example: python finetune/qlib_test.py --device cuda:0
The script prints a detailed performance analysis and generates a plot comparing cumulative returns against a benchmark.
Supporting visual aid:
A backtest sample illustrates typical performance curves and can help diagnose overfitting or regime sensitivity.

Important caveats:
The narrative notes that many code comments within finetune/ were AI-generated (Gemini 2.5 Pro) for explanatory purposes. Treat the code logic as the authoritative source; comments should be validated against the actual code.
- From Demo to Production: Important Considerations
Raw signals vs pure alpha:
In the Kronos demo, the model outputs raw predictions. In production, these signals are typically fed into a portfolio-optimization framework that imposes constraints to neutralize exposure to risk factors (beta, size, value, and other factors). This helps isolate “pure alpha” and improve robustness.
Data handling:
The QlibDataset in the demo is a simplified example. In real deployments, data sources may differ, requiring customization of the data-loading and preprocessing steps to align with Kronos’ tokenizer expectations and downstream goals.
Strategy and backtesting complexity:
The demo uses a straightforward top-K or similar strategy for illustration. Production-grade strategies commonly incorporate more sophisticated elements:
- Dynamic position sizing
- Transaction costs, slippage, and market impact modeling
- Robust risk controls and drawdown management
- Portfolio-level risk-factor neutralization and diversification
Practical notes:
The Kronos pipeline is designed for extensibility. Researchers and practitioners can swap in alternative data sources, feature sets, or forecasting objectives while preserving the core tokenization + autoregressive forecasting paradigm.
AI-generated commentary awareness:
A reminder that certain code comments were authored by an AI assistant. Users should verify critical logic and ensure alignment with the latest codebase before deploying in production.
- Citations and Licensing
If Kronos informs or appears in your research, a formal citation is encouraged:
@misc{shi2025kronos, title={Kronos: A Foundation Model for the Language of Financial Markets}, author={Yu Shi and Zongliang Fu and Shuo Chen and Bohan Zhao and Wei Xu and Changshui Zhang and Jian Li}, year={2025}, eprint={2508.02739}, archivePrefix={arXiv}, primaryClass={q-fin.ST}, url={https://arxiv.org/abs/2508.02739}, }
License:
This project is licensed under the MIT License.
The documentation and code are designed to be accessible and reusable, with links to the Hugging Face Hub for model and tokenizer assets, and to GitHub for code, commits, and issues.
- Visual Gallery and Key Illustrations
Kronos logo: a recognizable emblem introducing the project brand.

Overview diagram: captures the end-to-end Kronos pipeline from raw K-line data to tokenized inputs to autoregressive forecasting.

Forecast example visualization: a representative forecast plot showing model predictions versus ground truth for a horizon, illustrating the model’s predictive shape and uncertainty.

Backtest illustration: a plot showing cumulative returns under a backtested strategy, illustrating risk/return dynamics and comparison to a benchmark.

- Quick Reference: Essential Takeaways
Kronos is a purpose-built foundation model for financial K-line data, designed to handle high-noise market signals and non-stationarity with a two-stage tokenization-plus-forecasting pipeline.
The architecture emphasizes modularity: a specialized tokenizer converts OHLCV into hierarchical tokens, followed by a large Transformer trained autoregressively.
A spectrum of model sizes is provided to accommodate varying compute budgets, with Kronos-small and Kronos-base offering practical middle grounds and Kronos-mini serving as a lightweight starting point. Kronos-large remains non-open-source in the current release.
The ecosystem includes a live demo for immediate qualitative assessment, a model zoo for quick experimentation, and a comprehensive fine-tuning workflow that can adapt Kronos to domain-specific data (e.g., A-share markets) and enable backtesting to evaluate prospective strategies.
The documentation emphasizes practical deployment considerations: data handling, context-window constraints, batch-processing efficiency, and production-oriented risk-management concepts.
- Appendices and References
The Kronos repository and documentation provide practical scripts, examples, and notebooks that align with the sections described above. The two primary public-facing anchors are:
The arXiv paper (for scholarly grounding)
The Hugging Face Hub (for model and tokenizer hosting)
Readers are encouraged to explore the live demo, the model zoo, and the finetuning instructions to experiment with Kronos on their own data.
If you would like, I can tailor this description to a specific section length, convert any parts into a more narrative story, or provide additional paraphrased explanations of the code blocks and configuration steps.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/shiyu-coder/Kronos
GitHub - shiyu-coder/Kronos: Kronos: A Foundation Model for the Language of Financial Markets
Kronos is an open‑source foundation model designed to understand and forecast financial market time series, especially candlestick (K‑line) data. It employs a t...
github - shiyu-coder/kronos