Unsupervised text tokenizer for Neural Network-based text generation.
This report presents the forensic synthetic code analysis of google/sentencepiece, a C++ project with 11,961 GitHub stars. SynthScan v2.0 examined 35,516 lines of code across 88 source files, recording 299 pattern matches distributed across 12 syntactic categories. The overall adjusted score of 14.1 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 299 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 | contrib/nlcodec/bpe_model_trainer_nlcodec.h | 31 | // ─── Data Structures ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | contrib/nlcodec/bpe_model_trainer_nlcodec.h | 115 | // ─── Fast BPE Training Function ───────────────────────────────────────────── | COMMENT |
| MEDIUM | contrib/nlcodec/benchmark.sh | 15 | # ─── Defaults ───────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | contrib/nlcodec/benchmark.sh | 47 | # ─── Parse arguments ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | contrib/nlcodec/benchmark.sh | 60 | # ─── Step 1: Build SentencePiece if needed ──────────────────────────────────── | COMMENT |
| MEDIUM | contrib/nlcodec/benchmark.sh | 75 | # ─── Step 2: Download CC-100 data if needed ─────────────────────────────────── | COMMENT |
| MEDIUM | contrib/nlcodec/benchmark.sh | 119 | # ─── Step 3: Run benchmark ─────────────────────────────────────────────────── | 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 |
| MEDIUM⚡ | data/Scripts.txt | 2201 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2211 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2252 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2259 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2267 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2342 | # ================================================ | COMMENT |
| MEDIUM⚡ | data/Scripts.txt | 2350 | # ================================================ | COMMENT |
| 85 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 | contrib/nlcodec/bpe_model_trainer_nlcodec.h | 1 | // Copyright 2024 nlcodec / Thamme Gowda | 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 | .github/workflows/requirements/cibuildwheel.txt | 1 | # | COMMENT |
| LOW | .github/workflows/requirements/cibuildwheel.txt | 81 | # -c base.txt | 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 <utility> | COMMENT |
| LOW | src/CMakeLists.txt | 1 | # Copyright 2018 Google Inc. | COMMENT |
| LOW | src/bpe_model.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/testharness.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/testharness.h | 121 | .IsEq(std::string(a), std::string(b), #a, #b) | 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/sentencepiece_trainer.h | 41 | 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/common.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/common.h | 21 | #include "third_party/absl/log/check.h" | COMMENT |
| LOW | src/common.h | 41 | #define FRIEND_TEST(a, b) friend class a##_Test_##b; | COMMENT |
| LOW | src/unigram_model_trainer.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/unigram_model_trainer.h | 81 | // node_int_type should be of integer type (int32_t or int64_t), | COMMENT |
| LOW | src/unigram_model.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/unigram_model.h | 101 | // generation probability (Product of piece probabilities). | COMMENT |
| LOW | src/sentencepiece_processor.h | 1 | // Copyright 2016 Google Inc. | COMMENT |
| LOW | src/sentencepiece_processor.h | 21 | #include <memory> | COMMENT |
| LOW | src/sentencepiece_processor.h | 41 | // SentencePieceProcessor provides Encode() and Decode() methods, | COMMENT |
| LOW | src/sentencepiece_processor.h | 61 | // | COMMENT |
| LOW | src/sentencepiece_processor.h | 121 | // Currently, the C++ API does not include a dedicated batch processing API. | COMMENT |
| LOW | src/sentencepiece_processor.h | 361 | // - Unigram (--model_type=unigram): | COMMENT |
| LOW | src/sentencepiece_processor.h | 381 | // Same as above, but returns a sequence of ids. | COMMENT |
| LOW | src/sentencepiece_processor.h | 421 | virtual absl::Status CalculateEntropy(absl::string_view input, float alpha, | COMMENT |
| LOW | src/sentencepiece_processor.h | 781 | // Returns -1 if not defined. | COMMENT |
| LOW | src/sentencepiece_processor.h | 901 | // IO related functions to absorb model formats. | COMMENT |
| LOW | src/spec_parser.h | 1 | // Copyright 2016 Google LLC. | COMMENT |
| LOW | src/spec_parser.h | 281 | #undef PARSE_DUOBLE | 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 <algorithm> | COMMENT |
| LOW | src/util.h | 281 | std::wstring Utf8ToWide(const absl::string_view input); | COMMENT |
| 20 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 | 300 | def test_encode_extra_options(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 402 | def test_sample_encode_and_score(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 503 | def test_normalization_and_entropy(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 642 | def run_heavy_op_with_gil_check(op_func, name): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 701 | def test_gil_release_encode_with_list_modification(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 722 | def test_gil_release_decode_pieces_with_list_modification(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 742 | def test_encode_bytes_is_zero_copy(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 778 | def test_encode_str_is_zero_copy(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 961 | def test_train_with_writer_only(self): | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 972 | 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 | 250 | def test_special_tokens_combinations(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 701 | def test_classmethod_factories(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 771 | def test_word_model_user_defined_symbol(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1164 | def test_trainer_with_normalizer(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1199 | def test_override_normalize_spec(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1288 | def test_decode_offset_mapping(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1364 | def test_decode_return_type_bytes(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1401 | def test_legacy_out_type_compat(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1430 | def test_normalizer_model_proto(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1438 | def test_encode_return_type_explicit(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1510 | def test_native_batch_piece_to_id(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1540 | def test_native_batch_id_to_piece(self): | CODE |
| LOW | python/test/sentencepiece_test.py | 1574 | 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 | 875 | def serialized_normalizer_spec(self): | 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 | 753 | except Exception as e: | CODE |
| LOW | python/test/clean_sentencepiece_test_manual.py | 832 | except Exception as e: | CODE |
| LOW | python/src/sentencepiece/__init__.py | 925 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | python/test/sentencepiece_test.py | 320 | # suppress logging (redirect to /dev/null) | COMMENT |
| HIGH | python/test/sentencepiece_test.py | 360 | # 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 | 162 | CODE | |
| LOW | python/tools/gen_stubs.py | 414 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 784 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 834 | 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 | python/src/sentencepiece/__init__.py | 137 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 220 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 437 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 511 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 834 | CODE |
| 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/setup.py | 17 | CODE | |
| LOW | python/test/sentencepiece_test.py | 23 | CODE | |
| LOW | python/src/sentencepiece/__init__.py | 921 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/test/clean_sentencepiece_test_manual.py | 984 | # 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 |