Unsupervised text tokenizer for Neural Network-based text generation.
This report presents the forensic synthetic code analysis of google/sentencepiece, a C++ project with 12,049 GitHub stars. SynthScan v2.0 examined 42,048 lines of code across 89 source files, recording 327 pattern matches distributed across 12 syntactic categories. The overall adjusted score of 13.8 places this repository in the Low 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 327 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | CMakeLists.txt | 15 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 17 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 38 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 40 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 61 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 63 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 135 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 137 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 294 | # ============================================================================== | COMMENT |
| MEDIUM | CMakeLists.txt | 296 | # ============================================================================== | COMMENT |
| MEDIUM⚡ | CMakeLists.txt | 363 | # ============================================================================== | COMMENT |
| MEDIUM⚡ | CMakeLists.txt | 365 | # ============================================================================== | COMMENT |
| MEDIUM⚡ | CMakeLists.txt | 369 | # ============================================================================== | COMMENT |
| MEDIUM⚡ | CMakeLists.txt | 371 | # ============================================================================== | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1383 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1391 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1401 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1410 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1418 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1515 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1524 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1531 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1540 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1546 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1583 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1591 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1598 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1605 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1613 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1649 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1656 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1662 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1669 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1680 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1686 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1696 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1804 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1813 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1821 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1828 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1902 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1911 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1920 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1926 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1932 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1939 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 1999 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2006 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2012 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2026 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2034 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2044 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2085 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2093 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2101 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2108 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2115 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2121 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2185 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2195 | # ================================================ | COMMENT |
| 108 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | CMakeLists.txt | 1 | # Copyright 2018 Google Inc. | COMMENT |
| LOW | python/README.md | 61 | # Encode text to pieces as bytes | COMMENT |
| LOW | python/README.md | 81 | # Output: | COMMENT |
| LOW | python/README.md | 101 | # ['▁', 'This', '▁', 'is', '▁a', '▁', 't', 'e', 'st'] | COMMENT |
| LOW | python/README.md | 121 | ids_np = np.array([284, 47, 11, 4, 15, 400], dtype=np.int32) | COMMENT |
| LOW | python/setup.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | python/tools/gen_stubs.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | python/test/gen_stubs_test.py | 1 | # Copyright 2024 Google Sepm. | COMMENT |
| LOW | python/test/sentencepiece_test.py | 1 | #!/usr/bin/python | COMMENT |
| LOW | third_party/darts_clone/darts.h | 1 | #ifndef DARTS_H_ | COMMENT |
| LOW | third_party/darts_clone/darts.h | 101 | COMMENT | |
| LOW | third_party/darts_clone/darts.h | 141 | // member variables with 0 and NULLs. | COMMENT |
| LOW | third_party/darts_clone/darts.h | 221 | COMMENT | |
| LOW | third_party/darts_clone/darts.h | 241 | Details::progress_func_type progress_func = NULL); | COMMENT |
| LOW | third_party/darts_clone/darts.h | 261 | // if it exists, its value and length are set to `result'. Otherwise, the | COMMENT |
| LOW | third_party/darts_clone/darts.h | 281 | COMMENT | |
| LOW | third_party/libsais/libsais.c | 21 | COMMENT | |
| LOW | third_party/libsais/libsais.c | 41 | typedef size_t fast_uint_t; | COMMENT |
| LOW | third_party/libsais/libsais.c | 101 | #error Your compiler, configuration or platform is not supported. | COMMENT |
| LOW | third_party/libsais/libsais.c | 121 | COMMENT | |
| LOW | third_party/libsais/libsais.c | 161 | __BYTE_ORDER == __BIG_ENDIAN) || \ | COMMENT |
| LOW | third_party/libsais/libsais.h | 21 | COMMENT | |
| LOW | .github/workflows/requirements/cibuildwheel.txt | 1 | # | COMMENT |
| LOW | .github/scripts/update_dependencies.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | doc/special_symbols.md | 141 | # Output: | COMMENT |
| LOW | data/Scripts.txt | 1 | # Scripts-9.0.0.txt | COMMENT |
| LOW | data/gen_unicode_scripts_code.pl | 1 | #!/usr/bin/perl | COMMENT |
| LOW | src/filesystem.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/freelist.h | 1 | // Copyright 2018 Google Inc. | COMMENT |
| LOW | src/unicode_script.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/model_interface.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/model_interface.h | 21 | #include <string> | COMMENT |
| LOW | src/model_interface.h | 101 | COMMENT | |
| LOW | src/CMakeLists.txt | 1 | # Copyright 2018 Google Inc. | COMMENT |
| LOW | src/ret_check.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/ret_check.h | 21 | #ifndef RET_CHECK | COMMENT |
| LOW | src/bpe_model.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/word_model_trainer.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/sentencepiece_trainer.h | 1 | // Copyright 2018 Google Inc. | COMMENT |
| LOW | src/char_model_trainer.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/trainer_interface.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/trainer_interface.h | 21 | #include <string> | COMMENT |
| LOW | src/gtest_prod.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/unigram_model_trainer.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/unigram_model.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/sentencepiece_processor.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/sentencepiece_processor.h | 21 | #include <string> | COMMENT |
| LOW | src/sentencepiece_processor.h | 41 | // | COMMENT |
| LOW | src/sentencepiece_processor.h | 61 | // | COMMENT |
| LOW | src/sentencepiece_processor.h | 121 | // `total_tasks`: Number of tasks to execute (= batch size) | COMMENT |
| LOW | src/sentencepiece_processor.h | 201 | COMMENT | |
| LOW | src/sentencepiece_processor.h | 221 | // value, samples one segmentation from the hypotheses (Lattice) according to | COMMENT |
| LOW | src/sentencepiece_processor.h | 401 | COMMENT | |
| LOW | src/sentencepiece_processor.h | 501 | // std::random_device. | COMMENT |
| LOW | src/spec_parser.h | 1 | // Copyright 2016 Google LLC. | COMMENT |
| LOW | src/spec_parser.h | 21 | #include <string> | COMMENT |
| LOW | src/unicode_script_map.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/util.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/util.h | 21 | #include <memory> | COMMENT |
| LOW | src/builder.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| 12 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/test/numpy_test.py | 57 | def test_return_type_validation_and_compat(self): | CODE |
| LOW | python/test/numpy_test.py | 101 | def test_decode_numpy_batch_list(self): | CODE |
| LOW | python/test/numpy_test.py | 127 | def test_decode_numpy_non_contiguous(self): | CODE |
| LOW | python/test/numpy_test.py | 146 | def test_decode_numpy_invalid_types(self): | CODE |
| LOW | python/test/numpy_test.py | 157 | def test_parallel_encode_numpy(self): | CODE |
| LOW | python/test/numpy_test.py | 240 | def test_decode_invalid_ids_numpy(self): | CODE |
| LOW | python/test/numpy_test.py | 249 | def test_decode_numpy_batch_mixed(self): | CODE |
| LOW | python/test/numpy_test.py | 261 | def test_native_batch_id_to_piece_numpy(self): | CODE |
| LOW | python/test/numpy_test.py | 277 | def test_native_batch_other_id_methods_numpy(self): | CODE |
| LOW | python/test/gil_release_test.py | 31 | def run_heavy_op_with_gil_check(op_func, name): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 115 | def test_encode_decode_types_single(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 294 | def test_encode_extra_options(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 439 | def test_normalization_and_entropy(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 571 | def run_heavy_op_with_gil_check(op_func, name): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 630 | def test_gil_release_encode_with_list_modification(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 651 | def test_gil_release_decode_pieces_with_list_modification(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 671 | def test_encode_bytes_is_zero_copy(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 707 | def test_encode_str_is_zero_copy(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 890 | def test_train_with_writer_only(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 901 | def test_train_with_logstream(self): | CODE |
| LOW | python/test/gen_stubs_test.py | 45 | def test_committed_stub_in_sync(self): | CODE |
| LOW | python/test/gen_stubs_test.py | 101 | def test_leaked_module_level_import_ignored(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 257 | def test_special_tokens_combinations(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 683 | def test_classmethod_factories(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 755 | def test_word_model_user_defined_symbol(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 877 | def test_train_with_pretokenizer(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 891 | def test_inconsistent_pretokenizer(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 916 | def test_pretokenizer_exception(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 932 | def test_pretokenizer_and_delimiter_mutually_exclusive(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 945 | def test_complex_regex_pretokenizer(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1253 | def test_trainer_with_normalizer(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1367 | def test_decode_offset_mapping(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1459 | def test_decode_return_type_bytes(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1505 | def test_legacy_out_type_compat(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1537 | def test_normalizer_model_proto(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1545 | def test_encode_return_type_explicit(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1652 | def test_native_batch_piece_to_id(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1682 | def test_native_batch_id_to_piece(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1716 | def test_native_batch_other_id_methods(self): | CODE |
| LOW | python/src/sentencepiece/__init__.py | 165 | def _resolve_and_validate_return_type(self, return_type): | CODE |
| LOW | python/src/sentencepiece/__init__.py | 787 | def serialized_normalizer_spec(self): | CODE |
| LOW | .github/scripts/update_dependencies.py | 180 | def update_module_bazel_content(content: str): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | benchmark/analyze_results.py | 7 | print("Error: 'results.json' not found.") | CODE |
| MEDIUM | benchmark/analyze_results.py | 15 | print("Error: 'results.json' is empty.") | CODE |
| LOW⚡ | benchmark/download_models.py | 11 | except Exception as e: | CODE |
| LOW⚡ | benchmark/download_models.py | 18 | except Exception as e: | CODE |
| LOW⚡ | benchmark/download_models.py | 27 | except Exception as e: | CODE |
| LOW⚡ | benchmark/download_models.py | 35 | except Exception as e: | CODE |
| MEDIUM | benchmark/run_bench.py | 139 | print(f"Error: Dataset file '{path}' not found.") | CODE |
| MEDIUM | benchmark/run_bench.py | 163 | print("Error: No tasks available to run. Please run 'python download_models.py' first.") | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 682 | except Exception as e: | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 761 | except Exception as e: | CODE |
| LOW | python/src/sentencepiece/__init__.py | 837 | except Exception: | CODE |
| LOW | .github/scripts/update_dependencies.py | 74 | except Exception as e: | CODE |
| LOW | .github/scripts/update_dependencies.py | 88 | except Exception as e: | CODE |
| MEDIUM | .github/scripts/update_dependencies.py | 89 | print(f"Error fetching tags for {repo_path}: {e}") | CODE |
| LOW | .github/scripts/update_dependencies.py | 122 | except Exception as e: | CODE |
| LOW | .github/scripts/update_dependencies.py | 252 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | python/test/sentencepiece_test.py | 340 | # suppress logging (redirect to /dev/null) | COMMENT |
| HIGH | python/test/sentencepiece_test.py | 381 | # suppress logging (redirect to /dev/null) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | benchmark/run_bench.py | 37 | CODE | |
| LOW | benchmark/run_bench.py | 62 | CODE | |
| LOW | benchmark/run_bench.py | 122 | CODE | |
| LOW | benchmark/run_bench.py | 135 | CODE | |
| LOW | python/setup.py | 41 | CODE | |
| LOW | python/setup.py | 166 | CODE | |
| LOW | python/tools/gen_stubs.py | 395 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 691 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 746 | CODE | |
| LOW | .github/scripts/update_dependencies.py | 52 | CODE | |
| LOW | .github/scripts/update_dependencies.py | 94 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | python/tools/gen_stubs.py | 48 | # This file is auto-generated by python/tools/gen_stubs.py. | COMMENT |
| MEDIUM | python/test/numpy_test.py | 206 | # Create a processor local to this scope | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | doc/model_proto.md | 56 | ### Step 1: Define your extension | COMMENT |
| LOW | doc/model_proto.md | 73 | ### Step 2: Compile your proto | COMMENT |
| LOW | doc/model_proto.md | 81 | ### Step 3: Read/Write Custom Metadata in Python | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/src/sentencepiece/__init__.py | 137 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 220 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 432 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 746 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/test/sentencepiece_test.py | 19 | CODE | |
| LOW | python/test/sentencepiece_test.py | 24 | CODE | |
| LOW | python/test/sentencepiece_test.py | 26 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 833 | CODE | |
| LOW | .github/scripts/update_dependencies.py | 19 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/test/clean_sentencepiece_test_manual.py | 913 | # Check if log file is not empty | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | doc/model_proto.md | 95 | model_proto.Extensions[my_metadata_pb2.model_author] = "John Doe" | CODE |