Repository Analysis

microsoft/BitNet

Official inference framework for 1-bit LLMs

8.5 Low AI signal View on GitHub

Analysis Overview

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).

8.5
Adjusted Score
8.5
Raw Score
100%
Time Factor
2026-07-27
Last Push
39.8K
Stars
C++
Language
21.9K
Lines of Code
59
Files
129
Pattern Hits
2026-08-02
Scan Date
0.03
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

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.

No multi-scan history yet — run the scanner again to build trend data.

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 2MEDIUM 27LOW 100

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 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.

Excessive Try-Catch Wrapping26 hits · 43 pts
SeverityFileLineSnippetContext
MEDIUMrun_inference_server.py13 print(f"Error occurred while running command: {e}")CODE
MEDIUMrun_inference.py13 print(f"Error occurred while running command: {e}")CODE
MEDIUMutils/quantize_embeddings.py116 print(f"Error: {result.stderr}")CODE
LOWutils/quantize_embeddings.py123 except Exception as e:CODE
MEDIUMutils/quantize_embeddings.py176 print(f"Error: {result.stderr}")CODE
LOWutils/quantize_embeddings.py183 except Exception as e:CODE
LOWutils/quantize_embeddings.py270 except Exception as e:CODE
LOWutils/quantize_embeddings.py367 except Exception as e:CODE
LOWutils/quantize_embeddings.py465 except Exception as e:CODE
LOWutils/tune_gemm_config.py252 except Exception as e:CODE
MEDIUMutils/convert-helper-bitnet.py15 print(f"Error executing command: {' '.join(map(str, e.cmd))}")CODE
MEDIUMutils/convert-helper-bitnet.py29 print(f"Error: Model directory '{model_dir}' not found or is not a directory.")CODE
MEDIUMutils/convert-helper-bitnet.py48 print(f"Error: Preprocess script not found at '{preprocess_script}'")CODE
MEDIUMutils/convert-helper-bitnet.py51 print(f"Error: Convert script not found at '{convert_script}'")CODE
MEDIUMutils/convert-helper-bitnet.py54 print(f"Error: llama-quantize binary not found at '{llama_quantize_binary}'")CODE
MEDIUMutils/convert-helper-bitnet.py58 print(f"Error: Input safetensors file not found at '{input_file}'")CODE
LOWutils/convert-helper-bitnet.py101 except Exception as e:CODE
MEDIUMutils/convert-helper-bitnet.py102 print(f"An error occurred: {e}")CODE
LOWutils/convert-helper-bitnet.py124 except Exception as e:CODE
LOWutils/test_perplexity.py102 except Exception as e:CODE
MEDIUMutils/test_perplexity.py170 print(f"Error: {result.stderr[:500]}")CODE
LOWutils/test_perplexity.py195 except Exception as e:CODE
MEDIUMutils/test_perplexity.py304 print(f"Error: {result.stderr[:500]}")CODE
LOWutils/test_perplexity.py310 except Exception as e:CODE
LOWutils/test_perplexity.py321 except Exception as e:CODE
LOWutils/test_perplexity.py598 except Exception as e:CODE
Decorative Section Separators12 hits · 36 pts
SeverityFileLineSnippetContext
MEDIUMutils/convert-bitnet-embedding-to-gguf.py32# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py34# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py90# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py92# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py335# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py337# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py397# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py399# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py416# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py418# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py495# ---------------------------------------------------------------------------COMMENT
MEDIUMutils/convert-bitnet-embedding-to-gguf.py497# ---------------------------------------------------------------------------COMMENT
Unused Imports29 hits · 29 pts
SeverityFileLineSnippetContext
LOWgpu/convert_safetensors.py1CODE
LOWgpu/convert_safetensors.py3CODE
LOWgpu/generate.py6CODE
LOWgpu/generate.py8CODE
LOWgpu/test.py3CODE
LOWgpu/test.py6CODE
LOWgpu/test.py6CODE
LOWgpu/test.py6CODE
LOWgpu/convert_checkpoint.py1CODE
LOWgpu/convert_checkpoint.py3CODE
LOWgpu/convert_checkpoint.py4CODE
LOWgpu/convert_checkpoint.py5CODE
LOWgpu/convert_checkpoint.py6CODE
LOWgpu/convert_checkpoint.py7CODE
LOWgpu/convert_checkpoint.py9CODE
LOWgpu/convert_checkpoint.py10CODE
LOWutils/convert-ms-to-gguf-bitnet.py2CODE
LOWutils/convert.py2CODE
LOWutils/generate-dummy-bitnet-model.py4CODE
LOWutils/generate-dummy-bitnet-model.py9CODE
LOWutils/generate-dummy-bitnet-model.py15CODE
LOWutils/convert-helper-bitnet.py4CODE
LOWutils/convert-bitnet-embedding-to-gguf.py3CODE
LOWutils/convert-bitnet-embedding-to-gguf.py12CODE
LOWutils/test_perplexity.py16CODE
LOWutils/test_perplexity.py17CODE
LOWutils/convert-hf-to-gguf-bitnet.py3CODE
LOWutils/convert-hf-to-gguf-bitnet.py10CODE
LOWutils/convert-hf-to-gguf-bitnet.py17CODE
Deep Nesting27 hits · 27 pts
SeverityFileLineSnippetContext
LOWsetup_env.py115CODE
LOWsetup_env.py162CODE
LOWgpu/convert_checkpoint.py15CODE
LOWutils/convert-ms-to-gguf-bitnet.py1076CODE
LOWutils/quantize_embeddings.py187CODE
LOWutils/convert.py1002CODE
LOWutils/convert.py1302CODE
LOWutils/tune_gemm_config.py262CODE
LOWutils/generate-dummy-bitnet-model.py498CODE
LOWutils/generate-dummy-bitnet-model.py577CODE
LOWutils/generate-dummy-bitnet-model.py620CODE
LOWutils/generate-dummy-bitnet-model.py328CODE
LOWutils/generate-dummy-bitnet-model.py431CODE
LOWutils/generate-dummy-bitnet-model.py861CODE
LOWutils/convert-helper-bitnet.py19CODE
LOWutils/convert-bitnet-embedding-to-gguf.py193CODE
LOWutils/convert-bitnet-embedding-to-gguf.py248CODE
LOWutils/convert-bitnet-embedding-to-gguf.py339CODE
LOWutils/convert-bitnet-embedding-to-gguf.py499CODE
LOWutils/test_perplexity.py326CODE
LOWutils/test_perplexity.py490CODE
LOWutils/convert-hf-to-gguf-bitnet.py260CODE
LOWutils/convert-hf-to-gguf-bitnet.py380CODE
LOWutils/convert-hf-to-gguf-bitnet.py776CODE
LOWutils/convert-hf-to-gguf-bitnet.py946CODE
LOWutils/convert-hf-to-gguf-bitnet.py991CODE
LOWutils/convert-hf-to-gguf-bitnet.py1074CODE
Over-Commented Block14 hits · 14 pts
SeverityFileLineSnippetContext
LOWgpu/test.py81 )COMMENT
LOWgpu/bitnet_kernels/bitnet_kernels.h1#include <cuda_runtime.h>COMMENT
LOWinclude/gemm-config.h1#define ACT_PARALLELCOMMENT
LOWinclude/gemm-config.h21 #define PARALLEL_SIZE 2COMMENT
LOWutils/convert-ms-to-gguf-bitnet.py121# assert(np.prod(arr.shape) % 4 == 0)COMMENT
LOWutils/convert-ms-to-gguf-bitnet.py1381 # if params.n_experts and params.n_experts > 0:COMMENT
LOWutils/convert-ms-to-gguf-bitnet.py1401COMMENT
LOWutils/convert-ms-to-gguf-bitnet.py1421COMMENT
LOWutils/convert-ms-to-gguf-bitnet.py1441 # for name, lazy_tensor in model.items():COMMENT
LOWutils/convert-ms-to-gguf-bitnet.py1461 # tmp[f"layers.{i}.feed_forward.w3.weight"] = part_lazy_w3(model[f"layers.{i}.feed_forward.w13.weight"], 1)COMMENT
LOWutils/convert.py121# assert(np.prod(arr.shape) % 4 == 0)COMMENT
LOWutils/test_gemm_kernel.sh121COMMENT
LOWsrc/ggml-bitnet-mad.cpp1#include <vector>COMMENT
LOWsrc/ggml-bitnet-lut.cpp1#include <vector>COMMENT
Redundant / Tautological Comments7 hits · 10 pts
SeverityFileLineSnippetContext
LOWsetup_env.py210 # Check if cmake is installedCOMMENT
LOWutils/convert-ms-to-gguf-bitnet.py1551 # Check if it's a set of safetensors filesCOMMENT
LOWutils/quantize_embeddings.py59 # Check if file already existsCOMMENT
LOWutils/convert.py1406 # Check if it's a set of safetensors filesCOMMENT
LOWutils/test_gemm_kernel.sh448# Set LD_LIBRARY_PATH to include the GGML library directoryCOMMENT
LOWutils/test_gemm_kernel.sh477 # Check if values were extracted successfullyCOMMENT
LOWutils/test_perplexity.py256 # Check if file already existsCOMMENT
Cross-Language Confusion2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHutils/codegen_tl2.py629 if (!(is_type_supported(tensor->type) && tensor->backend == GGML_BACKEND_TYPE_CPU && tensor->extra == nullptr)) {\n\CODE
HIGHutils/codegen_tl1.py324 if (!(is_type_supported(tensor->type) && tensor->backend == GGML_BACKEND_TYPE_CPU && tensor->extra == nullptr)) {\n\CODE
Self-Referential Comments2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMgpu/pack_weight.py23 # Create a lookup table for the permutationCOMMENT
MEDIUMgpu/pack_weight.py36 # Create the source indicesCOMMENT
Hyper-Verbose Identifiers5 hits · 5 pts
SeverityFileLineSnippetContext
LOWgpu/tokenizer.py172 def _split_whitespaces_or_nonwhitespaces(CODE
LOWutils/convert-ms-to-gguf-bitnet.py1029def lazy_load_safetensors_file(fp: IO[bytes], path: Path) -> ModelPlus:CODE
LOWutils/convert-ms-to-gguf-bitnet.py1193 def extract_vocabulary_from_model(self, vocab: Vocab) -> tuple[list[bytes], list[float], list[gguf.TokenType]]:CODE
LOWutils/convert.py955def lazy_load_safetensors_file(fp: IO[bytes], path: Path) -> ModelPlus:CODE
LOWutils/convert.py1123 def extract_vocabulary_from_model(self, vocab: Vocab) -> tuple[list[bytes], list[float], list[gguf.TokenType]]:CODE
AI Structural Patterns4 hits · 4 pts
SeverityFileLineSnippetContext
LOWgpu/pack_weight.py98CODE
LOWgpu/model.py162CODE
LOWgpu/model.py197CODE
LOWgpu/model.py243CODE
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWutils/convert-hf-to-gguf-bitnet.py370 def _set_vocab_gpt2(self) -> None:CODE