Official inference framework for 1-bit LLMs
This report presents the forensic synthetic code analysis of microsoft/BitNet, a C++ project with 39,801 GitHub stars. SynthScan v2.0 examined 21,907 lines of code across 59 source files, recording 129 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 8.5 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).
Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.
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 129 distinct pattern matches across 11 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 | run_inference_server.py | 13 | print(f"Error occurred while running command: {e}") | CODE |
| MEDIUM | run_inference.py | 13 | print(f"Error occurred while running command: {e}") | CODE |
| MEDIUM | utils/quantize_embeddings.py | 116 | print(f"Error: {result.stderr}") | CODE |
| LOW | utils/quantize_embeddings.py | 123 | except Exception as e: | CODE |
| MEDIUM | utils/quantize_embeddings.py | 176 | print(f"Error: {result.stderr}") | CODE |
| LOW | utils/quantize_embeddings.py | 183 | except Exception as e: | CODE |
| LOW | utils/quantize_embeddings.py | 270 | except Exception as e: | CODE |
| LOW | utils/quantize_embeddings.py | 367 | except Exception as e: | CODE |
| LOW | utils/quantize_embeddings.py | 465 | except Exception as e: | CODE |
| LOW | utils/tune_gemm_config.py | 252 | except Exception as e: | CODE |
| MEDIUM | utils/convert-helper-bitnet.py | 15 | print(f"Error executing command: {' '.join(map(str, e.cmd))}") | CODE |
| MEDIUM | utils/convert-helper-bitnet.py | 29 | print(f"Error: Model directory '{model_dir}' not found or is not a directory.") | CODE |
| MEDIUM⚡ | utils/convert-helper-bitnet.py | 48 | print(f"Error: Preprocess script not found at '{preprocess_script}'") | CODE |
| MEDIUM⚡ | utils/convert-helper-bitnet.py | 51 | print(f"Error: Convert script not found at '{convert_script}'") | CODE |
| MEDIUM⚡ | utils/convert-helper-bitnet.py | 54 | print(f"Error: llama-quantize binary not found at '{llama_quantize_binary}'") | CODE |
| MEDIUM⚡ | utils/convert-helper-bitnet.py | 58 | print(f"Error: Input safetensors file not found at '{input_file}'") | CODE |
| LOW | utils/convert-helper-bitnet.py | 101 | except Exception as e: | CODE |
| MEDIUM | utils/convert-helper-bitnet.py | 102 | print(f"An error occurred: {e}") | CODE |
| LOW | utils/convert-helper-bitnet.py | 124 | except Exception as e: | CODE |
| LOW | utils/test_perplexity.py | 102 | except Exception as e: | CODE |
| MEDIUM | utils/test_perplexity.py | 170 | print(f"Error: {result.stderr[:500]}") | CODE |
| LOW | utils/test_perplexity.py | 195 | except Exception as e: | CODE |
| MEDIUM | utils/test_perplexity.py | 304 | print(f"Error: {result.stderr[:500]}") | CODE |
| LOW | utils/test_perplexity.py | 310 | except Exception as e: | CODE |
| LOW | utils/test_perplexity.py | 321 | except Exception as e: | CODE |
| LOW | utils/test_perplexity.py | 598 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 32 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 34 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 90 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 92 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 335 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 337 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 397 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 399 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 416 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 418 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 495 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 497 | # --------------------------------------------------------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gpu/convert_safetensors.py | 1 | CODE | |
| LOW | gpu/convert_safetensors.py | 3 | CODE | |
| LOW | gpu/generate.py | 6 | CODE | |
| LOW | gpu/generate.py | 8 | CODE | |
| LOW | gpu/test.py | 3 | CODE | |
| LOW | gpu/test.py | 6 | CODE | |
| LOW | gpu/test.py | 6 | CODE | |
| LOW | gpu/test.py | 6 | CODE | |
| LOW | gpu/convert_checkpoint.py | 1 | CODE | |
| LOW | gpu/convert_checkpoint.py | 3 | CODE | |
| LOW | gpu/convert_checkpoint.py | 4 | CODE | |
| LOW | gpu/convert_checkpoint.py | 5 | CODE | |
| LOW | gpu/convert_checkpoint.py | 6 | CODE | |
| LOW | gpu/convert_checkpoint.py | 7 | CODE | |
| LOW | gpu/convert_checkpoint.py | 9 | CODE | |
| LOW | gpu/convert_checkpoint.py | 10 | CODE | |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 2 | CODE | |
| LOW | utils/convert.py | 2 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 4 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 9 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 15 | CODE | |
| LOW | utils/convert-helper-bitnet.py | 4 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 3 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 12 | CODE | |
| LOW | utils/test_perplexity.py | 16 | CODE | |
| LOW | utils/test_perplexity.py | 17 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 3 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 10 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 17 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup_env.py | 115 | CODE | |
| LOW | setup_env.py | 162 | CODE | |
| LOW | gpu/convert_checkpoint.py | 15 | CODE | |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1076 | CODE | |
| LOW | utils/quantize_embeddings.py | 187 | CODE | |
| LOW | utils/convert.py | 1002 | CODE | |
| LOW | utils/convert.py | 1302 | CODE | |
| LOW | utils/tune_gemm_config.py | 262 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 498 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 577 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 620 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 328 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 431 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 861 | CODE | |
| LOW | utils/convert-helper-bitnet.py | 19 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 193 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 248 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 339 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 499 | CODE | |
| LOW | utils/test_perplexity.py | 326 | CODE | |
| LOW | utils/test_perplexity.py | 490 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 260 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 380 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 776 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 946 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 991 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 1074 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gpu/test.py | 81 | ) | COMMENT |
| LOW | gpu/bitnet_kernels/bitnet_kernels.h | 1 | #include <cuda_runtime.h> | COMMENT |
| LOW | include/gemm-config.h | 1 | #define ACT_PARALLEL | COMMENT |
| LOW | include/gemm-config.h | 21 | #define PARALLEL_SIZE 2 | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 121 | # assert(np.prod(arr.shape) % 4 == 0) | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1381 | # if params.n_experts and params.n_experts > 0: | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1401 | COMMENT | |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1421 | COMMENT | |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1441 | # for name, lazy_tensor in model.items(): | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1461 | # tmp[f"layers.{i}.feed_forward.w3.weight"] = part_lazy_w3(model[f"layers.{i}.feed_forward.w13.weight"], 1) | COMMENT |
| LOW | utils/convert.py | 121 | # assert(np.prod(arr.shape) % 4 == 0) | COMMENT |
| LOW | utils/test_gemm_kernel.sh | 121 | COMMENT | |
| LOW | src/ggml-bitnet-mad.cpp | 1 | #include <vector> | COMMENT |
| LOW | src/ggml-bitnet-lut.cpp | 1 | #include <vector> | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup_env.py | 210 | # Check if cmake is installed | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1551 | # Check if it's a set of safetensors files | COMMENT |
| LOW | utils/quantize_embeddings.py | 59 | # Check if file already exists | COMMENT |
| LOW | utils/convert.py | 1406 | # Check if it's a set of safetensors files | COMMENT |
| LOW | utils/test_gemm_kernel.sh | 448 | # Set LD_LIBRARY_PATH to include the GGML library directory | COMMENT |
| LOW | utils/test_gemm_kernel.sh | 477 | # Check if values were extracted successfully | COMMENT |
| LOW | utils/test_perplexity.py | 256 | # Check if file already exists | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | utils/codegen_tl2.py | 629 | if (!(is_type_supported(tensor->type) && tensor->backend == GGML_BACKEND_TYPE_CPU && tensor->extra == nullptr)) {\n\ | CODE |
| HIGH | utils/codegen_tl1.py | 324 | if (!(is_type_supported(tensor->type) && tensor->backend == GGML_BACKEND_TYPE_CPU && tensor->extra == nullptr)) {\n\ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | gpu/pack_weight.py | 23 | # Create a lookup table for the permutation | COMMENT |
| MEDIUM | gpu/pack_weight.py | 36 | # Create the source indices | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gpu/tokenizer.py | 172 | def _split_whitespaces_or_nonwhitespaces( | CODE |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1029 | def lazy_load_safetensors_file(fp: IO[bytes], path: Path) -> ModelPlus: | CODE |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1193 | def extract_vocabulary_from_model(self, vocab: Vocab) -> tuple[list[bytes], list[float], list[gguf.TokenType]]: | CODE |
| LOW | utils/convert.py | 955 | def lazy_load_safetensors_file(fp: IO[bytes], path: Path) -> ModelPlus: | CODE |
| LOW | utils/convert.py | 1123 | def extract_vocabulary_from_model(self, vocab: Vocab) -> tuple[list[bytes], list[float], list[gguf.TokenType]]: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gpu/pack_weight.py | 98 | CODE | |
| LOW | gpu/model.py | 162 | CODE | |
| LOW | gpu/model.py | 197 | CODE | |
| LOW | gpu/model.py | 243 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | utils/convert-hf-to-gguf-bitnet.py | 370 | def _set_vocab_gpt2(self) -> None: | CODE |