The best ChatGPT that $100 can buy.
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).
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.
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.
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.
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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tasks/smoltalk.py | 24 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | tasks/smoltalk.py | 40 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_engine.py | 12 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 48 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 50 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 251 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 253 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 337 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 339 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/execution.py | 30 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/dataset.py | 19 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/dataset.py | 29 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/dataset.py | 83 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/tokenizer.py | 28 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/tokenizer.py | 261 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/engine.py | 23 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/engine.py | 81 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/engine.py | 139 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/engine.py | 158 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 20 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 22 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 74 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 76 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 112 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 114 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 188 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 190 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/core_eval.py | 14 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/optim.py | 17 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/optim.py | 65 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/optim.py | 182 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/checkpoint_manager.py | 145 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/infer_bench.py | 46 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/infer_bench.py | 95 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/infer_bench.py | 124 | # ------------------------------------------------------------------------ | COMMENT |
| MEDIUM | scripts/infer_bench.py | 182 | # ------------------------------------------------------------------------ | COMMENT |
| MEDIUM | scripts/infer_bench.py | 197 | # ------------------------------------------------------------------------ | COMMENT |
| MEDIUM | scripts/chat_eval.py | 25 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_eval.py | 82 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_eval.py | 154 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_eval.py | 177 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 39 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 82 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 119 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 126 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 164 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 242 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 248 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 306 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/base_train.py | 322 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/base_train.py | 328 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/base_train.py | 335 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 388 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 505 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 545 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 30 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 62 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 77 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 148 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 193 | # ----------------------------------------------------------------------------- | COMMENT |
| 20 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_engine.py | 158 | def test_multi_sample_first_token_diversity(): | CODE |
| LOW | tests/test_engine.py | 201 | def test_seed_reproducibility(): | CODE |
| LOW | tests/test_engine.py | 214 | def test_temperature_zero_determinism(): | CODE |
| LOW | tests/test_engine.py | 226 | def test_max_tokens_respected(): | CODE |
| LOW | tests/test_engine.py | 249 | def test_different_seeds_introduce_variation_when_temperature_nonzero(): | CODE |
| LOW | tests/test_tokenizer.py | 31 | def test_encode_decode_roundtrip(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 47 | def test_encode_prepend_append(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 61 | def test_render_conversation_masks(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 82 | def test_render_conversation_system_message_merged(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 95 | def test_render_conversation_tool_parts(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 117 | def test_render_conversation_truncation(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 126 | def test_render_for_completion(tokenizer): | CODE |
| LOW | tests/test_optim.py | 48 | def test_adamw_matches_torch_reference(): | CODE |
| LOW | tests/test_optim.py | 99 | def test_muon_update_is_orthogonalized(): | CODE |
| LOW | tests/test_execution.py | 20 | def test_exception_is_captured(): | CODE |
| LOW | tests/test_execution.py | 26 | def test_timeout_kills_infinite_loop(): | CODE |
| LOW⚡ | tests/test_execution.py | 48 | def test_destructive_functions_disabled(evil): | CODE |
| LOW⚡ | tests/test_execution.py | 58 | def test_writes_go_to_tempdir(): | CODE |
| LOW⚡ | tests/test_execution.py | 64 | def test_environment_is_scrubbed(): | CODE |
| LOW⚡ | tests/test_execution.py | 73 | def test_tricky_string_content(): | CODE |
| LOW | tests/test_attention_fallback.py | 155 | def test_kvcache_single_token(self): | CODE |
| LOW | tests/test_attention_fallback.py | 182 | def test_kvcache_single_token_sliding_window(self): | CODE |
| LOW | tests/test_attention_fallback.py | 215 | def test_backward_gradients_match(self): | CODE |
| LOW | tests/test_tasks.py | 46 | def test_mixture_covers_all_examples_deterministically(): | CODE |
| LOW | tests/test_tasks.py | 60 | def test_mixture_oversampling(): | CODE |
| LOW | tests/test_tasks.py | 73 | def test_hub_dataset_shuffle_matches_numpy(): | CODE |
| LOW | tests/test_tasks.py | 84 | def test_render_mc_letter_binding(): | CODE |
| LOW | nanochat/tokenizer.py | 129 | def decode_single_token_bytes(self, token_id): | CODE |
| LOW | nanochat/dataloader.py | 74 | def tokenizing_distributed_data_loader_with_state_bos_bestfit( | CODE |
| LOW | nanochat/dataloader.py | 163 | def tokenizing_distributed_data_loader_bos_bestfit(*args, **kwargs): | CODE |
| LOW | nanochat/checkpoint_manager.py | 22 | def _patch_missing_config_keys(model_config_kwargs): | CODE |
| LOW | nanochat/gpt.py | 270 | def _precompute_rotary_embeddings(self, seq_len, head_dim, base=100000, device=None): | CODE |
| LOW | scripts/chat_sft.py | 180 | def sft_data_generator_bos_bestfit(split, buffer_size=100): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tasks/common.py | 45 | CODE | |
| LOW | nanochat/dataset.py | 84 | CODE | |
| LOW | nanochat/tokenizer.py | 96 | CODE | |
| LOW | nanochat/tokenizer.py | 140 | CODE | |
| LOW | nanochat/engine.py | 176 | CODE | |
| LOW | nanochat/engine.py | 277 | CODE | |
| LOW | nanochat/dataloader.py | 25 | CODE | |
| LOW | nanochat/dataloader.py | 74 | CODE | |
| LOW | scripts/chat_eval.py | 87 | CODE | |
| LOW | scripts/base_eval.py | 128 | CODE | |
| LOW | scripts/chat_sft.py | 180 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/engine.py | 54 | # Check if it's a pure math expression (old behavior) | COMMENT |
| LOW | nanochat/engine.py | 60 | # Check if it's a string operation we support | COMMENT |
| LOW⚡ | runs/scaling_laws.sh | 34 | # Check if a run already exists in results | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/tokenizer.py | 195 | # simple string => simply add the tokens | COMMENT |
| LOW | nanochat/tokenizer.py | 202 | # string part => simply add the tokens | COMMENT |
| LOW | nanochat/gpt.py | 523 | # inference: just return the logits directly | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/engine.py | 41 | except Exception as e: | CODE |
| MEDIUM | nanochat/engine.py | 35 | def eval_with_timeout(formula, max_time=3): | CODE |
| LOW | nanochat/flash_attention.py | 45 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/gpt.py | 15 | CODE | |
| LOW | nanochat/gpt.py | 22 | CODE | |
| LOW | scripts/chat_cli.py | 8 | CODE | |
| LOW | scripts/base_eval.py | 29 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/execution.py | 134 | CODE | |
| LOW | nanochat/fp8.py | 154 | CODE | |
| LOW | scripts/base_eval.py | 123 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | nanochat/core_eval.py | 175 | # Sample few-shot examples (excluding current item) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/chat_eval.py | 159 | # Create the evaluation object | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | runs/speedrun.sh | 1 | #!/bin/bash | COMMENT |
| LOW | runs/speedrun.sh | 21 | # install uv (if not already installed) | COMMENT |
| LOW | runs/speedrun.sh | 41 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/common.py | 69 | logger = logging.getLogger(__name__) | CODE |
| LOW | nanochat/checkpoint_manager.py | 17 | logger = logging.getLogger(__name__) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/chat_rl.py | 112 | seed=seed, # must make sure to change the seed for each sampling step | CODE |