Repository Analysis

shiyu-coder/Kronos

Kronos: A Foundation Model for the Language of Financial Markets

3.4 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of shiyu-coder/Kronos, a Python project with 32,141 GitHub stars. SynthScan v2.0 examined 78,563 lines of code across 73 source files, recording 217 pattern matches distributed across 12 syntactic categories. The overall adjusted score of 3.4 places this repository in the Likely human-written band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

3.4
Adjusted Score
3.4
Raw Score
100%
Time Factor
2026-04-13
Last Push
32.1K
Stars
Python
Language
78.6K
Lines of Code
73
Files
217
Pattern Hits
2026-07-14
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 0MEDIUM 29LOW 188

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 217 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators23 hits · 69 pts
SeverityFileLineSnippetContext
MEDIUMfinetune/config.py9 # =================================================================COMMENT
MEDIUMfinetune/config.py11 # =================================================================COMMENT
MEDIUMfinetune/config.py30 # =================================================================COMMENT
MEDIUMfinetune/config.py32 # =================================================================COMMENT
MEDIUMfinetune/config.py43 # =================================================================COMMENT
MEDIUMfinetune/config.py45 # =================================================================COMMENT
MEDIUMfinetune/config.py72 # =================================================================COMMENT
MEDIUMfinetune/config.py74 # =================================================================COMMENT
MEDIUMfinetune/config.py96 # =================================================================COMMENT
MEDIUMfinetune/config.py98 # =================================================================COMMENT
MEDIUMfinetune/config.py109 # =================================================================COMMENT
MEDIUMfinetune/config.py111 # =================================================================COMMENT
MEDIUMfinetune/qlib_test.py28# =================================================================================COMMENT
MEDIUMfinetune/qlib_test.py30# =================================================================================COMMENT
MEDIUMfinetune/qlib_test.py92# =================================================================================COMMENT
MEDIUMfinetune/qlib_test.py94# =================================================================================COMMENT
MEDIUMfinetune/qlib_test.py203# =================================================================================COMMENT
MEDIUMfinetune/qlib_test.py205# =================================================================================COMMENT
MEDIUMfinetune/qlib_test.py298# =================================================================================COMMENT
MEDIUMfinetune/qlib_test.py300# =================================================================================COMMENT
MEDIUMexamples/get_akshare_date_2024-2025_x.py619 # =====================================================COMMENT
MEDIUMexamples/get_date_new.py651 # =====================================================COMMENT
MEDIUMexamples/prediction_akshare_2024-2025.py532 # =========================================================COMMENT
Hyper-Verbose Identifiers63 hits · 62 pts
SeverityFileLineSnippetContext
LOWtests/test_kronos_regression.py46def test_kronos_predictor_regression(context_len):CODE
LOWtests/test_kronos_regression.py91def test_kronos_predictor_mse(context_len, expected_mse):CODE
LOWexamples/get_akshare_date_2024-2025_x.py157def parse_kline_data_directly(response_text, stock_code, start_year, end_year):CODE
LOWexamples/get_akshare_date_2024-2025_x.py353def get_stock_data_with_retry(stock_code="002354", start_year=2024, end_year=2025, retry_count=2):CODE
LOWexamples/prediction_new.py664 def _get_default_market_analysis(self):CODE
LOWexamples/prediction_new.py672 def _get_default_sector_analysis(self):CODE
LOWexamples/prediction_new.py682 def _get_default_macro_analysis(self):CODE
LOWexamples/prediction_new.py689 def _get_default_fundamental_analysis(self):CODE
LOWexamples/prediction_new.py89def get_stock_data_with_retry_all_history(stock_code="600580", retry_count=2):CODE
LOWexamples/prediction_new.py105def create_realistic_fallback_data(stock_code="600580"):CODE
LOWexamples/prediction_new.py191def save_all_history_stock_data(df, stock_code, save_dir):CODE
LOWexamples/prediction_new.py284def calculate_prediction_parameters(df, target_days=60):CODE
LOWexamples/prediction_new.py333def calculate_optimal_interval(min_val, max_val):CODE
LOWexamples/prediction_new.py363def get_stock_price_reference(stock_code, current_price):CODE
LOWexamples/prediction_new.py600 def analyze_company_fundamentals(self, stock_code):CODE
LOWexamples/prediction_new.py651 def _calculate_trend_strength(self, df):CODE
LOWexamples/prediction_new.py702def enhance_prediction_with_market_factors(CODE
LOWexamples/prediction_new.py757def calculate_enhanced_adjustment_factor(market_analysis, sector_analysis, macro_analysis, fundamental_analysis):CODE
LOWexamples/prediction_new.py826def create_comprehensive_market_report(enhancement_info, output_dir, stock_code):CODE
LOWexamples/prediction_new.py850def generate_analysis_summary(enhancement_info):CODE
LOWexamples/prediction_new.py895def plot_comprehensive_prediction(CODE
LOWexamples/prediction_new.py1148def run_comprehensive_kronos_prediction(stock_code, stock_name, data_dir, pred_days, output_dir, history_years=1):CODE
LOWexamples/prediction_new_GUI.py959 def _get_default_market_analysis(self):CODE
LOWexamples/prediction_new_GUI.py967 def _get_default_sector_analysis(self):CODE
LOWexamples/prediction_new_GUI.py977 def _get_default_macro_analysis(self):CODE
LOWexamples/prediction_new_GUI.py984 def _get_default_fundamental_analysis(self):CODE
LOWexamples/prediction_new_GUI.py391def get_stock_data_with_retry_all_history(stock_code="600580", retry_count=2):CODE
LOWexamples/prediction_new_GUI.py407def create_realistic_fallback_data(stock_code="600580"):CODE
LOWexamples/prediction_new_GUI.py493def save_all_history_stock_data(df, stock_code, save_dir):CODE
LOWexamples/prediction_new_GUI.py586def calculate_prediction_parameters(df, target_days=60):CODE
LOWexamples/prediction_new_GUI.py616def generate_trading_dates_only(last_date, pred_len):CODE
LOWexamples/prediction_new_GUI.py649def calculate_optimal_interval(min_val, max_val):CODE
LOWexamples/prediction_new_GUI.py895 def analyze_company_fundamentals(self, stock_code):CODE
LOWexamples/prediction_new_GUI.py946 def _calculate_trend_strength(self, df):CODE
LOWexamples/prediction_new_GUI.py997def smooth_prediction_results(prediction_df, historical_df, smooth_factor=0.3):CODE
LOWexamples/prediction_new_GUI.py1070def apply_post_holiday_adjustment(prediction_df, future_dates, holiday_periods):CODE
LOWexamples/prediction_new_GUI.py1105def validate_prediction_results(historical_df, prediction_df, max_price_change=0.3):CODE
LOWexamples/prediction_new_GUI.py1140def run_comprehensive_prediction_gui(stock_code, stock_name, data_dir, pred_days, output_dir, history_years=1,CODE
LOWexamples/prediction_new_GUI.py1327def enhance_prediction_with_market_factors(historical_df, prediction_df, stock_code, market_analyzer):CODE
LOWexamples/prediction_new_GUI.py1369def calculate_enhanced_adjustment_factor(market_analysis, sector_analysis, macro_analysis, fundamental_analysis):CODE
LOWexamples/prediction_new_GUI.py1410def create_comprehensive_market_report(enhancement_info, output_dir, stock_code):CODE
LOWexamples/prediction_new_GUI.py1433def plot_optimized_prediction_gui(historical_df, base_pred_df, enhanced_pred_df, future_trading_dates,CODE
LOWexamples/get_date_new.py23def get_stock_data_eastmoney_all_history(stock_code="002354"):CODE
LOWexamples/get_date_new.py147def parse_kline_data_directly_all_history(response_text, stock_code):CODE
LOWexamples/get_date_new.py190def get_stock_data_akshare_all_history(stock_code="002354"):CODE
LOWexamples/get_date_new.py243def get_stock_data_baostock_all_history(stock_code="002354"):CODE
LOWexamples/get_date_new.py354def get_stock_data_with_retry_all_history(stock_code="002354", retry_count=2):CODE
LOWexamples/get_date_new.py378def create_sample_data_all_history(stock_code="002354"):CODE
LOWexamples/get_date_new.py504def display_all_history_data_info(df, stock_code):CODE
LOWexamples/get_date_new.py566def save_all_history_stock_data(df, stock_code, save_dir="D:/lianghuajiaoyi/Kronos/examples/data"):CODE
LOWexamples/prediction_akshare_2024-2025.py78def calculate_prediction_parameters(df, target_days=100):CODE
LOWexamples/prediction_akshare_2024-2025.py112def generate_future_dates_with_holidays(last_date, pred_len):CODE
LOWexamples/prediction_akshare_2024-2025.py152def plot_prediction_with_details(kline_df, pred_df, future_dates, stock_code="002354", stock_name="股票", pred_len=100,CODE
LOWexamples/prediction_akshare_2024-2025.py312def generate_prediction_report(close_df, volume_df, pred_df, future_dates, stock_code="002354", stock_name="股票",CODE
LOWexamples/run_backtest_kronos.py132 def calculate_trading_signals(self, hist_df, pred_df, threshold=0.02):CODE
LOWexamples/yuce/historical_backtest.py57 def simulate_model_prediction(self, df, lookback_days=60, pred_days=30):CODE
LOWexamples/yuce/historical_backtest.py104 def calculate_prediction_accuracy(self, results_df):CODE
LOWmodel/kronos.py389def auto_regressive_inference(tokenizer, model, x, x_stamp, y_stamp, max_context, pred_len, clip=5, T=1.0, top_k=0, top_CODE
LOWmodel/module.py157 def get_hard_per_sample_entropy(self, zb_by_sample):CODE
LOWwebui/templates/index.html843 function setupSliderEventListeners() {CODE
3 more matches not shown…
Excessive Try-Catch Wrapping39 hits · 38 pts
SeverityFileLineSnippetContext
LOWexamples/get_akshare_date_2024-2025_x.py152 except Exception as e:CODE
LOWexamples/get_akshare_date_2024-2025_x.py195 except Exception as e:CODE
LOWexamples/get_akshare_date_2024-2025_x.py256 except Exception as e:CODE
LOWexamples/get_akshare_date_2024-2025_x.py348 except Exception as e:CODE
LOWexamples/prediction_new.py84 except Exception as e:CODE
LOWexamples/prediction_new.py472 except Exception as e:CODE
LOWexamples/prediction_new.py543 except Exception as e:CODE
LOWexamples/prediction_new.py596 except Exception as e:CODE
LOWexamples/prediction_new.py647 except Exception as e:CODE
LOWexamples/prediction_new.py1172 except Exception as e:CODE
LOWexamples/prediction_new.py1295 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py311 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py386 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py767 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py838 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py891 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py942 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py1176 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py1319 except Exception as e:CODE
LOWexamples/prediction_new_GUI.py1611 except Exception as e:CODE
LOWexamples/get_date_new.py142 except Exception as e:CODE
LOWexamples/get_date_new.py184 except Exception as e:CODE
LOWexamples/get_date_new.py238 except Exception as e:CODE
LOWexamples/get_date_new.py349 except Exception as e:CODE
LOWexamples/prediction_akshare_2024-2025.py504 except Exception as e:CODE
LOWexamples/run_backtest_kronos.py408 except Exception as e:CODE
LOWexamples/prediction_cn_markets_day.py60 except Exception as e:CODE
LOWexamples/yuce/historical_backtest.py329 except Exception as e:CODE
LOWwebui/run.py84 except Exception as e:CODE
LOWwebui/app.py122 except Exception as e:CODE
LOWwebui/app.py205 except Exception as e:CODE
LOWwebui/app.py401 except Exception as e:CODE
LOWwebui/app.py489 except Exception as e:CODE
LOWwebui/app.py610 except Exception as e:CODE
LOWwebui/app.py623 except Exception as e:CODE
LOWwebui/app.py662 except Exception as e:CODE
LOWfinetune_csv/train_sequential.py308 except Exception as e:CODE
MEDIUMfinetune_csv/train_sequential.py310 print(f"Error occurred during training: {str(e)}")CODE
LOWfinetune_csv/train_sequential.py355 except Exception:CODE
Unused Imports44 hits · 37 pts
SeverityFileLineSnippetContext
LOWfinetune/config.py1CODE
LOWfinetune/qlib_test.py11CODE
LOWfinetune/qlib_test.py16CODE
LOWfinetune/qlib_test.py19CODE
LOWfinetune/train_tokenizer.py6CODE
LOWfinetune/train_tokenizer.py7CODE
LOWexamples/get_akshare_date_2024-2025_x.py4CODE
LOWexamples/prediction_new.py8CODE
LOWexamples/prediction_new.py10CODE
LOWexamples/prediction_new.py13CODE
LOWexamples/prediction_new.py13CODE
LOWexamples/prediction_new.py13CODE
LOWexamples/prediction_new.py13CODE
LOWexamples/prediction_new_GUI.py8CODE
LOWexamples/prediction_new_GUI.py10CODE
LOWexamples/prediction_new_GUI.py13CODE
LOWexamples/prediction_new_GUI.py13CODE
LOWexamples/prediction_new_GUI.py13CODE
LOWexamples/prediction_new_GUI.py13CODE
LOWexamples/prediction_new_GUI.py17CODE
LOWexamples/prediction_new_GUI.py19CODE
LOWexamples/get_date_new.py4CODE
LOWexamples/run_backtest_kronos.py6CODE
LOWexamples/run_backtest_kronos.py6CODE
LOWexamples/yuce/historical_backtest.py6CODE
LOWexamples/yuce/historical_backtest.py6CODE
LOWmodel/kronos.py10CODE
LOWwebui/run.py15CODE
LOWwebui/run.py16CODE
LOWwebui/run.py17CODE
LOWwebui/run.py18CODE
LOWwebui/run.py19CODE
LOWwebui/run.py56CODE
LOWwebui/run.py56CODE
LOWwebui/run.py56CODE
LOWwebui/app.py3CODE
LOWfinetune_csv/train_sequential.py6CODE
LOWfinetune_csv/train_sequential.py7CODE
LOWfinetune_csv/train_sequential.py11CODE
LOWfinetune_csv/train_sequential.py15CODE
LOWfinetune_csv/finetune_tokenizer.py11CODE
LOWfinetune_csv/finetune_base_model.py5CODE
LOWfinetune_csv/finetune_base_model.py13CODE
LOWfinetune_csv/finetune_base_model.py21CODE
Deep Nesting29 hits · 26 pts
SeverityFileLineSnippetContext
LOWfinetune/qlib_test.py239CODE
LOWfinetune/train_tokenizer.py74CODE
LOWexamples/get_akshare_date_2024-2025_x.py23CODE
LOWexamples/get_akshare_date_2024-2025_x.py157CODE
LOWexamples/get_akshare_date_2024-2025_x.py384CODE
LOWexamples/get_akshare_date_2024-2025_x.py500CODE
LOWexamples/prediction_new.py333CODE
LOWexamples/prediction_new.py702CODE
LOWexamples/prediction_new.py476CODE
LOWexamples/prediction_new_GUI.py649CODE
LOWexamples/prediction_new_GUI.py1070CODE
LOWexamples/prediction_new_GUI.py1105CODE
LOWexamples/prediction_new_GUI.py771CODE
LOWexamples/get_date_new.py23CODE
LOWexamples/get_date_new.py147CODE
LOWexamples/get_date_new.py378CODE
LOWexamples/get_date_new.py504CODE
LOWexamples/prediction_akshare_2024-2025.py369CODE
LOWexamples/run_backtest_kronos.py158CODE
LOWexamples/run_backtest_kronos.py359CODE
LOWexamples/yuce/historical_backtest.py264CODE
LOWmodel/kronos.py225CODE
LOWwebui/app.py78CODE
LOWwebui/app.py209CODE
LOWwebui/app.py342CODE
LOWwebui/app.py405CODE
LOWfinetune_csv/config_loader.py25CODE
LOWfinetune_csv/finetune_tokenizer.py151CODE
LOWfinetune_csv/finetune_base_model.py239CODE
Redundant / Tautological Comments5 hits · 10 pts
SeverityFileLineSnippetContext
LOWfinetune/qlib_data_preprocess.py43 # Check if start_index lookbackw_window will cause negative indexCOMMENT
LOWfinetune/qlib_data_preprocess.py47 # Check if end_index exceeds the range of the arrayCOMMENT
LOWfinetune/qlib_data_preprocess.py53 # Check if end_index+predictw_window will exceed the range of the arrayCOMMENT
LOWwebui/start.sh8# Check if Python is installedCOMMENT
LOWwebui/start.sh14# Check if in correct directoryCOMMENT
Structural Annotation Overuse6 hits · 9 pts
SeverityFileLineSnippetContext
LOWREADME.md239### Step 1: Configure Your ExperimentCOMMENT
LOWREADME.md251### Step 2: Prepare the DatasetCOMMENT
LOWREADME.md261### Step 3: Run the FinetuningCOMMENT
LOWREADME.md287### Step 4: Evaluate with BacktestingCOMMENT
LOWfinetune_csv/README.md75# Step 1: Train tokenizerCOMMENT
LOWfinetune_csv/README.md78# Step 2: Train predictor (requires fine-tuned tokenizer)COMMENT
Self-Referential Comments3 hits · 7 pts
SeverityFileLineSnippetContext
MEDIUMfinetune/qlib_test.py311 # Create a dedicated dictionary for this run's configurationCOMMENT
MEDIUMmodel/kronos.py129 mask = 2 ** torch.arange(self.codebook_dim//2, device=x1.device, dtype=torch.long) # Create a mask for bit eCODE
MEDIUMmodel/kronos.py134 mask = 2 ** torch.arange(self.codebook_dim, device=x.device, dtype=torch.long) # Create a mask for bit extraCODE
Modern AI Meta-Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMREADME.md138# Define context window and prediction lengthCOMMENT
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMfinetune/dataset.py115 # Apply normalization and robust clipping to the entire sequenceCOMMENT
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/test_kronos_regression.py36def set_seed(seed: int) -> None:CODE
LOWtests/data/generate_regression_output.py26def set_seed(seed: int) -> None:CODE
AI Structural Patterns1 hit · 1 pts
SeverityFileLineSnippetContext
LOWfinetune_csv/finetune_base_model.py27CODE