Repository Analysis

karpathy/nanochat

The best ChatGPT that $100 can buy.

33.6 Strong AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of karpathy/nanochat, a Python project with 56,238 GitHub stars. SynthScan v2.0 examined 9,834 lines of code across 45 source files, recording 148 pattern matches distributed across 13 syntactic categories. The overall adjusted score of 33.6 places this repository in the Strong AI signal 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).

33.6
Adjusted Score
33.6
Raw Score
100%
Time Factor
2026-07-04
Last Push
56.2K
Stars
Python
Language
9.8K
Lines of Code
45
Files
148
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 83LOW 65

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 148 distinct pattern matches across 13 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 Separators80 hits · 252 pts
SeverityFileLineSnippetContext
MEDIUMtasks/smoltalk.py24 # ---------------------------------------------------------------------COMMENT
MEDIUMtasks/smoltalk.py40 # ---------------------------------------------------------------------COMMENT
MEDIUMtests/test_engine.py12# -----------------------------------------------------------------------------COMMENT
MEDIUMtests/test_attention_fallback.py48# =============================================================================COMMENT
MEDIUMtests/test_attention_fallback.py50# =============================================================================COMMENT
MEDIUMtests/test_attention_fallback.py251# =============================================================================COMMENT
MEDIUMtests/test_attention_fallback.py253# =============================================================================COMMENT
MEDIUMtests/test_attention_fallback.py337# =============================================================================COMMENT
MEDIUMtests/test_attention_fallback.py339# =============================================================================COMMENT
MEDIUMnanochat/execution.py30# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/dataset.py19# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/dataset.py29# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/dataset.py83# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/tokenizer.py28# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/tokenizer.py261# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/engine.py23# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/engine.py81# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/engine.py139# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/engine.py158# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/flash_attention.py20# =============================================================================COMMENT
MEDIUMnanochat/flash_attention.py22# =============================================================================COMMENT
MEDIUMnanochat/flash_attention.py74# =============================================================================COMMENT
MEDIUMnanochat/flash_attention.py76# =============================================================================COMMENT
MEDIUMnanochat/flash_attention.py112# =============================================================================COMMENT
MEDIUMnanochat/flash_attention.py114# =============================================================================COMMENT
MEDIUMnanochat/flash_attention.py188# =============================================================================COMMENT
MEDIUMnanochat/flash_attention.py190# =============================================================================COMMENT
MEDIUMnanochat/core_eval.py14# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/optim.py17# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/optim.py65# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/optim.py182# -----------------------------------------------------------------------------COMMENT
MEDIUMnanochat/checkpoint_manager.py145# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/infer_bench.py46# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/infer_bench.py95# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/infer_bench.py124 # ------------------------------------------------------------------------COMMENT
MEDIUMscripts/infer_bench.py182 # ------------------------------------------------------------------------COMMENT
MEDIUMscripts/infer_bench.py197 # ------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_eval.py25# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_eval.py82# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_eval.py154# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_eval.py177# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py39# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py82# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py119# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py126# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py164# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py242# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py248# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py306# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py322# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py328# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py335# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py388# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py505 # -------------------------------------------------------------------------COMMENT
MEDIUMscripts/base_train.py545 # -------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_rl.py30# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_rl.py62# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_rl.py77# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_rl.py148# -----------------------------------------------------------------------------COMMENT
MEDIUMscripts/chat_rl.py193# -----------------------------------------------------------------------------COMMENT
20 more matches not shown…
Hyper-Verbose Identifiers33 hits · 35 pts
SeverityFileLineSnippetContext
LOWtests/test_engine.py158def test_multi_sample_first_token_diversity():CODE
LOWtests/test_engine.py201def test_seed_reproducibility():CODE
LOWtests/test_engine.py214def test_temperature_zero_determinism():CODE
LOWtests/test_engine.py226def test_max_tokens_respected():CODE
LOWtests/test_engine.py249def test_different_seeds_introduce_variation_when_temperature_nonzero():CODE
LOWtests/test_tokenizer.py31def test_encode_decode_roundtrip(tokenizer):CODE
LOWtests/test_tokenizer.py47def test_encode_prepend_append(tokenizer):CODE
LOWtests/test_tokenizer.py61def test_render_conversation_masks(tokenizer):CODE
LOWtests/test_tokenizer.py82def test_render_conversation_system_message_merged(tokenizer):CODE
LOWtests/test_tokenizer.py95def test_render_conversation_tool_parts(tokenizer):CODE
LOWtests/test_tokenizer.py117def test_render_conversation_truncation(tokenizer):CODE
LOWtests/test_tokenizer.py126def test_render_for_completion(tokenizer):CODE
LOWtests/test_optim.py48def test_adamw_matches_torch_reference():CODE
LOWtests/test_optim.py99def test_muon_update_is_orthogonalized():CODE
LOWtests/test_execution.py20def test_exception_is_captured():CODE
LOWtests/test_execution.py26def test_timeout_kills_infinite_loop():CODE
LOWtests/test_execution.py48def test_destructive_functions_disabled(evil):CODE
LOWtests/test_execution.py58def test_writes_go_to_tempdir():CODE
LOWtests/test_execution.py64def test_environment_is_scrubbed():CODE
LOWtests/test_execution.py73def test_tricky_string_content():CODE
LOWtests/test_attention_fallback.py155 def test_kvcache_single_token(self):CODE
LOWtests/test_attention_fallback.py182 def test_kvcache_single_token_sliding_window(self):CODE
LOWtests/test_attention_fallback.py215 def test_backward_gradients_match(self):CODE
LOWtests/test_tasks.py46def test_mixture_covers_all_examples_deterministically():CODE
LOWtests/test_tasks.py60def test_mixture_oversampling():CODE
LOWtests/test_tasks.py73def test_hub_dataset_shuffle_matches_numpy():CODE
LOWtests/test_tasks.py84def test_render_mc_letter_binding():CODE
LOWnanochat/tokenizer.py129 def decode_single_token_bytes(self, token_id):CODE
LOWnanochat/dataloader.py74def tokenizing_distributed_data_loader_with_state_bos_bestfit(CODE
LOWnanochat/dataloader.py163def tokenizing_distributed_data_loader_bos_bestfit(*args, **kwargs):CODE
LOWnanochat/checkpoint_manager.py22def _patch_missing_config_keys(model_config_kwargs):CODE
LOWnanochat/gpt.py270 def _precompute_rotary_embeddings(self, seq_len, head_dim, base=100000, device=None):CODE
LOWscripts/chat_sft.py180def sft_data_generator_bos_bestfit(split, buffer_size=100):CODE
Deep Nesting11 hits · 11 pts
SeverityFileLineSnippetContext
LOWtasks/common.py45CODE
LOWnanochat/dataset.py84CODE
LOWnanochat/tokenizer.py96CODE
LOWnanochat/tokenizer.py140CODE
LOWnanochat/engine.py176CODE
LOWnanochat/engine.py277CODE
LOWnanochat/dataloader.py25CODE
LOWnanochat/dataloader.py74CODE
LOWscripts/chat_eval.py87CODE
LOWscripts/base_eval.py128CODE
LOWscripts/chat_sft.py180CODE
Redundant / Tautological Comments3 hits · 5 pts
SeverityFileLineSnippetContext
LOWnanochat/engine.py54 # Check if it's a pure math expression (old behavior)COMMENT
LOWnanochat/engine.py60 # Check if it's a string operation we supportCOMMENT
LOWruns/scaling_laws.sh34# Check if a run already exists in resultsCOMMENT
AI Slop Vocabulary3 hits · 4 pts
SeverityFileLineSnippetContext
LOWnanochat/tokenizer.py195 # simple string => simply add the tokensCOMMENT
LOWnanochat/tokenizer.py202 # string part => simply add the tokensCOMMENT
LOWnanochat/gpt.py523 # inference: just return the logits directlyCOMMENT
Excessive Try-Catch Wrapping3 hits · 4 pts
SeverityFileLineSnippetContext
LOWnanochat/engine.py41 except Exception as e:CODE
MEDIUMnanochat/engine.py35def eval_with_timeout(formula, max_time=3):CODE
LOWnanochat/flash_attention.py45 except Exception:CODE
Unused Imports4 hits · 4 pts
SeverityFileLineSnippetContext
LOWnanochat/gpt.py15CODE
LOWnanochat/gpt.py22CODE
LOWscripts/chat_cli.py8CODE
LOWscripts/base_eval.py29CODE
AI Structural Patterns3 hits · 3 pts
SeverityFileLineSnippetContext
LOWnanochat/execution.py134CODE
LOWnanochat/fp8.py154CODE
LOWscripts/base_eval.py123CODE
Modern AI Meta-Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMnanochat/core_eval.py175 # Sample few-shot examples (excluding current item)COMMENT
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMscripts/chat_eval.py159 # Create the evaluation objectCOMMENT
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippetContext
LOWruns/speedrun.sh1#!/bin/bashCOMMENT
LOWruns/speedrun.sh21# install uv (if not already installed)COMMENT
LOWruns/speedrun.sh41COMMENT
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWnanochat/common.py69logger = logging.getLogger(__name__)CODE
LOWnanochat/checkpoint_manager.py17logger = logging.getLogger(__name__)CODE
Slop Phrases1 hit · 1 pts
SeverityFileLineSnippetContext
LOWscripts/chat_rl.py112 seed=seed, # must make sure to change the seed for each sampling stepCODE